diff --git a/.env b/.env deleted file mode 100644 index 939b639..0000000 --- a/.env +++ /dev/null @@ -1,3 +0,0 @@ -CONFLUENCE_URL=https://agiliton.atlassian.net/wiki -CONFLUENCE_USER=christian.gick@agiliton.eu -CONFLUENCE_API_TOKEN=ATATT3xFfGF0tpaJTS4nJklW587McubEw-1SYbLWqfovkxI5320NdbFc-3fgHlw0HGTLOikgV082m9N-SIsYVZveGXa553_1LAyOevV6Qples93xF4hIExWGAvwvXPy_4pW2tH5FNusN5ieMca5_-YUP0i69SIN0RLIMQjfqDmQyhZXbkIvrm-I=A8A2A1FC diff --git a/dist/client.d.ts b/dist/client.d.ts deleted file mode 100644 index 25759f1..0000000 --- a/dist/client.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Confluence Cloud REST API v2 client. - * Uses basic auth with Atlassian API token. - */ -export interface Space { - id: string; - key: string; - name: string; - type: string; - status: string; - description?: string; -} -export interface Page { - id: string; - status: string; - title: string; - spaceId: string; - parentId?: string; - authorId: string; - createdAt: string; - version: { - number: number; - message?: string; - createdAt: string; - authorId?: string; - }; - body?: { - storage?: { - representation: string; - value: string; - }; - atlas_doc_format?: { - representation: string; - value: string; - }; - }; - _links?: { - webui?: string; - editui?: string; - }; -} -export interface Comment { - id: string; - status: string; - title: string; - body?: { - storage?: { - representation: string; - value: string; - }; - }; - version: { - number: number; - createdAt: string; - }; -} -export declare function listSpaces(limit?: number): Promise; -export declare function getSpace(spaceIdOrKey: string): Promise; -export declare function createSpace(key: string, name: string, description?: string): Promise; -export declare function searchPages(query: string, spaceId?: string, limit?: number): Promise; -export declare function getPage(pageId: string, includeBody?: boolean): Promise; -export declare function getPageByTitle(spaceId: string, title: string): Promise; -export declare function createPage(spaceId: string, title: string, body: string, parentId?: string): Promise; -export declare function updatePage(pageId: string, title: string, body: string, versionNumber: number, versionMessage?: string): Promise; -export declare function getPageComments(pageId: string, limit?: number): Promise; -export declare function addPageComment(pageId: string, body: string): Promise; -export declare function getWebUrl(page: Page): string; diff --git a/dist/client.js b/dist/client.js deleted file mode 100644 index afc955a..0000000 --- a/dist/client.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Confluence Cloud REST API v2 client. - * Uses basic auth with Atlassian API token. - */ -const BASE_URL = process.env.CONFLUENCE_URL || 'https://agiliton.atlassian.net/wiki'; -const API_V2 = `${BASE_URL}/api/v2`; -const API_V1 = `${BASE_URL}/rest/api`; -function getAuth() { - const user = process.env.CONFLUENCE_USER || process.env.JIRA_USER; - const token = process.env.CONFLUENCE_API_TOKEN || process.env.JIRA_API_TOKEN; - if (!user || !token) { - throw new Error('CONFLUENCE_USER and CONFLUENCE_API_TOKEN (or JIRA_USER/JIRA_API_TOKEN) must be set'); - } - return Buffer.from(`${user}:${token}`).toString('base64'); -} -async function request(url, options = {}) { - const headers = { - 'Authorization': `Basic ${getAuth()}`, - 'Accept': 'application/json', - ...(options.headers || {}), - }; - if (options.body && typeof options.body === 'string') { - headers['Content-Type'] = 'application/json'; - } - const response = await fetch(url, { ...options, headers }); - if (!response.ok) { - const text = await response.text().catch(() => ''); - throw new Error(`Confluence API ${response.status}: ${text.slice(0, 500)}`); - } - if (response.status === 204) - return null; - return response.json(); -} -// --- Spaces --- -export async function listSpaces(limit = 25) { - const data = await request(`${API_V2}/spaces?limit=${limit}&sort=name`); - return data.results; -} -export async function getSpace(spaceIdOrKey) { - return request(`${API_V2}/spaces/${spaceIdOrKey}`); -} -export async function createSpace(key, name, description) { - // v2 doesn't have space creation — use v1 - const body = { - key, - name, - type: 'global', - }; - if (description) { - body.description = { - plain: { value: description, representation: 'plain' }, - }; - } - return request(`${API_V1}/space`, { - method: 'POST', - body: JSON.stringify(body), - }); -} -// --- Pages --- -export async function searchPages(query, spaceId, limit = 10) { - let cql = `type=page AND text ~ "${query.replace(/"/g, '\\"')}"`; - if (spaceId) - cql += ` AND space.id=${spaceId}`; - cql += ' ORDER BY lastmodified DESC'; - const params = new URLSearchParams({ - cql, - limit: String(limit), - }); - // CQL search is v1 only - const data = await request(`${API_V1}/content/search?${params}`); - return data.results.map((r) => ({ - id: r.id, - status: r.status, - title: r.title, - spaceId: r.space?.id || '', - authorId: r.history?.createdBy?.accountId || '', - createdAt: r.history?.createdDate || '', - version: { - number: r.version?.number || 1, - createdAt: r.version?.when || '', - }, - _links: { - webui: r._links?.webui ? `${BASE_URL}${r._links.webui}` : undefined, - }, - })); -} -export async function getPage(pageId, includeBody = true) { - const params = includeBody ? '?body-format=storage' : ''; - return request(`${API_V2}/pages/${pageId}${params}`); -} -export async function getPageByTitle(spaceId, title) { - const params = new URLSearchParams({ - title, - 'space-id': spaceId, - 'body-format': 'storage', - limit: '1', - }); - const data = await request(`${API_V2}/pages?${params}`); - return data.results?.[0] || null; -} -export async function createPage(spaceId, title, body, parentId) { - const payload = { - spaceId, - status: 'current', - title, - body: { - representation: 'storage', - value: body, - }, - }; - if (parentId) - payload.parentId = parentId; - return request(`${API_V2}/pages`, { - method: 'POST', - body: JSON.stringify(payload), - }); -} -export async function updatePage(pageId, title, body, versionNumber, versionMessage) { - const payload = { - id: pageId, - status: 'current', - title, - body: { - representation: 'storage', - value: body, - }, - version: { - number: versionNumber, - message: versionMessage || 'Updated via Claude', - }, - }; - return request(`${API_V2}/pages/${pageId}`, { - method: 'PUT', - body: JSON.stringify(payload), - }); -} -// --- Comments --- -export async function getPageComments(pageId, limit = 25) { - const data = await request(`${API_V2}/pages/${pageId}/footer-comments?body-format=storage&limit=${limit}`); - return data.results; -} -export async function addPageComment(pageId, body) { - return request(`${API_V2}/footer-comments`, { - method: 'POST', - body: JSON.stringify({ - pageId, - body: { - representation: 'storage', - value: body, - }, - }), - }); -} -// --- Utility --- -export function getWebUrl(page) { - if (page._links?.webui) { - return page._links.webui.startsWith('http') - ? page._links.webui - : `${BASE_URL}${page._links.webui}`; - } - return `${BASE_URL}/pages/${page.id}`; -} diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 45768e4..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node -/** - * Confluence MCP Server - * - * Provides Confluence Cloud page CRUD and collaboration via Model Context Protocol. - * Tools: confluence_list_spaces, confluence_create_space, confluence_search, - * confluence_get_page, confluence_create_page, confluence_update_page, - * confluence_get_comments, confluence_add_comment - */ -export {}; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index bb64596..0000000 --- a/dist/index.js +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env node -/** - * Confluence MCP Server - * - * Provides Confluence Cloud page CRUD and collaboration via Model Context Protocol. - * Tools: confluence_list_spaces, confluence_create_space, confluence_search, - * confluence_get_page, confluence_create_page, confluence_update_page, - * confluence_get_comments, confluence_add_comment - */ -import { fileURLToPath } from 'url'; -import { dirname, join } from 'path'; -import dotenv from 'dotenv'; -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -const envPath = join(__dirname, '..', '.env'); -dotenv.config({ path: envPath, override: true }); -import { Server } from '@modelcontextprotocol/sdk/server/index.js'; -import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; -import { ListToolsRequestSchema, CallToolRequestSchema, } from '@modelcontextprotocol/sdk/types.js'; -import { toolDefinitions, handleListSpaces, handleCreateSpace, handleSearch, handleGetPage, handleCreatePage, handleUpdatePage, handleGetComments, handleAddComment, } from './tools.js'; -const server = new Server({ name: 'confluence-mcp', version: '1.0.0' }, { capabilities: { tools: {} } }); -server.setRequestHandler(ListToolsRequestSchema, async () => ({ - tools: toolDefinitions, -})); -server.setRequestHandler(CallToolRequestSchema, async (request) => { - const { name, arguments: args } = request.params; - const a = args; - let result; - try { - switch (name) { - case 'confluence_list_spaces': - result = await handleListSpaces({ limit: a.limit }); - break; - case 'confluence_create_space': - result = await handleCreateSpace({ - key: a.key, - name: a.name, - description: a.description, - }); - break; - case 'confluence_search': - result = await handleSearch({ - query: a.query, - space_id: a.space_id, - limit: a.limit, - }); - break; - case 'confluence_get_page': - result = await handleGetPage({ page_id: String(a.page_id) }); - break; - case 'confluence_create_page': - result = await handleCreatePage({ - space_id: a.space_id, - title: a.title, - body: a.body, - parent_id: a.parent_id, - }); - break; - case 'confluence_update_page': - result = await handleUpdatePage({ - page_id: String(a.page_id), - title: a.title, - body: a.body, - version_number: a.version_number, - version_message: a.version_message, - }); - break; - case 'confluence_get_comments': - result = await handleGetComments({ - page_id: String(a.page_id), - limit: a.limit, - }); - break; - case 'confluence_add_comment': - result = await handleAddComment({ - page_id: String(a.page_id), - body: a.body, - }); - break; - default: - result = `Unknown tool: ${name}`; - } - } - catch (error) { - const message = error instanceof Error ? error.message : String(error); - result = `Error: ${message}`; - } - return { - content: [{ type: 'text', text: result }], - }; -}); -async function main() { - const transport = new StdioServerTransport(); - await server.connect(transport); - console.error('confluence-mcp: Server started'); -} -main().catch((error) => { - console.error('confluence-mcp: Fatal error:', error); - process.exit(1); -}); -process.on('SIGINT', async () => { - await server.close(); - process.exit(0); -}); -process.on('SIGTERM', async () => { - await server.close(); - process.exit(0); -}); diff --git a/dist/tools.d.ts b/dist/tools.d.ts deleted file mode 100644 index dfa92b0..0000000 --- a/dist/tools.d.ts +++ /dev/null @@ -1,272 +0,0 @@ -/** - * MCP tool definitions and handlers for Confluence Cloud. - */ -export declare const toolDefinitions: ({ - name: string; - description: string; - inputSchema: { - type: "object"; - properties: { - limit: { - type: string; - description: string; - }; - key?: undefined; - name?: undefined; - description?: undefined; - query?: undefined; - space_id?: undefined; - page_id?: undefined; - title?: undefined; - body?: undefined; - parent_id?: undefined; - version_number?: undefined; - version_message?: undefined; - }; - required?: undefined; - }; -} | { - name: string; - description: string; - inputSchema: { - type: "object"; - properties: { - key: { - type: string; - description: string; - }; - name: { - type: string; - description: string; - }; - description: { - type: string; - description: string; - }; - limit?: undefined; - query?: undefined; - space_id?: undefined; - page_id?: undefined; - title?: undefined; - body?: undefined; - parent_id?: undefined; - version_number?: undefined; - version_message?: undefined; - }; - required: string[]; - }; -} | { - name: string; - description: string; - inputSchema: { - type: "object"; - properties: { - query: { - type: string; - description: string; - }; - space_id: { - type: string; - description: string; - }; - limit: { - type: string; - description: string; - }; - key?: undefined; - name?: undefined; - description?: undefined; - page_id?: undefined; - title?: undefined; - body?: undefined; - parent_id?: undefined; - version_number?: undefined; - version_message?: undefined; - }; - required: string[]; - }; -} | { - name: string; - description: string; - inputSchema: { - type: "object"; - properties: { - page_id: { - type: string; - description: string; - }; - limit?: undefined; - key?: undefined; - name?: undefined; - description?: undefined; - query?: undefined; - space_id?: undefined; - title?: undefined; - body?: undefined; - parent_id?: undefined; - version_number?: undefined; - version_message?: undefined; - }; - required: string[]; - }; -} | { - name: string; - description: string; - inputSchema: { - type: "object"; - properties: { - space_id: { - type: string; - description: string; - }; - title: { - type: string; - description: string; - }; - body: { - type: string; - description: string; - }; - parent_id: { - type: string; - description: string; - }; - limit?: undefined; - key?: undefined; - name?: undefined; - description?: undefined; - query?: undefined; - page_id?: undefined; - version_number?: undefined; - version_message?: undefined; - }; - required: string[]; - }; -} | { - name: string; - description: string; - inputSchema: { - type: "object"; - properties: { - page_id: { - type: string; - description: string; - }; - title: { - type: string; - description: string; - }; - body: { - type: string; - description: string; - }; - version_number: { - type: string; - description: string; - }; - version_message: { - type: string; - description: string; - }; - limit?: undefined; - key?: undefined; - name?: undefined; - description?: undefined; - query?: undefined; - space_id?: undefined; - parent_id?: undefined; - }; - required: string[]; - }; -} | { - name: string; - description: string; - inputSchema: { - type: "object"; - properties: { - page_id: { - type: string; - description: string; - }; - limit: { - type: string; - description: string; - }; - key?: undefined; - name?: undefined; - description?: undefined; - query?: undefined; - space_id?: undefined; - title?: undefined; - body?: undefined; - parent_id?: undefined; - version_number?: undefined; - version_message?: undefined; - }; - required: string[]; - }; -} | { - name: string; - description: string; - inputSchema: { - type: "object"; - properties: { - page_id: { - type: string; - description: string; - }; - body: { - type: string; - description: string; - }; - limit?: undefined; - key?: undefined; - name?: undefined; - description?: undefined; - query?: undefined; - space_id?: undefined; - title?: undefined; - parent_id?: undefined; - version_number?: undefined; - version_message?: undefined; - }; - required: string[]; - }; -})[]; -export declare function handleListSpaces(args: { - limit?: number; -}): Promise; -export declare function handleCreateSpace(args: { - key: string; - name: string; - description?: string; -}): Promise; -export declare function handleSearch(args: { - query: string; - space_id?: string; - limit?: number; -}): Promise; -export declare function handleGetPage(args: { - page_id: string; -}): Promise; -export declare function handleCreatePage(args: { - space_id: string; - title: string; - body: string; - parent_id?: string; -}): Promise; -export declare function handleUpdatePage(args: { - page_id: string; - title: string; - body: string; - version_number: number; - version_message?: string; -}): Promise; -export declare function handleGetComments(args: { - page_id: string; - limit?: number; -}): Promise; -export declare function handleAddComment(args: { - page_id: string; - body: string; -}): Promise; diff --git a/dist/tools.js b/dist/tools.js deleted file mode 100644 index 54c0e32..0000000 --- a/dist/tools.js +++ /dev/null @@ -1,231 +0,0 @@ -/** - * MCP tool definitions and handlers for Confluence Cloud. - */ -import { listSpaces, searchPages, getPage, createPage, updatePage, getPageComments, addPageComment, createSpace, getWebUrl, } from './client.js'; -// --- Tool Definitions --- -export const toolDefinitions = [ - { - name: 'confluence_list_spaces', - description: 'List available Confluence spaces.', - inputSchema: { - type: 'object', - properties: { - limit: { - type: 'number', - description: 'Max spaces to return (default: 25)', - }, - }, - }, - }, - { - name: 'confluence_create_space', - description: 'Create a new Confluence space.', - inputSchema: { - type: 'object', - properties: { - key: { - type: 'string', - description: 'Space key (uppercase, e.g. "AI", "CLAUDE")', - }, - name: { - type: 'string', - description: 'Space display name', - }, - description: { - type: 'string', - description: 'Space description (optional)', - }, - }, - required: ['key', 'name'], - }, - }, - { - name: 'confluence_search', - description: 'Search Confluence pages by text content. Returns matching pages with titles and links.', - inputSchema: { - type: 'object', - properties: { - query: { - type: 'string', - description: 'Search text to find in pages', - }, - space_id: { - type: 'string', - description: 'Filter by space ID (optional)', - }, - limit: { - type: 'number', - description: 'Max results (default: 10)', - }, - }, - required: ['query'], - }, - }, - { - name: 'confluence_get_page', - description: 'Get a Confluence page by ID, including its full body content and version number. Use the version number for updates.', - inputSchema: { - type: 'object', - properties: { - page_id: { - type: 'string', - description: 'Confluence page ID', - }, - }, - required: ['page_id'], - }, - }, - { - name: 'confluence_create_page', - description: 'Create a new Confluence page in a space. Body is XHTML storage format (supports

,

-

, , , etc).', - inputSchema: { - type: 'object', - properties: { - space_id: { - type: 'string', - description: 'Space ID to create the page in', - }, - title: { - type: 'string', - description: 'Page title', - }, - body: { - type: 'string', - description: 'Page body in Confluence storage format (XHTML). Example: "

Hello world

"', - }, - parent_id: { - type: 'string', - description: 'Parent page ID (optional, creates at root if omitted)', - }, - }, - required: ['space_id', 'title', 'body'], - }, - }, - { - name: 'confluence_update_page', - description: 'Update an existing Confluence page. MUST provide the current version number (from confluence_get_page) incremented by 1. Replaces the full page body.', - inputSchema: { - type: 'object', - properties: { - page_id: { - type: 'string', - description: 'Page ID to update', - }, - title: { - type: 'string', - description: 'Page title (can be changed)', - }, - body: { - type: 'string', - description: 'New page body in Confluence storage format (replaces entire body)', - }, - version_number: { - type: 'number', - description: 'New version number (must be current version + 1)', - }, - version_message: { - type: 'string', - description: 'Version change message (optional)', - }, - }, - required: ['page_id', 'title', 'body', 'version_number'], - }, - }, - { - name: 'confluence_get_comments', - description: 'Get footer comments on a Confluence page.', - inputSchema: { - type: 'object', - properties: { - page_id: { - type: 'string', - description: 'Page ID', - }, - limit: { - type: 'number', - description: 'Max comments (default: 25)', - }, - }, - required: ['page_id'], - }, - }, - { - name: 'confluence_add_comment', - description: 'Add a footer comment to a Confluence page.', - inputSchema: { - type: 'object', - properties: { - page_id: { - type: 'string', - description: 'Page ID to comment on', - }, - body: { - type: 'string', - description: 'Comment body in storage format (XHTML)', - }, - }, - required: ['page_id', 'body'], - }, - }, -]; -// --- Handlers --- -export async function handleListSpaces(args) { - const spaces = await listSpaces(args.limit); - if (spaces.length === 0) - return 'No spaces found.'; - const lines = spaces.map((s) => `${s.key} | ${s.name} | ID: ${s.id} | ${s.type}`); - return `Found ${spaces.length} spaces:\n\n${lines.join('\n')}`; -} -export async function handleCreateSpace(args) { - const space = await createSpace(args.key, args.name, args.description); - return `Space created: ${space.key} (${space.name}) — ID: ${space.id}`; -} -export async function handleSearch(args) { - const pages = await searchPages(args.query, args.space_id, args.limit); - if (pages.length === 0) - return `No pages found for: ${args.query}`; - const lines = pages.map((p) => { - const url = getWebUrl(p); - return `${p.title} | ID: ${p.id} | v${p.version.number} | ${url}`; - }); - return `Found ${pages.length} pages:\n\n${lines.join('\n')}`; -} -export async function handleGetPage(args) { - const page = await getPage(args.page_id, true); - const url = getWebUrl(page); - const body = page.body?.storage?.value || '(empty)'; - return [ - `Title: ${page.title}`, - `ID: ${page.id} | Space: ${page.spaceId} | Version: ${page.version.number}`, - `URL: ${url}`, - `Last updated: ${page.version.createdAt}`, - '', - '--- Content (storage format) ---', - body, - ].join('\n'); -} -export async function handleCreatePage(args) { - const page = await createPage(args.space_id, args.title, args.body, args.parent_id); - const url = getWebUrl(page); - return `Page created: "${page.title}" | ID: ${page.id} | Version: ${page.version.number}\nURL: ${url}`; -} -export async function handleUpdatePage(args) { - const page = await updatePage(args.page_id, args.title, args.body, args.version_number, args.version_message); - const url = getWebUrl(page); - return `Page updated: "${page.title}" | Version: ${page.version.number}\nURL: ${url}`; -} -export async function handleGetComments(args) { - const comments = await getPageComments(args.page_id, args.limit); - if (comments.length === 0) - return 'No comments on this page.'; - const lines = comments.map((c) => { - const body = c.body?.storage?.value || '(empty)'; - const date = c.version?.createdAt || 'unknown'; - return `[${date}] ${body}`; - }); - return `${comments.length} comments:\n\n${lines.join('\n\n')}`; -} -export async function handleAddComment(args) { - const comment = await addPageComment(args.page_id, args.body); - return `Comment added (ID: ${comment.id})`; -} diff --git a/node_modules/.bin/esbuild b/node_modules/.bin/esbuild deleted file mode 120000 index c83ac07..0000000 --- a/node_modules/.bin/esbuild +++ /dev/null @@ -1 +0,0 @@ -../esbuild/bin/esbuild \ No newline at end of file diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which deleted file mode 120000 index 6f8415e..0000000 --- a/node_modules/.bin/node-which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/node-which \ No newline at end of file diff --git a/node_modules/.bin/tsc b/node_modules/.bin/tsc deleted file mode 120000 index 0863208..0000000 --- a/node_modules/.bin/tsc +++ /dev/null @@ -1 +0,0 @@ -../typescript/bin/tsc \ No newline at end of file diff --git a/node_modules/.bin/tsserver b/node_modules/.bin/tsserver deleted file mode 120000 index f8f8f1a..0000000 --- a/node_modules/.bin/tsserver +++ /dev/null @@ -1 +0,0 @@ -../typescript/bin/tsserver \ No newline at end of file diff --git a/node_modules/.bin/tsx b/node_modules/.bin/tsx deleted file mode 120000 index f7282dd..0000000 --- a/node_modules/.bin/tsx +++ /dev/null @@ -1 +0,0 @@ -../tsx/dist/cli.mjs \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index a285869..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,1276 +0,0 @@ -{ - "name": "confluence-mcp", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", - "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@hono/node-server": { - "version": "1.19.9", - "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.9.tgz", - "integrity": "sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==", - "license": "MIT", - "engines": { - "node": ">=18.14.1" - }, - "peerDependencies": { - "hono": "^4" - } - }, - "node_modules/@modelcontextprotocol/sdk": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.26.0.tgz", - "integrity": "sha512-Y5RmPncpiDtTXDbLKswIJzTqu2hyBKxTNsgKqKclDbhIgg1wgtf1fRuvxgTnRfcnxtvvgbIEcqUOzZrJ6iSReg==", - "license": "MIT", - "dependencies": { - "@hono/node-server": "^1.19.9", - "ajv": "^8.17.1", - "ajv-formats": "^3.0.1", - "content-type": "^1.0.5", - "cors": "^2.8.5", - "cross-spawn": "^7.0.5", - "eventsource": "^3.0.2", - "eventsource-parser": "^3.0.0", - "express": "^5.2.1", - "express-rate-limit": "^8.2.1", - "hono": "^4.11.4", - "jose": "^6.1.3", - "json-schema-typed": "^8.0.2", - "pkce-challenge": "^5.0.0", - "raw-body": "^3.0.0", - "zod": "^3.25 || ^4.0", - "zod-to-json-schema": "^3.25.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@cfworker/json-schema": "^4.1.1", - "zod": "^3.25 || ^4.0" - }, - "peerDependenciesMeta": { - "@cfworker/json-schema": { - "optional": true - }, - "zod": { - "optional": false - } - } - }, - "node_modules/@types/node": { - "version": "20.19.33", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.33.tgz", - "integrity": "sha512-Rs1bVAIdBs5gbTIKza/tgpMuG1k3U/UMJLWecIMxNdJFDMzcM5LOiLVRYh3PilWEYDIeUDv7bpiHPLPsbydGcw==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/accepts": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", - "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", - "license": "MIT", - "dependencies": { - "mime-types": "^3.0.0", - "negotiator": "^1.0.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", - "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", - "license": "MIT", - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "node_modules/body-parser": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", - "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", - "license": "MIT", - "dependencies": { - "bytes": "^3.1.2", - "content-type": "^1.0.5", - "debug": "^4.4.3", - "http-errors": "^2.0.0", - "iconv-lite": "^0.7.0", - "on-finished": "^2.4.1", - "qs": "^6.14.1", - "raw-body": "^3.0.1", - "type-is": "^2.0.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/content-disposition": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", - "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", - "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", - "license": "MIT", - "engines": { - "node": ">=6.6.0" - } - }, - "node_modules/cors": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", - "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/dotenv": { - "version": "17.2.4", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.4.tgz", - "integrity": "sha512-mudtfb4zRB4bVvdj0xRo+e6duH1csJRM8IukBqfTRvHotn9+LBXB8ynAidP9zHqoRC/fsllXgk4kCKlR21fIhw==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/esbuild": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", - "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.3", - "@esbuild/android-arm": "0.27.3", - "@esbuild/android-arm64": "0.27.3", - "@esbuild/android-x64": "0.27.3", - "@esbuild/darwin-arm64": "0.27.3", - "@esbuild/darwin-x64": "0.27.3", - "@esbuild/freebsd-arm64": "0.27.3", - "@esbuild/freebsd-x64": "0.27.3", - "@esbuild/linux-arm": "0.27.3", - "@esbuild/linux-arm64": "0.27.3", - "@esbuild/linux-ia32": "0.27.3", - "@esbuild/linux-loong64": "0.27.3", - "@esbuild/linux-mips64el": "0.27.3", - "@esbuild/linux-ppc64": "0.27.3", - "@esbuild/linux-riscv64": "0.27.3", - "@esbuild/linux-s390x": "0.27.3", - "@esbuild/linux-x64": "0.27.3", - "@esbuild/netbsd-arm64": "0.27.3", - "@esbuild/netbsd-x64": "0.27.3", - "@esbuild/openbsd-arm64": "0.27.3", - "@esbuild/openbsd-x64": "0.27.3", - "@esbuild/openharmony-arm64": "0.27.3", - "@esbuild/sunos-x64": "0.27.3", - "@esbuild/win32-arm64": "0.27.3", - "@esbuild/win32-ia32": "0.27.3", - "@esbuild/win32-x64": "0.27.3" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/eventsource": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", - "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", - "license": "MIT", - "dependencies": { - "eventsource-parser": "^3.0.1" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/eventsource-parser": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz", - "integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==", - "license": "MIT", - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/express": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", - "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", - "license": "MIT", - "dependencies": { - "accepts": "^2.0.0", - "body-parser": "^2.2.1", - "content-disposition": "^1.0.0", - "content-type": "^1.0.5", - "cookie": "^0.7.1", - "cookie-signature": "^1.2.1", - "debug": "^4.4.0", - "depd": "^2.0.0", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "finalhandler": "^2.1.0", - "fresh": "^2.0.0", - "http-errors": "^2.0.0", - "merge-descriptors": "^2.0.0", - "mime-types": "^3.0.0", - "on-finished": "^2.4.1", - "once": "^1.4.0", - "parseurl": "^1.3.3", - "proxy-addr": "^2.0.7", - "qs": "^6.14.0", - "range-parser": "^1.2.1", - "router": "^2.2.0", - "send": "^1.1.0", - "serve-static": "^2.2.0", - "statuses": "^2.0.1", - "type-is": "^2.0.1", - "vary": "^1.1.2" - }, - "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/express-rate-limit": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.2.1.tgz", - "integrity": "sha512-PCZEIEIxqwhzw4KF0n7QF4QqruVTcF73O5kFKUnGOyjbCCgizBBiFaYpd/fnBLUMPw/BWw9OsiN7GgrNYr7j6g==", - "license": "MIT", - "dependencies": { - "ip-address": "10.0.1" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/express-rate-limit" - }, - "peerDependencies": { - "express": ">= 4.11" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "license": "MIT" - }, - "node_modules/fast-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", - "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/finalhandler": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", - "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", - "license": "MIT", - "dependencies": { - "debug": "^4.4.0", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "on-finished": "^2.4.1", - "parseurl": "^1.3.3", - "statuses": "^2.0.1" - }, - "engines": { - "node": ">= 18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", - "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/get-tsconfig": { - "version": "4.13.6", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.6.tgz", - "integrity": "sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hono": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.9.tgz", - "integrity": "sha512-Eaw2YTGM6WOxA6CXbckaEvslr2Ne4NFsKrvc0v97JD5awbmeBLO5w9Ho9L9kmKonrwF9RJlW6BxT1PVv/agBHQ==", - "license": "MIT", - "engines": { - "node": ">=16.9.0" - } - }, - "node_modules/http-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", - "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", - "license": "MIT", - "dependencies": { - "depd": "~2.0.0", - "inherits": "~2.0.4", - "setprototypeof": "~1.2.0", - "statuses": "~2.0.2", - "toidentifier": "~1.0.1" - }, - "engines": { - "node": ">= 0.8" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/iconv-lite": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", - "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/ip-address": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz", - "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==", - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-promise": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", - "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", - "license": "MIT" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "license": "ISC" - }, - "node_modules/jose": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/jose/-/jose-6.1.3.tgz", - "integrity": "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/panva" - } - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "license": "MIT" - }, - "node_modules/json-schema-typed": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", - "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", - "license": "BSD-2-Clause" - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/media-typer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", - "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/merge-descriptors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", - "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mime-db": { - "version": "1.54.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", - "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", - "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", - "license": "MIT", - "dependencies": { - "mime-db": "^1.54.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/negotiator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", - "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-to-regexp": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", - "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/pkce-challenge": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz", - "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", - "license": "MIT", - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.14.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", - "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", - "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "http-errors": "~2.0.1", - "iconv-lite": "~0.7.0", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, - "node_modules/router": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", - "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", - "license": "MIT", - "dependencies": { - "debug": "^4.4.0", - "depd": "^2.0.0", - "is-promise": "^4.0.0", - "parseurl": "^1.3.3", - "path-to-regexp": "^8.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, - "node_modules/send": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", - "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", - "license": "MIT", - "dependencies": { - "debug": "^4.4.3", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "fresh": "^2.0.0", - "http-errors": "^2.0.1", - "mime-types": "^3.0.2", - "ms": "^2.1.3", - "on-finished": "^2.4.1", - "range-parser": "^1.2.1", - "statuses": "^2.0.2" - }, - "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/serve-static": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", - "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", - "license": "MIT", - "dependencies": { - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "parseurl": "^1.3.3", - "send": "^1.2.0" - }, - "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", - "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/tsx": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", - "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.27.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, - "node_modules/type-is": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", - "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", - "license": "MIT", - "dependencies": { - "content-type": "^1.0.5", - "media-typer": "^1.1.0", - "mime-types": "^3.0.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "license": "ISC" - }, - "node_modules/zod": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", - "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, - "node_modules/zod-to-json-schema": { - "version": "3.25.1", - "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.1.tgz", - "integrity": "sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA==", - "license": "ISC", - "peerDependencies": { - "zod": "^3.25 || ^4" - } - } - } -} diff --git a/node_modules/@esbuild/darwin-arm64/README.md b/node_modules/@esbuild/darwin-arm64/README.md deleted file mode 100644 index c2c0398..0000000 --- a/node_modules/@esbuild/darwin-arm64/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# esbuild - -This is the macOS ARM 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details. diff --git a/node_modules/@esbuild/darwin-arm64/bin/esbuild b/node_modules/@esbuild/darwin-arm64/bin/esbuild deleted file mode 100755 index b8c23e2..0000000 Binary files a/node_modules/@esbuild/darwin-arm64/bin/esbuild and /dev/null differ diff --git a/node_modules/@esbuild/darwin-arm64/package.json b/node_modules/@esbuild/darwin-arm64/package.json deleted file mode 100644 index 2c15be1..0000000 --- a/node_modules/@esbuild/darwin-arm64/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@esbuild/darwin-arm64", - "version": "0.27.3", - "description": "The macOS ARM 64-bit binary for esbuild, a JavaScript bundler.", - "repository": { - "type": "git", - "url": "git+https://github.com/evanw/esbuild.git" - }, - "license": "MIT", - "preferUnplugged": true, - "engines": { - "node": ">=18" - }, - "os": [ - "darwin" - ], - "cpu": [ - "arm64" - ] -} diff --git a/node_modules/@hono/node-server/README.md b/node_modules/@hono/node-server/README.md deleted file mode 100644 index e0c5f79..0000000 --- a/node_modules/@hono/node-server/README.md +++ /dev/null @@ -1,357 +0,0 @@ -# Node.js Adapter for Hono - -This adapter `@hono/node-server` allows you to run your Hono application on Node.js. -Initially, Hono wasn't designed for Node.js, but with this adapter, you can now use Hono on Node.js. -It utilizes web standard APIs implemented in Node.js version 18 or higher. - -## Benchmarks - -Hono is 3.5 times faster than Express. - -Express: - -```txt -$ bombardier -d 10s --fasthttp http://localhost:3000/ - -Statistics Avg Stdev Max - Reqs/sec 16438.94 1603.39 19155.47 - Latency 7.60ms 7.51ms 559.89ms - HTTP codes: - 1xx - 0, 2xx - 164494, 3xx - 0, 4xx - 0, 5xx - 0 - others - 0 - Throughput: 4.55MB/s -``` - -Hono + `@hono/node-server`: - -```txt -$ bombardier -d 10s --fasthttp http://localhost:3000/ - -Statistics Avg Stdev Max - Reqs/sec 58296.56 5512.74 74403.56 - Latency 2.14ms 1.46ms 190.92ms - HTTP codes: - 1xx - 0, 2xx - 583059, 3xx - 0, 4xx - 0, 5xx - 0 - others - 0 - Throughput: 12.56MB/s -``` - -## Requirements - -It works on Node.js versions greater than 18.x. The specific required Node.js versions are as follows: - -- 18.x => 18.14.1+ -- 19.x => 19.7.0+ -- 20.x => 20.0.0+ - -Essentially, you can simply use the latest version of each major release. - -## Installation - -You can install it from the npm registry with `npm` command: - -```sh -npm install @hono/node-server -``` - -Or use `yarn`: - -```sh -yarn add @hono/node-server -``` - -## Usage - -Just import `@hono/node-server` at the top and write the code as usual. -The same code that runs on Cloudflare Workers, Deno, and Bun will work. - -```ts -import { serve } from '@hono/node-server' -import { Hono } from 'hono' - -const app = new Hono() -app.get('/', (c) => c.text('Hono meets Node.js')) - -serve(app, (info) => { - console.log(`Listening on http://localhost:${info.port}`) // Listening on http://localhost:3000 -}) -``` - -For example, run it using `ts-node`. Then an HTTP server will be launched. The default port is `3000`. - -```sh -ts-node ./index.ts -``` - -Open `http://localhost:3000` with your browser. - -## Options - -### `port` - -```ts -serve({ - fetch: app.fetch, - port: 8787, // Port number, default is 3000 -}) -``` - -### `createServer` - -```ts -import { createServer } from 'node:https' -import fs from 'node:fs' - -//... - -serve({ - fetch: app.fetch, - createServer: createServer, - serverOptions: { - key: fs.readFileSync('test/fixtures/keys/agent1-key.pem'), - cert: fs.readFileSync('test/fixtures/keys/agent1-cert.pem'), - }, -}) -``` - -### `overrideGlobalObjects` - -The default value is `true`. The Node.js Adapter rewrites the global Request/Response and uses a lightweight Request/Response to improve performance. If you don't want to do that, set `false`. - -```ts -serve({ - fetch: app.fetch, - overrideGlobalObjects: false, -}) -``` - -### `autoCleanupIncoming` - -The default value is `true`. The Node.js Adapter automatically cleans up (explicitly call `destroy()` method) if application is not finished to consume the incoming request. If you don't want to do that, set `false`. - -If the application accepts connections from arbitrary clients, this cleanup must be done otherwise incomplete requests from clients may cause the application to stop responding. If your application only accepts connections from trusted clients, such as in a reverse proxy environment and there is no process that returns a response without reading the body of the POST request all the way through, you can improve performance by setting it to `false`. - -```ts -serve({ - fetch: app.fetch, - autoCleanupIncoming: false, -}) -``` - -## Middleware - -Most built-in middleware also works with Node.js. -Read [the documentation](https://hono.dev/middleware/builtin/basic-auth) and use the Middleware of your liking. - -```ts -import { serve } from '@hono/node-server' -import { Hono } from 'hono' -import { prettyJSON } from 'hono/pretty-json' - -const app = new Hono() - -app.get('*', prettyJSON()) -app.get('/', (c) => c.json({ 'Hono meets': 'Node.js' })) - -serve(app) -``` - -## Serve Static Middleware - -Use Serve Static Middleware that has been created for Node.js. - -```ts -import { serveStatic } from '@hono/node-server/serve-static' - -//... - -app.use('/static/*', serveStatic({ root: './' })) -``` - -If using a relative path, `root` will be relative to the current working directory from which the app was started. - -This can cause confusion when running your application locally. - -Imagine your project structure is: - -``` -my-hono-project/ - src/ - index.ts - static/ - index.html -``` - -Typically, you would run your app from the project's root directory (`my-hono-project`), -so you would need the following code to serve the `static` folder: - -```ts -app.use('/static/*', serveStatic({ root: './static' })) -``` - -Notice that `root` here is not relative to `src/index.ts`, rather to `my-hono-project`. - -### Options - -#### `rewriteRequestPath` - -If you want to serve files in `./.foojs` with the request path `/__foo/*`, you can write like the following. - -```ts -app.use( - '/__foo/*', - serveStatic({ - root: './.foojs/', - rewriteRequestPath: (path: string) => path.replace(/^\/__foo/, ''), - }) -) -``` - -#### `onFound` - -You can specify handling when the requested file is found with `onFound`. - -```ts -app.use( - '/static/*', - serveStatic({ - // ... - onFound: (_path, c) => { - c.header('Cache-Control', `public, immutable, max-age=31536000`) - }, - }) -) -``` - -#### `onNotFound` - -The `onNotFound` is useful for debugging. You can write a handle for when a file is not found. - -```ts -app.use( - '/static/*', - serveStatic({ - root: './non-existent-dir', - onNotFound: (path, c) => { - console.log(`${path} is not found, request to ${c.req.path}`) - }, - }) -) -``` - -#### `precompressed` - -The `precompressed` option checks if files with extensions like `.br` or `.gz` are available and serves them based on the `Accept-Encoding` header. It prioritizes Brotli, then Zstd, and Gzip. If none are available, it serves the original file. - -```ts -app.use( - '/static/*', - serveStatic({ - precompressed: true, - }) -) -``` - -## ConnInfo Helper - -You can use the [ConnInfo Helper](https://hono.dev/docs/helpers/conninfo) by importing `getConnInfo` from `@hono/node-server/conninfo`. - -```ts -import { getConnInfo } from '@hono/node-server/conninfo' - -app.get('/', (c) => { - const info = getConnInfo(c) // info is `ConnInfo` - return c.text(`Your remote address is ${info.remote.address}`) -}) -``` - -## Accessing Node.js API - -You can access the Node.js API from `c.env` in Node.js. For example, if you want to specify a type, you can write the following. - -```ts -import { serve } from '@hono/node-server' -import type { HttpBindings } from '@hono/node-server' -import { Hono } from 'hono' - -const app = new Hono<{ Bindings: HttpBindings }>() - -app.get('/', (c) => { - return c.json({ - remoteAddress: c.env.incoming.socket.remoteAddress, - }) -}) - -serve(app) -``` - -The APIs that you can get from `c.env` are as follows. - -```ts -type HttpBindings = { - incoming: IncomingMessage - outgoing: ServerResponse -} - -type Http2Bindings = { - incoming: Http2ServerRequest - outgoing: Http2ServerResponse -} -``` - -## Direct response from Node.js API - -You can directly respond to the client from the Node.js API. -In that case, the response from Hono should be ignored, so return `RESPONSE_ALREADY_SENT`. - -> [!NOTE] -> This feature can be used when migrating existing Node.js applications to Hono, but we recommend using Hono's API for new applications. - -```ts -import { serve } from '@hono/node-server' -import type { HttpBindings } from '@hono/node-server' -import { RESPONSE_ALREADY_SENT } from '@hono/node-server/utils/response' -import { Hono } from 'hono' - -const app = new Hono<{ Bindings: HttpBindings }>() - -app.get('/', (c) => { - const { outgoing } = c.env - outgoing.writeHead(200, { 'Content-Type': 'text/plain' }) - outgoing.end('Hello World\n') - - return RESPONSE_ALREADY_SENT -}) - -serve(app) -``` - -## Listen to a UNIX domain socket - -You can configure the HTTP server to listen to a UNIX domain socket instead of a TCP port. - -```ts -import { createAdaptorServer } from '@hono/node-server' - -// ... - -const socketPath ='/tmp/example.sock' - -const server = createAdaptorServer(app) -server.listen(socketPath, () => { - console.log(`Listening on ${socketPath}`) -}) -``` - -## Related projects - -- Hono - -- Hono GitHub repository - - -## Author - -Yusuke Wada - -## License - -MIT diff --git a/node_modules/@hono/node-server/dist/conninfo.d.mts b/node_modules/@hono/node-server/dist/conninfo.d.mts deleted file mode 100644 index 4c756d1..0000000 --- a/node_modules/@hono/node-server/dist/conninfo.d.mts +++ /dev/null @@ -1,10 +0,0 @@ -import { GetConnInfo } from 'hono/conninfo'; - -/** - * ConnInfo Helper for Node.js - * @param c Context - * @returns ConnInfo - */ -declare const getConnInfo: GetConnInfo; - -export { getConnInfo }; diff --git a/node_modules/@hono/node-server/dist/conninfo.d.ts b/node_modules/@hono/node-server/dist/conninfo.d.ts deleted file mode 100644 index 4c756d1..0000000 --- a/node_modules/@hono/node-server/dist/conninfo.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GetConnInfo } from 'hono/conninfo'; - -/** - * ConnInfo Helper for Node.js - * @param c Context - * @returns ConnInfo - */ -declare const getConnInfo: GetConnInfo; - -export { getConnInfo }; diff --git a/node_modules/@hono/node-server/dist/conninfo.js b/node_modules/@hono/node-server/dist/conninfo.js deleted file mode 100644 index 131934d..0000000 --- a/node_modules/@hono/node-server/dist/conninfo.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/conninfo.ts -var conninfo_exports = {}; -__export(conninfo_exports, { - getConnInfo: () => getConnInfo -}); -module.exports = __toCommonJS(conninfo_exports); -var getConnInfo = (c) => { - const bindings = c.env.server ? c.env.server : c.env; - const address = bindings.incoming.socket.remoteAddress; - const port = bindings.incoming.socket.remotePort; - const family = bindings.incoming.socket.remoteFamily; - return { - remote: { - address, - port, - addressType: family === "IPv4" ? "IPv4" : family === "IPv6" ? "IPv6" : void 0 - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - getConnInfo -}); diff --git a/node_modules/@hono/node-server/dist/conninfo.mjs b/node_modules/@hono/node-server/dist/conninfo.mjs deleted file mode 100644 index ab3cc95..0000000 --- a/node_modules/@hono/node-server/dist/conninfo.mjs +++ /dev/null @@ -1,17 +0,0 @@ -// src/conninfo.ts -var getConnInfo = (c) => { - const bindings = c.env.server ? c.env.server : c.env; - const address = bindings.incoming.socket.remoteAddress; - const port = bindings.incoming.socket.remotePort; - const family = bindings.incoming.socket.remoteFamily; - return { - remote: { - address, - port, - addressType: family === "IPv4" ? "IPv4" : family === "IPv6" ? "IPv6" : void 0 - } - }; -}; -export { - getConnInfo -}; diff --git a/node_modules/@hono/node-server/dist/globals.d.mts b/node_modules/@hono/node-server/dist/globals.d.mts deleted file mode 100644 index c9247d4..0000000 --- a/node_modules/@hono/node-server/dist/globals.d.mts +++ /dev/null @@ -1,2 +0,0 @@ - -export { } diff --git a/node_modules/@hono/node-server/dist/globals.d.ts b/node_modules/@hono/node-server/dist/globals.d.ts deleted file mode 100644 index c9247d4..0000000 --- a/node_modules/@hono/node-server/dist/globals.d.ts +++ /dev/null @@ -1,2 +0,0 @@ - -export { } diff --git a/node_modules/@hono/node-server/dist/globals.js b/node_modules/@hono/node-server/dist/globals.js deleted file mode 100644 index 4704d2c..0000000 --- a/node_modules/@hono/node-server/dist/globals.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); - -// src/globals.ts -var import_node_crypto = __toESM(require("crypto")); -if (typeof global.crypto === "undefined") { - global.crypto = import_node_crypto.default; -} diff --git a/node_modules/@hono/node-server/dist/globals.mjs b/node_modules/@hono/node-server/dist/globals.mjs deleted file mode 100644 index 45daa06..0000000 --- a/node_modules/@hono/node-server/dist/globals.mjs +++ /dev/null @@ -1,5 +0,0 @@ -// src/globals.ts -import crypto from "crypto"; -if (typeof global.crypto === "undefined") { - global.crypto = crypto; -} diff --git a/node_modules/@hono/node-server/dist/index.d.mts b/node_modules/@hono/node-server/dist/index.d.mts deleted file mode 100644 index b9f383b..0000000 --- a/node_modules/@hono/node-server/dist/index.d.mts +++ /dev/null @@ -1,8 +0,0 @@ -export { createAdaptorServer, serve } from './server.mjs'; -export { getRequestListener } from './listener.mjs'; -export { RequestError } from './request.mjs'; -export { Http2Bindings, HttpBindings, ServerType } from './types.mjs'; -import 'node:net'; -import 'node:http'; -import 'node:http2'; -import 'node:https'; diff --git a/node_modules/@hono/node-server/dist/index.d.ts b/node_modules/@hono/node-server/dist/index.d.ts deleted file mode 100644 index 7a03b52..0000000 --- a/node_modules/@hono/node-server/dist/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { createAdaptorServer, serve } from './server.js'; -export { getRequestListener } from './listener.js'; -export { RequestError } from './request.js'; -export { Http2Bindings, HttpBindings, ServerType } from './types.js'; -import 'node:net'; -import 'node:http'; -import 'node:http2'; -import 'node:https'; diff --git a/node_modules/@hono/node-server/dist/index.js b/node_modules/@hono/node-server/dist/index.js deleted file mode 100644 index 5b00ade..0000000 --- a/node_modules/@hono/node-server/dist/index.js +++ /dev/null @@ -1,613 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var src_exports = {}; -__export(src_exports, { - RequestError: () => RequestError, - createAdaptorServer: () => createAdaptorServer, - getRequestListener: () => getRequestListener, - serve: () => serve -}); -module.exports = __toCommonJS(src_exports); - -// src/server.ts -var import_node_http = require("http"); - -// src/listener.ts -var import_node_http22 = require("http2"); - -// src/request.ts -var import_node_http2 = require("http2"); -var import_node_stream = require("stream"); -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= import_node_stream.Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = import_node_stream.Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof import_node_http2.Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof import_node_http2.Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; - -// src/response.ts -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response2 = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response2, GlobalResponse); -Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype); - -// src/utils.ts -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; - -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/globals.ts -var import_node_crypto = __toESM(require("crypto")); -if (typeof global.crypto === "undefined") { - global.crypto = import_node_crypto.default; -} - -// src/listener.ts -var outgoingEnded = Symbol("outgoingEnded"); -var handleRequestError = () => new Response(null, { - status: 400 -}); -var handleFetchError = (e) => new Response(null, { - status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500 -}); -var handleResponseError = (e, outgoing) => { - const err = e instanceof Error ? e : new Error("unknown error", { cause: e }); - if (err.code === "ERR_STREAM_PREMATURE_CLOSE") { - console.info("The user aborted a request."); - } else { - console.error(e); - if (!outgoing.headersSent) { - outgoing.writeHead(500, { "Content-Type": "text/plain" }); - } - outgoing.end(`Error: ${err.message}`); - outgoing.destroy(err); - } -}; -var flushHeaders = (outgoing) => { - if ("flushHeaders" in outgoing && outgoing.writable) { - outgoing.flushHeaders(); - } -}; -var responseViaCache = async (res, outgoing) => { - let [status, body, header] = res[cacheKey]; - if (header instanceof Headers) { - header = buildOutgoingHttpHeaders(header); - } - if (typeof body === "string") { - header["Content-Length"] = Buffer.byteLength(body); - } else if (body instanceof Uint8Array) { - header["Content-Length"] = body.byteLength; - } else if (body instanceof Blob) { - header["Content-Length"] = body.size; - } - outgoing.writeHead(status, header); - if (typeof body === "string" || body instanceof Uint8Array) { - outgoing.end(body); - } else if (body instanceof Blob) { - outgoing.end(new Uint8Array(await body.arrayBuffer())); - } else { - flushHeaders(outgoing); - await writeFromReadableStream(body, outgoing)?.catch( - (e) => handleResponseError(e, outgoing) - ); - } - ; - outgoing[outgoingEnded]?.(); -}; -var isPromise = (res) => typeof res.then === "function"; -var responseViaResponseObject = async (res, outgoing, options = {}) => { - if (isPromise(res)) { - if (options.errorHandler) { - try { - res = await res; - } catch (err) { - const errRes = await options.errorHandler(err); - if (!errRes) { - return; - } - res = errRes; - } - } else { - res = await res.catch(handleFetchError); - } - } - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - const resHeaderRecord = buildOutgoingHttpHeaders(res.headers); - if (res.body) { - const reader = res.body.getReader(); - const values = []; - let done = false; - let currentReadPromise = void 0; - if (resHeaderRecord["transfer-encoding"] !== "chunked") { - let maxReadCount = 2; - for (let i = 0; i < maxReadCount; i++) { - currentReadPromise ||= reader.read(); - const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => { - console.error(e); - done = true; - }); - if (!chunk) { - if (i === 1) { - await new Promise((resolve) => setTimeout(resolve)); - maxReadCount = 3; - continue; - } - break; - } - currentReadPromise = void 0; - if (chunk.value) { - values.push(chunk.value); - } - if (chunk.done) { - done = true; - break; - } - } - if (done && !("content-length" in resHeaderRecord)) { - resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0); - } - } - outgoing.writeHead(res.status, resHeaderRecord); - values.forEach((value) => { - ; - outgoing.write(value); - }); - if (done) { - outgoing.end(); - } else { - if (values.length === 0) { - flushHeaders(outgoing); - } - await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise); - } - } else if (resHeaderRecord[X_ALREADY_SENT]) { - } else { - outgoing.writeHead(res.status, resHeaderRecord); - outgoing.end(); - } - ; - outgoing[outgoingEnded]?.(); -}; -var getRequestListener = (fetchCallback, options = {}) => { - const autoCleanupIncoming = options.autoCleanupIncoming ?? true; - if (options.overrideGlobalObjects !== false && global.Request !== Request) { - Object.defineProperty(global, "Request", { - value: Request - }); - Object.defineProperty(global, "Response", { - value: Response2 - }); - } - return async (incoming, outgoing) => { - let res, req; - try { - req = newRequest(incoming, options.hostname); - let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD"; - if (!incomingEnded) { - ; - incoming[wrapBodyStream] = true; - incoming.on("end", () => { - incomingEnded = true; - }); - if (incoming instanceof import_node_http22.Http2ServerRequest) { - ; - outgoing[outgoingEnded] = () => { - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - outgoing.destroy(); - }); - } - }); - } - }; - } - } - outgoing.on("close", () => { - const abortController = req[abortControllerKey]; - if (abortController) { - if (incoming.errored) { - req[abortControllerKey].abort(incoming.errored.toString()); - } else if (!outgoing.writableFinished) { - req[abortControllerKey].abort("Client connection prematurely closed."); - } - } - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - }); - } - }); - } - }); - res = fetchCallback(req, { incoming, outgoing }); - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - } catch (e) { - if (!res) { - if (options.errorHandler) { - res = await options.errorHandler(req ? e : toRequestError(e)); - if (!res) { - return; - } - } else if (!req) { - res = handleRequestError(); - } else { - res = handleFetchError(e); - } - } else { - return handleResponseError(e, outgoing); - } - } - try { - return await responseViaResponseObject(res, outgoing, options); - } catch (e) { - return handleResponseError(e, outgoing); - } - }; -}; - -// src/server.ts -var createAdaptorServer = (options) => { - const fetchCallback = options.fetch; - const requestListener = getRequestListener(fetchCallback, { - hostname: options.hostname, - overrideGlobalObjects: options.overrideGlobalObjects, - autoCleanupIncoming: options.autoCleanupIncoming - }); - const createServer = options.createServer || import_node_http.createServer; - const server = createServer(options.serverOptions || {}, requestListener); - return server; -}; -var serve = (options, listeningListener) => { - const server = createAdaptorServer(options); - server.listen(options?.port ?? 3e3, options.hostname, () => { - const serverInfo = server.address(); - listeningListener && listeningListener(serverInfo); - }); - return server; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - RequestError, - createAdaptorServer, - getRequestListener, - serve -}); diff --git a/node_modules/@hono/node-server/dist/index.mjs b/node_modules/@hono/node-server/dist/index.mjs deleted file mode 100644 index b30aec9..0000000 --- a/node_modules/@hono/node-server/dist/index.mjs +++ /dev/null @@ -1,573 +0,0 @@ -// src/server.ts -import { createServer as createServerHTTP } from "http"; - -// src/listener.ts -import { Http2ServerRequest as Http2ServerRequest2 } from "http2"; - -// src/request.ts -import { Http2ServerRequest } from "http2"; -import { Readable } from "stream"; -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; - -// src/response.ts -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response2 = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response2, GlobalResponse); -Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype); - -// src/utils.ts -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; - -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/globals.ts -import crypto from "crypto"; -if (typeof global.crypto === "undefined") { - global.crypto = crypto; -} - -// src/listener.ts -var outgoingEnded = Symbol("outgoingEnded"); -var handleRequestError = () => new Response(null, { - status: 400 -}); -var handleFetchError = (e) => new Response(null, { - status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500 -}); -var handleResponseError = (e, outgoing) => { - const err = e instanceof Error ? e : new Error("unknown error", { cause: e }); - if (err.code === "ERR_STREAM_PREMATURE_CLOSE") { - console.info("The user aborted a request."); - } else { - console.error(e); - if (!outgoing.headersSent) { - outgoing.writeHead(500, { "Content-Type": "text/plain" }); - } - outgoing.end(`Error: ${err.message}`); - outgoing.destroy(err); - } -}; -var flushHeaders = (outgoing) => { - if ("flushHeaders" in outgoing && outgoing.writable) { - outgoing.flushHeaders(); - } -}; -var responseViaCache = async (res, outgoing) => { - let [status, body, header] = res[cacheKey]; - if (header instanceof Headers) { - header = buildOutgoingHttpHeaders(header); - } - if (typeof body === "string") { - header["Content-Length"] = Buffer.byteLength(body); - } else if (body instanceof Uint8Array) { - header["Content-Length"] = body.byteLength; - } else if (body instanceof Blob) { - header["Content-Length"] = body.size; - } - outgoing.writeHead(status, header); - if (typeof body === "string" || body instanceof Uint8Array) { - outgoing.end(body); - } else if (body instanceof Blob) { - outgoing.end(new Uint8Array(await body.arrayBuffer())); - } else { - flushHeaders(outgoing); - await writeFromReadableStream(body, outgoing)?.catch( - (e) => handleResponseError(e, outgoing) - ); - } - ; - outgoing[outgoingEnded]?.(); -}; -var isPromise = (res) => typeof res.then === "function"; -var responseViaResponseObject = async (res, outgoing, options = {}) => { - if (isPromise(res)) { - if (options.errorHandler) { - try { - res = await res; - } catch (err) { - const errRes = await options.errorHandler(err); - if (!errRes) { - return; - } - res = errRes; - } - } else { - res = await res.catch(handleFetchError); - } - } - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - const resHeaderRecord = buildOutgoingHttpHeaders(res.headers); - if (res.body) { - const reader = res.body.getReader(); - const values = []; - let done = false; - let currentReadPromise = void 0; - if (resHeaderRecord["transfer-encoding"] !== "chunked") { - let maxReadCount = 2; - for (let i = 0; i < maxReadCount; i++) { - currentReadPromise ||= reader.read(); - const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => { - console.error(e); - done = true; - }); - if (!chunk) { - if (i === 1) { - await new Promise((resolve) => setTimeout(resolve)); - maxReadCount = 3; - continue; - } - break; - } - currentReadPromise = void 0; - if (chunk.value) { - values.push(chunk.value); - } - if (chunk.done) { - done = true; - break; - } - } - if (done && !("content-length" in resHeaderRecord)) { - resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0); - } - } - outgoing.writeHead(res.status, resHeaderRecord); - values.forEach((value) => { - ; - outgoing.write(value); - }); - if (done) { - outgoing.end(); - } else { - if (values.length === 0) { - flushHeaders(outgoing); - } - await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise); - } - } else if (resHeaderRecord[X_ALREADY_SENT]) { - } else { - outgoing.writeHead(res.status, resHeaderRecord); - outgoing.end(); - } - ; - outgoing[outgoingEnded]?.(); -}; -var getRequestListener = (fetchCallback, options = {}) => { - const autoCleanupIncoming = options.autoCleanupIncoming ?? true; - if (options.overrideGlobalObjects !== false && global.Request !== Request) { - Object.defineProperty(global, "Request", { - value: Request - }); - Object.defineProperty(global, "Response", { - value: Response2 - }); - } - return async (incoming, outgoing) => { - let res, req; - try { - req = newRequest(incoming, options.hostname); - let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD"; - if (!incomingEnded) { - ; - incoming[wrapBodyStream] = true; - incoming.on("end", () => { - incomingEnded = true; - }); - if (incoming instanceof Http2ServerRequest2) { - ; - outgoing[outgoingEnded] = () => { - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - outgoing.destroy(); - }); - } - }); - } - }; - } - } - outgoing.on("close", () => { - const abortController = req[abortControllerKey]; - if (abortController) { - if (incoming.errored) { - req[abortControllerKey].abort(incoming.errored.toString()); - } else if (!outgoing.writableFinished) { - req[abortControllerKey].abort("Client connection prematurely closed."); - } - } - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - }); - } - }); - } - }); - res = fetchCallback(req, { incoming, outgoing }); - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - } catch (e) { - if (!res) { - if (options.errorHandler) { - res = await options.errorHandler(req ? e : toRequestError(e)); - if (!res) { - return; - } - } else if (!req) { - res = handleRequestError(); - } else { - res = handleFetchError(e); - } - } else { - return handleResponseError(e, outgoing); - } - } - try { - return await responseViaResponseObject(res, outgoing, options); - } catch (e) { - return handleResponseError(e, outgoing); - } - }; -}; - -// src/server.ts -var createAdaptorServer = (options) => { - const fetchCallback = options.fetch; - const requestListener = getRequestListener(fetchCallback, { - hostname: options.hostname, - overrideGlobalObjects: options.overrideGlobalObjects, - autoCleanupIncoming: options.autoCleanupIncoming - }); - const createServer = options.createServer || createServerHTTP; - const server = createServer(options.serverOptions || {}, requestListener); - return server; -}; -var serve = (options, listeningListener) => { - const server = createAdaptorServer(options); - server.listen(options?.port ?? 3e3, options.hostname, () => { - const serverInfo = server.address(); - listeningListener && listeningListener(serverInfo); - }); - return server; -}; -export { - RequestError, - createAdaptorServer, - getRequestListener, - serve -}; diff --git a/node_modules/@hono/node-server/dist/listener.d.mts b/node_modules/@hono/node-server/dist/listener.d.mts deleted file mode 100644 index a48eaff..0000000 --- a/node_modules/@hono/node-server/dist/listener.d.mts +++ /dev/null @@ -1,13 +0,0 @@ -import { IncomingMessage, ServerResponse } from 'node:http'; -import { Http2ServerRequest, Http2ServerResponse } from 'node:http2'; -import { FetchCallback, CustomErrorHandler } from './types.mjs'; -import 'node:https'; - -declare const getRequestListener: (fetchCallback: FetchCallback, options?: { - hostname?: string; - errorHandler?: CustomErrorHandler; - overrideGlobalObjects?: boolean; - autoCleanupIncoming?: boolean; -}) => (incoming: IncomingMessage | Http2ServerRequest, outgoing: ServerResponse | Http2ServerResponse) => Promise; - -export { getRequestListener }; diff --git a/node_modules/@hono/node-server/dist/listener.d.ts b/node_modules/@hono/node-server/dist/listener.d.ts deleted file mode 100644 index 2bb0b8f..0000000 --- a/node_modules/@hono/node-server/dist/listener.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IncomingMessage, ServerResponse } from 'node:http'; -import { Http2ServerRequest, Http2ServerResponse } from 'node:http2'; -import { FetchCallback, CustomErrorHandler } from './types.js'; -import 'node:https'; - -declare const getRequestListener: (fetchCallback: FetchCallback, options?: { - hostname?: string; - errorHandler?: CustomErrorHandler; - overrideGlobalObjects?: boolean; - autoCleanupIncoming?: boolean; -}) => (incoming: IncomingMessage | Http2ServerRequest, outgoing: ServerResponse | Http2ServerResponse) => Promise; - -export { getRequestListener }; diff --git a/node_modules/@hono/node-server/dist/listener.js b/node_modules/@hono/node-server/dist/listener.js deleted file mode 100644 index cb081d2..0000000 --- a/node_modules/@hono/node-server/dist/listener.js +++ /dev/null @@ -1,581 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/listener.ts -var listener_exports = {}; -__export(listener_exports, { - getRequestListener: () => getRequestListener -}); -module.exports = __toCommonJS(listener_exports); -var import_node_http22 = require("http2"); - -// src/request.ts -var import_node_http2 = require("http2"); -var import_node_stream = require("stream"); -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= import_node_stream.Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = import_node_stream.Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof import_node_http2.Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof import_node_http2.Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; - -// src/response.ts -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response2 = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response2, GlobalResponse); -Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype); - -// src/utils.ts -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; - -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/globals.ts -var import_node_crypto = __toESM(require("crypto")); -if (typeof global.crypto === "undefined") { - global.crypto = import_node_crypto.default; -} - -// src/listener.ts -var outgoingEnded = Symbol("outgoingEnded"); -var handleRequestError = () => new Response(null, { - status: 400 -}); -var handleFetchError = (e) => new Response(null, { - status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500 -}); -var handleResponseError = (e, outgoing) => { - const err = e instanceof Error ? e : new Error("unknown error", { cause: e }); - if (err.code === "ERR_STREAM_PREMATURE_CLOSE") { - console.info("The user aborted a request."); - } else { - console.error(e); - if (!outgoing.headersSent) { - outgoing.writeHead(500, { "Content-Type": "text/plain" }); - } - outgoing.end(`Error: ${err.message}`); - outgoing.destroy(err); - } -}; -var flushHeaders = (outgoing) => { - if ("flushHeaders" in outgoing && outgoing.writable) { - outgoing.flushHeaders(); - } -}; -var responseViaCache = async (res, outgoing) => { - let [status, body, header] = res[cacheKey]; - if (header instanceof Headers) { - header = buildOutgoingHttpHeaders(header); - } - if (typeof body === "string") { - header["Content-Length"] = Buffer.byteLength(body); - } else if (body instanceof Uint8Array) { - header["Content-Length"] = body.byteLength; - } else if (body instanceof Blob) { - header["Content-Length"] = body.size; - } - outgoing.writeHead(status, header); - if (typeof body === "string" || body instanceof Uint8Array) { - outgoing.end(body); - } else if (body instanceof Blob) { - outgoing.end(new Uint8Array(await body.arrayBuffer())); - } else { - flushHeaders(outgoing); - await writeFromReadableStream(body, outgoing)?.catch( - (e) => handleResponseError(e, outgoing) - ); - } - ; - outgoing[outgoingEnded]?.(); -}; -var isPromise = (res) => typeof res.then === "function"; -var responseViaResponseObject = async (res, outgoing, options = {}) => { - if (isPromise(res)) { - if (options.errorHandler) { - try { - res = await res; - } catch (err) { - const errRes = await options.errorHandler(err); - if (!errRes) { - return; - } - res = errRes; - } - } else { - res = await res.catch(handleFetchError); - } - } - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - const resHeaderRecord = buildOutgoingHttpHeaders(res.headers); - if (res.body) { - const reader = res.body.getReader(); - const values = []; - let done = false; - let currentReadPromise = void 0; - if (resHeaderRecord["transfer-encoding"] !== "chunked") { - let maxReadCount = 2; - for (let i = 0; i < maxReadCount; i++) { - currentReadPromise ||= reader.read(); - const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => { - console.error(e); - done = true; - }); - if (!chunk) { - if (i === 1) { - await new Promise((resolve) => setTimeout(resolve)); - maxReadCount = 3; - continue; - } - break; - } - currentReadPromise = void 0; - if (chunk.value) { - values.push(chunk.value); - } - if (chunk.done) { - done = true; - break; - } - } - if (done && !("content-length" in resHeaderRecord)) { - resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0); - } - } - outgoing.writeHead(res.status, resHeaderRecord); - values.forEach((value) => { - ; - outgoing.write(value); - }); - if (done) { - outgoing.end(); - } else { - if (values.length === 0) { - flushHeaders(outgoing); - } - await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise); - } - } else if (resHeaderRecord[X_ALREADY_SENT]) { - } else { - outgoing.writeHead(res.status, resHeaderRecord); - outgoing.end(); - } - ; - outgoing[outgoingEnded]?.(); -}; -var getRequestListener = (fetchCallback, options = {}) => { - const autoCleanupIncoming = options.autoCleanupIncoming ?? true; - if (options.overrideGlobalObjects !== false && global.Request !== Request) { - Object.defineProperty(global, "Request", { - value: Request - }); - Object.defineProperty(global, "Response", { - value: Response2 - }); - } - return async (incoming, outgoing) => { - let res, req; - try { - req = newRequest(incoming, options.hostname); - let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD"; - if (!incomingEnded) { - ; - incoming[wrapBodyStream] = true; - incoming.on("end", () => { - incomingEnded = true; - }); - if (incoming instanceof import_node_http22.Http2ServerRequest) { - ; - outgoing[outgoingEnded] = () => { - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - outgoing.destroy(); - }); - } - }); - } - }; - } - } - outgoing.on("close", () => { - const abortController = req[abortControllerKey]; - if (abortController) { - if (incoming.errored) { - req[abortControllerKey].abort(incoming.errored.toString()); - } else if (!outgoing.writableFinished) { - req[abortControllerKey].abort("Client connection prematurely closed."); - } - } - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - }); - } - }); - } - }); - res = fetchCallback(req, { incoming, outgoing }); - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - } catch (e) { - if (!res) { - if (options.errorHandler) { - res = await options.errorHandler(req ? e : toRequestError(e)); - if (!res) { - return; - } - } else if (!req) { - res = handleRequestError(); - } else { - res = handleFetchError(e); - } - } else { - return handleResponseError(e, outgoing); - } - } - try { - return await responseViaResponseObject(res, outgoing, options); - } catch (e) { - return handleResponseError(e, outgoing); - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - getRequestListener -}); diff --git a/node_modules/@hono/node-server/dist/listener.mjs b/node_modules/@hono/node-server/dist/listener.mjs deleted file mode 100644 index d6942d6..0000000 --- a/node_modules/@hono/node-server/dist/listener.mjs +++ /dev/null @@ -1,546 +0,0 @@ -// src/listener.ts -import { Http2ServerRequest as Http2ServerRequest2 } from "http2"; - -// src/request.ts -import { Http2ServerRequest } from "http2"; -import { Readable } from "stream"; -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; - -// src/response.ts -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response2 = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response2, GlobalResponse); -Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype); - -// src/utils.ts -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; - -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/globals.ts -import crypto from "crypto"; -if (typeof global.crypto === "undefined") { - global.crypto = crypto; -} - -// src/listener.ts -var outgoingEnded = Symbol("outgoingEnded"); -var handleRequestError = () => new Response(null, { - status: 400 -}); -var handleFetchError = (e) => new Response(null, { - status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500 -}); -var handleResponseError = (e, outgoing) => { - const err = e instanceof Error ? e : new Error("unknown error", { cause: e }); - if (err.code === "ERR_STREAM_PREMATURE_CLOSE") { - console.info("The user aborted a request."); - } else { - console.error(e); - if (!outgoing.headersSent) { - outgoing.writeHead(500, { "Content-Type": "text/plain" }); - } - outgoing.end(`Error: ${err.message}`); - outgoing.destroy(err); - } -}; -var flushHeaders = (outgoing) => { - if ("flushHeaders" in outgoing && outgoing.writable) { - outgoing.flushHeaders(); - } -}; -var responseViaCache = async (res, outgoing) => { - let [status, body, header] = res[cacheKey]; - if (header instanceof Headers) { - header = buildOutgoingHttpHeaders(header); - } - if (typeof body === "string") { - header["Content-Length"] = Buffer.byteLength(body); - } else if (body instanceof Uint8Array) { - header["Content-Length"] = body.byteLength; - } else if (body instanceof Blob) { - header["Content-Length"] = body.size; - } - outgoing.writeHead(status, header); - if (typeof body === "string" || body instanceof Uint8Array) { - outgoing.end(body); - } else if (body instanceof Blob) { - outgoing.end(new Uint8Array(await body.arrayBuffer())); - } else { - flushHeaders(outgoing); - await writeFromReadableStream(body, outgoing)?.catch( - (e) => handleResponseError(e, outgoing) - ); - } - ; - outgoing[outgoingEnded]?.(); -}; -var isPromise = (res) => typeof res.then === "function"; -var responseViaResponseObject = async (res, outgoing, options = {}) => { - if (isPromise(res)) { - if (options.errorHandler) { - try { - res = await res; - } catch (err) { - const errRes = await options.errorHandler(err); - if (!errRes) { - return; - } - res = errRes; - } - } else { - res = await res.catch(handleFetchError); - } - } - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - const resHeaderRecord = buildOutgoingHttpHeaders(res.headers); - if (res.body) { - const reader = res.body.getReader(); - const values = []; - let done = false; - let currentReadPromise = void 0; - if (resHeaderRecord["transfer-encoding"] !== "chunked") { - let maxReadCount = 2; - for (let i = 0; i < maxReadCount; i++) { - currentReadPromise ||= reader.read(); - const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => { - console.error(e); - done = true; - }); - if (!chunk) { - if (i === 1) { - await new Promise((resolve) => setTimeout(resolve)); - maxReadCount = 3; - continue; - } - break; - } - currentReadPromise = void 0; - if (chunk.value) { - values.push(chunk.value); - } - if (chunk.done) { - done = true; - break; - } - } - if (done && !("content-length" in resHeaderRecord)) { - resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0); - } - } - outgoing.writeHead(res.status, resHeaderRecord); - values.forEach((value) => { - ; - outgoing.write(value); - }); - if (done) { - outgoing.end(); - } else { - if (values.length === 0) { - flushHeaders(outgoing); - } - await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise); - } - } else if (resHeaderRecord[X_ALREADY_SENT]) { - } else { - outgoing.writeHead(res.status, resHeaderRecord); - outgoing.end(); - } - ; - outgoing[outgoingEnded]?.(); -}; -var getRequestListener = (fetchCallback, options = {}) => { - const autoCleanupIncoming = options.autoCleanupIncoming ?? true; - if (options.overrideGlobalObjects !== false && global.Request !== Request) { - Object.defineProperty(global, "Request", { - value: Request - }); - Object.defineProperty(global, "Response", { - value: Response2 - }); - } - return async (incoming, outgoing) => { - let res, req; - try { - req = newRequest(incoming, options.hostname); - let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD"; - if (!incomingEnded) { - ; - incoming[wrapBodyStream] = true; - incoming.on("end", () => { - incomingEnded = true; - }); - if (incoming instanceof Http2ServerRequest2) { - ; - outgoing[outgoingEnded] = () => { - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - outgoing.destroy(); - }); - } - }); - } - }; - } - } - outgoing.on("close", () => { - const abortController = req[abortControllerKey]; - if (abortController) { - if (incoming.errored) { - req[abortControllerKey].abort(incoming.errored.toString()); - } else if (!outgoing.writableFinished) { - req[abortControllerKey].abort("Client connection prematurely closed."); - } - } - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - }); - } - }); - } - }); - res = fetchCallback(req, { incoming, outgoing }); - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - } catch (e) { - if (!res) { - if (options.errorHandler) { - res = await options.errorHandler(req ? e : toRequestError(e)); - if (!res) { - return; - } - } else if (!req) { - res = handleRequestError(); - } else { - res = handleFetchError(e); - } - } else { - return handleResponseError(e, outgoing); - } - } - try { - return await responseViaResponseObject(res, outgoing, options); - } catch (e) { - return handleResponseError(e, outgoing); - } - }; -}; -export { - getRequestListener -}; diff --git a/node_modules/@hono/node-server/dist/request.d.mts b/node_modules/@hono/node-server/dist/request.d.mts deleted file mode 100644 index 92727aa..0000000 --- a/node_modules/@hono/node-server/dist/request.d.mts +++ /dev/null @@ -1,25 +0,0 @@ -import { IncomingMessage } from 'node:http'; -import { Http2ServerRequest } from 'node:http2'; - -declare class RequestError extends Error { - constructor(message: string, options?: { - cause?: unknown; - }); -} -declare const toRequestError: (e: unknown) => RequestError; -declare const GlobalRequest: { - new (input: RequestInfo | URL, init?: RequestInit): globalThis.Request; - prototype: globalThis.Request; -}; -declare class Request extends GlobalRequest { - constructor(input: string | Request, options?: RequestInit); -} -type IncomingMessageWithWrapBodyStream = IncomingMessage & { - [wrapBodyStream]: boolean; -}; -declare const wrapBodyStream: unique symbol; -declare const abortControllerKey: unique symbol; -declare const getAbortController: unique symbol; -declare const newRequest: (incoming: IncomingMessage | Http2ServerRequest, defaultHostname?: string) => any; - -export { GlobalRequest, IncomingMessageWithWrapBodyStream, Request, RequestError, abortControllerKey, getAbortController, newRequest, toRequestError, wrapBodyStream }; diff --git a/node_modules/@hono/node-server/dist/request.d.ts b/node_modules/@hono/node-server/dist/request.d.ts deleted file mode 100644 index 92727aa..0000000 --- a/node_modules/@hono/node-server/dist/request.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IncomingMessage } from 'node:http'; -import { Http2ServerRequest } from 'node:http2'; - -declare class RequestError extends Error { - constructor(message: string, options?: { - cause?: unknown; - }); -} -declare const toRequestError: (e: unknown) => RequestError; -declare const GlobalRequest: { - new (input: RequestInfo | URL, init?: RequestInit): globalThis.Request; - prototype: globalThis.Request; -}; -declare class Request extends GlobalRequest { - constructor(input: string | Request, options?: RequestInit); -} -type IncomingMessageWithWrapBodyStream = IncomingMessage & { - [wrapBodyStream]: boolean; -}; -declare const wrapBodyStream: unique symbol; -declare const abortControllerKey: unique symbol; -declare const getAbortController: unique symbol; -declare const newRequest: (incoming: IncomingMessage | Http2ServerRequest, defaultHostname?: string) => any; - -export { GlobalRequest, IncomingMessageWithWrapBodyStream, Request, RequestError, abortControllerKey, getAbortController, newRequest, toRequestError, wrapBodyStream }; diff --git a/node_modules/@hono/node-server/dist/request.js b/node_modules/@hono/node-server/dist/request.js deleted file mode 100644 index a0a3ad2..0000000 --- a/node_modules/@hono/node-server/dist/request.js +++ /dev/null @@ -1,227 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/request.ts -var request_exports = {}; -__export(request_exports, { - GlobalRequest: () => GlobalRequest, - Request: () => Request, - RequestError: () => RequestError, - abortControllerKey: () => abortControllerKey, - getAbortController: () => getAbortController, - newRequest: () => newRequest, - toRequestError: () => toRequestError, - wrapBodyStream: () => wrapBodyStream -}); -module.exports = __toCommonJS(request_exports); -var import_node_http2 = require("http2"); -var import_node_stream = require("stream"); -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= import_node_stream.Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = import_node_stream.Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof import_node_http2.Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof import_node_http2.Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - GlobalRequest, - Request, - RequestError, - abortControllerKey, - getAbortController, - newRequest, - toRequestError, - wrapBodyStream -}); diff --git a/node_modules/@hono/node-server/dist/request.mjs b/node_modules/@hono/node-server/dist/request.mjs deleted file mode 100644 index 1e5cb64..0000000 --- a/node_modules/@hono/node-server/dist/request.mjs +++ /dev/null @@ -1,195 +0,0 @@ -// src/request.ts -import { Http2ServerRequest } from "http2"; -import { Readable } from "stream"; -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; -export { - GlobalRequest, - Request, - RequestError, - abortControllerKey, - getAbortController, - newRequest, - toRequestError, - wrapBodyStream -}; diff --git a/node_modules/@hono/node-server/dist/response.d.mts b/node_modules/@hono/node-server/dist/response.d.mts deleted file mode 100644 index d61ca0e..0000000 --- a/node_modules/@hono/node-server/dist/response.d.mts +++ /dev/null @@ -1,26 +0,0 @@ -import { OutgoingHttpHeaders } from 'node:http'; - -declare const getResponseCache: unique symbol; -declare const cacheKey: unique symbol; -type InternalCache = [ - number, - string | ReadableStream, - Record | Headers | OutgoingHttpHeaders -]; -declare const GlobalResponse: { - new (body?: BodyInit | null, init?: ResponseInit): globalThis.Response; - prototype: globalThis.Response; - error(): globalThis.Response; - json(data: any, init?: ResponseInit): globalThis.Response; - redirect(url: string | URL, status?: number): globalThis.Response; -}; -declare class Response { - #private; - [getResponseCache](): globalThis.Response; - constructor(body?: BodyInit | null, init?: ResponseInit); - get headers(): Headers; - get status(): number; - get ok(): boolean; -} - -export { GlobalResponse, InternalCache, Response, cacheKey }; diff --git a/node_modules/@hono/node-server/dist/response.d.ts b/node_modules/@hono/node-server/dist/response.d.ts deleted file mode 100644 index d61ca0e..0000000 --- a/node_modules/@hono/node-server/dist/response.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { OutgoingHttpHeaders } from 'node:http'; - -declare const getResponseCache: unique symbol; -declare const cacheKey: unique symbol; -type InternalCache = [ - number, - string | ReadableStream, - Record | Headers | OutgoingHttpHeaders -]; -declare const GlobalResponse: { - new (body?: BodyInit | null, init?: ResponseInit): globalThis.Response; - prototype: globalThis.Response; - error(): globalThis.Response; - json(data: any, init?: ResponseInit): globalThis.Response; - redirect(url: string | URL, status?: number): globalThis.Response; -}; -declare class Response { - #private; - [getResponseCache](): globalThis.Response; - constructor(body?: BodyInit | null, init?: ResponseInit); - get headers(): Headers; - get status(): number; - get ok(): boolean; -} - -export { GlobalResponse, InternalCache, Response, cacheKey }; diff --git a/node_modules/@hono/node-server/dist/response.js b/node_modules/@hono/node-server/dist/response.js deleted file mode 100644 index 1a85329..0000000 --- a/node_modules/@hono/node-server/dist/response.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/response.ts -var response_exports = {}; -__export(response_exports, { - GlobalResponse: () => GlobalResponse, - Response: () => Response, - cacheKey: () => cacheKey -}); -module.exports = __toCommonJS(response_exports); -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response, GlobalResponse); -Object.setPrototypeOf(Response.prototype, GlobalResponse.prototype); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - GlobalResponse, - Response, - cacheKey -}); diff --git a/node_modules/@hono/node-server/dist/response.mjs b/node_modules/@hono/node-server/dist/response.mjs deleted file mode 100644 index 547e4ad..0000000 --- a/node_modules/@hono/node-server/dist/response.mjs +++ /dev/null @@ -1,72 +0,0 @@ -// src/response.ts -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response, GlobalResponse); -Object.setPrototypeOf(Response.prototype, GlobalResponse.prototype); -export { - GlobalResponse, - Response, - cacheKey -}; diff --git a/node_modules/@hono/node-server/dist/serve-static.d.mts b/node_modules/@hono/node-server/dist/serve-static.d.mts deleted file mode 100644 index d10584b..0000000 --- a/node_modules/@hono/node-server/dist/serve-static.d.mts +++ /dev/null @@ -1,17 +0,0 @@ -import { Env, Context, MiddlewareHandler } from 'hono'; - -type ServeStaticOptions = { - /** - * Root path, relative to current working directory from which the app was started. Absolute paths are not supported. - */ - root?: string; - path?: string; - index?: string; - precompressed?: boolean; - rewriteRequestPath?: (path: string, c: Context) => string; - onFound?: (path: string, c: Context) => void | Promise; - onNotFound?: (path: string, c: Context) => void | Promise; -}; -declare const serveStatic: (options?: ServeStaticOptions) => MiddlewareHandler; - -export { ServeStaticOptions, serveStatic }; diff --git a/node_modules/@hono/node-server/dist/serve-static.d.ts b/node_modules/@hono/node-server/dist/serve-static.d.ts deleted file mode 100644 index d10584b..0000000 --- a/node_modules/@hono/node-server/dist/serve-static.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Env, Context, MiddlewareHandler } from 'hono'; - -type ServeStaticOptions = { - /** - * Root path, relative to current working directory from which the app was started. Absolute paths are not supported. - */ - root?: string; - path?: string; - index?: string; - precompressed?: boolean; - rewriteRequestPath?: (path: string, c: Context) => string; - onFound?: (path: string, c: Context) => void | Promise; - onNotFound?: (path: string, c: Context) => void | Promise; -}; -declare const serveStatic: (options?: ServeStaticOptions) => MiddlewareHandler; - -export { ServeStaticOptions, serveStatic }; diff --git a/node_modules/@hono/node-server/dist/serve-static.js b/node_modules/@hono/node-server/dist/serve-static.js deleted file mode 100644 index 956482d..0000000 --- a/node_modules/@hono/node-server/dist/serve-static.js +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/serve-static.ts -var serve_static_exports = {}; -__export(serve_static_exports, { - serveStatic: () => serveStatic -}); -module.exports = __toCommonJS(serve_static_exports); -var import_mime = require("hono/utils/mime"); -var import_node_fs = require("fs"); -var import_node_path = require("path"); -var import_node_process = require("process"); -var import_node_stream = require("stream"); -var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i; -var ENCODINGS = { - br: ".br", - zstd: ".zst", - gzip: ".gz" -}; -var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS); -var pr54206Applied = () => { - const [major, minor] = import_node_process.versions.node.split(".").map((component) => parseInt(component)); - return major >= 23 || major === 22 && minor >= 7 || major === 20 && minor >= 18; -}; -var useReadableToWeb = pr54206Applied(); -var createStreamBody = (stream) => { - if (useReadableToWeb) { - return import_node_stream.Readable.toWeb(stream); - } - const body = new ReadableStream({ - start(controller) { - stream.on("data", (chunk) => { - controller.enqueue(chunk); - }); - stream.on("error", (err) => { - controller.error(err); - }); - stream.on("end", () => { - controller.close(); - }); - }, - cancel() { - stream.destroy(); - } - }); - return body; -}; -var getStats = (path) => { - let stats; - try { - stats = (0, import_node_fs.statSync)(path); - } catch { - } - return stats; -}; -var serveStatic = (options = { root: "" }) => { - const root = options.root || ""; - const optionPath = options.path; - if (root !== "" && !(0, import_node_fs.existsSync)(root)) { - console.error(`serveStatic: root path '${root}' is not found, are you sure it's correct?`); - } - return async (c, next) => { - if (c.finalized) { - return next(); - } - let filename; - if (optionPath) { - filename = optionPath; - } else { - try { - filename = decodeURIComponent(c.req.path); - if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) { - throw new Error(); - } - } catch { - await options.onNotFound?.(c.req.path, c); - return next(); - } - } - let path = (0, import_node_path.join)( - root, - !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename, c) : filename - ); - let stats = getStats(path); - if (stats && stats.isDirectory()) { - const indexFile = options.index ?? "index.html"; - path = (0, import_node_path.join)(path, indexFile); - stats = getStats(path); - } - if (!stats) { - await options.onNotFound?.(path, c); - return next(); - } - const mimeType = (0, import_mime.getMimeType)(path); - c.header("Content-Type", mimeType || "application/octet-stream"); - if (options.precompressed && (!mimeType || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) { - const acceptEncodingSet = new Set( - c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()) - ); - for (const encoding of ENCODINGS_ORDERED_KEYS) { - if (!acceptEncodingSet.has(encoding)) { - continue; - } - const precompressedStats = getStats(path + ENCODINGS[encoding]); - if (precompressedStats) { - c.header("Content-Encoding", encoding); - c.header("Vary", "Accept-Encoding", { append: true }); - stats = precompressedStats; - path = path + ENCODINGS[encoding]; - break; - } - } - } - let result; - const size = stats.size; - const range = c.req.header("range") || ""; - if (c.req.method == "HEAD" || c.req.method == "OPTIONS") { - c.header("Content-Length", size.toString()); - c.status(200); - result = c.body(null); - } else if (!range) { - c.header("Content-Length", size.toString()); - result = c.body(createStreamBody((0, import_node_fs.createReadStream)(path)), 200); - } else { - c.header("Accept-Ranges", "bytes"); - c.header("Date", stats.birthtime.toUTCString()); - const parts = range.replace(/bytes=/, "").split("-", 2); - const start = parseInt(parts[0], 10) || 0; - let end = parseInt(parts[1], 10) || size - 1; - if (size < end - start + 1) { - end = size - 1; - } - const chunksize = end - start + 1; - const stream = (0, import_node_fs.createReadStream)(path, { start, end }); - c.header("Content-Length", chunksize.toString()); - c.header("Content-Range", `bytes ${start}-${end}/${stats.size}`); - result = c.body(createStreamBody(stream), 206); - } - await options.onFound?.(path, c); - return result; - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - serveStatic -}); diff --git a/node_modules/@hono/node-server/dist/serve-static.mjs b/node_modules/@hono/node-server/dist/serve-static.mjs deleted file mode 100644 index 64ecf2c..0000000 --- a/node_modules/@hono/node-server/dist/serve-static.mjs +++ /dev/null @@ -1,138 +0,0 @@ -// src/serve-static.ts -import { getMimeType } from "hono/utils/mime"; -import { createReadStream, statSync, existsSync } from "fs"; -import { join } from "path"; -import { versions } from "process"; -import { Readable } from "stream"; -var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i; -var ENCODINGS = { - br: ".br", - zstd: ".zst", - gzip: ".gz" -}; -var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS); -var pr54206Applied = () => { - const [major, minor] = versions.node.split(".").map((component) => parseInt(component)); - return major >= 23 || major === 22 && minor >= 7 || major === 20 && minor >= 18; -}; -var useReadableToWeb = pr54206Applied(); -var createStreamBody = (stream) => { - if (useReadableToWeb) { - return Readable.toWeb(stream); - } - const body = new ReadableStream({ - start(controller) { - stream.on("data", (chunk) => { - controller.enqueue(chunk); - }); - stream.on("error", (err) => { - controller.error(err); - }); - stream.on("end", () => { - controller.close(); - }); - }, - cancel() { - stream.destroy(); - } - }); - return body; -}; -var getStats = (path) => { - let stats; - try { - stats = statSync(path); - } catch { - } - return stats; -}; -var serveStatic = (options = { root: "" }) => { - const root = options.root || ""; - const optionPath = options.path; - if (root !== "" && !existsSync(root)) { - console.error(`serveStatic: root path '${root}' is not found, are you sure it's correct?`); - } - return async (c, next) => { - if (c.finalized) { - return next(); - } - let filename; - if (optionPath) { - filename = optionPath; - } else { - try { - filename = decodeURIComponent(c.req.path); - if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) { - throw new Error(); - } - } catch { - await options.onNotFound?.(c.req.path, c); - return next(); - } - } - let path = join( - root, - !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename, c) : filename - ); - let stats = getStats(path); - if (stats && stats.isDirectory()) { - const indexFile = options.index ?? "index.html"; - path = join(path, indexFile); - stats = getStats(path); - } - if (!stats) { - await options.onNotFound?.(path, c); - return next(); - } - const mimeType = getMimeType(path); - c.header("Content-Type", mimeType || "application/octet-stream"); - if (options.precompressed && (!mimeType || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) { - const acceptEncodingSet = new Set( - c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()) - ); - for (const encoding of ENCODINGS_ORDERED_KEYS) { - if (!acceptEncodingSet.has(encoding)) { - continue; - } - const precompressedStats = getStats(path + ENCODINGS[encoding]); - if (precompressedStats) { - c.header("Content-Encoding", encoding); - c.header("Vary", "Accept-Encoding", { append: true }); - stats = precompressedStats; - path = path + ENCODINGS[encoding]; - break; - } - } - } - let result; - const size = stats.size; - const range = c.req.header("range") || ""; - if (c.req.method == "HEAD" || c.req.method == "OPTIONS") { - c.header("Content-Length", size.toString()); - c.status(200); - result = c.body(null); - } else if (!range) { - c.header("Content-Length", size.toString()); - result = c.body(createStreamBody(createReadStream(path)), 200); - } else { - c.header("Accept-Ranges", "bytes"); - c.header("Date", stats.birthtime.toUTCString()); - const parts = range.replace(/bytes=/, "").split("-", 2); - const start = parseInt(parts[0], 10) || 0; - let end = parseInt(parts[1], 10) || size - 1; - if (size < end - start + 1) { - end = size - 1; - } - const chunksize = end - start + 1; - const stream = createReadStream(path, { start, end }); - c.header("Content-Length", chunksize.toString()); - c.header("Content-Range", `bytes ${start}-${end}/${stats.size}`); - result = c.body(createStreamBody(stream), 206); - } - await options.onFound?.(path, c); - return result; - }; -}; -export { - serveStatic -}; diff --git a/node_modules/@hono/node-server/dist/server.d.mts b/node_modules/@hono/node-server/dist/server.d.mts deleted file mode 100644 index a8e9543..0000000 --- a/node_modules/@hono/node-server/dist/server.d.mts +++ /dev/null @@ -1,10 +0,0 @@ -import { AddressInfo } from 'node:net'; -import { Options, ServerType } from './types.mjs'; -import 'node:http'; -import 'node:http2'; -import 'node:https'; - -declare const createAdaptorServer: (options: Options) => ServerType; -declare const serve: (options: Options, listeningListener?: (info: AddressInfo) => void) => ServerType; - -export { createAdaptorServer, serve }; diff --git a/node_modules/@hono/node-server/dist/server.d.ts b/node_modules/@hono/node-server/dist/server.d.ts deleted file mode 100644 index b639283..0000000 --- a/node_modules/@hono/node-server/dist/server.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AddressInfo } from 'node:net'; -import { Options, ServerType } from './types.js'; -import 'node:http'; -import 'node:http2'; -import 'node:https'; - -declare const createAdaptorServer: (options: Options) => ServerType; -declare const serve: (options: Options, listeningListener?: (info: AddressInfo) => void) => ServerType; - -export { createAdaptorServer, serve }; diff --git a/node_modules/@hono/node-server/dist/server.js b/node_modules/@hono/node-server/dist/server.js deleted file mode 100644 index bec6481..0000000 --- a/node_modules/@hono/node-server/dist/server.js +++ /dev/null @@ -1,607 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/server.ts -var server_exports = {}; -__export(server_exports, { - createAdaptorServer: () => createAdaptorServer, - serve: () => serve -}); -module.exports = __toCommonJS(server_exports); -var import_node_http = require("http"); - -// src/listener.ts -var import_node_http22 = require("http2"); - -// src/request.ts -var import_node_http2 = require("http2"); -var import_node_stream = require("stream"); -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= import_node_stream.Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = import_node_stream.Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof import_node_http2.Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof import_node_http2.Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; - -// src/response.ts -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response2 = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response2, GlobalResponse); -Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype); - -// src/utils.ts -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; - -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/globals.ts -var import_node_crypto = __toESM(require("crypto")); -if (typeof global.crypto === "undefined") { - global.crypto = import_node_crypto.default; -} - -// src/listener.ts -var outgoingEnded = Symbol("outgoingEnded"); -var handleRequestError = () => new Response(null, { - status: 400 -}); -var handleFetchError = (e) => new Response(null, { - status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500 -}); -var handleResponseError = (e, outgoing) => { - const err = e instanceof Error ? e : new Error("unknown error", { cause: e }); - if (err.code === "ERR_STREAM_PREMATURE_CLOSE") { - console.info("The user aborted a request."); - } else { - console.error(e); - if (!outgoing.headersSent) { - outgoing.writeHead(500, { "Content-Type": "text/plain" }); - } - outgoing.end(`Error: ${err.message}`); - outgoing.destroy(err); - } -}; -var flushHeaders = (outgoing) => { - if ("flushHeaders" in outgoing && outgoing.writable) { - outgoing.flushHeaders(); - } -}; -var responseViaCache = async (res, outgoing) => { - let [status, body, header] = res[cacheKey]; - if (header instanceof Headers) { - header = buildOutgoingHttpHeaders(header); - } - if (typeof body === "string") { - header["Content-Length"] = Buffer.byteLength(body); - } else if (body instanceof Uint8Array) { - header["Content-Length"] = body.byteLength; - } else if (body instanceof Blob) { - header["Content-Length"] = body.size; - } - outgoing.writeHead(status, header); - if (typeof body === "string" || body instanceof Uint8Array) { - outgoing.end(body); - } else if (body instanceof Blob) { - outgoing.end(new Uint8Array(await body.arrayBuffer())); - } else { - flushHeaders(outgoing); - await writeFromReadableStream(body, outgoing)?.catch( - (e) => handleResponseError(e, outgoing) - ); - } - ; - outgoing[outgoingEnded]?.(); -}; -var isPromise = (res) => typeof res.then === "function"; -var responseViaResponseObject = async (res, outgoing, options = {}) => { - if (isPromise(res)) { - if (options.errorHandler) { - try { - res = await res; - } catch (err) { - const errRes = await options.errorHandler(err); - if (!errRes) { - return; - } - res = errRes; - } - } else { - res = await res.catch(handleFetchError); - } - } - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - const resHeaderRecord = buildOutgoingHttpHeaders(res.headers); - if (res.body) { - const reader = res.body.getReader(); - const values = []; - let done = false; - let currentReadPromise = void 0; - if (resHeaderRecord["transfer-encoding"] !== "chunked") { - let maxReadCount = 2; - for (let i = 0; i < maxReadCount; i++) { - currentReadPromise ||= reader.read(); - const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => { - console.error(e); - done = true; - }); - if (!chunk) { - if (i === 1) { - await new Promise((resolve) => setTimeout(resolve)); - maxReadCount = 3; - continue; - } - break; - } - currentReadPromise = void 0; - if (chunk.value) { - values.push(chunk.value); - } - if (chunk.done) { - done = true; - break; - } - } - if (done && !("content-length" in resHeaderRecord)) { - resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0); - } - } - outgoing.writeHead(res.status, resHeaderRecord); - values.forEach((value) => { - ; - outgoing.write(value); - }); - if (done) { - outgoing.end(); - } else { - if (values.length === 0) { - flushHeaders(outgoing); - } - await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise); - } - } else if (resHeaderRecord[X_ALREADY_SENT]) { - } else { - outgoing.writeHead(res.status, resHeaderRecord); - outgoing.end(); - } - ; - outgoing[outgoingEnded]?.(); -}; -var getRequestListener = (fetchCallback, options = {}) => { - const autoCleanupIncoming = options.autoCleanupIncoming ?? true; - if (options.overrideGlobalObjects !== false && global.Request !== Request) { - Object.defineProperty(global, "Request", { - value: Request - }); - Object.defineProperty(global, "Response", { - value: Response2 - }); - } - return async (incoming, outgoing) => { - let res, req; - try { - req = newRequest(incoming, options.hostname); - let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD"; - if (!incomingEnded) { - ; - incoming[wrapBodyStream] = true; - incoming.on("end", () => { - incomingEnded = true; - }); - if (incoming instanceof import_node_http22.Http2ServerRequest) { - ; - outgoing[outgoingEnded] = () => { - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - outgoing.destroy(); - }); - } - }); - } - }; - } - } - outgoing.on("close", () => { - const abortController = req[abortControllerKey]; - if (abortController) { - if (incoming.errored) { - req[abortControllerKey].abort(incoming.errored.toString()); - } else if (!outgoing.writableFinished) { - req[abortControllerKey].abort("Client connection prematurely closed."); - } - } - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - }); - } - }); - } - }); - res = fetchCallback(req, { incoming, outgoing }); - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - } catch (e) { - if (!res) { - if (options.errorHandler) { - res = await options.errorHandler(req ? e : toRequestError(e)); - if (!res) { - return; - } - } else if (!req) { - res = handleRequestError(); - } else { - res = handleFetchError(e); - } - } else { - return handleResponseError(e, outgoing); - } - } - try { - return await responseViaResponseObject(res, outgoing, options); - } catch (e) { - return handleResponseError(e, outgoing); - } - }; -}; - -// src/server.ts -var createAdaptorServer = (options) => { - const fetchCallback = options.fetch; - const requestListener = getRequestListener(fetchCallback, { - hostname: options.hostname, - overrideGlobalObjects: options.overrideGlobalObjects, - autoCleanupIncoming: options.autoCleanupIncoming - }); - const createServer = options.createServer || import_node_http.createServer; - const server = createServer(options.serverOptions || {}, requestListener); - return server; -}; -var serve = (options, listeningListener) => { - const server = createAdaptorServer(options); - server.listen(options?.port ?? 3e3, options.hostname, () => { - const serverInfo = server.address(); - listeningListener && listeningListener(serverInfo); - }); - return server; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createAdaptorServer, - serve -}); diff --git a/node_modules/@hono/node-server/dist/server.mjs b/node_modules/@hono/node-server/dist/server.mjs deleted file mode 100644 index c241378..0000000 --- a/node_modules/@hono/node-server/dist/server.mjs +++ /dev/null @@ -1,571 +0,0 @@ -// src/server.ts -import { createServer as createServerHTTP } from "http"; - -// src/listener.ts -import { Http2ServerRequest as Http2ServerRequest2 } from "http2"; - -// src/request.ts -import { Http2ServerRequest } from "http2"; -import { Readable } from "stream"; -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; - -// src/response.ts -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response2 = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response2, GlobalResponse); -Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype); - -// src/utils.ts -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; - -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/globals.ts -import crypto from "crypto"; -if (typeof global.crypto === "undefined") { - global.crypto = crypto; -} - -// src/listener.ts -var outgoingEnded = Symbol("outgoingEnded"); -var handleRequestError = () => new Response(null, { - status: 400 -}); -var handleFetchError = (e) => new Response(null, { - status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500 -}); -var handleResponseError = (e, outgoing) => { - const err = e instanceof Error ? e : new Error("unknown error", { cause: e }); - if (err.code === "ERR_STREAM_PREMATURE_CLOSE") { - console.info("The user aborted a request."); - } else { - console.error(e); - if (!outgoing.headersSent) { - outgoing.writeHead(500, { "Content-Type": "text/plain" }); - } - outgoing.end(`Error: ${err.message}`); - outgoing.destroy(err); - } -}; -var flushHeaders = (outgoing) => { - if ("flushHeaders" in outgoing && outgoing.writable) { - outgoing.flushHeaders(); - } -}; -var responseViaCache = async (res, outgoing) => { - let [status, body, header] = res[cacheKey]; - if (header instanceof Headers) { - header = buildOutgoingHttpHeaders(header); - } - if (typeof body === "string") { - header["Content-Length"] = Buffer.byteLength(body); - } else if (body instanceof Uint8Array) { - header["Content-Length"] = body.byteLength; - } else if (body instanceof Blob) { - header["Content-Length"] = body.size; - } - outgoing.writeHead(status, header); - if (typeof body === "string" || body instanceof Uint8Array) { - outgoing.end(body); - } else if (body instanceof Blob) { - outgoing.end(new Uint8Array(await body.arrayBuffer())); - } else { - flushHeaders(outgoing); - await writeFromReadableStream(body, outgoing)?.catch( - (e) => handleResponseError(e, outgoing) - ); - } - ; - outgoing[outgoingEnded]?.(); -}; -var isPromise = (res) => typeof res.then === "function"; -var responseViaResponseObject = async (res, outgoing, options = {}) => { - if (isPromise(res)) { - if (options.errorHandler) { - try { - res = await res; - } catch (err) { - const errRes = await options.errorHandler(err); - if (!errRes) { - return; - } - res = errRes; - } - } else { - res = await res.catch(handleFetchError); - } - } - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - const resHeaderRecord = buildOutgoingHttpHeaders(res.headers); - if (res.body) { - const reader = res.body.getReader(); - const values = []; - let done = false; - let currentReadPromise = void 0; - if (resHeaderRecord["transfer-encoding"] !== "chunked") { - let maxReadCount = 2; - for (let i = 0; i < maxReadCount; i++) { - currentReadPromise ||= reader.read(); - const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => { - console.error(e); - done = true; - }); - if (!chunk) { - if (i === 1) { - await new Promise((resolve) => setTimeout(resolve)); - maxReadCount = 3; - continue; - } - break; - } - currentReadPromise = void 0; - if (chunk.value) { - values.push(chunk.value); - } - if (chunk.done) { - done = true; - break; - } - } - if (done && !("content-length" in resHeaderRecord)) { - resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0); - } - } - outgoing.writeHead(res.status, resHeaderRecord); - values.forEach((value) => { - ; - outgoing.write(value); - }); - if (done) { - outgoing.end(); - } else { - if (values.length === 0) { - flushHeaders(outgoing); - } - await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise); - } - } else if (resHeaderRecord[X_ALREADY_SENT]) { - } else { - outgoing.writeHead(res.status, resHeaderRecord); - outgoing.end(); - } - ; - outgoing[outgoingEnded]?.(); -}; -var getRequestListener = (fetchCallback, options = {}) => { - const autoCleanupIncoming = options.autoCleanupIncoming ?? true; - if (options.overrideGlobalObjects !== false && global.Request !== Request) { - Object.defineProperty(global, "Request", { - value: Request - }); - Object.defineProperty(global, "Response", { - value: Response2 - }); - } - return async (incoming, outgoing) => { - let res, req; - try { - req = newRequest(incoming, options.hostname); - let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD"; - if (!incomingEnded) { - ; - incoming[wrapBodyStream] = true; - incoming.on("end", () => { - incomingEnded = true; - }); - if (incoming instanceof Http2ServerRequest2) { - ; - outgoing[outgoingEnded] = () => { - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - outgoing.destroy(); - }); - } - }); - } - }; - } - } - outgoing.on("close", () => { - const abortController = req[abortControllerKey]; - if (abortController) { - if (incoming.errored) { - req[abortControllerKey].abort(incoming.errored.toString()); - } else if (!outgoing.writableFinished) { - req[abortControllerKey].abort("Client connection prematurely closed."); - } - } - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - }); - } - }); - } - }); - res = fetchCallback(req, { incoming, outgoing }); - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - } catch (e) { - if (!res) { - if (options.errorHandler) { - res = await options.errorHandler(req ? e : toRequestError(e)); - if (!res) { - return; - } - } else if (!req) { - res = handleRequestError(); - } else { - res = handleFetchError(e); - } - } else { - return handleResponseError(e, outgoing); - } - } - try { - return await responseViaResponseObject(res, outgoing, options); - } catch (e) { - return handleResponseError(e, outgoing); - } - }; -}; - -// src/server.ts -var createAdaptorServer = (options) => { - const fetchCallback = options.fetch; - const requestListener = getRequestListener(fetchCallback, { - hostname: options.hostname, - overrideGlobalObjects: options.overrideGlobalObjects, - autoCleanupIncoming: options.autoCleanupIncoming - }); - const createServer = options.createServer || createServerHTTP; - const server = createServer(options.serverOptions || {}, requestListener); - return server; -}; -var serve = (options, listeningListener) => { - const server = createAdaptorServer(options); - server.listen(options?.port ?? 3e3, options.hostname, () => { - const serverInfo = server.address(); - listeningListener && listeningListener(serverInfo); - }); - return server; -}; -export { - createAdaptorServer, - serve -}; diff --git a/node_modules/@hono/node-server/dist/types.d.mts b/node_modules/@hono/node-server/dist/types.d.mts deleted file mode 100644 index adde70c..0000000 --- a/node_modules/@hono/node-server/dist/types.d.mts +++ /dev/null @@ -1,44 +0,0 @@ -import { IncomingMessage, ServerResponse, Server, ServerOptions as ServerOptions$1, createServer } from 'node:http'; -import { Http2ServerRequest, Http2ServerResponse, Http2Server, Http2SecureServer, ServerOptions as ServerOptions$3, createServer as createServer$2, SecureServerOptions, createSecureServer } from 'node:http2'; -import { ServerOptions as ServerOptions$2, createServer as createServer$1 } from 'node:https'; - -type HttpBindings = { - incoming: IncomingMessage; - outgoing: ServerResponse; -}; -type Http2Bindings = { - incoming: Http2ServerRequest; - outgoing: Http2ServerResponse; -}; -type FetchCallback = (request: Request, env: HttpBindings | Http2Bindings) => Promise | unknown; -type NextHandlerOption = { - fetch: FetchCallback; -}; -type ServerType = Server | Http2Server | Http2SecureServer; -type createHttpOptions = { - serverOptions?: ServerOptions$1; - createServer?: typeof createServer; -}; -type createHttpsOptions = { - serverOptions?: ServerOptions$2; - createServer?: typeof createServer$1; -}; -type createHttp2Options = { - serverOptions?: ServerOptions$3; - createServer?: typeof createServer$2; -}; -type createSecureHttp2Options = { - serverOptions?: SecureServerOptions; - createServer?: typeof createSecureServer; -}; -type ServerOptions = createHttpOptions | createHttpsOptions | createHttp2Options | createSecureHttp2Options; -type Options = { - fetch: FetchCallback; - overrideGlobalObjects?: boolean; - autoCleanupIncoming?: boolean; - port?: number; - hostname?: string; -} & ServerOptions; -type CustomErrorHandler = (err: unknown) => void | Response | Promise; - -export { CustomErrorHandler, FetchCallback, Http2Bindings, HttpBindings, NextHandlerOption, Options, ServerOptions, ServerType }; diff --git a/node_modules/@hono/node-server/dist/types.d.ts b/node_modules/@hono/node-server/dist/types.d.ts deleted file mode 100644 index adde70c..0000000 --- a/node_modules/@hono/node-server/dist/types.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { IncomingMessage, ServerResponse, Server, ServerOptions as ServerOptions$1, createServer } from 'node:http'; -import { Http2ServerRequest, Http2ServerResponse, Http2Server, Http2SecureServer, ServerOptions as ServerOptions$3, createServer as createServer$2, SecureServerOptions, createSecureServer } from 'node:http2'; -import { ServerOptions as ServerOptions$2, createServer as createServer$1 } from 'node:https'; - -type HttpBindings = { - incoming: IncomingMessage; - outgoing: ServerResponse; -}; -type Http2Bindings = { - incoming: Http2ServerRequest; - outgoing: Http2ServerResponse; -}; -type FetchCallback = (request: Request, env: HttpBindings | Http2Bindings) => Promise | unknown; -type NextHandlerOption = { - fetch: FetchCallback; -}; -type ServerType = Server | Http2Server | Http2SecureServer; -type createHttpOptions = { - serverOptions?: ServerOptions$1; - createServer?: typeof createServer; -}; -type createHttpsOptions = { - serverOptions?: ServerOptions$2; - createServer?: typeof createServer$1; -}; -type createHttp2Options = { - serverOptions?: ServerOptions$3; - createServer?: typeof createServer$2; -}; -type createSecureHttp2Options = { - serverOptions?: SecureServerOptions; - createServer?: typeof createSecureServer; -}; -type ServerOptions = createHttpOptions | createHttpsOptions | createHttp2Options | createSecureHttp2Options; -type Options = { - fetch: FetchCallback; - overrideGlobalObjects?: boolean; - autoCleanupIncoming?: boolean; - port?: number; - hostname?: string; -} & ServerOptions; -type CustomErrorHandler = (err: unknown) => void | Response | Promise; - -export { CustomErrorHandler, FetchCallback, Http2Bindings, HttpBindings, NextHandlerOption, Options, ServerOptions, ServerType }; diff --git a/node_modules/@hono/node-server/dist/types.js b/node_modules/@hono/node-server/dist/types.js deleted file mode 100644 index 14bbc9e..0000000 --- a/node_modules/@hono/node-server/dist/types.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/types.ts -var types_exports = {}; -module.exports = __toCommonJS(types_exports); diff --git a/node_modules/@hono/node-server/dist/types.mjs b/node_modules/@hono/node-server/dist/types.mjs deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/@hono/node-server/dist/utils.d.mts b/node_modules/@hono/node-server/dist/utils.d.mts deleted file mode 100644 index 6240c5e..0000000 --- a/node_modules/@hono/node-server/dist/utils.d.mts +++ /dev/null @@ -1,9 +0,0 @@ -import { OutgoingHttpHeaders } from 'node:http'; -import { Writable } from 'node:stream'; - -declare function readWithoutBlocking(readPromise: Promise>): Promise | undefined>; -declare function writeFromReadableStreamDefaultReader(reader: ReadableStreamDefaultReader, writable: Writable, currentReadPromise?: Promise> | undefined): Promise; -declare function writeFromReadableStream(stream: ReadableStream, writable: Writable): Promise | undefined; -declare const buildOutgoingHttpHeaders: (headers: Headers | HeadersInit | null | undefined) => OutgoingHttpHeaders; - -export { buildOutgoingHttpHeaders, readWithoutBlocking, writeFromReadableStream, writeFromReadableStreamDefaultReader }; diff --git a/node_modules/@hono/node-server/dist/utils.d.ts b/node_modules/@hono/node-server/dist/utils.d.ts deleted file mode 100644 index 6240c5e..0000000 --- a/node_modules/@hono/node-server/dist/utils.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { OutgoingHttpHeaders } from 'node:http'; -import { Writable } from 'node:stream'; - -declare function readWithoutBlocking(readPromise: Promise>): Promise | undefined>; -declare function writeFromReadableStreamDefaultReader(reader: ReadableStreamDefaultReader, writable: Writable, currentReadPromise?: Promise> | undefined): Promise; -declare function writeFromReadableStream(stream: ReadableStream, writable: Writable): Promise | undefined; -declare const buildOutgoingHttpHeaders: (headers: Headers | HeadersInit | null | undefined) => OutgoingHttpHeaders; - -export { buildOutgoingHttpHeaders, readWithoutBlocking, writeFromReadableStream, writeFromReadableStreamDefaultReader }; diff --git a/node_modules/@hono/node-server/dist/utils.js b/node_modules/@hono/node-server/dist/utils.js deleted file mode 100644 index 7d416f1..0000000 --- a/node_modules/@hono/node-server/dist/utils.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/utils.ts -var utils_exports = {}; -__export(utils_exports, { - buildOutgoingHttpHeaders: () => buildOutgoingHttpHeaders, - readWithoutBlocking: () => readWithoutBlocking, - writeFromReadableStream: () => writeFromReadableStream, - writeFromReadableStreamDefaultReader: () => writeFromReadableStreamDefaultReader -}); -module.exports = __toCommonJS(utils_exports); -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - buildOutgoingHttpHeaders, - readWithoutBlocking, - writeFromReadableStream, - writeFromReadableStreamDefaultReader -}); diff --git a/node_modules/@hono/node-server/dist/utils.mjs b/node_modules/@hono/node-server/dist/utils.mjs deleted file mode 100644 index 5184acb..0000000 --- a/node_modules/@hono/node-server/dist/utils.mjs +++ /dev/null @@ -1,71 +0,0 @@ -// src/utils.ts -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; -export { - buildOutgoingHttpHeaders, - readWithoutBlocking, - writeFromReadableStream, - writeFromReadableStreamDefaultReader -}; diff --git a/node_modules/@hono/node-server/dist/utils/response.d.mts b/node_modules/@hono/node-server/dist/utils/response.d.mts deleted file mode 100644 index 523b753..0000000 --- a/node_modules/@hono/node-server/dist/utils/response.d.mts +++ /dev/null @@ -1,3 +0,0 @@ -declare const RESPONSE_ALREADY_SENT: Response; - -export { RESPONSE_ALREADY_SENT }; diff --git a/node_modules/@hono/node-server/dist/utils/response.d.ts b/node_modules/@hono/node-server/dist/utils/response.d.ts deleted file mode 100644 index 523b753..0000000 --- a/node_modules/@hono/node-server/dist/utils/response.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const RESPONSE_ALREADY_SENT: Response; - -export { RESPONSE_ALREADY_SENT }; diff --git a/node_modules/@hono/node-server/dist/utils/response.js b/node_modules/@hono/node-server/dist/utils/response.js deleted file mode 100644 index 6fe007b..0000000 --- a/node_modules/@hono/node-server/dist/utils/response.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/utils/response.ts -var response_exports = {}; -__export(response_exports, { - RESPONSE_ALREADY_SENT: () => RESPONSE_ALREADY_SENT -}); -module.exports = __toCommonJS(response_exports); - -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/utils/response.ts -var RESPONSE_ALREADY_SENT = new Response(null, { - headers: { [X_ALREADY_SENT]: "true" } -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - RESPONSE_ALREADY_SENT -}); diff --git a/node_modules/@hono/node-server/dist/utils/response.mjs b/node_modules/@hono/node-server/dist/utils/response.mjs deleted file mode 100644 index 5d42aaa..0000000 --- a/node_modules/@hono/node-server/dist/utils/response.mjs +++ /dev/null @@ -1,10 +0,0 @@ -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/utils/response.ts -var RESPONSE_ALREADY_SENT = new Response(null, { - headers: { [X_ALREADY_SENT]: "true" } -}); -export { - RESPONSE_ALREADY_SENT -}; diff --git a/node_modules/@hono/node-server/dist/utils/response/constants.d.mts b/node_modules/@hono/node-server/dist/utils/response/constants.d.mts deleted file mode 100644 index f09b912..0000000 --- a/node_modules/@hono/node-server/dist/utils/response/constants.d.mts +++ /dev/null @@ -1,3 +0,0 @@ -declare const X_ALREADY_SENT = "x-hono-already-sent"; - -export { X_ALREADY_SENT }; diff --git a/node_modules/@hono/node-server/dist/utils/response/constants.d.ts b/node_modules/@hono/node-server/dist/utils/response/constants.d.ts deleted file mode 100644 index f09b912..0000000 --- a/node_modules/@hono/node-server/dist/utils/response/constants.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const X_ALREADY_SENT = "x-hono-already-sent"; - -export { X_ALREADY_SENT }; diff --git a/node_modules/@hono/node-server/dist/utils/response/constants.js b/node_modules/@hono/node-server/dist/utils/response/constants.js deleted file mode 100644 index 615e7c5..0000000 --- a/node_modules/@hono/node-server/dist/utils/response/constants.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/utils/response/constants.ts -var constants_exports = {}; -__export(constants_exports, { - X_ALREADY_SENT: () => X_ALREADY_SENT -}); -module.exports = __toCommonJS(constants_exports); -var X_ALREADY_SENT = "x-hono-already-sent"; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - X_ALREADY_SENT -}); diff --git a/node_modules/@hono/node-server/dist/utils/response/constants.mjs b/node_modules/@hono/node-server/dist/utils/response/constants.mjs deleted file mode 100644 index e6ed45f..0000000 --- a/node_modules/@hono/node-server/dist/utils/response/constants.mjs +++ /dev/null @@ -1,5 +0,0 @@ -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; -export { - X_ALREADY_SENT -}; diff --git a/node_modules/@hono/node-server/dist/vercel.d.mts b/node_modules/@hono/node-server/dist/vercel.d.mts deleted file mode 100644 index d187c05..0000000 --- a/node_modules/@hono/node-server/dist/vercel.d.mts +++ /dev/null @@ -1,7 +0,0 @@ -import * as http2 from 'http2'; -import * as http from 'http'; -import { Hono } from 'hono'; - -declare const handle: (app: Hono) => (incoming: http.IncomingMessage | http2.Http2ServerRequest, outgoing: http.ServerResponse | http2.Http2ServerResponse) => Promise; - -export { handle }; diff --git a/node_modules/@hono/node-server/dist/vercel.d.ts b/node_modules/@hono/node-server/dist/vercel.d.ts deleted file mode 100644 index d187c05..0000000 --- a/node_modules/@hono/node-server/dist/vercel.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as http2 from 'http2'; -import * as http from 'http'; -import { Hono } from 'hono'; - -declare const handle: (app: Hono) => (incoming: http.IncomingMessage | http2.Http2ServerRequest, outgoing: http.ServerResponse | http2.Http2ServerResponse) => Promise; - -export { handle }; diff --git a/node_modules/@hono/node-server/dist/vercel.js b/node_modules/@hono/node-server/dist/vercel.js deleted file mode 100644 index 63def62..0000000 --- a/node_modules/@hono/node-server/dist/vercel.js +++ /dev/null @@ -1,588 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/vercel.ts -var vercel_exports = {}; -__export(vercel_exports, { - handle: () => handle -}); -module.exports = __toCommonJS(vercel_exports); - -// src/listener.ts -var import_node_http22 = require("http2"); - -// src/request.ts -var import_node_http2 = require("http2"); -var import_node_stream = require("stream"); -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= import_node_stream.Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = import_node_stream.Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof import_node_http2.Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof import_node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof import_node_http2.Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; - -// src/response.ts -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response2 = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response2, GlobalResponse); -Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype); - -// src/utils.ts -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; - -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/globals.ts -var import_node_crypto = __toESM(require("crypto")); -if (typeof global.crypto === "undefined") { - global.crypto = import_node_crypto.default; -} - -// src/listener.ts -var outgoingEnded = Symbol("outgoingEnded"); -var handleRequestError = () => new Response(null, { - status: 400 -}); -var handleFetchError = (e) => new Response(null, { - status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500 -}); -var handleResponseError = (e, outgoing) => { - const err = e instanceof Error ? e : new Error("unknown error", { cause: e }); - if (err.code === "ERR_STREAM_PREMATURE_CLOSE") { - console.info("The user aborted a request."); - } else { - console.error(e); - if (!outgoing.headersSent) { - outgoing.writeHead(500, { "Content-Type": "text/plain" }); - } - outgoing.end(`Error: ${err.message}`); - outgoing.destroy(err); - } -}; -var flushHeaders = (outgoing) => { - if ("flushHeaders" in outgoing && outgoing.writable) { - outgoing.flushHeaders(); - } -}; -var responseViaCache = async (res, outgoing) => { - let [status, body, header] = res[cacheKey]; - if (header instanceof Headers) { - header = buildOutgoingHttpHeaders(header); - } - if (typeof body === "string") { - header["Content-Length"] = Buffer.byteLength(body); - } else if (body instanceof Uint8Array) { - header["Content-Length"] = body.byteLength; - } else if (body instanceof Blob) { - header["Content-Length"] = body.size; - } - outgoing.writeHead(status, header); - if (typeof body === "string" || body instanceof Uint8Array) { - outgoing.end(body); - } else if (body instanceof Blob) { - outgoing.end(new Uint8Array(await body.arrayBuffer())); - } else { - flushHeaders(outgoing); - await writeFromReadableStream(body, outgoing)?.catch( - (e) => handleResponseError(e, outgoing) - ); - } - ; - outgoing[outgoingEnded]?.(); -}; -var isPromise = (res) => typeof res.then === "function"; -var responseViaResponseObject = async (res, outgoing, options = {}) => { - if (isPromise(res)) { - if (options.errorHandler) { - try { - res = await res; - } catch (err) { - const errRes = await options.errorHandler(err); - if (!errRes) { - return; - } - res = errRes; - } - } else { - res = await res.catch(handleFetchError); - } - } - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - const resHeaderRecord = buildOutgoingHttpHeaders(res.headers); - if (res.body) { - const reader = res.body.getReader(); - const values = []; - let done = false; - let currentReadPromise = void 0; - if (resHeaderRecord["transfer-encoding"] !== "chunked") { - let maxReadCount = 2; - for (let i = 0; i < maxReadCount; i++) { - currentReadPromise ||= reader.read(); - const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => { - console.error(e); - done = true; - }); - if (!chunk) { - if (i === 1) { - await new Promise((resolve) => setTimeout(resolve)); - maxReadCount = 3; - continue; - } - break; - } - currentReadPromise = void 0; - if (chunk.value) { - values.push(chunk.value); - } - if (chunk.done) { - done = true; - break; - } - } - if (done && !("content-length" in resHeaderRecord)) { - resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0); - } - } - outgoing.writeHead(res.status, resHeaderRecord); - values.forEach((value) => { - ; - outgoing.write(value); - }); - if (done) { - outgoing.end(); - } else { - if (values.length === 0) { - flushHeaders(outgoing); - } - await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise); - } - } else if (resHeaderRecord[X_ALREADY_SENT]) { - } else { - outgoing.writeHead(res.status, resHeaderRecord); - outgoing.end(); - } - ; - outgoing[outgoingEnded]?.(); -}; -var getRequestListener = (fetchCallback, options = {}) => { - const autoCleanupIncoming = options.autoCleanupIncoming ?? true; - if (options.overrideGlobalObjects !== false && global.Request !== Request) { - Object.defineProperty(global, "Request", { - value: Request - }); - Object.defineProperty(global, "Response", { - value: Response2 - }); - } - return async (incoming, outgoing) => { - let res, req; - try { - req = newRequest(incoming, options.hostname); - let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD"; - if (!incomingEnded) { - ; - incoming[wrapBodyStream] = true; - incoming.on("end", () => { - incomingEnded = true; - }); - if (incoming instanceof import_node_http22.Http2ServerRequest) { - ; - outgoing[outgoingEnded] = () => { - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - outgoing.destroy(); - }); - } - }); - } - }; - } - } - outgoing.on("close", () => { - const abortController = req[abortControllerKey]; - if (abortController) { - if (incoming.errored) { - req[abortControllerKey].abort(incoming.errored.toString()); - } else if (!outgoing.writableFinished) { - req[abortControllerKey].abort("Client connection prematurely closed."); - } - } - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - }); - } - }); - } - }); - res = fetchCallback(req, { incoming, outgoing }); - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - } catch (e) { - if (!res) { - if (options.errorHandler) { - res = await options.errorHandler(req ? e : toRequestError(e)); - if (!res) { - return; - } - } else if (!req) { - res = handleRequestError(); - } else { - res = handleFetchError(e); - } - } else { - return handleResponseError(e, outgoing); - } - } - try { - return await responseViaResponseObject(res, outgoing, options); - } catch (e) { - return handleResponseError(e, outgoing); - } - }; -}; - -// src/vercel.ts -var handle = (app) => { - return getRequestListener(app.fetch); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - handle -}); diff --git a/node_modules/@hono/node-server/dist/vercel.mjs b/node_modules/@hono/node-server/dist/vercel.mjs deleted file mode 100644 index 334c1c8..0000000 --- a/node_modules/@hono/node-server/dist/vercel.mjs +++ /dev/null @@ -1,551 +0,0 @@ -// src/listener.ts -import { Http2ServerRequest as Http2ServerRequest2 } from "http2"; - -// src/request.ts -import { Http2ServerRequest } from "http2"; -import { Readable } from "stream"; -var RequestError = class extends Error { - constructor(message, options) { - super(message, options); - this.name = "RequestError"; - } -}; -var toRequestError = (e) => { - if (e instanceof RequestError) { - return e; - } - return new RequestError(e.message, { cause: e }); -}; -var GlobalRequest = global.Request; -var Request = class extends GlobalRequest { - constructor(input, options) { - if (typeof input === "object" && getRequestCache in input) { - input = input[getRequestCache](); - } - if (typeof options?.body?.getReader !== "undefined") { - ; - options.duplex ??= "half"; - } - super(input, options); - } -}; -var newHeadersFromIncoming = (incoming) => { - const headerRecord = []; - const rawHeaders = incoming.rawHeaders; - for (let i = 0; i < rawHeaders.length; i += 2) { - const { [i]: key, [i + 1]: value } = rawHeaders; - if (key.charCodeAt(0) !== /*:*/ - 58) { - headerRecord.push([key, value]); - } - } - return new Headers(headerRecord); -}; -var wrapBodyStream = Symbol("wrapBodyStream"); -var newRequestFromIncoming = (method, url, headers, incoming, abortController) => { - const init = { - method, - headers, - signal: abortController.signal - }; - if (method === "TRACE") { - init.method = "GET"; - const req = new Request(url, init); - Object.defineProperty(req, "method", { - get() { - return "TRACE"; - } - }); - return req; - } - if (!(method === "GET" || method === "HEAD")) { - if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) { - init.body = new ReadableStream({ - start(controller) { - controller.enqueue(incoming.rawBody); - controller.close(); - } - }); - } else if (incoming[wrapBodyStream]) { - let reader; - init.body = new ReadableStream({ - async pull(controller) { - try { - reader ||= Readable.toWeb(incoming).getReader(); - const { done, value } = await reader.read(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - } catch (error) { - controller.error(error); - } - } - }); - } else { - init.body = Readable.toWeb(incoming); - } - } - return new Request(url, init); -}; -var getRequestCache = Symbol("getRequestCache"); -var requestCache = Symbol("requestCache"); -var incomingKey = Symbol("incomingKey"); -var urlKey = Symbol("urlKey"); -var headersKey = Symbol("headersKey"); -var abortControllerKey = Symbol("abortControllerKey"); -var getAbortController = Symbol("getAbortController"); -var requestPrototype = { - get method() { - return this[incomingKey].method || "GET"; - }, - get url() { - return this[urlKey]; - }, - get headers() { - return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]); - }, - [getAbortController]() { - this[getRequestCache](); - return this[abortControllerKey]; - }, - [getRequestCache]() { - this[abortControllerKey] ||= new AbortController(); - return this[requestCache] ||= newRequestFromIncoming( - this.method, - this[urlKey], - this.headers, - this[incomingKey], - this[abortControllerKey] - ); - } -}; -[ - "body", - "bodyUsed", - "cache", - "credentials", - "destination", - "integrity", - "mode", - "redirect", - "referrer", - "referrerPolicy", - "signal", - "keepalive" -].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - get() { - return this[getRequestCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(requestPrototype, k, { - value: function() { - return this[getRequestCache]()[k](); - } - }); -}); -Object.setPrototypeOf(requestPrototype, Request.prototype); -var newRequest = (incoming, defaultHostname) => { - const req = Object.create(requestPrototype); - req[incomingKey] = incoming; - const incomingUrl = incoming.url || ""; - if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL. - (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) { - if (incoming instanceof Http2ServerRequest) { - throw new RequestError("Absolute URL for :path is not allowed in HTTP/2"); - } - try { - const url2 = new URL(incomingUrl); - req[urlKey] = url2.href; - } catch (e) { - throw new RequestError("Invalid absolute URL", { cause: e }); - } - return req; - } - const host = (incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname; - if (!host) { - throw new RequestError("Missing host header"); - } - let scheme; - if (incoming instanceof Http2ServerRequest) { - scheme = incoming.scheme; - if (!(scheme === "http" || scheme === "https")) { - throw new RequestError("Unsupported scheme"); - } - } else { - scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http"; - } - const url = new URL(`${scheme}://${host}${incomingUrl}`); - if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) { - throw new RequestError("Invalid host header"); - } - req[urlKey] = url.href; - return req; -}; - -// src/response.ts -var responseCache = Symbol("responseCache"); -var getResponseCache = Symbol("getResponseCache"); -var cacheKey = Symbol("cache"); -var GlobalResponse = global.Response; -var Response2 = class _Response { - #body; - #init; - [getResponseCache]() { - delete this[cacheKey]; - return this[responseCache] ||= new GlobalResponse(this.#body, this.#init); - } - constructor(body, init) { - let headers; - this.#body = body; - if (init instanceof _Response) { - const cachedGlobalResponse = init[responseCache]; - if (cachedGlobalResponse) { - this.#init = cachedGlobalResponse; - this[getResponseCache](); - return; - } else { - this.#init = init.#init; - headers = new Headers(init.#init.headers); - } - } else { - this.#init = init; - } - if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) { - headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" }; - this[cacheKey] = [init?.status || 200, body, headers]; - } - } - get headers() { - const cache = this[cacheKey]; - if (cache) { - if (!(cache[2] instanceof Headers)) { - cache[2] = new Headers(cache[2]); - } - return cache[2]; - } - return this[getResponseCache]().headers; - } - get status() { - return this[cacheKey]?.[0] ?? this[getResponseCache]().status; - } - get ok() { - const status = this.status; - return status >= 200 && status < 300; - } -}; -["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - get() { - return this[getResponseCache]()[k]; - } - }); -}); -["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => { - Object.defineProperty(Response2.prototype, k, { - value: function() { - return this[getResponseCache]()[k](); - } - }); -}); -Object.setPrototypeOf(Response2, GlobalResponse); -Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype); - -// src/utils.ts -async function readWithoutBlocking(readPromise) { - return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]); -} -function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) { - const cancel = (error) => { - reader.cancel(error).catch(() => { - }); - }; - writable.on("close", cancel); - writable.on("error", cancel); - (currentReadPromise ?? reader.read()).then(flow, handleStreamError); - return reader.closed.finally(() => { - writable.off("close", cancel); - writable.off("error", cancel); - }); - function handleStreamError(error) { - if (error) { - writable.destroy(error); - } - } - function onDrain() { - reader.read().then(flow, handleStreamError); - } - function flow({ done, value }) { - try { - if (done) { - writable.end(); - } else if (!writable.write(value)) { - writable.once("drain", onDrain); - } else { - return reader.read().then(flow, handleStreamError); - } - } catch (e) { - handleStreamError(e); - } - } -} -function writeFromReadableStream(stream, writable) { - if (stream.locked) { - throw new TypeError("ReadableStream is locked."); - } else if (writable.destroyed) { - return; - } - return writeFromReadableStreamDefaultReader(stream.getReader(), writable); -} -var buildOutgoingHttpHeaders = (headers) => { - const res = {}; - if (!(headers instanceof Headers)) { - headers = new Headers(headers ?? void 0); - } - const cookies = []; - for (const [k, v] of headers) { - if (k === "set-cookie") { - cookies.push(v); - } else { - res[k] = v; - } - } - if (cookies.length > 0) { - res["set-cookie"] = cookies; - } - res["content-type"] ??= "text/plain; charset=UTF-8"; - return res; -}; - -// src/utils/response/constants.ts -var X_ALREADY_SENT = "x-hono-already-sent"; - -// src/globals.ts -import crypto from "crypto"; -if (typeof global.crypto === "undefined") { - global.crypto = crypto; -} - -// src/listener.ts -var outgoingEnded = Symbol("outgoingEnded"); -var handleRequestError = () => new Response(null, { - status: 400 -}); -var handleFetchError = (e) => new Response(null, { - status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500 -}); -var handleResponseError = (e, outgoing) => { - const err = e instanceof Error ? e : new Error("unknown error", { cause: e }); - if (err.code === "ERR_STREAM_PREMATURE_CLOSE") { - console.info("The user aborted a request."); - } else { - console.error(e); - if (!outgoing.headersSent) { - outgoing.writeHead(500, { "Content-Type": "text/plain" }); - } - outgoing.end(`Error: ${err.message}`); - outgoing.destroy(err); - } -}; -var flushHeaders = (outgoing) => { - if ("flushHeaders" in outgoing && outgoing.writable) { - outgoing.flushHeaders(); - } -}; -var responseViaCache = async (res, outgoing) => { - let [status, body, header] = res[cacheKey]; - if (header instanceof Headers) { - header = buildOutgoingHttpHeaders(header); - } - if (typeof body === "string") { - header["Content-Length"] = Buffer.byteLength(body); - } else if (body instanceof Uint8Array) { - header["Content-Length"] = body.byteLength; - } else if (body instanceof Blob) { - header["Content-Length"] = body.size; - } - outgoing.writeHead(status, header); - if (typeof body === "string" || body instanceof Uint8Array) { - outgoing.end(body); - } else if (body instanceof Blob) { - outgoing.end(new Uint8Array(await body.arrayBuffer())); - } else { - flushHeaders(outgoing); - await writeFromReadableStream(body, outgoing)?.catch( - (e) => handleResponseError(e, outgoing) - ); - } - ; - outgoing[outgoingEnded]?.(); -}; -var isPromise = (res) => typeof res.then === "function"; -var responseViaResponseObject = async (res, outgoing, options = {}) => { - if (isPromise(res)) { - if (options.errorHandler) { - try { - res = await res; - } catch (err) { - const errRes = await options.errorHandler(err); - if (!errRes) { - return; - } - res = errRes; - } - } else { - res = await res.catch(handleFetchError); - } - } - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - const resHeaderRecord = buildOutgoingHttpHeaders(res.headers); - if (res.body) { - const reader = res.body.getReader(); - const values = []; - let done = false; - let currentReadPromise = void 0; - if (resHeaderRecord["transfer-encoding"] !== "chunked") { - let maxReadCount = 2; - for (let i = 0; i < maxReadCount; i++) { - currentReadPromise ||= reader.read(); - const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => { - console.error(e); - done = true; - }); - if (!chunk) { - if (i === 1) { - await new Promise((resolve) => setTimeout(resolve)); - maxReadCount = 3; - continue; - } - break; - } - currentReadPromise = void 0; - if (chunk.value) { - values.push(chunk.value); - } - if (chunk.done) { - done = true; - break; - } - } - if (done && !("content-length" in resHeaderRecord)) { - resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0); - } - } - outgoing.writeHead(res.status, resHeaderRecord); - values.forEach((value) => { - ; - outgoing.write(value); - }); - if (done) { - outgoing.end(); - } else { - if (values.length === 0) { - flushHeaders(outgoing); - } - await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise); - } - } else if (resHeaderRecord[X_ALREADY_SENT]) { - } else { - outgoing.writeHead(res.status, resHeaderRecord); - outgoing.end(); - } - ; - outgoing[outgoingEnded]?.(); -}; -var getRequestListener = (fetchCallback, options = {}) => { - const autoCleanupIncoming = options.autoCleanupIncoming ?? true; - if (options.overrideGlobalObjects !== false && global.Request !== Request) { - Object.defineProperty(global, "Request", { - value: Request - }); - Object.defineProperty(global, "Response", { - value: Response2 - }); - } - return async (incoming, outgoing) => { - let res, req; - try { - req = newRequest(incoming, options.hostname); - let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD"; - if (!incomingEnded) { - ; - incoming[wrapBodyStream] = true; - incoming.on("end", () => { - incomingEnded = true; - }); - if (incoming instanceof Http2ServerRequest2) { - ; - outgoing[outgoingEnded] = () => { - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - outgoing.destroy(); - }); - } - }); - } - }; - } - } - outgoing.on("close", () => { - const abortController = req[abortControllerKey]; - if (abortController) { - if (incoming.errored) { - req[abortControllerKey].abort(incoming.errored.toString()); - } else if (!outgoing.writableFinished) { - req[abortControllerKey].abort("Client connection prematurely closed."); - } - } - if (!incomingEnded) { - setTimeout(() => { - if (!incomingEnded) { - setTimeout(() => { - incoming.destroy(); - }); - } - }); - } - }); - res = fetchCallback(req, { incoming, outgoing }); - if (cacheKey in res) { - return responseViaCache(res, outgoing); - } - } catch (e) { - if (!res) { - if (options.errorHandler) { - res = await options.errorHandler(req ? e : toRequestError(e)); - if (!res) { - return; - } - } else if (!req) { - res = handleRequestError(); - } else { - res = handleFetchError(e); - } - } else { - return handleResponseError(e, outgoing); - } - } - try { - return await responseViaResponseObject(res, outgoing, options); - } catch (e) { - return handleResponseError(e, outgoing); - } - }; -}; - -// src/vercel.ts -var handle = (app) => { - return getRequestListener(app.fetch); -}; -export { - handle -}; diff --git a/node_modules/@hono/node-server/package.json b/node_modules/@hono/node-server/package.json deleted file mode 100644 index 58fbc79..0000000 --- a/node_modules/@hono/node-server/package.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "name": "@hono/node-server", - "version": "1.19.9", - "description": "Node.js Adapter for Hono", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "files": [ - "dist" - ], - "exports": { - ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.js", - "import": "./dist/index.mjs" - }, - "./serve-static": { - "types": "./dist/serve-static.d.ts", - "require": "./dist/serve-static.js", - "import": "./dist/serve-static.mjs" - }, - "./vercel": { - "types": "./dist/vercel.d.ts", - "require": "./dist/vercel.js", - "import": "./dist/vercel.mjs" - }, - "./utils/*": { - "types": "./dist/utils/*.d.ts", - "require": "./dist/utils/*.js", - "import": "./dist/utils/*.mjs" - }, - "./conninfo": { - "types": "./dist/conninfo.d.ts", - "require": "./dist/conninfo.js", - "import": "./dist/conninfo.mjs" - } - }, - "typesVersions": { - "*": { - ".": [ - "./dist/index.d.ts" - ], - "serve-static": [ - "./dist/serve-static.d.ts" - ], - "vercel": [ - "./dist/vercel.d.ts" - ], - "utils/*": [ - "./dist/utils/*.d.ts" - ], - "conninfo": [ - "./dist/conninfo.d.ts" - ] - } - }, - "scripts": { - "test": "node --expose-gc node_modules/jest/bin/jest.js", - "build": "tsup --external hono", - "watch": "tsup --watch", - "postbuild": "publint", - "prerelease": "bun run build && bun run test", - "release": "np", - "lint": "eslint src test", - "lint:fix": "eslint src test --fix", - "format": "prettier --check \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\"", - "format:fix": "prettier --write \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\"" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/honojs/node-server.git" - }, - "homepage": "https://github.com/honojs/node-server", - "author": "Yusuke Wada (https://github.com/yusukebe)", - "publishConfig": { - "registry": "https://registry.npmjs.org", - "access": "public" - }, - "engines": { - "node": ">=18.14.1" - }, - "devDependencies": { - "@hono/eslint-config": "^1.0.1", - "@types/jest": "^29.5.3", - "@types/node": "^20.10.0", - "@types/supertest": "^2.0.12", - "@whatwg-node/fetch": "^0.9.14", - "eslint": "^9.10.0", - "hono": "^4.4.10", - "jest": "^29.6.1", - "np": "^7.7.0", - "prettier": "^3.2.4", - "publint": "^0.1.16", - "supertest": "^6.3.3", - "ts-jest": "^29.1.1", - "tsup": "^7.2.0", - "typescript": "^5.3.2" - }, - "peerDependencies": { - "hono": "^4" - }, - "packageManager": "bun@1.2.20" -} diff --git a/node_modules/@modelcontextprotocol/sdk/LICENSE b/node_modules/@modelcontextprotocol/sdk/LICENSE deleted file mode 100644 index 3d48435..0000000 --- a/node_modules/@modelcontextprotocol/sdk/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Anthropic, PBC - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@modelcontextprotocol/sdk/README.md b/node_modules/@modelcontextprotocol/sdk/README.md deleted file mode 100644 index 254671c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/README.md +++ /dev/null @@ -1,169 +0,0 @@ -# MCP TypeScript SDK [![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fsdk)](https://www.npmjs.com/package/@modelcontextprotocol/sdk) [![MIT licensed](https://img.shields.io/npm/l/%40modelcontextprotocol%2Fsdk)](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/LICENSE) - -
-Table of Contents - -- [Overview](#overview) -- [Installation](#installation) -- [Quick Start](#quick-start) -- [Core Concepts](#core-concepts) -- [Examples](#examples) -- [Documentation](#documentation) -- [Contributing](#contributing) -- [License](#license) - -
- -## Overview - -The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This TypeScript SDK implements -[the full MCP specification](https://modelcontextprotocol.io/specification/draft), making it easy to: - -- Create MCP servers that expose resources, prompts and tools -- Build MCP clients that can connect to any MCP server -- Use standard transports like stdio and Streamable HTTP - -## Installation - -```bash -npm install @modelcontextprotocol/sdk zod -``` - -This SDK has a **required peer dependency** on `zod` for schema validation. The SDK internally imports from `zod/v4`, but maintains backwards compatibility with projects using Zod v3.25 or later. You can use either API in your code by importing from `zod/v3` or `zod/v4`: - -## Quick Start - -To see the SDK in action end-to-end, start from the runnable examples in `src/examples`: - -1. **Install dependencies** (from the SDK repo root): - - ```bash - npm install - ``` - -2. **Run the example Streamable HTTP server**: - - ```bash - npx tsx src/examples/server/simpleStreamableHttp.ts - ``` - -3. **Run the interactive client in another terminal**: - - ```bash - npx tsx src/examples/client/simpleStreamableHttp.ts - ``` - -This pair of examples demonstrates tools, resources, prompts, sampling, elicitation, tasks and logging. For a guided walkthrough and variations (stateless servers, JSON-only responses, SSE compatibility, OAuth, etc.), see [docs/server.md](docs/server.md) and -[docs/client.md](docs/client.md). - -## Core Concepts - -### Servers and transports - -An MCP server is typically created with `McpServer` and connected to a transport such as Streamable HTTP or stdio. The SDK supports: - -- **Streamable HTTP** for remote servers (recommended). -- **HTTP + SSE** for backwards compatibility only. -- **stdio** for local, process-spawned integrations. - -Runnable server examples live under `src/examples/server` and are documented in [docs/server.md](docs/server.md). - -### Tools, resources, prompts - -- **Tools** let LLMs ask your server to take actions (computation, side effects, network calls). -- **Resources** expose read-only data that clients can surface to users or models. -- **Prompts** are reusable templates that help users talk to models in a consistent way. - -The detailed APIs, including `ResourceTemplate`, completions, and display-name metadata, are covered in [docs/server.md](docs/server.md#tools-resources-and-prompts), with runnable implementations in [`simpleStreamableHttp.ts`](src/examples/server/simpleStreamableHttp.ts). - -### Capabilities: sampling, elicitation, and tasks - -The SDK includes higher-level capabilities for richer workflows: - -- **Sampling**: server-side tools can ask connected clients to run LLM completions. -- **Form elicitation**: tools can request non-sensitive input via structured forms. -- **URL elicitation**: servers can ask users to complete secure flows in a browser (e.g., API key entry, payments, OAuth). -- **Tasks (experimental)**: long-running tool calls can be turned into tasks that you poll or resume later. - -Conceptual overviews and links to runnable examples are in: - -- [docs/capabilities.md](docs/capabilities.md) - -Key example servers include: - -- [`toolWithSampleServer.ts`](src/examples/server/toolWithSampleServer.ts) -- [`elicitationFormExample.ts`](src/examples/server/elicitationFormExample.ts) -- [`elicitationUrlExample.ts`](src/examples/server/elicitationUrlExample.ts) - -### Clients - -The high-level `Client` class connects to MCP servers over different transports and exposes helpers like `listTools`, `callTool`, `listResources`, `readResource`, `listPrompts`, and `getPrompt`. - -Runnable clients live under `src/examples/client` and are described in [docs/client.md](docs/client.md), including: - -- Interactive Streamable HTTP client ([`simpleStreamableHttp.ts`](src/examples/client/simpleStreamableHttp.ts)) -- Streamable HTTP client with SSE fallback ([`streamableHttpWithSseFallbackClient.ts`](src/examples/client/streamableHttpWithSseFallbackClient.ts)) -- OAuth-enabled clients and polling/parallel examples - -### Node.js Web Crypto (globalThis.crypto) compatibility - -Some parts of the SDK (for example, JWT-based client authentication in `auth-extensions.ts` via `jose`) rely on the Web Crypto API exposed as `globalThis.crypto`. - -See [docs/faq.md](docs/faq.md) for details on supported Node.js versions and how to polyfill `globalThis.crypto` when running on older Node.js runtimes. - -## Examples - -The SDK ships runnable examples under `src/examples`. Use these tables to find the scenario you care about and jump straight to the corresponding code and docs. - -### Server examples - -| Scenario | Description | Example file(s) | Related docs | -| --------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -| Streamable HTTP server (stateful) | Feature-rich server with tools, resources, prompts, logging, tasks, sampling, and optional OAuth. | [`simpleStreamableHttp.ts`](src/examples/server/simpleStreamableHttp.ts) | [`server.md`](docs/server.md), [`capabilities.md`](docs/capabilities.md) | -| Streamable HTTP server (stateless) | No session tracking; good for simple API-style servers. | [`simpleStatelessStreamableHttp.ts`](src/examples/server/simpleStatelessStreamableHttp.ts) | [`server.md`](docs/server.md) | -| JSON response mode (no SSE) | Streamable HTTP with JSON responses only and limited notifications. | [`jsonResponseStreamableHttp.ts`](src/examples/server/jsonResponseStreamableHttp.ts) | [`server.md`](docs/server.md) | -| Server notifications over Streamable HTTP | Demonstrates server-initiated notifications using SSE with Streamable HTTP. | [`standaloneSseWithGetStreamableHttp.ts`](src/examples/server/standaloneSseWithGetStreamableHttp.ts) | [`server.md`](docs/server.md) | -| Deprecated HTTP+SSE server | Legacy HTTP+SSE transport for backwards-compatibility testing. | [`simpleSseServer.ts`](src/examples/server/simpleSseServer.ts) | [`server.md`](docs/server.md) | -| Backwards-compatible server (Streamable HTTP + SSE) | Single server that supports both Streamable HTTP and legacy SSE clients. | [`sseAndStreamableHttpCompatibleServer.ts`](src/examples/server/sseAndStreamableHttpCompatibleServer.ts) | [`server.md`](docs/server.md) | -| Form elicitation server | Uses form elicitation to collect non-sensitive user input. | [`elicitationFormExample.ts`](src/examples/server/elicitationFormExample.ts) | [`capabilities.md`](docs/capabilities.md#elicitation) | -| URL elicitation server | Demonstrates URL-mode elicitation in an OAuth-protected server. | [`elicitationUrlExample.ts`](src/examples/server/elicitationUrlExample.ts) | [`capabilities.md`](docs/capabilities.md#elicitation) | -| Sampling and tasks server | Combines tools, logging, sampling, and experimental task-based execution. | [`toolWithSampleServer.ts`](src/examples/server/toolWithSampleServer.ts) | [`capabilities.md`](docs/capabilities.md) | -| OAuth demo authorization server | In-memory OAuth provider used with the example servers. | [`demoInMemoryOAuthProvider.ts`](src/examples/server/demoInMemoryOAuthProvider.ts) | [`server.md`](docs/server.md) | - -### Client examples - -| Scenario | Description | Example file(s) | Related docs | -| --------------------------------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | -| Interactive Streamable HTTP client | CLI client that exercises tools, resources, prompts, elicitation, and tasks. | [`simpleStreamableHttp.ts`](src/examples/client/simpleStreamableHttp.ts) | [`client.md`](docs/client.md) | -| Backwards-compatible client (Streamable HTTP → SSE) | Tries Streamable HTTP first, then falls back to SSE on 4xx responses. | [`streamableHttpWithSseFallbackClient.ts`](src/examples/client/streamableHttpWithSseFallbackClient.ts) | [`client.md`](docs/client.md), [`server.md`](docs/server.md) | -| SSE polling client | Polls a legacy SSE server and demonstrates notification handling. | [`ssePollingClient.ts`](src/examples/client/ssePollingClient.ts) | [`client.md`](docs/client.md) | -| Parallel tool calls client | Shows how to run multiple tool calls in parallel. | [`parallelToolCallsClient.ts`](src/examples/client/parallelToolCallsClient.ts) | [`client.md`](docs/client.md) | -| Multiple clients in parallel | Demonstrates connecting multiple clients concurrently to the same server. | [`multipleClientsParallel.ts`](src/examples/client/multipleClientsParallel.ts) | [`client.md`](docs/client.md) | -| OAuth clients | Examples of client_credentials (basic and private_key_jwt) and reusable providers. | [`simpleOAuthClient.ts`](src/examples/client/simpleOAuthClient.ts), [`simpleOAuthClientProvider.ts`](src/examples/client/simpleOAuthClientProvider.ts), [`simpleClientCredentials.ts`](src/examples/client/simpleClientCredentials.ts) | [`client.md`](docs/client.md) | -| URL elicitation client | Works with the URL elicitation server to drive secure browser flows. | [`elicitationUrlExample.ts`](src/examples/client/elicitationUrlExample.ts) | [`capabilities.md`](docs/capabilities.md#elicitation) | - -Shared utilities: - -- In-memory event store for resumability: [`inMemoryEventStore.ts`](src/examples/shared/inMemoryEventStore.ts) (see [`server.md`](docs/server.md)). - -For more details on how to run these examples (including recommended commands and deployment diagrams), see `src/examples/README.md`. - -## Documentation - -- Local SDK docs: - - [docs/server.md](docs/server.md) – building and running MCP servers, transports, tools/resources/prompts, CORS, DNS rebinding, and multi-node deployment. - - [docs/client.md](docs/client.md) – using the high-level client, transports, backwards compatibility, and OAuth helpers. - - [docs/capabilities.md](docs/capabilities.md) – sampling, elicitation (form and URL), and experimental task-based execution. - - [docs/faq.md](docs/faq.md) – environment and troubleshooting FAQs (including Node.js Web Crypto support). -- External references: - - [Model Context Protocol documentation](https://modelcontextprotocol.io) - - [MCP Specification](https://spec.modelcontextprotocol.io) - - [Example Servers](https://github.com/modelcontextprotocol/servers) - -## Contributing - -Issues and pull requests are welcome on GitHub at . - -## License - -This project is licensed under the MIT License—see the [LICENSE](LICENSE) file for details. diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts deleted file mode 100644 index 363697d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts +++ /dev/null @@ -1,190 +0,0 @@ -/** - * OAuth provider extensions for specialized authentication flows. - * - * This module provides ready-to-use OAuthClientProvider implementations - * for common machine-to-machine authentication scenarios. - */ -import { OAuthClientInformation, OAuthClientMetadata, OAuthTokens } from '../shared/auth.js'; -import { AddClientAuthentication, OAuthClientProvider } from './auth.js'; -/** - * Helper to produce a private_key_jwt client authentication function. - * - * Usage: - * const addClientAuth = createPrivateKeyJwtAuth({ issuer, subject, privateKey, alg, audience? }); - * // pass addClientAuth as provider.addClientAuthentication implementation - */ -export declare function createPrivateKeyJwtAuth(options: { - issuer: string; - subject: string; - privateKey: string | Uint8Array | Record; - alg: string; - audience?: string | URL; - lifetimeSeconds?: number; - claims?: Record; -}): AddClientAuthentication; -/** - * Options for creating a ClientCredentialsProvider. - */ -export interface ClientCredentialsProviderOptions { - /** - * The client_id for this OAuth client. - */ - clientId: string; - /** - * The client_secret for client_secret_basic authentication. - */ - clientSecret: string; - /** - * Optional client name for metadata. - */ - clientName?: string; - /** - * Space-separated scopes values requested by the client. - */ - scope?: string; -} -/** - * OAuth provider for client_credentials grant with client_secret_basic authentication. - * - * This provider is designed for machine-to-machine authentication where - * the client authenticates using a client_id and client_secret. - * - * @example - * const provider = new ClientCredentialsProvider({ - * clientId: 'my-client', - * clientSecret: 'my-secret' - * }); - * - * const transport = new StreamableHTTPClientTransport(serverUrl, { - * authProvider: provider - * }); - */ -export declare class ClientCredentialsProvider implements OAuthClientProvider { - private _tokens?; - private _clientInfo; - private _clientMetadata; - constructor(options: ClientCredentialsProviderOptions); - get redirectUrl(): undefined; - get clientMetadata(): OAuthClientMetadata; - clientInformation(): OAuthClientInformation; - saveClientInformation(info: OAuthClientInformation): void; - tokens(): OAuthTokens | undefined; - saveTokens(tokens: OAuthTokens): void; - redirectToAuthorization(): void; - saveCodeVerifier(): void; - codeVerifier(): string; - prepareTokenRequest(scope?: string): URLSearchParams; -} -/** - * Options for creating a PrivateKeyJwtProvider. - */ -export interface PrivateKeyJwtProviderOptions { - /** - * The client_id for this OAuth client. - */ - clientId: string; - /** - * The private key for signing JWT assertions. - * Can be a PEM string, Uint8Array, or JWK object. - */ - privateKey: string | Uint8Array | Record; - /** - * The algorithm to use for signing (e.g., 'RS256', 'ES256'). - */ - algorithm: string; - /** - * Optional client name for metadata. - */ - clientName?: string; - /** - * Optional JWT lifetime in seconds (default: 300). - */ - jwtLifetimeSeconds?: number; - /** - * Space-separated scopes values requested by the client. - */ - scope?: string; -} -/** - * OAuth provider for client_credentials grant with private_key_jwt authentication. - * - * This provider is designed for machine-to-machine authentication where - * the client authenticates using a signed JWT assertion (RFC 7523 Section 2.2). - * - * @example - * const provider = new PrivateKeyJwtProvider({ - * clientId: 'my-client', - * privateKey: pemEncodedPrivateKey, - * algorithm: 'RS256' - * }); - * - * const transport = new StreamableHTTPClientTransport(serverUrl, { - * authProvider: provider - * }); - */ -export declare class PrivateKeyJwtProvider implements OAuthClientProvider { - private _tokens?; - private _clientInfo; - private _clientMetadata; - addClientAuthentication: AddClientAuthentication; - constructor(options: PrivateKeyJwtProviderOptions); - get redirectUrl(): undefined; - get clientMetadata(): OAuthClientMetadata; - clientInformation(): OAuthClientInformation; - saveClientInformation(info: OAuthClientInformation): void; - tokens(): OAuthTokens | undefined; - saveTokens(tokens: OAuthTokens): void; - redirectToAuthorization(): void; - saveCodeVerifier(): void; - codeVerifier(): string; - prepareTokenRequest(scope?: string): URLSearchParams; -} -/** - * Options for creating a StaticPrivateKeyJwtProvider. - */ -export interface StaticPrivateKeyJwtProviderOptions { - /** - * The client_id for this OAuth client. - */ - clientId: string; - /** - * A pre-built JWT client assertion to use for authentication. - * - * This token should already contain the appropriate claims - * (iss, sub, aud, exp, etc.) and be signed by the client's key. - */ - jwtBearerAssertion: string; - /** - * Optional client name for metadata. - */ - clientName?: string; - /** - * Space-separated scopes values requested by the client. - */ - scope?: string; -} -/** - * OAuth provider for client_credentials grant with a static private_key_jwt assertion. - * - * This provider mirrors {@link PrivateKeyJwtProvider} but instead of constructing and - * signing a JWT on each request, it accepts a pre-built JWT assertion string and - * uses it directly for authentication. - */ -export declare class StaticPrivateKeyJwtProvider implements OAuthClientProvider { - private _tokens?; - private _clientInfo; - private _clientMetadata; - addClientAuthentication: AddClientAuthentication; - constructor(options: StaticPrivateKeyJwtProviderOptions); - get redirectUrl(): undefined; - get clientMetadata(): OAuthClientMetadata; - clientInformation(): OAuthClientInformation; - saveClientInformation(info: OAuthClientInformation): void; - tokens(): OAuthTokens | undefined; - saveTokens(tokens: OAuthTokens): void; - redirectToAuthorization(): void; - saveCodeVerifier(): void; - codeVerifier(): string; - prepareTokenRequest(scope?: string): URLSearchParams; -} -//# sourceMappingURL=auth-extensions.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts.map deleted file mode 100644 index 7945c0c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth-extensions.d.ts","sourceRoot":"","sources":["../../../src/client/auth-extensions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEzE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GAAG,uBAAuB,CAgE1B;AAED;;GAE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C,MAAM,EAAE,WAAW,GAAG,IAAI;IAIrC,uBAAuB,IAAI,IAAI;IAI/B,gBAAgB,IAAI,IAAI;IAIxB,YAAY,IAAI,MAAM;IAItB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe;CAKvD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js deleted file mode 100644 index 4677bb9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js +++ /dev/null @@ -1,299 +0,0 @@ -"use strict"; -/** - * OAuth provider extensions for specialized authentication flows. - * - * This module provides ready-to-use OAuthClientProvider implementations - * for common machine-to-machine authentication scenarios. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StaticPrivateKeyJwtProvider = exports.PrivateKeyJwtProvider = exports.ClientCredentialsProvider = void 0; -exports.createPrivateKeyJwtAuth = createPrivateKeyJwtAuth; -/** - * Helper to produce a private_key_jwt client authentication function. - * - * Usage: - * const addClientAuth = createPrivateKeyJwtAuth({ issuer, subject, privateKey, alg, audience? }); - * // pass addClientAuth as provider.addClientAuthentication implementation - */ -function createPrivateKeyJwtAuth(options) { - return async (_headers, params, url, metadata) => { - // Lazy import to avoid heavy dependency unless used - if (typeof globalThis.crypto === 'undefined') { - throw new TypeError('crypto is not available, please ensure you add have Web Crypto API support for older Node.js versions (see https://github.com/modelcontextprotocol/typescript-sdk#nodejs-web-crypto-globalthiscrypto-compatibility)'); - } - const jose = await Promise.resolve().then(() => __importStar(require('jose'))); - const audience = String(options.audience ?? metadata?.issuer ?? url); - const lifetimeSeconds = options.lifetimeSeconds ?? 300; - const now = Math.floor(Date.now() / 1000); - const jti = `${Date.now()}-${Math.random().toString(36).slice(2)}`; - const baseClaims = { - iss: options.issuer, - sub: options.subject, - aud: audience, - exp: now + lifetimeSeconds, - iat: now, - jti - }; - const claims = options.claims ? { ...baseClaims, ...options.claims } : baseClaims; - // Import key for the requested algorithm - const alg = options.alg; - let key; - if (typeof options.privateKey === 'string') { - if (alg.startsWith('RS') || alg.startsWith('ES') || alg.startsWith('PS')) { - key = await jose.importPKCS8(options.privateKey, alg); - } - else if (alg.startsWith('HS')) { - key = new TextEncoder().encode(options.privateKey); - } - else { - throw new Error(`Unsupported algorithm ${alg}`); - } - } - else if (options.privateKey instanceof Uint8Array) { - if (alg.startsWith('HS')) { - key = options.privateKey; - } - else { - // Assume PKCS#8 DER in Uint8Array for asymmetric algorithms - key = await jose.importPKCS8(new TextDecoder().decode(options.privateKey), alg); - } - } - else { - // Treat as JWK - key = await jose.importJWK(options.privateKey, alg); - } - // Sign JWT - const assertion = await new jose.SignJWT(claims) - .setProtectedHeader({ alg, typ: 'JWT' }) - .setIssuer(options.issuer) - .setSubject(options.subject) - .setAudience(audience) - .setIssuedAt(now) - .setExpirationTime(now + lifetimeSeconds) - .setJti(jti) - .sign(key); - params.set('client_assertion', assertion); - params.set('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'); - }; -} -/** - * OAuth provider for client_credentials grant with client_secret_basic authentication. - * - * This provider is designed for machine-to-machine authentication where - * the client authenticates using a client_id and client_secret. - * - * @example - * const provider = new ClientCredentialsProvider({ - * clientId: 'my-client', - * clientSecret: 'my-secret' - * }); - * - * const transport = new StreamableHTTPClientTransport(serverUrl, { - * authProvider: provider - * }); - */ -class ClientCredentialsProvider { - constructor(options) { - this._clientInfo = { - client_id: options.clientId, - client_secret: options.clientSecret - }; - this._clientMetadata = { - client_name: options.clientName ?? 'client-credentials-client', - redirect_uris: [], - grant_types: ['client_credentials'], - token_endpoint_auth_method: 'client_secret_basic', - scope: options.scope - }; - } - get redirectUrl() { - return undefined; - } - get clientMetadata() { - return this._clientMetadata; - } - clientInformation() { - return this._clientInfo; - } - saveClientInformation(info) { - this._clientInfo = info; - } - tokens() { - return this._tokens; - } - saveTokens(tokens) { - this._tokens = tokens; - } - redirectToAuthorization() { - throw new Error('redirectToAuthorization is not used for client_credentials flow'); - } - saveCodeVerifier() { - // Not used for client_credentials - } - codeVerifier() { - throw new Error('codeVerifier is not used for client_credentials flow'); - } - prepareTokenRequest(scope) { - const params = new URLSearchParams({ grant_type: 'client_credentials' }); - if (scope) - params.set('scope', scope); - return params; - } -} -exports.ClientCredentialsProvider = ClientCredentialsProvider; -/** - * OAuth provider for client_credentials grant with private_key_jwt authentication. - * - * This provider is designed for machine-to-machine authentication where - * the client authenticates using a signed JWT assertion (RFC 7523 Section 2.2). - * - * @example - * const provider = new PrivateKeyJwtProvider({ - * clientId: 'my-client', - * privateKey: pemEncodedPrivateKey, - * algorithm: 'RS256' - * }); - * - * const transport = new StreamableHTTPClientTransport(serverUrl, { - * authProvider: provider - * }); - */ -class PrivateKeyJwtProvider { - constructor(options) { - this._clientInfo = { - client_id: options.clientId - }; - this._clientMetadata = { - client_name: options.clientName ?? 'private-key-jwt-client', - redirect_uris: [], - grant_types: ['client_credentials'], - token_endpoint_auth_method: 'private_key_jwt', - scope: options.scope - }; - this.addClientAuthentication = createPrivateKeyJwtAuth({ - issuer: options.clientId, - subject: options.clientId, - privateKey: options.privateKey, - alg: options.algorithm, - lifetimeSeconds: options.jwtLifetimeSeconds - }); - } - get redirectUrl() { - return undefined; - } - get clientMetadata() { - return this._clientMetadata; - } - clientInformation() { - return this._clientInfo; - } - saveClientInformation(info) { - this._clientInfo = info; - } - tokens() { - return this._tokens; - } - saveTokens(tokens) { - this._tokens = tokens; - } - redirectToAuthorization() { - throw new Error('redirectToAuthorization is not used for client_credentials flow'); - } - saveCodeVerifier() { - // Not used for client_credentials - } - codeVerifier() { - throw new Error('codeVerifier is not used for client_credentials flow'); - } - prepareTokenRequest(scope) { - const params = new URLSearchParams({ grant_type: 'client_credentials' }); - if (scope) - params.set('scope', scope); - return params; - } -} -exports.PrivateKeyJwtProvider = PrivateKeyJwtProvider; -/** - * OAuth provider for client_credentials grant with a static private_key_jwt assertion. - * - * This provider mirrors {@link PrivateKeyJwtProvider} but instead of constructing and - * signing a JWT on each request, it accepts a pre-built JWT assertion string and - * uses it directly for authentication. - */ -class StaticPrivateKeyJwtProvider { - constructor(options) { - this._clientInfo = { - client_id: options.clientId - }; - this._clientMetadata = { - client_name: options.clientName ?? 'static-private-key-jwt-client', - redirect_uris: [], - grant_types: ['client_credentials'], - token_endpoint_auth_method: 'private_key_jwt', - scope: options.scope - }; - const assertion = options.jwtBearerAssertion; - this.addClientAuthentication = async (_headers, params) => { - params.set('client_assertion', assertion); - params.set('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'); - }; - } - get redirectUrl() { - return undefined; - } - get clientMetadata() { - return this._clientMetadata; - } - clientInformation() { - return this._clientInfo; - } - saveClientInformation(info) { - this._clientInfo = info; - } - tokens() { - return this._tokens; - } - saveTokens(tokens) { - this._tokens = tokens; - } - redirectToAuthorization() { - throw new Error('redirectToAuthorization is not used for client_credentials flow'); - } - saveCodeVerifier() { - // Not used for client_credentials - } - codeVerifier() { - throw new Error('codeVerifier is not used for client_credentials flow'); - } - prepareTokenRequest(scope) { - const params = new URLSearchParams({ grant_type: 'client_credentials' }); - if (scope) - params.set('scope', scope); - return params; - } -} -exports.StaticPrivateKeyJwtProvider = StaticPrivateKeyJwtProvider; -//# sourceMappingURL=auth-extensions.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js.map deleted file mode 100644 index 01a6636..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth-extensions.js","sourceRoot":"","sources":["../../../src/client/auth-extensions.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;AAaH,0DAwEC;AA/ED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CAAC,OAQvC;IACG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;QAC7C,oDAAoD;QACpD,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YAC3C,MAAM,IAAI,SAAS,CACf,qNAAqN,CACxN,CAAC;QACN,CAAC;QAED,MAAM,IAAI,GAAG,wDAAa,MAAM,GAAC,CAAC;QAElC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,EAAE,MAAM,IAAI,GAAG,CAAC,CAAC;QACrE,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,GAAG,CAAC;QAEvD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnE,MAAM,U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AO,EAAE,KAAK,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAlED,kEAkEC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts deleted file mode 100644 index c1405d6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts +++ /dev/null @@ -1,368 +0,0 @@ -import { OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens, OAuthMetadata, OAuthClientInformationFull, OAuthProtectedResourceMetadata, AuthorizationServerMetadata } from '../shared/auth.js'; -import { OAuthError } from '../server/auth/errors.js'; -import { FetchLike } from '../shared/transport.js'; -/** - * Function type for adding client authentication to token requests. - */ -export type AddClientAuthentication = (headers: Headers, params: URLSearchParams, url: string | URL, metadata?: AuthorizationServerMetadata) => void | Promise; -/** - * Implements an end-to-end OAuth client to be used with one MCP server. - * - * This client relies upon a concept of an authorized "session," the exact - * meaning of which is application-defined. Tokens, authorization codes, and - * code verifiers should not cross different sessions. - */ -export interface OAuthClientProvider { - /** - * The URL to redirect the user agent to after authorization. - * Return undefined for non-interactive flows that don't require user interaction - * (e.g., client_credentials, jwt-bearer). - */ - get redirectUrl(): string | URL | undefined; - /** - * External URL the server should use to fetch client metadata document - */ - clientMetadataUrl?: string; - /** - * Metadata about this OAuth client. - */ - get clientMetadata(): OAuthClientMetadata; - /** - * Returns a OAuth2 state parameter. - */ - state?(): string | Promise; - /** - * Loads information about this OAuth client, as registered already with the - * server, or returns `undefined` if the client is not registered with the - * server. - */ - clientInformation(): OAuthClientInformationMixed | undefined | Promise; - /** - * If implemented, this permits the OAuth client to dynamically register with - * the server. Client information saved this way should later be read via - * `clientInformation()`. - * - * This method is not required to be implemented if client information is - * statically known (e.g., pre-registered). - */ - saveClientInformation?(clientInformation: OAuthClientInformationMixed): void | Promise; - /** - * Loads any existing OAuth tokens for the current session, or returns - * `undefined` if there are no saved tokens. - */ - tokens(): OAuthTokens | undefined | Promise; - /** - * Stores new OAuth tokens for the current session, after a successful - * authorization. - */ - saveTokens(tokens: OAuthTokens): void | Promise; - /** - * Invoked to redirect the user agent to the given URL to begin the authorization flow. - */ - redirectToAuthorization(authorizationUrl: URL): void | Promise; - /** - * Saves a PKCE code verifier for the current session, before redirecting to - * the authorization flow. - */ - saveCodeVerifier(codeVerifier: string): void | Promise; - /** - * Loads the PKCE code verifier for the current session, necessary to validate - * the authorization result. - */ - codeVerifier(): string | Promise; - /** - * Adds custom client authentication to OAuth token requests. - * - * This optional method allows implementations to customize how client credentials - * are included in token exchange and refresh requests. When provided, this method - * is called instead of the default authentication logic, giving full control over - * the authentication mechanism. - * - * Common use cases include: - * - Supporting authentication methods beyond the standard OAuth 2.0 methods - * - Adding custom headers for proprietary authentication schemes - * - Implementing client assertion-based authentication (e.g., JWT bearer tokens) - * - * @param headers - The request headers (can be modified to add authentication) - * @param params - The request body parameters (can be modified to add credentials) - * @param url - The token endpoint URL being called - * @param metadata - Optional OAuth metadata for the server, which may include supported authentication methods - */ - addClientAuthentication?: AddClientAuthentication; - /** - * If defined, overrides the selection and validation of the - * RFC 8707 Resource Indicator. If left undefined, default - * validation behavior will be used. - * - * Implementations must verify the returned resource matches the MCP server. - */ - validateResourceURL?(serverUrl: string | URL, resource?: string): Promise; - /** - * If implemented, provides a way for the client to invalidate (e.g. delete) the specified - * credentials, in the case where the server has indicated that they are no longer valid. - * This avoids requiring the user to intervene manually. - */ - invalidateCredentials?(scope: 'all' | 'client' | 'tokens' | 'verifier'): void | Promise; - /** - * Prepares grant-specific parameters for a token request. - * - * This optional method allows providers to customize the token request based on - * the grant type they support. When implemented, it returns the grant type and - * any grant-specific parameters needed for the token exchange. - * - * If not implemented, the default behavior depends on the flow: - * - For authorization code flow: uses code, code_verifier, and redirect_uri - * - For client_credentials: detected via grant_types in clientMetadata - * - * @param scope - Optional scope to request - * @returns Grant type and parameters, or undefined to use default behavior - * - * @example - * // For client_credentials grant: - * prepareTokenRequest(scope) { - * return { - * grantType: 'client_credentials', - * params: scope ? { scope } : {} - * }; - * } - * - * @example - * // For authorization_code grant (default behavior): - * async prepareTokenRequest() { - * return { - * grantType: 'authorization_code', - * params: { - * code: this.authorizationCode, - * code_verifier: await this.codeVerifier(), - * redirect_uri: String(this.redirectUrl) - * } - * }; - * } - */ - prepareTokenRequest?(scope?: string): URLSearchParams | Promise | undefined; -} -export type AuthResult = 'AUTHORIZED' | 'REDIRECT'; -export declare class UnauthorizedError extends Error { - constructor(message?: string); -} -type ClientAuthMethod = 'client_secret_basic' | 'client_secret_post' | 'none'; -/** - * Determines the best client authentication method to use based on server support and client configuration. - * - * Priority order (highest to lowest): - * 1. client_secret_basic (if client secret is available) - * 2. client_secret_post (if client secret is available) - * 3. none (for public clients) - * - * @param clientInformation - OAuth client information containing credentials - * @param supportedMethods - Authentication methods supported by the authorization server - * @returns The selected authentication method - */ -export declare function selectClientAuthMethod(clientInformation: OAuthClientInformationMixed, supportedMethods: string[]): ClientAuthMethod; -/** - * Parses an OAuth error response from a string or Response object. - * - * If the input is a standard OAuth2.0 error response, it will be parsed according to the spec - * and an instance of the appropriate OAuthError subclass will be returned. - * If parsing fails, it falls back to a generic ServerError that includes - * the response status (if available) and original content. - * - * @param input - A Response object or string containing the error response - * @returns A Promise that resolves to an OAuthError instance - */ -export declare function parseErrorResponse(input: Response | string): Promise; -/** - * Orchestrates the full auth flow with a server. - * - * This can be used as a single entry point for all authorization functionality, - * instead of linking together the other lower-level functions in this module. - */ -export declare function auth(provider: OAuthClientProvider, options: { - serverUrl: string | URL; - authorizationCode?: string; - scope?: string; - resourceMetadataUrl?: URL; - fetchFn?: FetchLike; -}): Promise; -/** - * SEP-991: URL-based Client IDs - * Validate that the client_id is a valid URL with https scheme - */ -export declare function isHttpsUrl(value?: string): boolean; -export declare function selectResourceURL(serverUrl: string | URL, provider: OAuthClientProvider, resourceMetadata?: OAuthProtectedResourceMetadata): Promise; -/** - * Extract resource_metadata, scope, and error from WWW-Authenticate header. - */ -export declare function extractWWWAuthenticateParams(res: Response): { - resourceMetadataUrl?: URL; - scope?: string; - error?: string; -}; -/** - * Extract resource_metadata from response header. - * @deprecated Use `extractWWWAuthenticateParams` instead. - */ -export declare function extractResourceMetadataUrl(res: Response): URL | undefined; -/** - * Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata. - * - * If the server returns a 404 for the well-known endpoint, this function will - * return `undefined`. Any other errors will be thrown as exceptions. - */ -export declare function discoverOAuthProtectedResourceMetadata(serverUrl: string | URL, opts?: { - protocolVersion?: string; - resourceMetadataUrl?: string | URL; -}, fetchFn?: FetchLike): Promise; -/** - * Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata. - * - * If the server returns a 404 for the well-known endpoint, this function will - * return `undefined`. Any other errors will be thrown as exceptions. - * - * @deprecated This function is deprecated in favor of `discoverAuthorizationServerMetadata`. - */ -export declare function discoverOAuthMetadata(issuer: string | URL, { authorizationServerUrl, protocolVersion }?: { - authorizationServerUrl?: string | URL; - protocolVersion?: string; -}, fetchFn?: FetchLike): Promise; -/** - * Builds a list of discovery URLs to try for authorization server metadata. - * URLs are returned in priority order: - * 1. OAuth metadata at the given URL - * 2. OIDC metadata endpoints at the given URL - */ -export declare function buildDiscoveryUrls(authorizationServerUrl: string | URL): { - url: URL; - type: 'oauth' | 'oidc'; -}[]; -/** - * Discovers authorization server metadata with support for RFC 8414 OAuth 2.0 Authorization Server Metadata - * and OpenID Connect Discovery 1.0 specifications. - * - * This function implements a fallback strategy for authorization server discovery: - * 1. Attempts RFC 8414 OAuth metadata discovery first - * 2. If OAuth discovery fails, falls back to OpenID Connect Discovery - * - * @param authorizationServerUrl - The authorization server URL obtained from the MCP Server's - * protected resource metadata, or the MCP server's URL if the - * metadata was not found. - * @param options - Configuration options - * @param options.fetchFn - Optional fetch function for making HTTP requests, defaults to global fetch - * @param options.protocolVersion - MCP protocol version to use, defaults to LATEST_PROTOCOL_VERSION - * @returns Promise resolving to authorization server metadata, or undefined if discovery fails - */ -export declare function discoverAuthorizationServerMetadata(authorizationServerUrl: string | URL, { fetchFn, protocolVersion }?: { - fetchFn?: FetchLike; - protocolVersion?: string; -}): Promise; -/** - * Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL. - */ -export declare function startAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, redirectUrl, scope, state, resource }: { - metadata?: AuthorizationServerMetadata; - clientInformation: OAuthClientInformationMixed; - redirectUrl: string | URL; - scope?: string; - state?: string; - resource?: URL; -}): Promise<{ - authorizationUrl: URL; - codeVerifier: string; -}>; -/** - * Prepares token request parameters for an authorization code exchange. - * - * This is the default implementation used by fetchToken when the provider - * doesn't implement prepareTokenRequest. - * - * @param authorizationCode - The authorization code received from the authorization endpoint - * @param codeVerifier - The PKCE code verifier - * @param redirectUri - The redirect URI used in the authorization request - * @returns URLSearchParams for the authorization_code grant - */ -export declare function prepareAuthorizationCodeRequest(authorizationCode: string, codeVerifier: string, redirectUri: string | URL): URLSearchParams; -/** - * Exchanges an authorization code for an access token with the given server. - * - * Supports multiple client authentication methods as specified in OAuth 2.1: - * - Automatically selects the best authentication method based on server support - * - Falls back to appropriate defaults when server metadata is unavailable - * - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration object containing client info, auth code, etc. - * @returns Promise resolving to OAuth tokens - * @throws {Error} When token exchange fails or authentication is invalid - */ -export declare function exchangeAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, resource, addClientAuthentication, fetchFn }: { - metadata?: AuthorizationServerMetadata; - clientInformation: OAuthClientInformationMixed; - authorizationCode: string; - codeVerifier: string; - redirectUri: string | URL; - resource?: URL; - addClientAuthentication?: OAuthClientProvider['addClientAuthentication']; - fetchFn?: FetchLike; -}): Promise; -/** - * Exchange a refresh token for an updated access token. - * - * Supports multiple client authentication methods as specified in OAuth 2.1: - * - Automatically selects the best authentication method based on server support - * - Preserves the original refresh token if a new one is not returned - * - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration object containing client info, refresh token, etc. - * @returns Promise resolving to OAuth tokens (preserves original refresh_token if not replaced) - * @throws {Error} When token refresh fails or authentication is invalid - */ -export declare function refreshAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, fetchFn }: { - metadata?: AuthorizationServerMetadata; - clientInformation: OAuthClientInformationMixed; - refreshToken: string; - resource?: URL; - addClientAuthentication?: OAuthClientProvider['addClientAuthentication']; - fetchFn?: FetchLike; -}): Promise; -/** - * Unified token fetching that works with any grant type via provider.prepareTokenRequest(). - * - * This function provides a single entry point for obtaining tokens regardless of the - * OAuth grant type. The provider's prepareTokenRequest() method determines which grant - * to use and supplies the grant-specific parameters. - * - * @param provider - OAuth client provider that implements prepareTokenRequest() - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration for the token request - * @returns Promise resolving to OAuth tokens - * @throws {Error} When provider doesn't implement prepareTokenRequest or token fetch fails - * - * @example - * // Provider for client_credentials: - * class MyProvider implements OAuthClientProvider { - * prepareTokenRequest(scope) { - * const params = new URLSearchParams({ grant_type: 'client_credentials' }); - * if (scope) params.set('scope', scope); - * return params; - * } - * // ... other methods - * } - * - * const tokens = await fetchToken(provider, authServerUrl, { metadata }); - */ -export declare function fetchToken(provider: OAuthClientProvider, authorizationServerUrl: string | URL, { metadata, resource, authorizationCode, fetchFn }?: { - metadata?: AuthorizationServerMetadata; - resource?: URL; - /** Authorization code for the default authorization_code grant flow */ - authorizationCode?: string; - fetchFn?: FetchLike; -}): Promise; -/** - * Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591. - */ -export declare function registerClient(authorizationServerUrl: string | URL, { metadata, clientMetadata, fetchFn }: { - metadata?: AuthorizationServerMetadata; - clientMetadata: OAuthClientMetadata; - fetchFn?: FetchLike; -}): Promise; -export {}; -//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts.map deleted file mode 100644 index 012c440..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/client/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,mBAAmB,EAEnB,2BAA2B,EAC3B,WAAW,EACX,aAAa,EACb,0BAA0B,EAC1B,8BAA8B,EAE9B,2BAA2B,EAE9B,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAKH,UAAU,EAGb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,QAAQ,CAAC,EAAE,2BAA2B,KACrC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;OAIG;IACH,IAAI,WAAW,IAAI,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC;IAE5C;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,IAAI,cAAc,IAAI,mBAAmB,CAAC;IAE1C;;OAEG;IACH,KAAK,CAAC,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnC;;;;OAIG;IACH,iBAAiB,IAAI,2BAA2B,GAAG,SAAS,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAC;IAEhH;;;;;;;OAOG;IACH,qBAAqB,CAAC,CAAC,iBAAiB,EAAE,2BAA2B,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7F;;;OAGG;IACH,M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AAW,CAAC,CAiBtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,UAAU,CAC5B,QAAQ,EAAE,mBAAmB,EAC7B,sBAAsB,EAAE,MAAM,GAAG,GAAG,EACpC,EACI,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACV,GAAE;IACC,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IACvC,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,CAAC;CAClB,GACP,OAAO,CAAC,WAAW,CAAC,CA+BtB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAChC,sBAAsB,EAAE,MAAM,GAAG,GAAG,EACpC,EACI,QAAQ,EACR,cAAc,EACd,OAAO,EACV,EAAE;IACC,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IACvC,cAAc,EAAE,mBAAmB,CAAC;IACpC,OAAO,CAAC,EAAE,SAAS,CAAC;CACvB,GACF,OAAO,CAAC,0BAA0B,CAAC,CA0BrC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js deleted file mode 100644 index f89657f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js +++ /dev/null @@ -1,848 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.UnauthorizedError = void 0; -exports.selectClientAuthMethod = selectClientAuthMethod; -exports.parseErrorResponse = parseErrorResponse; -exports.auth = auth; -exports.isHttpsUrl = isHttpsUrl; -exports.selectResourceURL = selectResourceURL; -exports.extractWWWAuthenticateParams = extractWWWAuthenticateParams; -exports.extractResourceMetadataUrl = extractResourceMetadataUrl; -exports.discoverOAuthProtectedResourceMetadata = discoverOAuthProtectedResourceMetadata; -exports.discoverOAuthMetadata = discoverOAuthMetadata; -exports.buildDiscoveryUrls = buildDiscoveryUrls; -exports.discoverAuthorizationServerMetadata = discoverAuthorizationServerMetadata; -exports.startAuthorization = startAuthorization; -exports.prepareAuthorizationCodeRequest = prepareAuthorizationCodeRequest; -exports.exchangeAuthorization = exchangeAuthorization; -exports.refreshAuthorization = refreshAuthorization; -exports.fetchToken = fetchToken; -exports.registerClient = registerClient; -const pkce_challenge_1 = __importDefault(require("pkce-challenge")); -const types_js_1 = require("../types.js"); -const auth_js_1 = require("../shared/auth.js"); -const auth_js_2 = require("../shared/auth.js"); -const auth_utils_js_1 = require("../shared/auth-utils.js"); -const errors_js_1 = require("../server/auth/errors.js"); -class UnauthorizedError extends Error { - constructor(message) { - super(message ?? 'Unauthorized'); - } -} -exports.UnauthorizedError = UnauthorizedError; -function isClientAuthMethod(method) { - return ['client_secret_basic', 'client_secret_post', 'none'].includes(method); -} -const AUTHORIZATION_CODE_RESPONSE_TYPE = 'code'; -const AUTHORIZATION_CODE_CHALLENGE_METHOD = 'S256'; -/** - * Determines the best client authentication method to use based on server support and client configuration. - * - * Priority order (highest to lowest): - * 1. client_secret_basic (if client secret is available) - * 2. client_secret_post (if client secret is available) - * 3. none (for public clients) - * - * @param clientInformation - OAuth client information containing credentials - * @param supportedMethods - Authentication methods supported by the authorization server - * @returns The selected authentication method - */ -function selectClientAuthMethod(clientInformation, supportedMethods) { - const hasClientSecret = clientInformation.client_secret !== undefined; - // If server doesn't specify supported methods, use RFC 6749 defaults - if (supportedMethods.length === 0) { - return hasClientSecret ? 'client_secret_post' : 'none'; - } - // Prefer the method returned by the server during client registration if valid and supported - if ('token_endpoint_auth_method' in clientInformation && - clientInformation.token_endpoint_auth_method && - isClientAuthMethod(clientInformation.token_endpoint_auth_method) && - supportedMethods.includes(clientInformation.token_endpoint_auth_method)) { - return clientInformation.token_endpoint_auth_method; - } - // Try methods in priority order (most secure first) - if (hasClientSecret && supportedMethods.includes('client_secret_basic')) { - return 'client_secret_basic'; - } - if (hasClientSecret && supportedMethods.includes('client_secret_post')) { - return 'client_secret_post'; - } - if (supportedMethods.includes('none')) { - return 'none'; - } - // Fallback: use what we have - return hasClientSecret ? 'client_secret_post' : 'none'; -} -/** - * Applies client authentication to the request based on the specified method. - * - * Implements OAuth 2.1 client authentication methods: - * - client_secret_basic: HTTP Basic authentication (RFC 6749 Section 2.3.1) - * - client_secret_post: Credentials in request body (RFC 6749 Section 2.3.1) - * - none: Public client authentication (RFC 6749 Section 2.1) - * - * @param method - The authentication method to use - * @param clientInformation - OAuth client information containing credentials - * @param headers - HTTP headers object to modify - * @param params - URL search parameters to modify - * @throws {Error} When required credentials are missing - */ -function applyClientAuthentication(method, clientInformation, headers, params) { - const { client_id, client_secret } = clientInformation; - switch (method) { - case 'client_secret_basic': - applyBasicAuth(client_id, client_secret, headers); - return; - case 'client_secret_post': - applyPostAuth(client_id, client_secret, params); - return; - case 'none': - applyPublicAuth(client_id, params); - return; - default: - throw new Error(`Unsupported client authentication method: ${method}`); - } -} -/** - * Applies HTTP Basic authentication (RFC 6749 Section 2.3.1) - */ -function applyBasicAuth(clientId, clientSecret, headers) { - if (!clientSecret) { - throw new Error('client_secret_basic authentication requires a client_secret'); - } - const credentials = btoa(`${clientId}:${clientSecret}`); - headers.set('Authorization', `Basic ${credentials}`); -} -/** - * Applies POST body authentication (RFC 6749 Section 2.3.1) - */ -function applyPostAuth(clientId, clientSecret, params) { - params.set('client_id', clientId); - if (clientSecret) { - params.set('client_secret', clientSecret); - } -} -/** - * Applies public client authentication (RFC 6749 Section 2.1) - */ -function applyPublicAuth(clientId, params) { - params.set('client_id', clientId); -} -/** - * Parses an OAuth error response from a string or Response object. - * - * If the input is a standard OAuth2.0 error response, it will be parsed according to the spec - * and an instance of the appropriate OAuthError subclass will be returned. - * If parsing fails, it falls back to a generic ServerError that includes - * the response status (if available) and original content. - * - * @param input - A Response object or string containing the error response - * @returns A Promise that resolves to an OAuthError instance - */ -async function parseErrorResponse(input) { - const statusCode = input instanceof Response ? input.status : undefined; - const body = input instanceof Response ? await input.text() : input; - try { - const result = auth_js_1.OAuthErrorResponseSchema.parse(JSON.parse(body)); - const { error, error_description, error_uri } = result; - const errorClass = errors_js_1.OAUTH_ERRORS[error] || errors_js_1.ServerError; - return new errorClass(error_description || '', error_uri); - } - catch (error) { - // Not a valid OAuth error response, but try to inform the user of the raw data anyway - const errorMessage = `${statusCode ? `HTTP ${statusCode}: ` : ''}Invalid OAuth error response: ${error}. Raw body: ${body}`; - return new errors_js_1.ServerError(errorMessage); - } -} -/** - * Orchestrates the full auth flow with a server. - * - * This can be used as a single entry point for all authorization functionality, - * instead of linking together the other lower-level functions in this module. - */ -async function auth(provider, options) { - try { - return await authInternal(provider, options); - } - catch (error) { - // Handle recoverable error types by invalidating credentials and retrying - if (error instanceof errors_js_1.InvalidClientError || error instanceof errors_js_1.UnauthorizedClientError) { - await provider.invalidateCredentials?.('all'); - return await authInternal(provider, options); - } - else if (error instanceof errors_js_1.InvalidGrantError) { - await provider.invalidateCredentials?.('tokens'); - return await authInternal(provider, options); - } - // Throw otherwise - throw error; - } -} -async function authInternal(provider, { serverUrl, authorizationCode, scope, resourceMetadataUrl, fetchFn }) { - let resourceMetadata; - let authorizationServerUrl; - try { - resourceMetadata = await discoverOAuthProtectedResourceMetadata(serverUrl, { resourceMetadataUrl }, fetchFn); - if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) { - authorizationServerUrl = resourceMetadata.authorization_servers[0]; - } - } - catch { - // Ignore errors and fall back to /.well-known/oauth-authorization-server - } - /** - * If we don't get a valid authorization server metadata from protected resource metadata, - * fallback to the legacy MCP spec's implementation (version 2025-03-26): MCP server base URL acts as the Authorization server. - */ - if (!authorizationServerUrl) { - authorizationServerUrl = new URL('/', serverUrl); - } - const resource = await selectResourceURL(serverUrl, provider, resourceMetadata); - const metadata = await discoverAuthorizationServerMetadata(authorizationServerUrl, { - fetchFn - }); - // Handle client registration if needed - let clientInformation = await Promise.resolve(provider.clientInformation()); - if (!clientInformation) { - if (authorizationCode !== undefined) { - throw new Error('Existing OAuth client information is required when exchanging an authorization code'); - } - const supportsUrlBasedClientId = metadata?.client_id_metadata_document_supported === true; - const clientMetadataUrl = provider.clientMetadataUrl; - if (clientMetadataUrl && !isHttpsUrl(clientMetadataUrl)) { - throw new errors_js_1.InvalidClientMetadataError(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${clientMetadataUrl}`); - } - const shouldUseUrlBasedClientId = supportsUrlBasedClientId && clientMetadataUrl; - if (shouldUseUrlBasedClientId) { - // SEP-991: URL-based Client IDs - clientInformation = { - client_id: clientMetadataUrl - }; - await provider.saveClientInformation?.(clientInformation); - } - else { - // Fallback to dynamic registration - if (!provider.saveClientInformation) { - throw new Error('OAuth client information must be saveable for dynamic registration'); - } - const fullInformation = await registerClient(authorizationServerUrl, { - metadata, - clientMetadata: provider.clientMetadata, - fetchFn - }); - await provider.saveClientInformation(fullInformation); - clientInformation = fullInformation; - } - } - // Non-interactive flows (e.g., client_credentials, jwt-bearer) don't need a redirect URL - const nonInteractiveFlow = !provider.redirectUrl; - // Exchange authorization code for tokens, or fetch tokens directly for non-interactive flows - if (authorizationCode !== undefined || nonInteractiveFlow) { - const tokens = await fetchToken(provider, authorizationServerUrl, { - metadata, - resource, - authorizationCode, - fetchFn - }); - await provider.saveTokens(tokens); - return 'AUTHORIZED'; - } - const tokens = await provider.tokens(); - // Handle token refresh or new authorization - if (tokens?.refresh_token) { - try { - // Attempt to refresh the token - const newTokens = await refreshAuthorization(authorizationServerUrl, { - metadata, - clientInformation, - refreshToken: tokens.refresh_token, - resource, - addClientAuthentication: provider.addClientAuthentication, - fetchFn - }); - await provider.saveTokens(newTokens); - return 'AUTHORIZED'; - } - catch (error) { - // If this is a ServerError, or an unknown type, log it out and try to continue. Otherwise, escalate so we can fix things and retry. - if (!(error instanceof errors_js_1.OAuthError) || error instanceof errors_js_1.ServerError) { - // Could not refresh OAuth tokens - } - else { - // Refresh failed for another reason, re-throw - throw error; - } - } - } - const state = provider.state ? await provider.state() : undefined; - // Start new authorization flow - const { authorizationUrl, codeVerifier } = await startAuthorization(authorizationServerUrl, { - metadata, - clientInformation, - state, - redirectUrl: provider.redirectUrl, - scope: scope || resourceMetadata?.scopes_supported?.join(' ') || provider.clientMetadata.scope, - resource - }); - await provider.saveCodeVerifier(codeVerifier); - await provider.redirectToAuthorization(authorizationUrl); - return 'REDIRECT'; -} -/** - * SEP-991: URL-based Client IDs - * Validate that the client_id is a valid URL with https scheme - */ -function isHttpsUrl(value) { - if (!value) - return false; - try { - const url = new URL(value); - return url.protocol === 'https:' && url.pathname !== '/'; - } - catch { - return false; - } -} -async function selectResourceURL(serverUrl, provider, resourceMetadata) { - const defaultResource = (0, auth_utils_js_1.resourceUrlFromServerUrl)(serverUrl); - // If provider has custom validation, delegate to it - if (provider.validateResourceURL) { - return await provider.validateResourceURL(defaultResource, resourceMetadata?.resource); - } - // Only include resource parameter when Protected Resource Metadata is present - if (!resourceMetadata) { - return undefined; - } - // Validate that the metadata's resource is compatible with our request - if (!(0, auth_utils_js_1.checkResourceAllowed)({ requestedResource: defaultResource, configuredResource: resourceMetadata.resource })) { - throw new Error(`Protected resource ${resourceMetadata.resource} does not match expected ${defaultResource} (or origin)`); - } - // Prefer the resource from metadata since it's what the server is telling us to request - return new URL(resourceMetadata.resource); -} -/** - * Extract resource_metadata, scope, and error from WWW-Authenticate header. - */ -function extractWWWAuthenticateParams(res) { - const authenticateHeader = res.headers.get('WWW-Authenticate'); - if (!authenticateHeader) { - return {}; - } - const [type, scheme] = authenticateHeader.split(' '); - if (type.toLowerCase() !== 'bearer' || !scheme) { - return {}; - } - const resourceMetadataMatch = extractFieldFromWwwAuth(res, 'resource_metadata') || undefined; - let resourceMetadataUrl; - if (resourceMetadataMatch) { - try { - resourceMetadataUrl = new URL(resourceMetadataMatch); - } - catch { - // Ignore invalid URL - } - } - const scope = extractFieldFromWwwAuth(res, 'scope') || undefined; - const error = extractFieldFromWwwAuth(res, 'error') || undefined; - return { - resourceMetadataUrl, - scope, - error - }; -} -/** - * Extracts a specific field's value from the WWW-Authenticate header string. - * - * @param response The HTTP response object containing the headers. - * @param fieldName The name of the field to extract (e.g., "realm", "nonce"). - * @returns The field value - */ -function extractFieldFromWwwAuth(response, fieldName) { - const wwwAuthHeader = response.headers.get('WWW-Authenticate'); - if (!wwwAuthHeader) { - return null; - } - const pattern = new RegExp(`${fieldName}=(?:"([^"]+)"|([^\\s,]+))`); - const match = wwwAuthHeader.match(pattern); - if (match) { - // Pattern matches: field_name="value" or field_name=value (unquoted) - return match[1] || match[2]; - } - return null; -} -/** - * Extract resource_metadata from response header. - * @deprecated Use `extractWWWAuthenticateParams` instead. - */ -function extractResourceMetadataUrl(res) { - const authenticateHeader = res.headers.get('WWW-Authenticate'); - if (!authenticateHeader) { - return undefined; - } - const [type, scheme] = authenticateHeader.split(' '); - if (type.toLowerCase() !== 'bearer' || !scheme) { - return undefined; - } - const regex = /resource_metadata="([^"]*)"/; - const match = regex.exec(authenticateHeader); - if (!match) { - return undefined; - } - try { - return new URL(match[1]); - } - catch { - return undefined; - } -} -/** - * Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata. - * - * If the server returns a 404 for the well-known endpoint, this function will - * return `undefined`. Any other errors will be thrown as exceptions. - */ -async function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn = fetch) { - const response = await discoverMetadataWithFallback(serverUrl, 'oauth-protected-resource', fetchFn, { - protocolVersion: opts?.protocolVersion, - metadataUrl: opts?.resourceMetadataUrl - }); - if (!response || response.status === 404) { - await response?.body?.cancel(); - throw new Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`); - } - if (!response.ok) { - await response.body?.cancel(); - throw new Error(`HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`); - } - return auth_js_2.OAuthProtectedResourceMetadataSchema.parse(await response.json()); -} -/** - * Helper function to handle fetch with CORS retry logic - */ -async function fetchWithCorsRetry(url, headers, fetchFn = fetch) { - try { - return await fetchFn(url, { headers }); - } - catch (error) { - if (error instanceof TypeError) { - if (headers) { - // CORS errors come back as TypeError, retry without headers - return fetchWithCorsRetry(url, undefined, fetchFn); - } - else { - // We're getting CORS errors on retry too, return undefined - return undefined; - } - } - throw error; - } -} -/** - * Constructs the well-known path for auth-related metadata discovery - */ -function buildWellKnownPath(wellKnownPrefix, pathname = '', options = {}) { - // Strip trailing slash from pathname to avoid double slashes - if (pathname.endsWith('/')) { - pathname = pathname.slice(0, -1); - } - return options.prependPathname ? `${pathname}/.well-known/${wellKnownPrefix}` : `/.well-known/${wellKnownPrefix}${pathname}`; -} -/** - * Tries to discover OAuth metadata at a specific URL - */ -async function tryMetadataDiscovery(url, protocolVersion, fetchFn = fetch) { - const headers = { - 'MCP-Protocol-Version': protocolVersion - }; - return await fetchWithCorsRetry(url, headers, fetchFn); -} -/** - * Determines if fallback to root discovery should be attempted - */ -function shouldAttemptFallback(response, pathname) { - return !response || (response.status >= 400 && response.status < 500 && pathname !== '/'); -} -/** - * Generic function for discovering OAuth metadata with fallback support - */ -async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) { - const issuer = new URL(serverUrl); - const protocolVersion = opts?.protocolVersion ?? types_js_1.LATEST_PROTOCOL_VERSION; - let url; - if (opts?.metadataUrl) { - url = new URL(opts.metadataUrl); - } - else { - // Try path-aware discovery first - const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname); - url = new URL(wellKnownPath, opts?.metadataServerUrl ?? issuer); - url.search = issuer.search; - } - let response = await tryMetadataDiscovery(url, protocolVersion, fetchFn); - // If path-aware discovery fails with 404 and we're not already at root, try fallback to root discovery - if (!opts?.metadataUrl && shouldAttemptFallback(response, issuer.pathname)) { - const rootUrl = new URL(`/.well-known/${wellKnownType}`, issuer); - response = await tryMetadataDiscovery(rootUrl, protocolVersion, fetchFn); - } - return response; -} -/** - * Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata. - * - * If the server returns a 404 for the well-known endpoint, this function will - * return `undefined`. Any other errors will be thrown as exceptions. - * - * @deprecated This function is deprecated in favor of `discoverAuthorizationServerMetadata`. - */ -async function discoverOAuthMetadata(issuer, { authorizationServerUrl, protocolVersion } = {}, fetchFn = fetch) { - if (typeof issuer === 'string') { - issuer = new URL(issuer); - } - if (!authorizationServerUrl) { - authorizationServerUrl = issuer; - } - if (typeof authorizationServerUrl === 'string') { - authorizationServerUrl = new URL(authorizationServerUrl); - } - protocolVersion ?? (protocolVersion = types_js_1.LATEST_PROTOCOL_VERSION); - const response = await discoverMetadataWithFallback(authorizationServerUrl, 'oauth-authorization-server', fetchFn, { - protocolVersion, - metadataServerUrl: authorizationServerUrl - }); - if (!response || response.status === 404) { - await response?.body?.cancel(); - return undefined; - } - if (!response.ok) { - await response.body?.cancel(); - throw new Error(`HTTP ${response.status} trying to load well-known OAuth metadata`); - } - return auth_js_2.OAuthMetadataSchema.parse(await response.json()); -} -/** - * Builds a list of discovery URLs to try for authorization server metadata. - * URLs are returned in priority order: - * 1. OAuth metadata at the given URL - * 2. OIDC metadata endpoints at the given URL - */ -function buildDiscoveryUrls(authorizationServerUrl) { - const url = typeof authorizationServerUrl === 'string' ? new URL(authorizationServerUrl) : authorizationServerUrl; - const hasPath = url.pathname !== '/'; - const urlsToTry = []; - if (!hasPath) { - // Root path: https://example.com/.well-known/oauth-authorization-server - urlsToTry.push({ - url: new URL('/.well-known/oauth-authorization-server', url.origin), - type: 'oauth' - }); - // OIDC: https://example.com/.well-known/openid-configuration - urlsToTry.push({ - url: new URL(`/.well-known/openid-configuration`, url.origin), - type: 'oidc' - }); - return urlsToTry; - } - // Strip trailing slash from pathname to avoid double slashes - let pathname = url.pathname; - if (pathname.endsWith('/')) { - pathname = pathname.slice(0, -1); - } - // 1. OAuth metadata at the given URL - // Insert well-known before the path: https://example.com/.well-known/oauth-authorization-server/tenant1 - urlsToTry.push({ - url: new URL(`/.well-known/oauth-authorization-server${pathname}`, url.origin), - type: 'oauth' - }); - // 2. OIDC metadata endpoints - // RFC 8414 style: Insert /.well-known/openid-configuration before the path - urlsToTry.push({ - url: new URL(`/.well-known/openid-configuration${pathname}`, url.origin), - type: 'oidc' - }); - // OIDC Discovery 1.0 style: Append /.well-known/openid-configuration after the path - urlsToTry.push({ - url: new URL(`${pathname}/.well-known/openid-configuration`, url.origin), - type: 'oidc' - }); - return urlsToTry; -} -/** - * Discovers authorization server metadata with support for RFC 8414 OAuth 2.0 Authorization Server Metadata - * and OpenID Connect Discovery 1.0 specifications. - * - * This function implements a fallback strategy for authorization server discovery: - * 1. Attempts RFC 8414 OAuth metadata discovery first - * 2. If OAuth discovery fails, falls back to OpenID Connect Discovery - * - * @param authorizationServerUrl - The authorization server URL obtained from the MCP Server's - * protected resource metadata, or the MCP server's URL if the - * metadata was not found. - * @param options - Configuration options - * @param options.fetchFn - Optional fetch function for making HTTP requests, defaults to global fetch - * @param options.protocolVersion - MCP protocol version to use, defaults to LATEST_PROTOCOL_VERSION - * @returns Promise resolving to authorization server metadata, or undefined if discovery fails - */ -async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = types_js_1.LATEST_PROTOCOL_VERSION } = {}) { - const headers = { - 'MCP-Protocol-Version': protocolVersion, - Accept: 'application/json' - }; - // Get the list of URLs to try - const urlsToTry = buildDiscoveryUrls(authorizationServerUrl); - // Try each URL in order - for (const { url: endpointUrl, type } of urlsToTry) { - const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn); - if (!response) { - /** - * CORS error occurred - don't throw as the endpoint may not allow CORS, - * continue trying other possible endpoints - */ - continue; - } - if (!response.ok) { - await response.body?.cancel(); - // Continue looking for any 4xx response code. - if (response.status >= 400 && response.status < 500) { - continue; // Try next URL - } - throw new Error(`HTTP ${response.status} trying to load ${type === 'oauth' ? 'OAuth' : 'OpenID provider'} metadata from ${endpointUrl}`); - } - // Parse and validate based on type - if (type === 'oauth') { - return auth_js_2.OAuthMetadataSchema.parse(await response.json()); - } - else { - return auth_js_1.OpenIdProviderDiscoveryMetadataSchema.parse(await response.json()); - } - } - return undefined; -} -/** - * Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL. - */ -async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, resource }) { - let authorizationUrl; - if (metadata) { - authorizationUrl = new URL(metadata.authorization_endpoint); - if (!metadata.response_types_supported.includes(AUTHORIZATION_CODE_RESPONSE_TYPE)) { - throw new Error(`Incompatible auth server: does not support response type ${AUTHORIZATION_CODE_RESPONSE_TYPE}`); - } - if (metadata.code_challenge_methods_supported && - !metadata.code_challenge_methods_supported.includes(AUTHORIZATION_CODE_CHALLENGE_METHOD)) { - throw new Error(`Incompatible auth server: does not support code challenge method ${AUTHORIZATION_CODE_CHALLENGE_METHOD}`); - } - } - else { - authorizationUrl = new URL('/authorize', authorizationServerUrl); - } - // Generate PKCE challenge - const challenge = await (0, pkce_challenge_1.default)(); - const codeVerifier = challenge.code_verifier; - const codeChallenge = challenge.code_challenge; - authorizationUrl.searchParams.set('response_type', AUTHORIZATION_CODE_RESPONSE_TYPE); - authorizationUrl.searchParams.set('client_id', clientInformation.client_id); - authorizationUrl.searchParams.set('code_challenge', codeChallenge); - authorizationUrl.searchParams.set('code_challenge_method', AUTHORIZATION_CODE_CHALLENGE_METHOD); - authorizationUrl.searchParams.set('redirect_uri', String(redirectUrl)); - if (state) { - authorizationUrl.searchParams.set('state', state); - } - if (scope) { - authorizationUrl.searchParams.set('scope', scope); - } - if (scope?.includes('offline_access')) { - // if the request includes the OIDC-only "offline_access" scope, - // we need to set the prompt to "consent" to ensure the user is prompted to grant offline access - // https://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess - authorizationUrl.searchParams.append('prompt', 'consent'); - } - if (resource) { - authorizationUrl.searchParams.set('resource', resource.href); - } - return { authorizationUrl, codeVerifier }; -} -/** - * Prepares token request parameters for an authorization code exchange. - * - * This is the default implementation used by fetchToken when the provider - * doesn't implement prepareTokenRequest. - * - * @param authorizationCode - The authorization code received from the authorization endpoint - * @param codeVerifier - The PKCE code verifier - * @param redirectUri - The redirect URI used in the authorization request - * @returns URLSearchParams for the authorization_code grant - */ -function prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri) { - return new URLSearchParams({ - grant_type: 'authorization_code', - code: authorizationCode, - code_verifier: codeVerifier, - redirect_uri: String(redirectUri) - }); -} -/** - * Internal helper to execute a token request with the given parameters. - * Used by exchangeAuthorization, refreshAuthorization, and fetchToken. - */ -async function executeTokenRequest(authorizationServerUrl, { metadata, tokenRequestParams, clientInformation, addClientAuthentication, resource, fetchFn }) { - const tokenUrl = metadata?.token_endpoint ? new URL(metadata.token_endpoint) : new URL('/token', authorizationServerUrl); - const headers = new Headers({ - 'Content-Type': 'application/x-www-form-urlencoded', - Accept: 'application/json' - }); - if (resource) { - tokenRequestParams.set('resource', resource.href); - } - if (addClientAuthentication) { - await addClientAuthentication(headers, tokenRequestParams, tokenUrl, metadata); - } - else if (clientInformation) { - const supportedMethods = metadata?.token_endpoint_auth_methods_supported ?? []; - const authMethod = selectClientAuthMethod(clientInformation, supportedMethods); - applyClientAuthentication(authMethod, clientInformation, headers, tokenRequestParams); - } - const response = await (fetchFn ?? fetch)(tokenUrl, { - method: 'POST', - headers, - body: tokenRequestParams - }); - if (!response.ok) { - throw await parseErrorResponse(response); - } - return auth_js_2.OAuthTokensSchema.parse(await response.json()); -} -/** - * Exchanges an authorization code for an access token with the given server. - * - * Supports multiple client authentication methods as specified in OAuth 2.1: - * - Automatically selects the best authentication method based on server support - * - Falls back to appropriate defaults when server metadata is unavailable - * - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration object containing client info, auth code, etc. - * @returns Promise resolving to OAuth tokens - * @throws {Error} When token exchange fails or authentication is invalid - */ -async function exchangeAuthorization(authorizationServerUrl, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, resource, addClientAuthentication, fetchFn }) { - const tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri); - return executeTokenRequest(authorizationServerUrl, { - metadata, - tokenRequestParams, - clientInformation, - addClientAuthentication, - resource, - fetchFn - }); -} -/** - * Exchange a refresh token for an updated access token. - * - * Supports multiple client authentication methods as specified in OAuth 2.1: - * - Automatically selects the best authentication method based on server support - * - Preserves the original refresh token if a new one is not returned - * - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration object containing client info, refresh token, etc. - * @returns Promise resolving to OAuth tokens (preserves original refresh_token if not replaced) - * @throws {Error} When token refresh fails or authentication is invalid - */ -async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, fetchFn }) { - const tokenRequestParams = new URLSearchParams({ - grant_type: 'refresh_token', - refresh_token: refreshToken - }); - const tokens = await executeTokenRequest(authorizationServerUrl, { - metadata, - tokenRequestParams, - clientInformation, - addClientAuthentication, - resource, - fetchFn - }); - // Preserve original refresh token if server didn't return a new one - return { refresh_token: refreshToken, ...tokens }; -} -/** - * Unified token fetching that works with any grant type via provider.prepareTokenRequest(). - * - * This function provides a single entry point for obtaining tokens regardless of the - * OAuth grant type. The provider's prepareTokenRequest() method determines which grant - * to use and supplies the grant-specific parameters. - * - * @param provider - OAuth client provider that implements prepareTokenRequest() - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration for the token request - * @returns Promise resolving to OAuth tokens - * @throws {Error} When provider doesn't implement prepareTokenRequest or token fetch fails - * - * @example - * // Provider for client_credentials: - * class MyProvider implements OAuthClientProvider { - * prepareTokenRequest(scope) { - * const params = new URLSearchParams({ grant_type: 'client_credentials' }); - * if (scope) params.set('scope', scope); - * return params; - * } - * // ... other methods - * } - * - * const tokens = await fetchToken(provider, authServerUrl, { metadata }); - */ -async function fetchToken(provider, authorizationServerUrl, { metadata, resource, authorizationCode, fetchFn } = {}) { - const scope = provider.clientMetadata.scope; - // Use provider's prepareTokenRequest if available, otherwise fall back to authorization_code - let tokenRequestParams; - if (provider.prepareTokenRequest) { - tokenRequestParams = await provider.prepareTokenRequest(scope); - } - // Default to authorization_code grant if no custom prepareTokenRequest - if (!tokenRequestParams) { - if (!authorizationCode) { - throw new Error('Either provider.prepareTokenRequest() or authorizationCode is required'); - } - if (!provider.redirectUrl) { - throw new Error('redirectUrl is required for authorization_code flow'); - } - const codeVerifier = await provider.codeVerifier(); - tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, provider.redirectUrl); - } - const clientInformation = await provider.clientInformation(); - return executeTokenRequest(authorizationServerUrl, { - metadata, - tokenRequestParams, - clientInformation: clientInformation ?? undefined, - addClientAuthentication: provider.addClientAuthentication, - resource, - fetchFn - }); -} -/** - * Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591. - */ -async function registerClient(authorizationServerUrl, { metadata, clientMetadata, fetchFn }) { - let registrationUrl; - if (metadata) { - if (!metadata.registration_endpoint) { - throw new Error('Incompatible auth server: does not support dynamic client registration'); - } - registrationUrl = new URL(metadata.registration_endpoint); - } - else { - registrationUrl = new URL('/register', authorizationServerUrl); - } - const response = await (fetchFn ?? fetch)(registrationUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(clientMetadata) - }); - if (!response.ok) { - throw await parseErrorResponse(response); - } - return auth_js_2.OAuthClientInformationFullSchema.parse(await response.json()); -} -//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js.map deleted file mode 100644 index dab4f2a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/client/auth.ts"],"names":[],"mappings":";;;;;;AA8NA,wDAiCC;AA+ED,gDAcC;AAQD,oBAyBC;AAsJD,gCAQC;AAED,8CAuBC;AAKD,oEA8BC;A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C,CAAC;IAC7C,CAAC;IAED,OAAO,0CAAgC,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACzE,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts deleted file mode 100644 index efc0186..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts +++ /dev/null @@ -1,588 +0,0 @@ -import { Protocol, type ProtocolOptions, type RequestOptions } from '../shared/protocol.js'; -import type { Transport } from '../shared/transport.js'; -import { type CallToolRequest, CallToolResultSchema, type ClientCapabilities, type ClientNotification, type ClientRequest, type ClientResult, type CompatibilityCallToolResultSchema, type CompleteRequest, type GetPromptRequest, type Implementation, type ListPromptsRequest, type ListResourcesRequest, type ListResourceTemplatesRequest, type ListToolsRequest, type LoggingLevel, type ReadResourceRequest, type ServerCapabilities, type SubscribeRequest, type UnsubscribeRequest, type ListChangedHandlers, type Request, type Notification, type Result } from '../types.js'; -import type { jsonSchemaValidator } from '../validation/types.js'; -import { AnyObjectSchema, SchemaOutput } from '../server/zod-compat.js'; -import type { RequestHandlerExtra } from '../shared/protocol.js'; -import { ExperimentalClientTasks } from '../experimental/tasks/client.js'; -/** - * Determines which elicitation modes are supported based on declared client capabilities. - * - * According to the spec: - * - An empty elicitation capability object defaults to form mode support (backwards compatibility) - * - URL mode is only supported if explicitly declared - * - * @param capabilities - The client's elicitation capabilities - * @returns An object indicating which modes are supported - */ -export declare function getSupportedElicitationModes(capabilities: ClientCapabilities['elicitation']): { - supportsFormMode: boolean; - supportsUrlMode: boolean; -}; -export type ClientOptions = ProtocolOptions & { - /** - * Capabilities to advertise as being supported by this client. - */ - capabilities?: ClientCapabilities; - /** - * JSON Schema validator for tool output validation. - * - * The validator is used to validate structured content returned by tools - * against their declared output schemas. - * - * @default AjvJsonSchemaValidator - * - * @example - * ```typescript - * // ajv - * const client = new Client( - * { name: 'my-client', version: '1.0.0' }, - * { - * capabilities: {}, - * jsonSchemaValidator: new AjvJsonSchemaValidator() - * } - * ); - * - * // @cfworker/json-schema - * const client = new Client( - * { name: 'my-client', version: '1.0.0' }, - * { - * capabilities: {}, - * jsonSchemaValidator: new CfWorkerJsonSchemaValidator() - * } - * ); - * ``` - */ - jsonSchemaValidator?: jsonSchemaValidator; - /** - * Configure handlers for list changed notifications (tools, prompts, resources). - * - * @example - * ```typescript - * const client = new Client( - * { name: 'my-client', version: '1.0.0' }, - * { - * listChanged: { - * tools: { - * onChanged: (error, tools) => { - * if (error) { - * console.error('Failed to refresh tools:', error); - * return; - * } - * console.log('Tools updated:', tools); - * } - * }, - * prompts: { - * onChanged: (error, prompts) => console.log('Prompts updated:', prompts) - * } - * } - * } - * ); - * ``` - */ - listChanged?: ListChangedHandlers; -}; -/** - * An MCP client on top of a pluggable transport. - * - * The client will automatically begin the initialization flow with the server when connect() is called. - * - * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: - * - * ```typescript - * // Custom schemas - * const CustomRequestSchema = RequestSchema.extend({...}) - * const CustomNotificationSchema = NotificationSchema.extend({...}) - * const CustomResultSchema = ResultSchema.extend({...}) - * - * // Type aliases - * type CustomRequest = z.infer - * type CustomNotification = z.infer - * type CustomResult = z.infer - * - * // Create typed client - * const client = new Client({ - * name: "CustomClient", - * version: "1.0.0" - * }) - * ``` - */ -export declare class Client extends Protocol { - private _clientInfo; - private _serverCapabilities?; - private _serverVersion?; - private _capabilities; - private _instructions?; - private _jsonSchemaValidator; - private _cachedToolOutputValidators; - private _cachedKnownTaskTools; - private _cachedRequiredTaskTools; - private _experimental?; - private _listChangedDebounceTimers; - private _pendingListChangedConfig?; - /** - * Initializes this client with the given name and version information. - */ - constructor(_clientInfo: Implementation, options?: ClientOptions); - /** - * Set up handlers for list changed notifications based on config and server capabilities. - * This should only be called after initialization when server capabilities are known. - * Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability. - * @internal - */ - private _setupListChangedHandlers; - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental(): { - tasks: ExperimentalClientTasks; - }; - /** - * Registers new capabilities. This can only be called before connecting to a transport. - * - * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). - */ - registerCapabilities(capabilities: ClientCapabilities): void; - /** - * Override request handler registration to enforce client-side validation for elicitation. - */ - setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => ClientResult | ResultT | Promise): void; - protected assertCapability(capability: keyof ServerCapabilities, method: string): void; - connect(transport: Transport, options?: RequestOptions): Promise; - /** - * After initialization has completed, this will be populated with the server's reported capabilities. - */ - getServerCapabilities(): ServerCapabilities | undefined; - /** - * After initialization has completed, this will be populated with information about the server's name and version. - */ - getServerVersion(): Implementation | undefined; - /** - * After initialization has completed, this may be populated with information about the server's instructions. - */ - getInstructions(): string | undefined; - protected assertCapabilityForMethod(method: RequestT['method']): void; - protected assertNotificationCapability(method: NotificationT['method']): void; - protected assertRequestHandlerCapability(method: string): void; - protected assertTaskCapability(method: string): void; - protected assertTaskHandlerCapability(method: string): void; - ping(options?: RequestOptions): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - complete(params: CompleteRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - completion: { - [x: string]: unknown; - values: string[]; - total?: number | undefined; - hasMore?: boolean | undefined; - }; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - setLoggingLevel(level: LoggingLevel, options?: RequestOptions): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - getPrompt(params: GetPromptRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - messages: { - role: "user" | "assistant"; - content: { - type: "text"; - text: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "image"; - data: string; - mimeType: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "audio"; - data: string; - mimeType: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "resource"; - resource: { - uri: string; - text: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - } | { - uri: string; - blob: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - }; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - uri: string; - name: string; - type: "resource_link"; - description?: string | undefined; - mimeType?: string | undefined; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - description?: string | undefined; - }>; - listPrompts(params?: ListPromptsRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - prompts: { - name: string; - description?: string | undefined; - arguments?: { - name: string; - description?: string | undefined; - required?: boolean | undefined; - }[] | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - nextCursor?: string | undefined; - }>; - listResources(params?: ListResourcesRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - resources: { - uri: string; - name: string; - description?: string | undefined; - mimeType?: string | undefined; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - nextCursor?: string | undefined; - }>; - listResourceTemplates(params?: ListResourceTemplatesRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - resourceTemplates: { - uriTemplate: string; - name: string; - description?: string | undefined; - mimeType?: string | undefined; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - nextCursor?: string | undefined; - }>; - readResource(params: ReadResourceRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - contents: ({ - uri: string; - text: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - } | { - uri: string; - blob: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - })[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - subscribeResource(params: SubscribeRequest['params'], options?: RequestOptions): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - unsubscribeResource(params: UnsubscribeRequest['params'], options?: RequestOptions): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - /** - * Calls a tool and waits for the result. Automatically validates structured output if the tool has an outputSchema. - * - * For task-based execution with streaming behavior, use client.experimental.tasks.callToolStream() instead. - */ - callTool(params: CallToolRequest['params'], resultSchema?: typeof CallToolResultSchema | typeof CompatibilityCallToolResultSchema, options?: RequestOptions): Promise<{ - [x: string]: unknown; - content: ({ - type: "text"; - text: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "image"; - data: string; - mimeType: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "audio"; - data: string; - mimeType: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "resource"; - resource: { - uri: string; - text: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - } | { - uri: string; - blob: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - }; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - uri: string; - name: string; - type: "resource_link"; - description?: string | undefined; - mimeType?: string | undefined; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - })[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - structuredContent?: Record | undefined; - isError?: boolean | undefined; - } | { - [x: string]: unknown; - toolResult: unknown; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - private isToolTask; - /** - * Check if a tool requires task-based execution. - * Unlike isToolTask which includes 'optional' tools, this only checks for 'required'. - */ - private isToolTaskRequired; - /** - * Cache validators for tool output schemas. - * Called after listTools() to pre-compile validators for better performance. - */ - private cacheToolMetadata; - /** - * Get cached validator for a tool - */ - private getToolOutputValidator; - listTools(params?: ListToolsRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - tools: { - inputSchema: { - [x: string]: unknown; - type: "object"; - properties?: Record | undefined; - required?: string[] | undefined; - }; - name: string; - description?: string | undefined; - outputSchema?: { - [x: string]: unknown; - type: "object"; - properties?: Record | undefined; - required?: string[] | undefined; - } | undefined; - annotations?: { - title?: string | undefined; - readOnlyHint?: boolean | undefined; - destructiveHint?: boolean | undefined; - idempotentHint?: boolean | undefined; - openWorldHint?: boolean | undefined; - } | undefined; - execution?: { - taskSupport?: "optional" | "required" | "forbidden" | undefined; - } | undefined; - _meta?: Record | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - nextCursor?: string | undefined; - }>; - /** - * Set up a single list changed handler. - * @internal - */ - private _setupListChangedHandler; - sendRootsListChanged(): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts.map deleted file mode 100644 index 12d0abf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EACH,KAAK,eAAe,EACpB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iCAAiC,EACtC,KAAK,eAAe,EAIpB,KAAK,gBAAgB,EAErB,KAAK,cAAc,EAGnB,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EAEzB,KAAK,4BAA4B,EAEjC,KAAK,gBAAgB,EAErB,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EAExB,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EAYvB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,MAAM,EACd,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAuC,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EACH,eAAe,EACf,YAAY,EAMf,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAiD1E;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,kBAAkB,CAAC,aAAa,CAAC,GAAG;IAC3F,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;CA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;IAkD5B,OAAO,CAAC,UAAU;IAQlB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAuBzB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAIxB,SAAS,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAS7E;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAwD1B,oBAAoB;CAG7B"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js deleted file mode 100644 index 6ac1da1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js +++ /dev/null @@ -1,629 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Client = void 0; -exports.getSupportedElicitationModes = getSupportedElicitationModes; -const protocol_js_1 = require("../shared/protocol.js"); -const types_js_1 = require("../types.js"); -const ajv_provider_js_1 = require("../validation/ajv-provider.js"); -const zod_compat_js_1 = require("../server/zod-compat.js"); -const client_js_1 = require("../experimental/tasks/client.js"); -const helpers_js_1 = require("../experimental/tasks/helpers.js"); -/** - * Elicitation default application helper. Applies defaults to the data based on the schema. - * - * @param schema - The schema to apply defaults to. - * @param data - The data to apply defaults to. - */ -function applyElicitationDefaults(schema, data) { - if (!schema || data === null || typeof data !== 'object') - return; - // Handle object properties - if (schema.type === 'object' && schema.properties && typeof schema.properties === 'object') { - const obj = data; - const props = schema.properties; - for (const key of Object.keys(props)) { - const propSchema = props[key]; - // If missing or explicitly undefined, apply default if present - if (obj[key] === undefined && Object.prototype.hasOwnProperty.call(propSchema, 'default')) { - obj[key] = propSchema.default; - } - // Recurse into existing nested objects/arrays - if (obj[key] !== undefined) { - applyElicitationDefaults(propSchema, obj[key]); - } - } - } - if (Array.isArray(schema.anyOf)) { - for (const sub of schema.anyOf) { - // Skip boolean schemas (true/false are valid JSON Schemas but have no defaults) - if (typeof sub !== 'boolean') { - applyElicitationDefaults(sub, data); - } - } - } - // Combine schemas - if (Array.isArray(schema.oneOf)) { - for (const sub of schema.oneOf) { - // Skip boolean schemas (true/false are valid JSON Schemas but have no defaults) - if (typeof sub !== 'boolean') { - applyElicitationDefaults(sub, data); - } - } - } -} -/** - * Determines which elicitation modes are supported based on declared client capabilities. - * - * According to the spec: - * - An empty elicitation capability object defaults to form mode support (backwards compatibility) - * - URL mode is only supported if explicitly declared - * - * @param capabilities - The client's elicitation capabilities - * @returns An object indicating which modes are supported - */ -function getSupportedElicitationModes(capabilities) { - if (!capabilities) { - return { supportsFormMode: false, supportsUrlMode: false }; - } - const hasFormCapability = capabilities.form !== undefined; - const hasUrlCapability = capabilities.url !== undefined; - // If neither form nor url are explicitly declared, form mode is supported (backwards compatibility) - const supportsFormMode = hasFormCapability || (!hasFormCapability && !hasUrlCapability); - const supportsUrlMode = hasUrlCapability; - return { supportsFormMode, supportsUrlMode }; -} -/** - * An MCP client on top of a pluggable transport. - * - * The client will automatically begin the initialization flow with the server when connect() is called. - * - * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: - * - * ```typescript - * // Custom schemas - * const CustomRequestSchema = RequestSchema.extend({...}) - * const CustomNotificationSchema = NotificationSchema.extend({...}) - * const CustomResultSchema = ResultSchema.extend({...}) - * - * // Type aliases - * type CustomRequest = z.infer - * type CustomNotification = z.infer - * type CustomResult = z.infer - * - * // Create typed client - * const client = new Client({ - * name: "CustomClient", - * version: "1.0.0" - * }) - * ``` - */ -class Client extends protocol_js_1.Protocol { - /** - * Initializes this client with the given name and version information. - */ - constructor(_clientInfo, options) { - super(options); - this._clientInfo = _clientInfo; - this._cachedToolOutputValidators = new Map(); - this._cachedKnownTaskTools = new Set(); - this._cachedRequiredTaskTools = new Set(); - this._listChangedDebounceTimers = new Map(); - this._capabilities = options?.capabilities ?? {}; - this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new ajv_provider_js_1.AjvJsonSchemaValidator(); - // Store list changed config for setup after connection (when we know server capabilities) - if (options?.listChanged) { - this._pendingListChangedConfig = options.listChanged; - } - } - /** - * Set up handlers for list changed notifications based on config and server capabilities. - * This should only be called after initialization when server capabilities are known. - * Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability. - * @internal - */ - _setupListChangedHandlers(config) { - if (config.tools && this._serverCapabilities?.tools?.listChanged) { - this._setupListChangedHandler('tools', types_js_1.ToolListChangedNotificationSchema, config.tools, async () => { - const result = await this.listTools(); - return result.tools; - }); - } - if (config.prompts && this._serverCapabilities?.prompts?.listChanged) { - this._setupListChangedHandler('prompts', types_js_1.PromptListChangedNotificationSchema, config.prompts, async () => { - const result = await this.listPrompts(); - return result.prompts; - }); - } - if (config.resources && this._serverCapabilities?.resources?.listChanged) { - this._setupListChangedHandler('resources', types_js_1.ResourceListChangedNotificationSchema, config.resources, async () => { - const result = await this.listResources(); - return result.resources; - }); - } - } - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental() { - if (!this._experimental) { - this._experimental = { - tasks: new client_js_1.ExperimentalClientTasks(this) - }; - } - return this._experimental; - } - /** - * Registers new capabilities. This can only be called before connecting to a transport. - * - * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). - */ - registerCapabilities(capabilities) { - if (this.transport) { - throw new Error('Cannot register capabilities after connecting to transport'); - } - this._capabilities = (0, protocol_js_1.mergeCapabilities)(this._capabilities, capabilities); - } - /** - * Override request handler registration to enforce client-side validation for elicitation. - */ - setRequestHandler(requestSchema, handler) { - const shape = (0, zod_compat_js_1.getObjectShape)(requestSchema); - const methodSchema = shape?.method; - if (!methodSchema) { - throw new Error('Schema is missing a method literal'); - } - // Extract literal value using type-safe property access - let methodValue; - if ((0, zod_compat_js_1.isZ4Schema)(methodSchema)) { - const v4Schema = methodSchema; - const v4Def = v4Schema._zod?.def; - methodValue = v4Def?.value ?? v4Schema.value; - } - else { - const v3Schema = methodSchema; - const legacyDef = v3Schema._def; - methodValue = legacyDef?.value ?? v3Schema.value; - } - if (typeof methodValue !== 'string') { - throw new Error('Schema method literal must be a string'); - } - const method = methodValue; - if (method === 'elicitation/create') { - const wrappedHandler = async (request, extra) => { - const validatedRequest = (0, zod_compat_js_1.safeParse)(types_js_1.ElicitRequestSchema, request); - if (!validatedRequest.success) { - // Type guard: if success is false, error is guaranteed to exist - const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid elicitation request: ${errorMessage}`); - } - const { params } = validatedRequest.data; - params.mode = params.mode ?? 'form'; - const { supportsFormMode, supportsUrlMode } = getSupportedElicitationModes(this._capabilities.elicitation); - if (params.mode === 'form' && !supportsFormMode) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, 'Client does not support form-mode elicitation requests'); - } - if (params.mode === 'url' && !supportsUrlMode) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, 'Client does not support URL-mode elicitation requests'); - } - const result = await Promise.resolve(handler(request, extra)); - // When task creation is requested, validate and return CreateTaskResult - if (params.task) { - const taskValidationResult = (0, zod_compat_js_1.safeParse)(types_js_1.CreateTaskResultSchema, result); - if (!taskValidationResult.success) { - const errorMessage = taskValidationResult.error instanceof Error - ? taskValidationResult.error.message - : String(taskValidationResult.error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`); - } - return taskValidationResult.data; - } - // For non-task requests, validate against ElicitResultSchema - const validationResult = (0, zod_compat_js_1.safeParse)(types_js_1.ElicitResultSchema, result); - if (!validationResult.success) { - // Type guard: if success is false, error is guaranteed to exist - const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid elicitation result: ${errorMessage}`); - } - const validatedResult = validationResult.data; - const requestedSchema = params.mode === 'form' ? params.requestedSchema : undefined; - if (params.mode === 'form' && validatedResult.action === 'accept' && validatedResult.content && requestedSchema) { - if (this._capabilities.elicitation?.form?.applyDefaults) { - try { - applyElicitationDefaults(requestedSchema, validatedResult.content); - } - catch { - // gracefully ignore errors in default application - } - } - } - return validatedResult; - }; - // Install the wrapped handler - return super.setRequestHandler(requestSchema, wrappedHandler); - } - if (method === 'sampling/createMessage') { - const wrappedHandler = async (request, extra) => { - const validatedRequest = (0, zod_compat_js_1.safeParse)(types_js_1.CreateMessageRequestSchema, request); - if (!validatedRequest.success) { - const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid sampling request: ${errorMessage}`); - } - const { params } = validatedRequest.data; - const result = await Promise.resolve(handler(request, extra)); - // When task creation is requested, validate and return CreateTaskResult - if (params.task) { - const taskValidationResult = (0, zod_compat_js_1.safeParse)(types_js_1.CreateTaskResultSchema, result); - if (!taskValidationResult.success) { - const errorMessage = taskValidationResult.error instanceof Error - ? taskValidationResult.error.message - : String(taskValidationResult.error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`); - } - return taskValidationResult.data; - } - // For non-task requests, validate against appropriate schema based on tools presence - const hasTools = params.tools || params.toolChoice; - const resultSchema = hasTools ? types_js_1.CreateMessageResultWithToolsSchema : types_js_1.CreateMessageResultSchema; - const validationResult = (0, zod_compat_js_1.safeParse)(resultSchema, result); - if (!validationResult.success) { - const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`); - } - return validationResult.data; - }; - // Install the wrapped handler - return super.setRequestHandler(requestSchema, wrappedHandler); - } - // Other handlers use default behavior - return super.setRequestHandler(requestSchema, handler); - } - assertCapability(capability, method) { - if (!this._serverCapabilities?.[capability]) { - throw new Error(`Server does not support ${capability} (required for ${method})`); - } - } - async connect(transport, options) { - await super.connect(transport); - // When transport sessionId is already set this means we are trying to reconnect. - // In this case we don't need to initialize again. - if (transport.sessionId !== undefined) { - return; - } - try { - const result = await this.request({ - method: 'initialize', - params: { - protocolVersion: types_js_1.LATEST_PROTOCOL_VERSION, - capabilities: this._capabilities, - clientInfo: this._clientInfo - } - }, types_js_1.InitializeResultSchema, options); - if (result === undefined) { - throw new Error(`Server sent invalid initialize result: ${result}`); - } - if (!types_js_1.SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) { - throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`); - } - this._serverCapabilities = result.capabilities; - this._serverVersion = result.serverInfo; - // HTTP transports must set the protocol version in each header after initialization. - if (transport.setProtocolVersion) { - transport.setProtocolVersion(result.protocolVersion); - } - this._instructions = result.instructions; - await this.notification({ - method: 'notifications/initialized' - }); - // Set up list changed handlers now that we know server capabilities - if (this._pendingListChangedConfig) { - this._setupListChangedHandlers(this._pendingListChangedConfig); - this._pendingListChangedConfig = undefined; - } - } - catch (error) { - // Disconnect if initialization fails. - void this.close(); - throw error; - } - } - /** - * After initialization has completed, this will be populated with the server's reported capabilities. - */ - getServerCapabilities() { - return this._serverCapabilities; - } - /** - * After initialization has completed, this will be populated with information about the server's name and version. - */ - getServerVersion() { - return this._serverVersion; - } - /** - * After initialization has completed, this may be populated with information about the server's instructions. - */ - getInstructions() { - return this._instructions; - } - assertCapabilityForMethod(method) { - switch (method) { - case 'logging/setLevel': - if (!this._serverCapabilities?.logging) { - throw new Error(`Server does not support logging (required for ${method})`); - } - break; - case 'prompts/get': - case 'prompts/list': - if (!this._serverCapabilities?.prompts) { - throw new Error(`Server does not support prompts (required for ${method})`); - } - break; - case 'resources/list': - case 'resources/templates/list': - case 'resources/read': - case 'resources/subscribe': - case 'resources/unsubscribe': - if (!this._serverCapabilities?.resources) { - throw new Error(`Server does not support resources (required for ${method})`); - } - if (method === 'resources/subscribe' && !this._serverCapabilities.resources.subscribe) { - throw new Error(`Server does not support resource subscriptions (required for ${method})`); - } - break; - case 'tools/call': - case 'tools/list': - if (!this._serverCapabilities?.tools) { - throw new Error(`Server does not support tools (required for ${method})`); - } - break; - case 'completion/complete': - if (!this._serverCapabilities?.completions) { - throw new Error(`Server does not support completions (required for ${method})`); - } - break; - case 'initialize': - // No specific capability required for initialize - break; - case 'ping': - // No specific capability required for ping - break; - } - } - assertNotificationCapability(method) { - switch (method) { - case 'notifications/roots/list_changed': - if (!this._capabilities.roots?.listChanged) { - throw new Error(`Client does not support roots list changed notifications (required for ${method})`); - } - break; - case 'notifications/initialized': - // No specific capability required for initialized - break; - case 'notifications/cancelled': - // Cancellation notifications are always allowed - break; - case 'notifications/progress': - // Progress notifications are always allowed - break; - } - } - assertRequestHandlerCapability(method) { - // Task handlers are registered in Protocol constructor before _capabilities is initialized - // Skip capability check for task methods during initialization - if (!this._capabilities) { - return; - } - switch (method) { - case 'sampling/createMessage': - if (!this._capabilities.sampling) { - throw new Error(`Client does not support sampling capability (required for ${method})`); - } - break; - case 'elicitation/create': - if (!this._capabilities.elicitation) { - throw new Error(`Client does not support elicitation capability (required for ${method})`); - } - break; - case 'roots/list': - if (!this._capabilities.roots) { - throw new Error(`Client does not support roots capability (required for ${method})`); - } - break; - case 'tasks/get': - case 'tasks/list': - case 'tasks/result': - case 'tasks/cancel': - if (!this._capabilities.tasks) { - throw new Error(`Client does not support tasks capability (required for ${method})`); - } - break; - case 'ping': - // No specific capability required for ping - break; - } - } - assertTaskCapability(method) { - (0, helpers_js_1.assertToolsCallTaskCapability)(this._serverCapabilities?.tasks?.requests, method, 'Server'); - } - assertTaskHandlerCapability(method) { - // Task handlers are registered in Protocol constructor before _capabilities is initialized - // Skip capability check for task methods during initialization - if (!this._capabilities) { - return; - } - (0, helpers_js_1.assertClientRequestTaskCapability)(this._capabilities.tasks?.requests, method, 'Client'); - } - async ping(options) { - return this.request({ method: 'ping' }, types_js_1.EmptyResultSchema, options); - } - async complete(params, options) { - return this.request({ method: 'completion/complete', params }, types_js_1.CompleteResultSchema, options); - } - async setLoggingLevel(level, options) { - return this.request({ method: 'logging/setLevel', params: { level } }, types_js_1.EmptyResultSchema, options); - } - async getPrompt(params, options) { - return this.request({ method: 'prompts/get', params }, types_js_1.GetPromptResultSchema, options); - } - async listPrompts(params, options) { - return this.request({ method: 'prompts/list', params }, types_js_1.ListPromptsResultSchema, options); - } - async listResources(params, options) { - return this.request({ method: 'resources/list', params }, types_js_1.ListResourcesResultSchema, options); - } - async listResourceTemplates(params, options) { - return this.request({ method: 'resources/templates/list', params }, types_js_1.ListResourceTemplatesResultSchema, options); - } - async readResource(params, options) { - return this.request({ method: 'resources/read', params }, types_js_1.ReadResourceResultSchema, options); - } - async subscribeResource(params, options) { - return this.request({ method: 'resources/subscribe', params }, types_js_1.EmptyResultSchema, options); - } - async unsubscribeResource(params, options) { - return this.request({ method: 'resources/unsubscribe', params }, types_js_1.EmptyResultSchema, options); - } - /** - * Calls a tool and waits for the result. Automatically validates structured output if the tool has an outputSchema. - * - * For task-based execution with streaming behavior, use client.experimental.tasks.callToolStream() instead. - */ - async callTool(params, resultSchema = types_js_1.CallToolResultSchema, options) { - // Guard: required-task tools need experimental API - if (this.isToolTaskRequired(params.name)) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidRequest, `Tool "${params.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`); - } - const result = await this.request({ method: 'tools/call', params }, resultSchema, options); - // Check if the tool has an outputSchema - const validator = this.getToolOutputValidator(params.name); - if (validator) { - // If tool has outputSchema, it MUST return structuredContent (unless it's an error) - if (!result.structuredContent && !result.isError) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`); - } - // Only validate structured content if present (not when there's an error) - if (result.structuredContent) { - try { - // Validate the structured content against the schema - const validationResult = validator(result.structuredContent); - if (!validationResult.valid) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`); - } - } - catch (error) { - if (error instanceof types_js_1.McpError) { - throw error; - } - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`); - } - } - } - return result; - } - isToolTask(toolName) { - if (!this._serverCapabilities?.tasks?.requests?.tools?.call) { - return false; - } - return this._cachedKnownTaskTools.has(toolName); - } - /** - * Check if a tool requires task-based execution. - * Unlike isToolTask which includes 'optional' tools, this only checks for 'required'. - */ - isToolTaskRequired(toolName) { - return this._cachedRequiredTaskTools.has(toolName); - } - /** - * Cache validators for tool output schemas. - * Called after listTools() to pre-compile validators for better performance. - */ - cacheToolMetadata(tools) { - this._cachedToolOutputValidators.clear(); - this._cachedKnownTaskTools.clear(); - this._cachedRequiredTaskTools.clear(); - for (const tool of tools) { - // If the tool has an outputSchema, create and cache the validator - if (tool.outputSchema) { - const toolValidator = this._jsonSchemaValidator.getValidator(tool.outputSchema); - this._cachedToolOutputValidators.set(tool.name, toolValidator); - } - // If the tool supports task-based execution, cache that information - const taskSupport = tool.execution?.taskSupport; - if (taskSupport === 'required' || taskSupport === 'optional') { - this._cachedKnownTaskTools.add(tool.name); - } - if (taskSupport === 'required') { - this._cachedRequiredTaskTools.add(tool.name); - } - } - } - /** - * Get cached validator for a tool - */ - getToolOutputValidator(toolName) { - return this._cachedToolOutputValidators.get(toolName); - } - async listTools(params, options) { - const result = await this.request({ method: 'tools/list', params }, types_js_1.ListToolsResultSchema, options); - // Cache the tools and their output schemas for future validation - this.cacheToolMetadata(result.tools); - return result; - } - /** - * Set up a single list changed handler. - * @internal - */ - _setupListChangedHandler(listType, notificationSchema, options, fetcher) { - // Validate options using Zod schema (validates autoRefresh and debounceMs) - const parseResult = types_js_1.ListChangedOptionsBaseSchema.safeParse(options); - if (!parseResult.success) { - throw new Error(`Invalid ${listType} listChanged options: ${parseResult.error.message}`); - } - // Validate callback - if (typeof options.onChanged !== 'function') { - throw new Error(`Invalid ${listType} listChanged options: onChanged must be a function`); - } - const { autoRefresh, debounceMs } = parseResult.data; - const { onChanged } = options; - const refresh = async () => { - if (!autoRefresh) { - onChanged(null, null); - return; - } - try { - const items = await fetcher(); - onChanged(null, items); - } - catch (e) { - const error = e instanceof Error ? e : new Error(String(e)); - onChanged(error, null); - } - }; - const handler = () => { - if (debounceMs) { - // Clear any pending debounce timer for this list type - const existingTimer = this._listChangedDebounceTimers.get(listType); - if (existingTimer) { - clearTimeout(existingTimer); - } - // Set up debounced refresh - const timer = setTimeout(refresh, debounceMs); - this._listChangedDebounceTimers.set(listType, timer); - } - else { - // No debounce, refresh immediately - refresh(); - } - }; - // Register notification handler - this.setNotificationHandler(notificationSchema, handler); - } - async sendRootsListChanged() { - return this.notification({ method: 'notifications/roots/list_changed' }); - } -} -exports.Client = Client; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js.map deleted file mode 100644 index 0601a04..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":";;;AA4HA,oEAgBC;AA5ID,uDAA+G;AAG/G,0CAiDqB;AACrB,mEAAuE;AAEvE,2DAQiC;AAEjC,+DAA0E;AAC1E,iEAAoH;AAEpH;;;;;GAKG;AACH,SAAS,wBAAwB,CAAC,MAAkC,EAAE,IAAa;IAC/E,IAAI,CAAC,MAAM,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO;IAEjE,2BAA2B;IAC3B,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,UAAU,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ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D;gBACtD,MAAM,aAAa,GAAG,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACpE,IAAI,aAAa,EAAE,CAAC;oBAChB,YAAY,CAAC,aAAa,CAAC,CAAC;gBAChC,CAAC;gBAED,2BAA2B;gBAC3B,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;gBAC9C,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YACzD,CAAC;iBAAM,CAAC;gBACJ,mCAAmC;gBACnC,OAAO,EAAE,CAAC;YACd,CAAC;QACL,CAAC,CAAC;QAEF,gCAAgC;QAChC,IAAI,CAAC,sBAAsB,CAAC,kBAAqC,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED,KAAK,CAAC,oBAAoB;QACtB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC7E,CAAC;CACJ;AAlqBD,wBAkqBC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.d.ts deleted file mode 100644 index 726ac57..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { OAuthClientProvider } from './auth.js'; -import { FetchLike } from '../shared/transport.js'; -/** - * Middleware function that wraps and enhances fetch functionality. - * Takes a fetch handler and returns an enhanced fetch handler. - */ -export type Middleware = (next: FetchLike) => FetchLike; -/** - * Creates a fetch wrapper that handles OAuth authentication automatically. - * - * This wrapper will: - * - Add Authorization headers with access tokens - * - Handle 401 responses by attempting re-authentication - * - Retry the original request after successful auth - * - Handle OAuth errors appropriately (InvalidClientError, etc.) - * - * The baseUrl parameter is optional and defaults to using the domain from the request URL. - * However, you should explicitly provide baseUrl when: - * - Making requests to multiple subdomains (e.g., api.example.com, cdn.example.com) - * - Using API paths that differ from OAuth discovery paths (e.g., requesting /api/v1/data but OAuth is at /) - * - The OAuth server is on a different domain than your API requests - * - You want to ensure consistent OAuth behavior regardless of request URLs - * - * For MCP transports, set baseUrl to the same URL you pass to the transport constructor. - * - * Note: This wrapper is designed for general-purpose fetch operations. - * MCP transports (SSE and StreamableHTTP) already have built-in OAuth handling - * and should not need this wrapper. - * - * @param provider - OAuth client provider for authentication - * @param baseUrl - Base URL for OAuth server discovery (defaults to request URL domain) - * @returns A fetch middleware function - */ -export declare const withOAuth: (provider: OAuthClientProvider, baseUrl?: string | URL) => Middleware; -/** - * Logger function type for HTTP requests - */ -export type RequestLogger = (input: { - method: string; - url: string | URL; - status: number; - statusText: string; - duration: number; - requestHeaders?: Headers; - responseHeaders?: Headers; - error?: Error; -}) => void; -/** - * Configuration options for the logging middleware - */ -export type LoggingOptions = { - /** - * Custom logger function, defaults to console logging - */ - logger?: RequestLogger; - /** - * Whether to include request headers in logs - * @default false - */ - includeRequestHeaders?: boolean; - /** - * Whether to include response headers in logs - * @default false - */ - includeResponseHeaders?: boolean; - /** - * Status level filter - only log requests with status >= this value - * Set to 0 to log all requests, 400 to log only errors - * @default 0 - */ - statusLevel?: number; -}; -/** - * Creates a fetch middleware that logs HTTP requests and responses. - * - * When called without arguments `withLogging()`, it uses the default logger that: - * - Logs successful requests (2xx) to `console.log` - * - Logs error responses (4xx/5xx) and network errors to `console.error` - * - Logs all requests regardless of status (statusLevel: 0) - * - Does not include request or response headers in logs - * - Measures and displays request duration in milliseconds - * - * Important: the default logger uses both `console.log` and `console.error` so it should not be used with - * `stdio` transports and applications. - * - * @param options - Logging configuration options - * @returns A fetch middleware function - */ -export declare const withLogging: (options?: LoggingOptions) => Middleware; -/** - * Composes multiple fetch middleware functions into a single middleware pipeline. - * Middleware are applied in the order they appear, creating a chain of handlers. - * - * @example - * ```typescript - * // Create a middleware pipeline that handles both OAuth and logging - * const enhancedFetch = applyMiddlewares( - * withOAuth(oauthProvider, 'https://api.example.com'), - * withLogging({ statusLevel: 400 }) - * )(fetch); - * - * // Use the enhanced fetch - it will handle auth and log errors - * const response = await enhancedFetch('https://api.example.com/data'); - * ``` - * - * @param middleware - Array of fetch middleware to compose into a pipeline - * @returns A single composed middleware function - */ -export declare const applyMiddlewares: (...middleware: Middleware[]) => Middleware; -/** - * Helper function to create custom fetch middleware with cleaner syntax. - * Provides the next handler and request details as separate parameters for easier access. - * - * @example - * ```typescript - * // Create custom authentication middleware - * const customAuthMiddleware = createMiddleware(async (next, input, init) => { - * const headers = new Headers(init?.headers); - * headers.set('X-Custom-Auth', 'my-token'); - * - * const response = await next(input, { ...init, headers }); - * - * if (response.status === 401) { - * console.log('Authentication failed'); - * } - * - * return response; - * }); - * - * // Create conditional middleware - * const conditionalMiddleware = createMiddleware(async (next, input, init) => { - * const url = typeof input === 'string' ? input : input.toString(); - * - * // Only add headers for API routes - * if (url.includes('/api/')) { - * const headers = new Headers(init?.headers); - * headers.set('X-API-Version', 'v2'); - * return next(input, { ...init, headers }); - * } - * - * // Pass through for non-API routes - * return next(input, init); - * }); - * - * // Create caching middleware - * const cacheMiddleware = createMiddleware(async (next, input, init) => { - * const cacheKey = typeof input === 'string' ? input : input.toString(); - * - * // Check cache first - * const cached = await getFromCache(cacheKey); - * if (cached) { - * return new Response(cached, { status: 200 }); - * } - * - * // Make request and cache result - * const response = await next(input, init); - * if (response.ok) { - * await saveToCache(cacheKey, await response.clone().text()); - * } - * - * return response; - * }); - * ``` - * - * @param handler - Function that receives the next handler and request parameters - * @returns A fetch middleware function - */ -export declare const createMiddleware: (handler: (next: FetchLike, input: string | URL, init?: RequestInit) => Promise) => Middleware; -//# sourceMappingURL=middleware.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.d.ts.map deleted file mode 100644 index 88ac778..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../src/client/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AACvG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,SAAS,aACP,mBAAmB,YAAY,MAAM,GAAG,GAAG,KAAG,UA0DxD,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB,KAAK,IAAI,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,aAAa,cAAc,KAAQ,UA6E1D,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,kBAAmB,UAAU,EAAE,KAAG,UAI9D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,gBAAgB,YAAa,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,KAAG,UAE3H,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.js deleted file mode 100644 index 4dae753..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.js +++ /dev/null @@ -1,252 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createMiddleware = exports.applyMiddlewares = exports.withLogging = exports.withOAuth = void 0; -const auth_js_1 = require("./auth.js"); -/** - * Creates a fetch wrapper that handles OAuth authentication automatically. - * - * This wrapper will: - * - Add Authorization headers with access tokens - * - Handle 401 responses by attempting re-authentication - * - Retry the original request after successful auth - * - Handle OAuth errors appropriately (InvalidClientError, etc.) - * - * The baseUrl parameter is optional and defaults to using the domain from the request URL. - * However, you should explicitly provide baseUrl when: - * - Making requests to multiple subdomains (e.g., api.example.com, cdn.example.com) - * - Using API paths that differ from OAuth discovery paths (e.g., requesting /api/v1/data but OAuth is at /) - * - The OAuth server is on a different domain than your API requests - * - You want to ensure consistent OAuth behavior regardless of request URLs - * - * For MCP transports, set baseUrl to the same URL you pass to the transport constructor. - * - * Note: This wrapper is designed for general-purpose fetch operations. - * MCP transports (SSE and StreamableHTTP) already have built-in OAuth handling - * and should not need this wrapper. - * - * @param provider - OAuth client provider for authentication - * @param baseUrl - Base URL for OAuth server discovery (defaults to request URL domain) - * @returns A fetch middleware function - */ -const withOAuth = (provider, baseUrl) => next => { - return async (input, init) => { - const makeRequest = async () => { - const headers = new Headers(init?.headers); - // Add authorization header if tokens are available - const tokens = await provider.tokens(); - if (tokens) { - headers.set('Authorization', `Bearer ${tokens.access_token}`); - } - return await next(input, { ...init, headers }); - }; - let response = await makeRequest(); - // Handle 401 responses by attempting re-authentication - if (response.status === 401) { - try { - const { resourceMetadataUrl, scope } = (0, auth_js_1.extractWWWAuthenticateParams)(response); - // Use provided baseUrl or extract from request URL - const serverUrl = baseUrl || (typeof input === 'string' ? new URL(input).origin : input.origin); - const result = await (0, auth_js_1.auth)(provider, { - serverUrl, - resourceMetadataUrl, - scope, - fetchFn: next - }); - if (result === 'REDIRECT') { - throw new auth_js_1.UnauthorizedError('Authentication requires user authorization - redirect initiated'); - } - if (result !== 'AUTHORIZED') { - throw new auth_js_1.UnauthorizedError(`Authentication failed with result: ${result}`); - } - // Retry the request with fresh tokens - response = await makeRequest(); - } - catch (error) { - if (error instanceof auth_js_1.UnauthorizedError) { - throw error; - } - throw new auth_js_1.UnauthorizedError(`Failed to re-authenticate: ${error instanceof Error ? error.message : String(error)}`); - } - } - // If we still have a 401 after re-auth attempt, throw an error - if (response.status === 401) { - const url = typeof input === 'string' ? input : input.toString(); - throw new auth_js_1.UnauthorizedError(`Authentication failed for ${url}`); - } - return response; - }; -}; -exports.withOAuth = withOAuth; -/** - * Creates a fetch middleware that logs HTTP requests and responses. - * - * When called without arguments `withLogging()`, it uses the default logger that: - * - Logs successful requests (2xx) to `console.log` - * - Logs error responses (4xx/5xx) and network errors to `console.error` - * - Logs all requests regardless of status (statusLevel: 0) - * - Does not include request or response headers in logs - * - Measures and displays request duration in milliseconds - * - * Important: the default logger uses both `console.log` and `console.error` so it should not be used with - * `stdio` transports and applications. - * - * @param options - Logging configuration options - * @returns A fetch middleware function - */ -const withLogging = (options = {}) => { - const { logger, includeRequestHeaders = false, includeResponseHeaders = false, statusLevel = 0 } = options; - const defaultLogger = input => { - const { method, url, status, statusText, duration, requestHeaders, responseHeaders, error } = input; - let message = error - ? `HTTP ${method} ${url} failed: ${error.message} (${duration}ms)` - : `HTTP ${method} ${url} ${status} ${statusText} (${duration}ms)`; - // Add headers to message if requested - if (includeRequestHeaders && requestHeaders) { - const reqHeaders = Array.from(requestHeaders.entries()) - .map(([key, value]) => `${key}: ${value}`) - .join(', '); - message += `\n Request Headers: {${reqHeaders}}`; - } - if (includeResponseHeaders && responseHeaders) { - const resHeaders = Array.from(responseHeaders.entries()) - .map(([key, value]) => `${key}: ${value}`) - .join(', '); - message += `\n Response Headers: {${resHeaders}}`; - } - if (error || status >= 400) { - // eslint-disable-next-line no-console - console.error(message); - } - else { - // eslint-disable-next-line no-console - console.log(message); - } - }; - const logFn = logger || defaultLogger; - return next => async (input, init) => { - const startTime = performance.now(); - const method = init?.method || 'GET'; - const url = typeof input === 'string' ? input : input.toString(); - const requestHeaders = includeRequestHeaders ? new Headers(init?.headers) : undefined; - try { - const response = await next(input, init); - const duration = performance.now() - startTime; - // Only log if status meets the log level threshold - if (response.status >= statusLevel) { - logFn({ - method, - url, - status: response.status, - statusText: response.statusText, - duration, - requestHeaders, - responseHeaders: includeResponseHeaders ? response.headers : undefined - }); - } - return response; - } - catch (error) { - const duration = performance.now() - startTime; - // Always log errors regardless of log level - logFn({ - method, - url, - status: 0, - statusText: 'Network Error', - duration, - requestHeaders, - error: error - }); - throw error; - } - }; -}; -exports.withLogging = withLogging; -/** - * Composes multiple fetch middleware functions into a single middleware pipeline. - * Middleware are applied in the order they appear, creating a chain of handlers. - * - * @example - * ```typescript - * // Create a middleware pipeline that handles both OAuth and logging - * const enhancedFetch = applyMiddlewares( - * withOAuth(oauthProvider, 'https://api.example.com'), - * withLogging({ statusLevel: 400 }) - * )(fetch); - * - * // Use the enhanced fetch - it will handle auth and log errors - * const response = await enhancedFetch('https://api.example.com/data'); - * ``` - * - * @param middleware - Array of fetch middleware to compose into a pipeline - * @returns A single composed middleware function - */ -const applyMiddlewares = (...middleware) => { - return next => { - return middleware.reduce((handler, mw) => mw(handler), next); - }; -}; -exports.applyMiddlewares = applyMiddlewares; -/** - * Helper function to create custom fetch middleware with cleaner syntax. - * Provides the next handler and request details as separate parameters for easier access. - * - * @example - * ```typescript - * // Create custom authentication middleware - * const customAuthMiddleware = createMiddleware(async (next, input, init) => { - * const headers = new Headers(init?.headers); - * headers.set('X-Custom-Auth', 'my-token'); - * - * const response = await next(input, { ...init, headers }); - * - * if (response.status === 401) { - * console.log('Authentication failed'); - * } - * - * return response; - * }); - * - * // Create conditional middleware - * const conditionalMiddleware = createMiddleware(async (next, input, init) => { - * const url = typeof input === 'string' ? input : input.toString(); - * - * // Only add headers for API routes - * if (url.includes('/api/')) { - * const headers = new Headers(init?.headers); - * headers.set('X-API-Version', 'v2'); - * return next(input, { ...init, headers }); - * } - * - * // Pass through for non-API routes - * return next(input, init); - * }); - * - * // Create caching middleware - * const cacheMiddleware = createMiddleware(async (next, input, init) => { - * const cacheKey = typeof input === 'string' ? input : input.toString(); - * - * // Check cache first - * const cached = await getFromCache(cacheKey); - * if (cached) { - * return new Response(cached, { status: 200 }); - * } - * - * // Make request and cache result - * const response = await next(input, init); - * if (response.ok) { - * await saveToCache(cacheKey, await response.clone().text()); - * } - * - * return response; - * }); - * ``` - * - * @param handler - Function that receives the next handler and request parameters - * @returns A fetch middleware function - */ -const createMiddleware = (handler) => { - return next => (input, init) => handler(next, input, init); -}; -exports.createMiddleware = createMiddleware; -//# sourceMappingURL=middleware.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.js.map deleted file mode 100644 index d28adff..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/client/middleware.ts"],"names":[],"mappings":";;;AAAA,uCAAuG;AASvG;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACI,MAAM,SAAS,GAClB,CAAC,QAA6B,EAAE,OAAsB,EAAc,EAAE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;;;;;;;;;;;;GAkBG;AACI,MAAM,gBAAgB,GAAG,CAAC,GAAG,UAAwB,EAAc,EAAE;IACxE,OAAO,IAAI,CAAC,EAAE;QACV,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC,CAAC;AACN,CAAC,CAAC;AAJW,QAAA,gBAAgB,oBAI3B;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACI,MAAM,gBAAgB,GAAG,CAAC,OAAwF,EAAc,EAAE;IACrI,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAqB,EAAE,IAAI,CAAC,CAAC;AAC/E,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.d.ts deleted file mode 100644 index acf99f1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { type ErrorEvent, type EventSourceInit } from 'eventsource'; -import { Transport, FetchLike } from '../shared/transport.js'; -import { JSONRPCMessage } from '../types.js'; -import { OAuthClientProvider } from './auth.js'; -export declare class SseError extends Error { - readonly code: number | undefined; - readonly event: ErrorEvent; - constructor(code: number | undefined, message: string | undefined, event: ErrorEvent); -} -/** - * Configuration options for the `SSEClientTransport`. - */ -export type SSEClientTransportOptions = { - /** - * An OAuth client provider to use for authentication. - * - * When an `authProvider` is specified and the SSE connection is started: - * 1. The connection is attempted with any existing access token from the `authProvider`. - * 2. If the access token has expired, the `authProvider` is used to refresh the token. - * 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`. - * - * After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `SSEClientTransport.finishAuth` with the authorization code before retrying the connection. - * - * If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown. - * - * `UnauthorizedError` might also be thrown when sending any message over the SSE transport, indicating that the session has expired, and needs to be re-authed and reconnected. - */ - authProvider?: OAuthClientProvider; - /** - * Customizes the initial SSE request to the server (the request that begins the stream). - * - * NOTE: Setting this property will prevent an `Authorization` header from - * being automatically attached to the SSE request, if an `authProvider` is - * also given. This can be worked around by setting the `Authorization` header - * manually. - */ - eventSourceInit?: EventSourceInit; - /** - * Customizes recurring POST requests to the server. - */ - requestInit?: RequestInit; - /** - * Custom fetch implementation used for all network requests. - */ - fetch?: FetchLike; -}; -/** - * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving - * messages and make separate POST requests for sending messages. - * @deprecated SSEClientTransport is deprecated. Prefer to use StreamableHTTPClientTransport where possible instead. Note that because some servers are still using SSE, clients may need to support both transports during the migration period. - */ -export declare class SSEClientTransport implements Transport { - private _eventSource?; - private _endpoint?; - private _abortController?; - private _url; - private _resourceMetadataUrl?; - private _scope?; - private _eventSourceInit?; - private _requestInit?; - private _authProvider?; - private _fetch?; - private _fetchWithInit; - private _protocolVersion?; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - constructor(url: URL, opts?: SSEClientTransportOptions); - private _authThenStart; - private _commonHeaders; - private _startOrAuth; - start(): Promise; - /** - * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. - */ - finishAuth(authorizationCode: string): Promise; - close(): Promise; - send(message: JSONRPCMessage): Promise; - setProtocolVersion(version: string): void; -} -//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.d.ts.map deleted file mode 100644 index 14ee939..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/client/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAyC,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAkD,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AAEnH,qBAAa,QAAS,SAAQ,KAAK;aAEX,IAAI,EAAE,MAAM,GAAG,SAAS;aAExB,KAAK,EAAE,UAAU;gBAFjB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS,EACX,KAAK,EAAE,UAAU;CAIxC;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAChD,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,SAAS,CAAC,CAAM;IACxB,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,CAAC,oBAAoB,CAAC,CAAM;IACnC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,aAAa,CAAC,CAAsB;IAC5C,OAAO,CAAC,MAAM,CAAC,CAAY;IAC3B,OAAO,CAAC,cAAc,CAAY;IAClC,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAElC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,yBAAyB;YAWxC,cAAc;YAyBd,cAAc;IAoB5B,OAAO,CAAC,YAAY;IAyEd,KAAK;IAQX;;OAEG;IACG,UAAU,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAkDlD,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG5C"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.js deleted file mode 100644 index 8ca8dad..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.js +++ /dev/null @@ -1,211 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SSEClientTransport = exports.SseError = void 0; -const eventsource_1 = require("eventsource"); -const transport_js_1 = require("../shared/transport.js"); -const types_js_1 = require("../types.js"); -const auth_js_1 = require("./auth.js"); -class SseError extends Error { - constructor(code, message, event) { - super(`SSE error: ${message}`); - this.code = code; - this.event = event; - } -} -exports.SseError = SseError; -/** - * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving - * messages and make separate POST requests for sending messages. - * @deprecated SSEClientTransport is deprecated. Prefer to use StreamableHTTPClientTransport where possible instead. Note that because some servers are still using SSE, clients may need to support both transports during the migration period. - */ -class SSEClientTransport { - constructor(url, opts) { - this._url = url; - this._resourceMetadataUrl = undefined; - this._scope = undefined; - this._eventSourceInit = opts?.eventSourceInit; - this._requestInit = opts?.requestInit; - this._authProvider = opts?.authProvider; - this._fetch = opts?.fetch; - this._fetchWithInit = (0, transport_js_1.createFetchWithInit)(opts?.fetch, opts?.requestInit); - } - async _authThenStart() { - if (!this._authProvider) { - throw new auth_js_1.UnauthorizedError('No auth provider'); - } - let result; - try { - result = await (0, auth_js_1.auth)(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - } - catch (error) { - this.onerror?.(error); - throw error; - } - if (result !== 'AUTHORIZED') { - throw new auth_js_1.UnauthorizedError(); - } - return await this._startOrAuth(); - } - async _commonHeaders() { - const headers = {}; - if (this._authProvider) { - const tokens = await this._authProvider.tokens(); - if (tokens) { - headers['Authorization'] = `Bearer ${tokens.access_token}`; - } - } - if (this._protocolVersion) { - headers['mcp-protocol-version'] = this._protocolVersion; - } - const extraHeaders = (0, transport_js_1.normalizeHeaders)(this._requestInit?.headers); - return new Headers({ - ...headers, - ...extraHeaders - }); - } - _startOrAuth() { - const fetchImpl = (this?._eventSourceInit?.fetch ?? this._fetch ?? fetch); - return new Promise((resolve, reject) => { - this._eventSource = new eventsource_1.EventSource(this._url.href, { - ...this._eventSourceInit, - fetch: async (url, init) => { - const headers = await this._commonHeaders(); - headers.set('Accept', 'text/event-stream'); - const response = await fetchImpl(url, { - ...init, - headers - }); - if (response.status === 401 && response.headers.has('www-authenticate')) { - const { resourceMetadataUrl, scope } = (0, auth_js_1.extractWWWAuthenticateParams)(response); - this._resourceMetadataUrl = resourceMetadataUrl; - this._scope = scope; - } - return response; - } - }); - this._abortController = new AbortController(); - this._eventSource.onerror = event => { - if (event.code === 401 && this._authProvider) { - this._authThenStart().then(resolve, reject); - return; - } - const error = new SseError(event.code, event.message, event); - reject(error); - this.onerror?.(error); - }; - this._eventSource.onopen = () => { - // The connection is open, but we need to wait for the endpoint to be received. - }; - this._eventSource.addEventListener('endpoint', (event) => { - const messageEvent = event; - try { - this._endpoint = new URL(messageEvent.data, this._url); - if (this._endpoint.origin !== this._url.origin) { - throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`); - } - } - catch (error) { - reject(error); - this.onerror?.(error); - void this.close(); - return; - } - resolve(); - }); - this._eventSource.onmessage = (event) => { - const messageEvent = event; - let message; - try { - message = types_js_1.JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data)); - } - catch (error) { - this.onerror?.(error); - return; - } - this.onmessage?.(message); - }; - }); - } - async start() { - if (this._eventSource) { - throw new Error('SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.'); - } - return await this._startOrAuth(); - } - /** - * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. - */ - async finishAuth(authorizationCode) { - if (!this._authProvider) { - throw new auth_js_1.UnauthorizedError('No auth provider'); - } - const result = await (0, auth_js_1.auth)(this._authProvider, { - serverUrl: this._url, - authorizationCode, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - if (result !== 'AUTHORIZED') { - throw new auth_js_1.UnauthorizedError('Failed to authorize'); - } - } - async close() { - this._abortController?.abort(); - this._eventSource?.close(); - this.onclose?.(); - } - async send(message) { - if (!this._endpoint) { - throw new Error('Not connected'); - } - try { - const headers = await this._commonHeaders(); - headers.set('content-type', 'application/json'); - const init = { - ...this._requestInit, - method: 'POST', - headers, - body: JSON.stringify(message), - signal: this._abortController?.signal - }; - const response = await (this._fetch ?? fetch)(this._endpoint, init); - if (!response.ok) { - const text = await response.text().catch(() => null); - if (response.status === 401 && this._authProvider) { - const { resourceMetadataUrl, scope } = (0, auth_js_1.extractWWWAuthenticateParams)(response); - this._resourceMetadataUrl = resourceMetadataUrl; - this._scope = scope; - const result = await (0, auth_js_1.auth)(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - if (result !== 'AUTHORIZED') { - throw new auth_js_1.UnauthorizedError(); - } - // Purposely _not_ awaited, so we don't call onerror twice - return this.send(message); - } - throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`); - } - // Release connection - POST responses don't have content we need - await response.body?.cancel(); - } - catch (error) { - this.onerror?.(error); - throw error; - } - } - setProtocolVersion(version) { - this._protocolVersion = version; - } -} -exports.SSEClientTransport = SSEClientTransport; -//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.js.map deleted file mode 100644 index daa8b98..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../../src/client/sse.ts"],"names":[],"mappings":";;;AAAA,6CAAiF;AACjF,yDAAqG;AACrG,0CAAmE;AACnE,uCAAmH;AAEnH,MAAa,QAAS,SAAQ,KAAK;IAC/B,YACoB,IAAwB,EACxC,OAA2B,EACX,KAAiB;QAEjC,KAAK,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QAJf,SAAI,GAAJ,IAAI,CAAoB;QAExB,UAAK,GAAL,KAAK,CAAY;IAGrC,CAAC;CACJ;AARD,4BAQC;AA2CD;;;;GAIG;AACH,MAAa,kBAAkB;IAkB3B,YAAY,GAAQ,EAAE,IAAgC;QAClD,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,gBAAgB,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AmB,EAAE,KAAK,EAAE,GAAG,IAAA,sCAA4B,EAAC,QAAQ,CAAC,CAAC;oBAC9E,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;oBAChD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;oBAEpB,MAAM,MAAM,GAAG,MAAM,IAAA,cAAI,EAAC,IAAI,CAAC,aAAa,EAAE;wBAC1C,SAAS,EAAE,IAAI,CAAC,IAAI;wBACpB,mBAAmB,EAAE,IAAI,CAAC,oBAAoB;wBAC9C,KAAK,EAAE,IAAI,CAAC,MAAM;wBAClB,OAAO,EAAE,IAAI,CAAC,cAAc;qBAC/B,CAAC,CAAC;oBACH,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;wBAC1B,MAAM,IAAI,2BAAiB,EAAE,CAAC;oBAClC,CAAC;oBAED,0DAA0D;oBAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC9B,CAAC;gBAED,MAAM,IAAI,KAAK,CAAC,mCAAmC,QAAQ,CAAC,MAAM,MAAM,IAAI,EAAE,CAAC,CAAC;YACpF,CAAC;YAED,iEAAiE;YACjE,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,EAAE,CAAC,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC;IAED,kBAAkB,CAAC,OAAe;QAC9B,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;IACpC,CAAC;CACJ;AA1OD,gDA0OC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts deleted file mode 100644 index a411dba..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { IOType } from 'node:child_process'; -import { Stream } from 'node:stream'; -import { Transport } from '../shared/transport.js'; -import { JSONRPCMessage } from '../types.js'; -export type StdioServerParameters = { - /** - * The executable to run to start the server. - */ - command: string; - /** - * Command line arguments to pass to the executable. - */ - args?: string[]; - /** - * The environment to use when spawning the process. - * - * If not specified, the result of getDefaultEnvironment() will be used. - */ - env?: Record; - /** - * How to handle stderr of the child process. This matches the semantics of Node's `child_process.spawn`. - * - * The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr. - */ - stderr?: IOType | Stream | number; - /** - * The working directory to use when spawning the process. - * - * If not specified, the current working directory will be inherited. - */ - cwd?: string; -}; -/** - * Environment variables to inherit by default, if an environment is not explicitly given. - */ -export declare const DEFAULT_INHERITED_ENV_VARS: string[]; -/** - * Returns a default environment object including only environment variables deemed safe to inherit. - */ -export declare function getDefaultEnvironment(): Record; -/** - * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. - * - * This transport is only available in Node.js environments. - */ -export declare class StdioClientTransport implements Transport { - private _process?; - private _readBuffer; - private _serverParams; - private _stderrStream; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - constructor(server: StdioServerParameters); - /** - * Starts the server process and prepares to communicate with it. - */ - start(): Promise; - /** - * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". - * - * If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to - * attach listeners before the start method is invoked. This prevents loss of any early - * error output emitted by the child process. - */ - get stderr(): Stream | null; - /** - * The child process pid spawned by this transport. - * - * This is only available after the transport has been started. - */ - get pid(): number | null; - private processReadBuffer; - close(): Promise; - send(message: JSONRPCMessage): Promise; -} -//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts.map deleted file mode 100644 index 73b267b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/client/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,qBAAqB,GAAG;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAElC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,UAiBuB,CAAC;AAE/D;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkB9D;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IAClD,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,aAAa,CAA4B;IAEjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,MAAM,EAAE,qBAAqB;IAOzC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqD5B;;;;;;OAMG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,IAAI,CAM1B;IAED;;;;OAIG;IACH,IAAI,GAAG,IAAI,MAAM,GAAG,IAAI,CAEvB;IAED,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyC5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAc/C"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js deleted file mode 100644 index ee48b40..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js +++ /dev/null @@ -1,199 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StdioClientTransport = exports.DEFAULT_INHERITED_ENV_VARS = void 0; -exports.getDefaultEnvironment = getDefaultEnvironment; -const cross_spawn_1 = __importDefault(require("cross-spawn")); -const node_process_1 = __importDefault(require("node:process")); -const node_stream_1 = require("node:stream"); -const stdio_js_1 = require("../shared/stdio.js"); -/** - * Environment variables to inherit by default, if an environment is not explicitly given. - */ -exports.DEFAULT_INHERITED_ENV_VARS = node_process_1.default.platform === 'win32' - ? [ - 'APPDATA', - 'HOMEDRIVE', - 'HOMEPATH', - 'LOCALAPPDATA', - 'PATH', - 'PROCESSOR_ARCHITECTURE', - 'SYSTEMDRIVE', - 'SYSTEMROOT', - 'TEMP', - 'USERNAME', - 'USERPROFILE', - 'PROGRAMFILES' - ] - : /* list inspired by the default env inheritance of sudo */ - ['HOME', 'LOGNAME', 'PATH', 'SHELL', 'TERM', 'USER']; -/** - * Returns a default environment object including only environment variables deemed safe to inherit. - */ -function getDefaultEnvironment() { - const env = {}; - for (const key of exports.DEFAULT_INHERITED_ENV_VARS) { - const value = node_process_1.default.env[key]; - if (value === undefined) { - continue; - } - if (value.startsWith('()')) { - // Skip functions, which are a security risk. - continue; - } - env[key] = value; - } - return env; -} -/** - * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. - * - * This transport is only available in Node.js environments. - */ -class StdioClientTransport { - constructor(server) { - this._readBuffer = new stdio_js_1.ReadBuffer(); - this._stderrStream = null; - this._serverParams = server; - if (server.stderr === 'pipe' || server.stderr === 'overlapped') { - this._stderrStream = new node_stream_1.PassThrough(); - } - } - /** - * Starts the server process and prepares to communicate with it. - */ - async start() { - if (this._process) { - throw new Error('StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.'); - } - return new Promise((resolve, reject) => { - this._process = (0, cross_spawn_1.default)(this._serverParams.command, this._serverParams.args ?? [], { - // merge default env with server env because mcp server needs some env vars - env: { - ...getDefaultEnvironment(), - ...this._serverParams.env - }, - stdio: ['pipe', 'pipe', this._serverParams.stderr ?? 'inherit'], - shell: false, - windowsHide: node_process_1.default.platform === 'win32' && isElectron(), - cwd: this._serverParams.cwd - }); - this._process.on('error', error => { - reject(error); - this.onerror?.(error); - }); - this._process.on('spawn', () => { - resolve(); - }); - this._process.on('close', _code => { - this._process = undefined; - this.onclose?.(); - }); - this._process.stdin?.on('error', error => { - this.onerror?.(error); - }); - this._process.stdout?.on('data', chunk => { - this._readBuffer.append(chunk); - this.processReadBuffer(); - }); - this._process.stdout?.on('error', error => { - this.onerror?.(error); - }); - if (this._stderrStream && this._process.stderr) { - this._process.stderr.pipe(this._stderrStream); - } - }); - } - /** - * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". - * - * If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to - * attach listeners before the start method is invoked. This prevents loss of any early - * error output emitted by the child process. - */ - get stderr() { - if (this._stderrStream) { - return this._stderrStream; - } - return this._process?.stderr ?? null; - } - /** - * The child process pid spawned by this transport. - * - * This is only available after the transport has been started. - */ - get pid() { - return this._process?.pid ?? null; - } - processReadBuffer() { - while (true) { - try { - const message = this._readBuffer.readMessage(); - if (message === null) { - break; - } - this.onmessage?.(message); - } - catch (error) { - this.onerror?.(error); - } - } - } - async close() { - if (this._process) { - const processToClose = this._process; - this._process = undefined; - const closePromise = new Promise(resolve => { - processToClose.once('close', () => { - resolve(); - }); - }); - try { - processToClose.stdin?.end(); - } - catch { - // ignore - } - await Promise.race([closePromise, new Promise(resolve => setTimeout(resolve, 2000).unref())]); - if (processToClose.exitCode === null) { - try { - processToClose.kill('SIGTERM'); - } - catch { - // ignore - } - await Promise.race([closePromise, new Promise(resolve => setTimeout(resolve, 2000).unref())]); - } - if (processToClose.exitCode === null) { - try { - processToClose.kill('SIGKILL'); - } - catch { - // ignore - } - } - } - this._readBuffer.clear(); - } - send(message) { - return new Promise(resolve => { - if (!this._process?.stdin) { - throw new Error('Not connected'); - } - const json = (0, stdio_js_1.serializeMessage)(message); - if (this._process.stdin.write(json)) { - resolve(); - } - else { - this._process.stdin.once('drain', resolve); - } - }); - } -} -exports.StdioClientTransport = StdioClientTransport; -function isElectron() { - return 'type' in node_process_1.default; -} -//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js.map deleted file mode 100644 index 40253bc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/client/stdio.ts"],"names":[],"mappings":";;;;;;AAkEA,sDAkBC;AAnFD,8DAAgC;AAChC,gEAAmC;AACnC,6CAAkD;AAClD,iDAAkE;AAqClE;;GAEG;AACU,QAAA,0BAA0B,GACnC,sBAAO,CAAC,QAAQ,KAAK,OAAO;IACxB,CAAC,CAAC;QACI,SAAS;QACT,WAAW;QACX,UAAU;QACV,cAAc;Q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IAED,IAAI,CAAC,OAAuB;QACxB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YACrC,CAAC;YAED,MAAM,IAAI,GAAG,IAAA,2BAAgB,EAAC,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClC,OAAO,EAAE,CAAC;YACd,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC/C,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAvKD,oDAuKC;AAED,SAAS,UAAU;IACf,OAAO,MAAM,IAAI,sBAAO,CAAC;AAC7B,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts deleted file mode 100644 index 6035b24..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { Transport, FetchLike } from '../shared/transport.js'; -import { JSONRPCMessage } from '../types.js'; -import { OAuthClientProvider } from './auth.js'; -export declare class StreamableHTTPError extends Error { - readonly code: number | undefined; - constructor(code: number | undefined, message: string | undefined); -} -/** - * Options for starting or authenticating an SSE connection - */ -export interface StartSSEOptions { - /** - * The resumption token used to continue long-running requests that were interrupted. - * - * This allows clients to reconnect and continue from where they left off. - */ - resumptionToken?: string; - /** - * A callback that is invoked when the resumption token changes. - * - * This allows clients to persist the latest token for potential reconnection. - */ - onresumptiontoken?: (token: string) => void; - /** - * Override Message ID to associate with the replay message - * so that response can be associate with the new resumed request. - */ - replayMessageId?: string | number; -} -/** - * Configuration options for reconnection behavior of the StreamableHTTPClientTransport. - */ -export interface StreamableHTTPReconnectionOptions { - /** - * Maximum backoff time between reconnection attempts in milliseconds. - * Default is 30000 (30 seconds). - */ - maxReconnectionDelay: number; - /** - * Initial backoff time between reconnection attempts in milliseconds. - * Default is 1000 (1 second). - */ - initialReconnectionDelay: number; - /** - * The factor by which the reconnection delay increases after each attempt. - * Default is 1.5. - */ - reconnectionDelayGrowFactor: number; - /** - * Maximum number of reconnection attempts before giving up. - * Default is 2. - */ - maxRetries: number; -} -/** - * Configuration options for the `StreamableHTTPClientTransport`. - */ -export type StreamableHTTPClientTransportOptions = { - /** - * An OAuth client provider to use for authentication. - * - * When an `authProvider` is specified and the connection is started: - * 1. The connection is attempted with any existing access token from the `authProvider`. - * 2. If the access token has expired, the `authProvider` is used to refresh the token. - * 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`. - * - * After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `StreamableHTTPClientTransport.finishAuth` with the authorization code before retrying the connection. - * - * If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown. - * - * `UnauthorizedError` might also be thrown when sending any message over the transport, indicating that the session has expired, and needs to be re-authed and reconnected. - */ - authProvider?: OAuthClientProvider; - /** - * Customizes HTTP requests to the server. - */ - requestInit?: RequestInit; - /** - * Custom fetch implementation used for all network requests. - */ - fetch?: FetchLike; - /** - * Options to configure the reconnection behavior. - */ - reconnectionOptions?: StreamableHTTPReconnectionOptions; - /** - * Session ID for the connection. This is used to identify the session on the server. - * When not provided and connecting to a server that supports session IDs, the server will generate a new session ID. - */ - sessionId?: string; -}; -/** - * Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. - * It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events - * for receiving messages. - */ -export declare class StreamableHTTPClientTransport implements Transport { - private _abortController?; - private _url; - private _resourceMetadataUrl?; - private _scope?; - private _requestInit?; - private _authProvider?; - private _fetch?; - private _fetchWithInit; - private _sessionId?; - private _reconnectionOptions; - private _protocolVersion?; - private _hasCompletedAuthFlow; - private _lastUpscopingHeader?; - private _serverRetryMs?; - private _reconnectionTimeout?; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - constructor(url: URL, opts?: StreamableHTTPClientTransportOptions); - private _authThenStart; - private _commonHeaders; - private _startOrAuthSse; - /** - * Calculates the next reconnection delay using backoff algorithm - * - * @param attempt Current reconnection attempt count for the specific stream - * @returns Time to wait in milliseconds before next reconnection attempt - */ - private _getNextReconnectionDelay; - /** - * Schedule a reconnection attempt using server-provided retry interval or backoff - * - * @param lastEventId The ID of the last received event for resumability - * @param attemptCount Current reconnection attempt count for this specific stream - */ - private _scheduleReconnection; - private _handleSseStream; - start(): Promise; - /** - * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. - */ - finishAuth(authorizationCode: string): Promise; - close(): Promise; - send(message: JSONRPCMessage | JSONRPCMessage[], options?: { - resumptionToken?: string; - onresumptiontoken?: (token: string) => void; - }): Promise; - get sessionId(): string | undefined; - /** - * Terminates the current session by sending a DELETE request to the server. - * - * Clients that no longer need a particular session - * (e.g., because the user is leaving the client application) SHOULD send an - * HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly - * terminate the session. - * - * The server MAY respond with HTTP 405 Method Not Allowed, indicating that - * the server does not allow clients to terminate sessions. - */ - terminateSession(): Promise; - setProtocolVersion(version: string): void; - get protocolVersion(): string | undefined; - /** - * Resume an SSE stream from a previous event ID. - * Opens a GET SSE connection with Last-Event-ID header to replay missed events. - * - * @param lastEventId The event ID to resume from - * @param options Optional callback to receive new resumption tokens - */ - resumeStream(lastEventId: string, options?: { - onresumptiontoken?: (token: string) => void; - }): Promise; -} -//# sourceMappingURL=streamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts.map deleted file mode 100644 index 5b6ffb8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../../src/client/streamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAyC,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAwE,cAAc,EAAwB,MAAM,aAAa,CAAC;AACzI,OAAO,EAAkD,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AAWnH,qBAAa,mBAAoB,SAAQ,KAAK;aAEtB,IAAI,EAAE,MAAM,GAAG,SAAS;gBAAxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS;CAIlC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAC9C;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,2BAA2B,EAAE,MAAM,CAAC;IAEpC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG;IAC/C;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;OAEG;IACH,WAAW,CAAC,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G,OAAO,CAAC,IAAI,CAAC;IAiBpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,CACN,OAAO,EAAE,cAAc,GAAG,cAAc,EAAE,EAC1C,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GACpF,OAAO,CAAC,IAAI,CAAC;IA0JhB,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED;;;;;;;;;;OAUG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BvC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAGzC,IAAI,eAAe,IAAI,MAAM,GAAG,SAAS,CAExC;IAED;;;;;;OAMG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAMpH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js deleted file mode 100644 index a29a7d3..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js +++ /dev/null @@ -1,482 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StreamableHTTPClientTransport = exports.StreamableHTTPError = void 0; -const transport_js_1 = require("../shared/transport.js"); -const types_js_1 = require("../types.js"); -const auth_js_1 = require("./auth.js"); -const stream_1 = require("eventsource-parser/stream"); -// Default reconnection options for StreamableHTTP connections -const DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = { - initialReconnectionDelay: 1000, - maxReconnectionDelay: 30000, - reconnectionDelayGrowFactor: 1.5, - maxRetries: 2 -}; -class StreamableHTTPError extends Error { - constructor(code, message) { - super(`Streamable HTTP error: ${message}`); - this.code = code; - } -} -exports.StreamableHTTPError = StreamableHTTPError; -/** - * Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. - * It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events - * for receiving messages. - */ -class StreamableHTTPClientTransport { - constructor(url, opts) { - this._hasCompletedAuthFlow = false; // Circuit breaker: detect auth success followed by immediate 401 - this._url = url; - this._resourceMetadataUrl = undefined; - this._scope = undefined; - this._requestInit = opts?.requestInit; - this._authProvider = opts?.authProvider; - this._fetch = opts?.fetch; - this._fetchWithInit = (0, transport_js_1.createFetchWithInit)(opts?.fetch, opts?.requestInit); - this._sessionId = opts?.sessionId; - this._reconnectionOptions = opts?.reconnectionOptions ?? DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS; - } - async _authThenStart() { - if (!this._authProvider) { - throw new auth_js_1.UnauthorizedError('No auth provider'); - } - let result; - try { - result = await (0, auth_js_1.auth)(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - } - catch (error) { - this.onerror?.(error); - throw error; - } - if (result !== 'AUTHORIZED') { - throw new auth_js_1.UnauthorizedError(); - } - return await this._startOrAuthSse({ resumptionToken: undefined }); - } - async _commonHeaders() { - const headers = {}; - if (this._authProvider) { - const tokens = await this._authProvider.tokens(); - if (tokens) { - headers['Authorization'] = `Bearer ${tokens.access_token}`; - } - } - if (this._sessionId) { - headers['mcp-session-id'] = this._sessionId; - } - if (this._protocolVersion) { - headers['mcp-protocol-version'] = this._protocolVersion; - } - const extraHeaders = (0, transport_js_1.normalizeHeaders)(this._requestInit?.headers); - return new Headers({ - ...headers, - ...extraHeaders - }); - } - async _startOrAuthSse(options) { - const { resumptionToken } = options; - try { - // Try to open an initial SSE stream with GET to listen for server messages - // This is optional according to the spec - server may not support it - const headers = await this._commonHeaders(); - headers.set('Accept', 'text/event-stream'); - // Include Last-Event-ID header for resumable streams if provided - if (resumptionToken) { - headers.set('last-event-id', resumptionToken); - } - const response = await (this._fetch ?? fetch)(this._url, { - method: 'GET', - headers, - signal: this._abortController?.signal - }); - if (!response.ok) { - await response.body?.cancel(); - if (response.status === 401 && this._authProvider) { - // Need to authenticate - return await this._authThenStart(); - } - // 405 indicates that the server does not offer an SSE stream at GET endpoint - // This is an expected case that should not trigger an error - if (response.status === 405) { - return; - } - throw new StreamableHTTPError(response.status, `Failed to open SSE stream: ${response.statusText}`); - } - this._handleSseStream(response.body, options, true); - } - catch (error) { - this.onerror?.(error); - throw error; - } - } - /** - * Calculates the next reconnection delay using backoff algorithm - * - * @param attempt Current reconnection attempt count for the specific stream - * @returns Time to wait in milliseconds before next reconnection attempt - */ - _getNextReconnectionDelay(attempt) { - // Use server-provided retry value if available - if (this._serverRetryMs !== undefined) { - return this._serverRetryMs; - } - // Fall back to exponential backoff - const initialDelay = this._reconnectionOptions.initialReconnectionDelay; - const growFactor = this._reconnectionOptions.reconnectionDelayGrowFactor; - const maxDelay = this._reconnectionOptions.maxReconnectionDelay; - // Cap at maximum delay - return Math.min(initialDelay * Math.pow(growFactor, attempt), maxDelay); - } - /** - * Schedule a reconnection attempt using server-provided retry interval or backoff - * - * @param lastEventId The ID of the last received event for resumability - * @param attemptCount Current reconnection attempt count for this specific stream - */ - _scheduleReconnection(options, attemptCount = 0) { - // Use provided options or default options - const maxRetries = this._reconnectionOptions.maxRetries; - // Check if we've exceeded maximum retry attempts - if (attemptCount >= maxRetries) { - this.onerror?.(new Error(`Maximum reconnection attempts (${maxRetries}) exceeded.`)); - return; - } - // Calculate next delay based on current attempt count - const delay = this._getNextReconnectionDelay(attemptCount); - // Schedule the reconnection - this._reconnectionTimeout = setTimeout(() => { - // Use the last event ID to resume where we left off - this._startOrAuthSse(options).catch(error => { - this.onerror?.(new Error(`Failed to reconnect SSE stream: ${error instanceof Error ? error.message : String(error)}`)); - // Schedule another attempt if this one failed, incrementing the attempt counter - this._scheduleReconnection(options, attemptCount + 1); - }); - }, delay); - } - _handleSseStream(stream, options, isReconnectable) { - if (!stream) { - return; - } - const { onresumptiontoken, replayMessageId } = options; - let lastEventId; - // Track whether we've received a priming event (event with ID) - // Per spec, server SHOULD send a priming event with ID before closing - let hasPrimingEvent = false; - // Track whether we've received a response - if so, no need to reconnect - // Reconnection is for when server disconnects BEFORE sending response - let receivedResponse = false; - const processStream = async () => { - // this is the closest we can get to trying to catch network errors - // if something happens reader will throw - try { - // Create a pipeline: binary stream -> text decoder -> SSE parser - const reader = stream - .pipeThrough(new TextDecoderStream()) - .pipeThrough(new stream_1.EventSourceParserStream({ - onRetry: (retryMs) => { - // Capture server-provided retry value for reconnection timing - this._serverRetryMs = retryMs; - } - })) - .getReader(); - while (true) { - const { value: event, done } = await reader.read(); - if (done) { - break; - } - // Update last event ID if provided - if (event.id) { - lastEventId = event.id; - // Mark that we've received a priming event - stream is now resumable - hasPrimingEvent = true; - onresumptiontoken?.(event.id); - } - // Skip events with no data (priming events, keep-alives) - if (!event.data) { - continue; - } - if (!event.event || event.event === 'message') { - try { - const message = types_js_1.JSONRPCMessageSchema.parse(JSON.parse(event.data)); - if ((0, types_js_1.isJSONRPCResultResponse)(message)) { - // Mark that we received a response - no need to reconnect for this request - receivedResponse = true; - if (replayMessageId !== undefined) { - message.id = replayMessageId; - } - } - this.onmessage?.(message); - } - catch (error) { - this.onerror?.(error); - } - } - } - // Handle graceful server-side disconnect - // Server may close connection after sending event ID and retry field - // Reconnect if: already reconnectable (GET stream) OR received a priming event (POST stream with event ID) - // BUT don't reconnect if we already received a response - the request is complete - const canResume = isReconnectable || hasPrimingEvent; - const needsReconnect = canResume && !receivedResponse; - if (needsReconnect && this._abortController && !this._abortController.signal.aborted) { - this._scheduleReconnection({ - resumptionToken: lastEventId, - onresumptiontoken, - replayMessageId - }, 0); - } - } - catch (error) { - // Handle stream errors - likely a network disconnect - this.onerror?.(new Error(`SSE stream disconnected: ${error}`)); - // Attempt to reconnect if the stream disconnects unexpectedly and we aren't closing - // Reconnect if: already reconnectable (GET stream) OR received a priming event (POST stream with event ID) - // BUT don't reconnect if we already received a response - the request is complete - const canResume = isReconnectable || hasPrimingEvent; - const needsReconnect = canResume && !receivedResponse; - if (needsReconnect && this._abortController && !this._abortController.signal.aborted) { - // Use the exponential backoff reconnection strategy - try { - this._scheduleReconnection({ - resumptionToken: lastEventId, - onresumptiontoken, - replayMessageId - }, 0); - } - catch (error) { - this.onerror?.(new Error(`Failed to reconnect: ${error instanceof Error ? error.message : String(error)}`)); - } - } - } - }; - processStream(); - } - async start() { - if (this._abortController) { - throw new Error('StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.'); - } - this._abortController = new AbortController(); - } - /** - * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. - */ - async finishAuth(authorizationCode) { - if (!this._authProvider) { - throw new auth_js_1.UnauthorizedError('No auth provider'); - } - const result = await (0, auth_js_1.auth)(this._authProvider, { - serverUrl: this._url, - authorizationCode, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - if (result !== 'AUTHORIZED') { - throw new auth_js_1.UnauthorizedError('Failed to authorize'); - } - } - async close() { - if (this._reconnectionTimeout) { - clearTimeout(this._reconnectionTimeout); - this._reconnectionTimeout = undefined; - } - this._abortController?.abort(); - this.onclose?.(); - } - async send(message, options) { - try { - const { resumptionToken, onresumptiontoken } = options || {}; - if (resumptionToken) { - // If we have at last event ID, we need to reconnect the SSE stream - this._startOrAuthSse({ resumptionToken, replayMessageId: (0, types_js_1.isJSONRPCRequest)(message) ? message.id : undefined }).catch(err => this.onerror?.(err)); - return; - } - const headers = await this._commonHeaders(); - headers.set('content-type', 'application/json'); - headers.set('accept', 'application/json, text/event-stream'); - const init = { - ...this._requestInit, - method: 'POST', - headers, - body: JSON.stringify(message), - signal: this._abortController?.signal - }; - const response = await (this._fetch ?? fetch)(this._url, init); - // Handle session ID received during initialization - const sessionId = response.headers.get('mcp-session-id'); - if (sessionId) { - this._sessionId = sessionId; - } - if (!response.ok) { - const text = await response.text().catch(() => null); - if (response.status === 401 && this._authProvider) { - // Prevent infinite recursion when server returns 401 after successful auth - if (this._hasCompletedAuthFlow) { - throw new StreamableHTTPError(401, 'Server returned 401 after successful authentication'); - } - const { resourceMetadataUrl, scope } = (0, auth_js_1.extractWWWAuthenticateParams)(response); - this._resourceMetadataUrl = resourceMetadataUrl; - this._scope = scope; - const result = await (0, auth_js_1.auth)(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - if (result !== 'AUTHORIZED') { - throw new auth_js_1.UnauthorizedError(); - } - // Mark that we completed auth flow - this._hasCompletedAuthFlow = true; - // Purposely _not_ awaited, so we don't call onerror twice - return this.send(message); - } - if (response.status === 403 && this._authProvider) { - const { resourceMetadataUrl, scope, error } = (0, auth_js_1.extractWWWAuthenticateParams)(response); - if (error === 'insufficient_scope') { - const wwwAuthHeader = response.headers.get('WWW-Authenticate'); - // Check if we've already tried upscoping with this header to prevent infinite loops. - if (this._lastUpscopingHeader === wwwAuthHeader) { - throw new StreamableHTTPError(403, 'Server returned 403 after trying upscoping'); - } - if (scope) { - this._scope = scope; - } - if (resourceMetadataUrl) { - this._resourceMetadataUrl = resourceMetadataUrl; - } - // Mark that upscoping was tried. - this._lastUpscopingHeader = wwwAuthHeader ?? undefined; - const result = await (0, auth_js_1.auth)(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetch - }); - if (result !== 'AUTHORIZED') { - throw new auth_js_1.UnauthorizedError(); - } - return this.send(message); - } - } - throw new StreamableHTTPError(response.status, `Error POSTing to endpoint: ${text}`); - } - // Reset auth loop flag on successful response - this._hasCompletedAuthFlow = false; - this._lastUpscopingHeader = undefined; - // If the response is 202 Accepted, there's no body to process - if (response.status === 202) { - await response.body?.cancel(); - // if the accepted notification is initialized, we start the SSE stream - // if it's supported by the server - if ((0, types_js_1.isInitializedNotification)(message)) { - // Start without a lastEventId since this is a fresh connection - this._startOrAuthSse({ resumptionToken: undefined }).catch(err => this.onerror?.(err)); - } - return; - } - // Get original message(s) for detecting request IDs - const messages = Array.isArray(message) ? message : [message]; - const hasRequests = messages.filter(msg => 'method' in msg && 'id' in msg && msg.id !== undefined).length > 0; - // Check the response type - const contentType = response.headers.get('content-type'); - if (hasRequests) { - if (contentType?.includes('text/event-stream')) { - // Handle SSE stream responses for requests - // We use the same handler as standalone streams, which now supports - // reconnection with the last event ID - this._handleSseStream(response.body, { onresumptiontoken }, false); - } - else if (contentType?.includes('application/json')) { - // For non-streaming servers, we might get direct JSON responses - const data = await response.json(); - const responseMessages = Array.isArray(data) - ? data.map(msg => types_js_1.JSONRPCMessageSchema.parse(msg)) - : [types_js_1.JSONRPCMessageSchema.parse(data)]; - for (const msg of responseMessages) { - this.onmessage?.(msg); - } - } - else { - await response.body?.cancel(); - throw new StreamableHTTPError(-1, `Unexpected content type: ${contentType}`); - } - } - else { - // No requests in message but got 200 OK - still need to release connection - await response.body?.cancel(); - } - } - catch (error) { - this.onerror?.(error); - throw error; - } - } - get sessionId() { - return this._sessionId; - } - /** - * Terminates the current session by sending a DELETE request to the server. - * - * Clients that no longer need a particular session - * (e.g., because the user is leaving the client application) SHOULD send an - * HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly - * terminate the session. - * - * The server MAY respond with HTTP 405 Method Not Allowed, indicating that - * the server does not allow clients to terminate sessions. - */ - async terminateSession() { - if (!this._sessionId) { - return; // No session to terminate - } - try { - const headers = await this._commonHeaders(); - const init = { - ...this._requestInit, - method: 'DELETE', - headers, - signal: this._abortController?.signal - }; - const response = await (this._fetch ?? fetch)(this._url, init); - await response.body?.cancel(); - // We specifically handle 405 as a valid response according to the spec, - // meaning the server does not support explicit session termination - if (!response.ok && response.status !== 405) { - throw new StreamableHTTPError(response.status, `Failed to terminate session: ${response.statusText}`); - } - this._sessionId = undefined; - } - catch (error) { - this.onerror?.(error); - throw error; - } - } - setProtocolVersion(version) { - this._protocolVersion = version; - } - get protocolVersion() { - return this._protocolVersion; - } - /** - * Resume an SSE stream from a previous event ID. - * Opens a GET SSE connection with Last-Event-ID header to replay missed events. - * - * @param lastEventId The event ID to resume from - * @param options Optional callback to receive new resumption tokens - */ - async resumeStream(lastEventId, options) { - await this._startOrAuthSse({ - resumptionToken: lastEventId, - onresumptiontoken: options?.onresumptiontoken - }); - } -} -exports.StreamableHTTPClientTransport = StreamableHTTPClientTransport; -//# sourceMappingURL=streamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js.map deleted file mode 100644 index 9e12cb7..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttp.js","sourceRoot":"","sources":["../../../src/client/streamableHttp.ts"],"names":[],"mappings":";;;AAAA,yDAAqG;AACrG,0CAAyI;AACzI,uCAAmH;AACnH,sDAAoE;AAEpE,8DAA8D;AAC9D,MAAM,4CAA4C,GAAsC;IACpF,wBAAwB,EAAE,IAAI;IAC9B,oBAAoB,EAAE,KAAK;IAC3B,2BAA2B,EAAE,GAAG;IAChC,UAAU,EAAE,CAAC;CAChB,CAAC;AAEF,MAAa,mBAAoB,SAAQ,KAAK;IAC1C,YACoB,IAAwB,EACxC,OAA2B;QAE3B,KAAK,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;QAH3B,SAAI,GAAJ,IAAI,CAAoB;IAI5C,CAAC;CACJ;AAPD,kDAOC;AAkGD;;;;GAIG;AACH,MAAa,6BAA6B;IAqBtC,YAAY,GAAQ,EAAE,IAA2C;QATzD,0BAAqB,GAAG,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/dist/cjs/client/websocket.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.d.ts deleted file mode 100644 index 78f95de..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Transport } from '../shared/transport.js'; -import { JSONRPCMessage } from '../types.js'; -/** - * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. - */ -export declare class WebSocketClientTransport implements Transport { - private _socket?; - private _url; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - constructor(url: URL); - start(): Promise; - close(): Promise; - send(message: JSONRPCMessage): Promise; -} -//# sourceMappingURL=websocket.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.d.ts.map deleted file mode 100644 index 2882d98..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../src/client/websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAInE;;GAEG;AACH,qBAAa,wBAAyB,YAAW,SAAS;IACtD,OAAO,CAAC,OAAO,CAAC,CAAY;IAC5B,OAAO,CAAC,IAAI,CAAM;IAElB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG;IAIpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAsChB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAW/C"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.js deleted file mode 100644 index 0cadb38..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WebSocketClientTransport = void 0; -const types_js_1 = require("../types.js"); -const SUBPROTOCOL = 'mcp'; -/** - * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. - */ -class WebSocketClientTransport { - constructor(url) { - this._url = url; - } - start() { - if (this._socket) { - throw new Error('WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.'); - } - return new Promise((resolve, reject) => { - this._socket = new WebSocket(this._url, SUBPROTOCOL); - this._socket.onerror = event => { - const error = 'error' in event ? event.error : new Error(`WebSocket error: ${JSON.stringify(event)}`); - reject(error); - this.onerror?.(error); - }; - this._socket.onopen = () => { - resolve(); - }; - this._socket.onclose = () => { - this.onclose?.(); - }; - this._socket.onmessage = (event) => { - let message; - try { - message = types_js_1.JSONRPCMessageSchema.parse(JSON.parse(event.data)); - } - catch (error) { - this.onerror?.(error); - return; - } - this.onmessage?.(message); - }; - }); - } - async close() { - this._socket?.close(); - } - send(message) { - return new Promise((resolve, reject) => { - if (!this._socket) { - reject(new Error('Not connected')); - return; - } - this._socket?.send(JSON.stringify(message)); - resolve(); - }); - } -} -exports.WebSocketClientTransport = WebSocketClientTransport; -//# sourceMappingURL=websocket.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.js.map deleted file mode 100644 index ff439d9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.js.map +++ /dev/null @@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AI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;gBACjE,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACb,IAAI,CAAC,OAAO,EAAE,CAAC,KAAc,CAAC,CAAC;oBAC/B,OAAO;gBACX,CAAC;gBAED,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC;YAC9B,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,OAAuB;QACxB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAChB,MAAM,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;gBACnC,OAAO;YACX,CAAC;YAED,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5C,OAAO,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAjED,4DAiEC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.d.ts deleted file mode 100644 index 611f6eb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=elicitationUrlExample.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.d.ts.map deleted file mode 100644 index e749adf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationUrlExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/elicitationUrlExample.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.js deleted file mode 100644 index cb4d58b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.js +++ /dev/null @@ -1,692 +0,0 @@ -"use strict"; -// Run with: npx tsx src/examples/client/elicitationUrlExample.ts -// -// This example demonstrates how to use URL elicitation to securely -// collect user input in a remote (HTTP) server. -// URL elicitation allows servers to prompt the end-user to open a URL in their browser -// to collect sensitive information. -Object.defineProperty(exports, "__esModule", { value: true }); -const index_js_1 = require("../../client/index.js"); -const streamableHttp_js_1 = require("../../client/streamableHttp.js"); -const node_readline_1 = require("node:readline"); -const types_js_1 = require("../../types.js"); -const metadataUtils_js_1 = require("../../shared/metadataUtils.js"); -const node_child_process_1 = require("node:child_process"); -const simpleOAuthClientProvider_js_1 = require("./simpleOAuthClientProvider.js"); -const auth_js_1 = require("../../client/auth.js"); -const node_http_1 = require("node:http"); -// Set up OAuth (required for this example) -const OAUTH_CALLBACK_PORT = 8090; // Use different port than auth server (3001) -const OAUTH_CALLBACK_URL = `http://localhost:${OAUTH_CALLBACK_PORT}/callback`; -let oauthProvider = undefined; -console.log('Getting OAuth token...'); -const clientMetadata = { - client_name: 'Elicitation MCP Client', - redirect_uris: [OAUTH_CALLBACK_URL], - grant_types: ['authorization_code', 'refresh_token'], - response_types: ['code'], - token_endpoint_auth_method: 'client_secret_post', - scope: 'mcp:tools' -}; -oauthProvider = new simpleOAuthClientProvider_js_1.InMemoryOAuthClientProvider(OAUTH_CALLBACK_URL, clientMetadata, (redirectUrl) => { - console.log(`🌐 Opening browser for OAuth redirect: ${redirectUrl.toString()}`); - openBrowser(redirectUrl.toString()); -}); -// Create readline interface for user input -const readline = (0, node_readline_1.createInterface)({ - input: process.stdin, - output: process.stdout -}); -let abortCommand = new AbortController(); -// Global client and transport for interactive commands -let client = null; -let transport = null; -let serverUrl = 'http://localhost:3000/mcp'; -let sessionId = undefined; -let isProcessingCommand = false; -let isProcessingElicitations = false; -const elicitationQueue = []; -let elicitationQueueSignal = null; -let elicitationsCompleteSignal = null; -// Map to track pending URL elicitations waiting for completion notifications -const pendingURLElicitations = new Map(); -async function main() { - console.log('MCP Interactive Client'); - console.log('====================='); - // Connect to server immediately with default settings - await connect(); - // Start the elicitation loop in the background - elicitationLoop().catch(error => { - console.error('Unexpected error in elicitation loop:', error); - process.exit(1); - }); - // Short delay allowing the server to send any SSE elicitations on connection - await new Promise(resolve => setTimeout(resolve, 200)); - // Wait until we are done processing any initial elicitations - await waitForElicitationsToComplete(); - // Print help and start the command loop - printHelp(); - await commandLoop(); -} -async function waitForElicitationsToComplete() { - // Wait until the queue is empty and nothing is being processed - while (elicitationQueue.length > 0 || isProcessingElicitations) { - await new Promise(resolve => setTimeout(resolve, 100)); - } -} -function printHelp() { - console.log('\nAvailable commands:'); - console.log(' connect [url] - Connect to MCP server (default: http://localhost:3000/mcp)'); - console.log(' disconnect - Disconnect from server'); - console.log(' terminate-session - Terminate the current session'); - console.log(' reconnect - Reconnect to the server'); - console.log(' list-tools - List available tools'); - console.log(' call-tool [args] - Call a tool with optional JSON arguments'); - console.log(' payment-confirm - Test URL elicitation via error response with payment-confirm tool'); - console.log(' third-party-auth - Test tool that requires third-party OAuth credentials'); - console.log(' help - Show this help'); - console.log(' quit - Exit the program'); -} -async function commandLoop() { - await new Promise(resolve => { - if (!isProcessingElicitations) { - resolve(); - } - else { - elicitationsCompleteSignal = resolve; - } - }); - readline.question('\n> ', { signal: abortCommand.signal }, async (input) => { - isProcessingCommand = true; - const args = input.trim().split(/\s+/); - const command = args[0]?.toLowerCase(); - try { - switch (command) { - case 'connect': - await connect(args[1]); - break; - case 'disconnect': - await disconnect(); - break; - case 'terminate-session': - await terminateSession(); - break; - case 'reconnect': - await reconnect(); - break; - case 'list-tools': - await listTools(); - break; - case 'call-tool': - if (args.length < 2) { - console.log('Usage: call-tool [args]'); - } - else { - const toolName = args[1]; - let toolArgs = {}; - if (args.length > 2) { - try { - toolArgs = JSON.parse(args.slice(2).join(' ')); - } - catch { - console.log('Invalid JSON arguments. Using empty args.'); - } - } - await callTool(toolName, toolArgs); - } - break; - case 'payment-confirm': - await callPaymentConfirmTool(); - break; - case 'third-party-auth': - await callThirdPartyAuthTool(); - break; - case 'help': - printHelp(); - break; - case 'quit': - case 'exit': - await cleanup(); - return; - default: - if (command) { - console.log(`Unknown command: ${command}`); - } - break; - } - } - catch (error) { - console.error(`Error executing command: ${error}`); - } - finally { - isProcessingCommand = false; - } - // Process another command after we've processed the this one - await commandLoop(); - }); -} -async function elicitationLoop() { - while (true) { - // Wait until we have elicitations to process - await new Promise(resolve => { - if (elicitationQueue.length > 0) { - resolve(); - } - else { - elicitationQueueSignal = resolve; - } - }); - isProcessingElicitations = true; - abortCommand.abort(); // Abort the command loop if it's running - // Process all queued elicitations - while (elicitationQueue.length > 0) { - const queued = elicitationQueue.shift(); - console.log(`📤 Processing queued elicitation (${elicitationQueue.length} remaining)`); - try { - const result = await handleElicitationRequest(queued.request); - queued.resolve(result); - } - catch (error) { - queued.reject(error instanceof Error ? error : new Error(String(error))); - } - } - console.log('✅ All queued elicitations processed. Resuming command loop...\n'); - isProcessingElicitations = false; - // Reset the abort controller for the next command loop - abortCommand = new AbortController(); - // Resume the command loop - if (elicitationsCompleteSignal) { - elicitationsCompleteSignal(); - elicitationsCompleteSignal = null; - } - } -} -async function openBrowser(url) { - const command = `open "${url}"`; - (0, node_child_process_1.exec)(command, error => { - if (error) { - console.error(`Failed to open browser: ${error.message}`); - console.log(`Please manually open: ${url}`); - } - }); -} -/** - * Enqueues an elicitation request and returns the result. - * - * This function is used so that our CLI (which can only handle one input request at a time) - * can handle elicitation requests and the command loop. - * - * @param request - The elicitation request to be handled - * @returns The elicitation result - */ -async function elicitationRequestHandler(request) { - // If we are processing a command, handle this elicitation immediately - if (isProcessingCommand) { - console.log('📋 Processing elicitation immediately (during command execution)'); - return await handleElicitationRequest(request); - } - // Otherwise, queue the request to be handled by the elicitation loop - console.log(`📥 Queueing elicitation request (queue size will be: ${elicitationQueue.length + 1})`); - return new Promise((resolve, reject) => { - elicitationQueue.push({ - request, - resolve, - reject - }); - // Signal the elicitation loop that there's work to do - if (elicitationQueueSignal) { - elicitationQueueSignal(); - elicitationQueueSignal = null; - } - }); -} -/** - * Handles an elicitation request. - * - * This function is used to handle the elicitation request and return the result. - * - * @param request - The elicitation request to be handled - * @returns The elicitation result - */ -async function handleElicitationRequest(request) { - const mode = request.params.mode; - console.log('\n🔔 Elicitation Request Received:'); - console.log(`Mode: ${mode}`); - if (mode === 'url') { - return { - action: await handleURLElicitation(request.params) - }; - } - else { - // Should not happen because the client declares its capabilities to the server, - // but being defensive is a good practice: - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Unsupported elicitation mode: ${mode}`); - } -} -/** - * Handles a URL elicitation by opening the URL in the browser. - * - * Note: This is a shared code for both request handlers and error handlers. - * As a result of sharing schema, there is no big forking of logic for the client. - * - * @param params - The URL elicitation request parameters - * @returns The action to take (accept, cancel, or decline) - */ -async function handleURLElicitation(params) { - const url = params.url; - const elicitationId = params.elicitationId; - const message = params.message; - console.log(`🆔 Elicitation ID: ${elicitationId}`); // Print for illustration - // Parse URL to show domain for security - let domain = 'unknown domain'; - try { - const parsedUrl = new URL(url); - domain = parsedUrl.hostname; - } - catch { - console.error('Invalid URL provided by server'); - return 'decline'; - } - // Example security warning to help prevent phishing attacks - console.log('\n⚠️ \x1b[33mSECURITY WARNING\x1b[0m ⚠️'); - console.log('\x1b[33mThe server is requesting you to open an external URL.\x1b[0m'); - console.log('\x1b[33mOnly proceed if you trust this server and understand why it needs this.\x1b[0m\n'); - console.log(`🌐 Target domain: \x1b[36m${domain}\x1b[0m`); - console.log(`🔗 Full URL: \x1b[36m${url}\x1b[0m`); - console.log(`\nℹ️ Server's reason:\n\n\x1b[36m${message}\x1b[0m\n`); - // 1. Ask for user consent to open the URL - const consent = await new Promise(resolve => { - readline.question('\nDo you want to open this URL in your browser? (y/n): ', input => { - resolve(input.trim().toLowerCase()); - }); - }); - // 2. If user did not consent, return appropriate result - if (consent === 'no' || consent === 'n') { - console.log('❌ URL navigation declined.'); - return 'decline'; - } - else if (consent !== 'yes' && consent !== 'y') { - console.log('🚫 Invalid response. Cancelling elicitation.'); - return 'cancel'; - } - // 3. Wait for completion notification in the background - const completionPromise = new Promise((resolve, reject) => { - const timeout = setTimeout(() => { - pendingURLElicitations.delete(elicitationId); - console.log(`\x1b[31m❌ Elicitation ${elicitationId} timed out waiting for completion.\x1b[0m`); - reject(new Error('Elicitation completion timeout')); - }, 5 * 60 * 1000); // 5 minute timeout - pendingURLElicitations.set(elicitationId, { - resolve: () => { - clearTimeout(timeout); - resolve(); - }, - reject, - timeout - }); - }); - completionPromise.catch(error => { - console.error('Background completion wait failed:', error); - }); - // 4. Open the URL in the browser - console.log(`\n🚀 Opening browser to: ${url}`); - await openBrowser(url); - console.log('\n⏳ Waiting for you to complete the interaction in your browser...'); - console.log(' The server will send a notification once you complete the action.'); - // 5. Acknowledge the user accepted the elicitation - return 'accept'; -} -/** - * Example OAuth callback handler - in production, use a more robust approach - * for handling callbacks and storing tokens - */ -/** - * Starts a temporary HTTP server to receive the OAuth callback - */ -async function waitForOAuthCallback() { - return new Promise((resolve, reject) => { - const server = (0, node_http_1.createServer)((req, res) => { - // Ignore favicon requests - if (req.url === '/favicon.ico') { - res.writeHead(404); - res.end(); - return; - } - console.log(`📥 Received callback: ${req.url}`); - const parsedUrl = new URL(req.url || '', 'http://localhost'); - const code = parsedUrl.searchParams.get('code'); - const error = parsedUrl.searchParams.get('error'); - if (code) { - console.log(`✅ Authorization code received: ${code?.substring(0, 10)}...`); - res.writeHead(200, { 'Content-Type': 'text/html' }); - res.end(` - - -

Authorization Successful!

-

This simulates successful authorization of the MCP client, which now has an access token for the MCP server.

-

This window will close automatically in 10 seconds.

- - - - `); - resolve(code); - setTimeout(() => server.close(), 15000); - } - else if (error) { - console.log(`❌ Authorization error: ${error}`); - res.writeHead(400, { 'Content-Type': 'text/html' }); - res.end(` - - -

Authorization Failed

-

Error: ${error}

- - - `); - reject(new Error(`OAuth authorization failed: ${error}`)); - } - else { - console.log(`❌ No authorization code or error in callback`); - res.writeHead(400); - res.end('Bad request'); - reject(new Error('No authorization code provided')); - } - }); - server.listen(OAUTH_CALLBACK_PORT, () => { - console.log(`OAuth callback server started on http://localhost:${OAUTH_CALLBACK_PORT}`); - }); - }); -} -/** - * Attempts to connect to the MCP server with OAuth authentication. - * Handles OAuth flow recursively if authorization is required. - */ -async function attemptConnection(oauthProvider) { - console.log('🚢 Creating transport with OAuth provider...'); - const baseUrl = new URL(serverUrl); - transport = new streamableHttp_js_1.StreamableHTTPClientTransport(baseUrl, { - sessionId: sessionId, - authProvider: oauthProvider - }); - console.log('🚢 Transport created'); - try { - console.log('🔌 Attempting connection (this will trigger OAuth redirect if needed)...'); - await client.connect(transport); - sessionId = transport.sessionId; - console.log('Transport created with session ID:', sessionId); - console.log('✅ Connected successfully'); - } - catch (error) { - if (error instanceof auth_js_1.UnauthorizedError) { - console.log('🔐 OAuth required - waiting for authorization...'); - const callbackPromise = waitForOAuthCallback(); - const authCode = await callbackPromise; - await transport.finishAuth(authCode); - console.log('🔐 Authorization code received:', authCode); - console.log('🔌 Reconnecting with authenticated transport...'); - // Recursively retry connection after OAuth completion - await attemptConnection(oauthProvider); - } - else { - console.error('❌ Connection failed with non-auth error:', error); - throw error; - } - } -} -async function connect(url) { - if (client) { - console.log('Already connected. Disconnect first.'); - return; - } - if (url) { - serverUrl = url; - } - console.log(`🔗 Attempting to connect to ${serverUrl}...`); - // Create a new client with elicitation capability - console.log('👤 Creating MCP client...'); - client = new index_js_1.Client({ - name: 'example-client', - version: '1.0.0' - }, { - capabilities: { - elicitation: { - // Only URL elicitation is supported in this demo - // (see server/elicitationExample.ts for a demo of form mode elicitation) - url: {} - } - } - }); - console.log('👤 Client created'); - // Set up elicitation request handler with proper validation - client.setRequestHandler(types_js_1.ElicitRequestSchema, elicitationRequestHandler); - // Set up notification handler for elicitation completion - client.setNotificationHandler(types_js_1.ElicitationCompleteNotificationSchema, notification => { - const { elicitationId } = notification.params; - const pending = pendingURLElicitations.get(elicitationId); - if (pending) { - clearTimeout(pending.timeout); - pendingURLElicitations.delete(elicitationId); - console.log(`\x1b[32m✅ Elicitation ${elicitationId} completed!\x1b[0m`); - pending.resolve(); - } - else { - // Shouldn't happen - discard it! - console.warn(`Received completion notification for unknown elicitation: ${elicitationId}`); - } - }); - try { - console.log('🔐 Starting OAuth flow...'); - await attemptConnection(oauthProvider); - console.log('Connected to MCP server'); - // Set up error handler after connection is established so we don't double log errors - client.onerror = error => { - console.error('\x1b[31mClient error:', error, '\x1b[0m'); - }; - } - catch (error) { - console.error('Failed to connect:', error); - client = null; - transport = null; - return; - } -} -async function disconnect() { - if (!client || !transport) { - console.log('Not connected.'); - return; - } - try { - await transport.close(); - console.log('Disconnected from MCP server'); - client = null; - transport = null; - } - catch (error) { - console.error('Error disconnecting:', error); - } -} -async function terminateSession() { - if (!client || !transport) { - console.log('Not connected.'); - return; - } - try { - console.log('Terminating session with ID:', transport.sessionId); - await transport.terminateSession(); - console.log('Session terminated successfully'); - // Check if sessionId was cleared after termination - if (!transport.sessionId) { - console.log('Session ID has been cleared'); - sessionId = undefined; - // Also close the transport and clear client objects - await transport.close(); - console.log('Transport closed after session termination'); - client = null; - transport = null; - } - else { - console.log('Server responded with 405 Method Not Allowed (session termination not supported)'); - console.log('Session ID is still active:', transport.sessionId); - } - } - catch (error) { - console.error('Error terminating session:', error); - } -} -async function reconnect() { - if (client) { - await disconnect(); - } - await connect(); -} -async function listTools() { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const toolsRequest = { - method: 'tools/list', - params: {} - }; - const toolsResult = await client.request(toolsRequest, types_js_1.ListToolsResultSchema); - console.log('Available tools:'); - if (toolsResult.tools.length === 0) { - console.log(' No tools available'); - } - else { - for (const tool of toolsResult.tools) { - console.log(` - id: ${tool.name}, name: ${(0, metadataUtils_js_1.getDisplayName)(tool)}, description: ${tool.description}`); - } - } - } - catch (error) { - console.log(`Tools not supported by this server (${error})`); - } -} -async function callTool(name, args) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const request = { - method: 'tools/call', - params: { - name, - arguments: args - } - }; - console.log(`Calling tool '${name}' with args:`, args); - const result = await client.request(request, types_js_1.CallToolResultSchema); - console.log('Tool result:'); - const resourceLinks = []; - result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else if (item.type === 'resource_link') { - const resourceLink = item; - resourceLinks.push(resourceLink); - console.log(` 📁 Resource Link: ${resourceLink.name}`); - console.log(` URI: ${resourceLink.uri}`); - if (resourceLink.mimeType) { - console.log(` Type: ${resourceLink.mimeType}`); - } - if (resourceLink.description) { - console.log(` Description: ${resourceLink.description}`); - } - } - else if (item.type === 'resource') { - console.log(` [Embedded Resource: ${item.resource.uri}]`); - } - else if (item.type === 'image') { - console.log(` [Image: ${item.mimeType}]`); - } - else if (item.type === 'audio') { - console.log(` [Audio: ${item.mimeType}]`); - } - else { - console.log(` [Unknown content type]:`, item); - } - }); - // Offer to read resource links - if (resourceLinks.length > 0) { - console.log(`\nFound ${resourceLinks.length} resource link(s). Use 'read-resource ' to read their content.`); - } - } - catch (error) { - if (error instanceof types_js_1.UrlElicitationRequiredError) { - console.log('\n🔔 Elicitation Required Error Received:'); - console.log(`Message: ${error.message}`); - for (const e of error.elicitations) { - await handleURLElicitation(e); // For the error handler, we discard the action result because we don't respond to an error response - } - return; - } - console.log(`Error calling tool ${name}: ${error}`); - } -} -async function cleanup() { - if (client && transport) { - try { - // First try to terminate the session gracefully - if (transport.sessionId) { - try { - console.log('Terminating session before exit...'); - await transport.terminateSession(); - console.log('Session terminated successfully'); - } - catch (error) { - console.error('Error terminating session:', error); - } - } - // Then close the transport - await transport.close(); - } - catch (error) { - console.error('Error closing transport:', error); - } - } - process.stdin.setRawMode(false); - readline.close(); - console.log('\nGoodbye!'); - process.exit(0); -} -async function callPaymentConfirmTool() { - console.log('Calling payment-confirm tool...'); - await callTool('payment-confirm', { cartId: 'cart_123' }); -} -async function callThirdPartyAuthTool() { - console.log('Calling third-party-auth tool...'); - await callTool('third-party-auth', { param1: 'test' }); -} -// Set up raw mode for keyboard input to capture Escape key -process.stdin.setRawMode(true); -process.stdin.on('data', async (data) => { - // Check for Escape key (27) - if (data.length === 1 && data[0] === 27) { - console.log('\nESC key pressed. Disconnecting from server...'); - // Abort current operation and disconnect from server - if (client && transport) { - await disconnect(); - console.log('Disconnected. Press Enter to continue.'); - } - else { - console.log('Not connected to server.'); - } - // Re-display the prompt - process.stdout.write('> '); - } -}); -// Handle Ctrl+C -process.on('SIGINT', async () => { - console.log('\nReceived SIGINT. Cleaning up...'); - await cleanup(); -}); -// Start the interactive client -main().catch((error) => { - console.error('Error running MCP client:', error); - process.exit(1); -}); -//# sourceMappingURL=elicitationUrlExample.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.js.map deleted file mode 100644 index fd32734..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/elicitationUrlExample.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationUrlExample.js","sourceRoot":"","sources":["../../../../src/examples/client/elicitationUrlExample.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,EAAE;AACF,mEAAmE;AACnE,gDAAgD;AAChD,uFAAuF;AACvF,oCAAoC;;AAEpC,oDAA+C;AAC/C,sEA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ACpB,CAAC,CAAC,CAAC;AAEH,+BAA+B;AAC/B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.d.ts deleted file mode 100644 index 0ac5af8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=multipleClientsParallel.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.d.ts.map deleted file mode 100644 index 91051dc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"multipleClientsParallel.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/multipleClientsParallel.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.js deleted file mode 100644 index 5cfbb2f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.js +++ /dev/null @@ -1,134 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const index_js_1 = require("../../client/index.js"); -const streamableHttp_js_1 = require("../../client/streamableHttp.js"); -const types_js_1 = require("../../types.js"); -/** - * Multiple Clients MCP Example - * - * This client demonstrates how to: - * 1. Create multiple MCP clients in parallel - * 2. Each client calls a single tool - * 3. Track notifications from each client independently - */ -// Command line args processing -const args = process.argv.slice(2); -const serverUrl = args[0] || 'http://localhost:3000/mcp'; -async function createAndRunClient(config) { - console.log(`[${config.id}] Creating client: ${config.name}`); - const client = new index_js_1.Client({ - name: config.name, - version: '1.0.0' - }); - const transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(serverUrl)); - // Set up client-specific error handler - client.onerror = error => { - console.error(`[${config.id}] Client error:`, error); - }; - // Set up client-specific notification handler - client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, notification => { - console.log(`[${config.id}] Notification: ${notification.params.data}`); - }); - try { - // Connect to the server - await client.connect(transport); - console.log(`[${config.id}] Connected to MCP server`); - // Call the specified tool - console.log(`[${config.id}] Calling tool: ${config.toolName}`); - const toolRequest = { - method: 'tools/call', - params: { - name: config.toolName, - arguments: { - ...config.toolArguments, - // Add client ID to arguments for identification in notifications - caller: config.id - } - } - }; - const result = await client.request(toolRequest, types_js_1.CallToolResultSchema); - console.log(`[${config.id}] Tool call completed`); - // Keep the connection open for a bit to receive notifications - await new Promise(resolve => setTimeout(resolve, 5000)); - // Disconnect - await transport.close(); - console.log(`[${config.id}] Disconnected from MCP server`); - return { id: config.id, result }; - } - catch (error) { - console.error(`[${config.id}] Error:`, error); - throw error; - } -} -async function main() { - console.log('MCP Multiple Clients Example'); - console.log('============================'); - console.log(`Server URL: ${serverUrl}`); - console.log(''); - try { - // Define client configurations - const clientConfigs = [ - { - id: 'client1', - name: 'basic-client-1', - toolName: 'start-notification-stream', - toolArguments: { - interval: 3, // 1 second between notifications - count: 5 // Send 5 notifications - } - }, - { - id: 'client2', - name: 'basic-client-2', - toolName: 'start-notification-stream', - toolArguments: { - interval: 2, // 2 seconds between notifications - count: 3 // Send 3 notifications - } - }, - { - id: 'client3', - name: 'basic-client-3', - toolName: 'start-notification-stream', - toolArguments: { - interval: 1, // 0.5 second between notifications - count: 8 // Send 8 notifications - } - } - ]; - // Start all clients in parallel - console.log(`Starting ${clientConfigs.length} clients in parallel...`); - console.log(''); - const clientPromises = clientConfigs.map(config => createAndRunClient(config)); - const results = await Promise.all(clientPromises); - // Display results from all clients - console.log('\n=== Final Results ==='); - results.forEach(({ id, result }) => { - console.log(`\n[${id}] Tool result:`); - if (Array.isArray(result.content)) { - result.content.forEach((item) => { - if (item.type === 'text' && item.text) { - console.log(` ${item.text}`); - } - else { - console.log(` ${item.type} content:`, item); - } - }); - } - else { - console.log(` Unexpected result format:`, result); - } - }); - console.log('\n=== All clients completed successfully ==='); - } - catch (error) { - console.error('Error running multiple clients:', error); - process.exit(1); - } -} -// Start the example -main().catch((error) => { - console.error('Error running MCP multiple clients example:', error); - process.exit(1); -}); -//# sourceMappingURL=multipleClientsParallel.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.js.map deleted file mode 100644 index 05812d1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/multipleClientsParallel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"multipleClientsParallel.js","sourceRoot":"","sources":["../../../../src/examples/client/multipleClientsParallel.ts"],"names":[],"mappings":";;AAAA,oDAA+C;AAC/C,sEAA+E;AAC/E,6CAAyH;AAEzH;;;;;;;GAOG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,2BAA2B,CAAC;AASzD,KAAK,UAAU,kBAAkB,CAAC,MAAoB;IAClD,OAAO,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,sBAAsB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAE9D,MAAM,MA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AAC;YACvD,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,oBAAoB;AACpB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;IACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.d.ts deleted file mode 100644 index e93d4d6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=parallelToolCallsClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.d.ts.map deleted file mode 100644 index 25a3b82..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parallelToolCallsClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/parallelToolCallsClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.js deleted file mode 100644 index e5a9829..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.js +++ /dev/null @@ -1,176 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const index_js_1 = require("../../client/index.js"); -const streamableHttp_js_1 = require("../../client/streamableHttp.js"); -const types_js_1 = require("../../types.js"); -/** - * Parallel Tool Calls MCP Client - * - * This client demonstrates how to: - * 1. Start multiple tool calls in parallel - * 2. Track notifications from each tool call using a caller parameter - */ -// Command line args processing -const args = process.argv.slice(2); -const serverUrl = args[0] || 'http://localhost:3000/mcp'; -async function main() { - console.log('MCP Parallel Tool Calls Client'); - console.log('=============================='); - console.log(`Connecting to server at: ${serverUrl}`); - let client; - let transport; - try { - // Create client with streamable HTTP transport - client = new index_js_1.Client({ - name: 'parallel-tool-calls-client', - version: '1.0.0' - }); - client.onerror = error => { - console.error('Client error:', error); - }; - // Connect to the server - transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(serverUrl)); - await client.connect(transport); - console.log('Successfully connected to MCP server'); - // Set up notification handler with caller identification - client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, notification => { - console.log(`Notification: ${notification.params.data}`); - }); - console.log('List tools'); - const toolsRequest = await listTools(client); - console.log('Tools: ', toolsRequest); - // 2. Start multiple notification tools in parallel - console.log('\n=== Starting Multiple Notification Streams in Parallel ==='); - const toolResults = await startParallelNotificationTools(client); - // Log the results from each tool call - for (const [caller, result] of Object.entries(toolResults)) { - console.log(`\n=== Tool result for ${caller} ===`); - result.content.forEach((item) => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else { - console.log(` ${item.type} content:`, item); - } - }); - } - // 3. Wait for all notifications (10 seconds) - console.log('\n=== Waiting for all notifications ==='); - await new Promise(resolve => setTimeout(resolve, 10000)); - // 4. Disconnect - console.log('\n=== Disconnecting ==='); - await transport.close(); - console.log('Disconnected from MCP server'); - } - catch (error) { - console.error('Error running client:', error); - process.exit(1); - } -} -/** - * List available tools on the server - */ -async function listTools(client) { - try { - const toolsRequest = { - method: 'tools/list', - params: {} - }; - const toolsResult = await client.request(toolsRequest, types_js_1.ListToolsResultSchema); - console.log('Available tools:'); - if (toolsResult.tools.length === 0) { - console.log(' No tools available'); - } - else { - for (const tool of toolsResult.tools) { - console.log(` - ${tool.name}: ${tool.description}`); - } - } - } - catch (error) { - console.log(`Tools not supported by this server: ${error}`); - } -} -/** - * Start multiple notification tools in parallel with different configurations - * Each tool call includes a caller parameter to identify its notifications - */ -async function startParallelNotificationTools(client) { - try { - // Define multiple tool calls with different configurations - const toolCalls = [ - { - caller: 'fast-notifier', - request: { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { - interval: 2, // 0.5 second between notifications - count: 10, // Send 10 notifications - caller: 'fast-notifier' // Identify this tool call - } - } - } - }, - { - caller: 'slow-notifier', - request: { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { - interval: 5, // 2 seconds between notifications - count: 5, // Send 5 notifications - caller: 'slow-notifier' // Identify this tool call - } - } - } - }, - { - caller: 'burst-notifier', - request: { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { - interval: 1, // 0.1 second between notifications - count: 3, // Send just 3 notifications - caller: 'burst-notifier' // Identify this tool call - } - } - } - } - ]; - console.log(`Starting ${toolCalls.length} notification tools in parallel...`); - // Start all tool calls in parallel - const toolPromises = toolCalls.map(({ caller, request }) => { - console.log(`Starting tool call for ${caller}...`); - return client - .request(request, types_js_1.CallToolResultSchema) - .then(result => ({ caller, result })) - .catch(error => { - console.error(`Error in tool call for ${caller}:`, error); - throw error; - }); - }); - // Wait for all tool calls to complete - const results = await Promise.all(toolPromises); - // Organize results by caller - const resultsByTool = {}; - results.forEach(({ caller, result }) => { - resultsByTool[caller] = result; - }); - return resultsByTool; - } - catch (error) { - console.error(`Error starting parallel notification tools:`, error); - throw error; - } -} -// Start the client -main().catch((error) => { - console.error('Error running MCP client:', error); - process.exit(1); -}); -//# sourceMappingURL=parallelToolCallsClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.js.map deleted file mode 100644 index dabdf48..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/parallelToolCallsClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parallelToolCallsClient.js","sourceRoot":"","sources":["../../../../src/examples/client/parallelToolCallsClient.ts"],"names":[],"mappings":";;AAAA,oDAA+C;AAC/C,sEAA+E;AAC/E,6CAMwB;AAExB;;;;;;GAMG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,2BAA2B,CAAC;AAEzD,KAAK,UAAU,IAAI;IACf,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,4BAA4B,SAAS,EAAE,CAAC,CAAC;IAErD,IAAI,MAAc,CAAC;IACnB,IAAI,SAAwC,CAAC;IAE7C,IAAI,CAAC;QACD,+CAA+C;QAC/C,MAAM,GAAG,IAAI,iBAAM,CAAC;YAChB,IAAI,EAAE,4BAA4B;YAClC,OAAO,EAAE,OAAO;SACnB,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE;YACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QAC1C,CAAC,CAAC;QAEF,wBAAwB;QACxB,SAAS,GAAG,IAAI,iDAA6B,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;QAClE,MAAM,MAAM,CAAC,OAAO,CAAC,S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EAAE,CAAC,CAAC;iBACpC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACX,OAAO,CAAC,KAAK,CAAC,0BAA0B,MAAM,GAAG,EAAE,KAAK,CAAC,CAAC;gBAC1D,MAAM,KAAK,CAAC;YAChB,CAAC,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,sCAAsC;QACtC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAEhD,6BAA6B;QAC7B,MAAM,aAAa,GAAmC,EAAE,CAAC;QACzD,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;YACnC,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,OAAO,aAAa,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;QACpE,MAAM,KAAK,CAAC;IAChB,CAAC;AACL,CAAC;AAED,mBAAmB;AACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts deleted file mode 100644 index 876d25d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node -/** - * Example demonstrating client_credentials grant for machine-to-machine authentication. - * - * Supports two authentication methods based on environment variables: - * - * 1. client_secret_basic (default): - * MCP_CLIENT_ID - OAuth client ID (required) - * MCP_CLIENT_SECRET - OAuth client secret (required) - * - * 2. private_key_jwt (when MCP_CLIENT_PRIVATE_KEY_PEM is set): - * MCP_CLIENT_ID - OAuth client ID (required) - * MCP_CLIENT_PRIVATE_KEY_PEM - PEM-encoded private key for JWT signing (required) - * MCP_CLIENT_ALGORITHM - Signing algorithm (default: RS256) - * - * Common: - * MCP_SERVER_URL - Server URL (default: http://localhost:3000/mcp) - */ -export {}; -//# sourceMappingURL=simpleClientCredentials.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts.map deleted file mode 100644 index 7a935db..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleClientCredentials.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleClientCredentials.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;GAgBG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js deleted file mode 100644 index 0b251b1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env node -"use strict"; -/** - * Example demonstrating client_credentials grant for machine-to-machine authentication. - * - * Supports two authentication methods based on environment variables: - * - * 1. client_secret_basic (default): - * MCP_CLIENT_ID - OAuth client ID (required) - * MCP_CLIENT_SECRET - OAuth client secret (required) - * - * 2. private_key_jwt (when MCP_CLIENT_PRIVATE_KEY_PEM is set): - * MCP_CLIENT_ID - OAuth client ID (required) - * MCP_CLIENT_PRIVATE_KEY_PEM - PEM-encoded private key for JWT signing (required) - * MCP_CLIENT_ALGORITHM - Signing algorithm (default: RS256) - * - * Common: - * MCP_SERVER_URL - Server URL (default: http://localhost:3000/mcp) - */ -Object.defineProperty(exports, "__esModule", { value: true }); -const index_js_1 = require("../../client/index.js"); -const streamableHttp_js_1 = require("../../client/streamableHttp.js"); -const auth_extensions_js_1 = require("../../client/auth-extensions.js"); -const DEFAULT_SERVER_URL = process.env.MCP_SERVER_URL || 'http://localhost:3000/mcp'; -function createProvider() { - const clientId = process.env.MCP_CLIENT_ID; - if (!clientId) { - console.error('MCP_CLIENT_ID environment variable is required'); - process.exit(1); - } - // If private key is provided, use private_key_jwt authentication - const privateKeyPem = process.env.MCP_CLIENT_PRIVATE_KEY_PEM; - if (privateKeyPem) { - const algorithm = process.env.MCP_CLIENT_ALGORITHM || 'RS256'; - console.log('Using private_key_jwt authentication'); - return new auth_extensions_js_1.PrivateKeyJwtProvider({ - clientId, - privateKey: privateKeyPem, - algorithm - }); - } - // Otherwise, use client_secret_basic authentication - const clientSecret = process.env.MCP_CLIENT_SECRET; - if (!clientSecret) { - console.error('MCP_CLIENT_SECRET or MCP_CLIENT_PRIVATE_KEY_PEM environment variable is required'); - process.exit(1); - } - console.log('Using client_secret_basic authentication'); - return new auth_extensions_js_1.ClientCredentialsProvider({ - clientId, - clientSecret - }); -} -async function main() { - const provider = createProvider(); - const client = new index_js_1.Client({ name: 'client-credentials-example', version: '1.0.0' }, { capabilities: {} }); - const transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(DEFAULT_SERVER_URL), { - authProvider: provider - }); - await client.connect(transport); - console.log('Connected successfully.'); - const tools = await client.listTools(); - console.log('Available tools:', tools.tools.map(t => t.name).join(', ') || '(none)'); - await transport.close(); -} -main().catch(err => { - console.error(err); - process.exit(1); -}); -//# sourceMappingURL=simpleClientCredentials.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js.map deleted file mode 100644 index 65e4b52..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleClientCredentials.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleClientCredentials.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;GAgBG;;AAEH,oDAA+C;AAC/C,sEAA+E;AAC/E,wEAAmG;AAGnG,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,2BAA2B,CAAC;AAErF,SAAS,cAAc;IACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,iEAAiE;IACjE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC7D,IAAI,aAAa,EAAE,CAAC;QAChB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QACpD,OAAO,IAAI,0CAAqB,CAAC;YAC7B,QAAQ;YACR,UAAU,EAAE,aAAa;YACzB,SAAS;SACZ,CAAC,CAAC;IACP,CAAC;IAED,oDAAoD;IACpD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACnD,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;QAClG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IACxD,OAAO,IAAI,8CAAyB,CAAC;QACjC,QAAQ;QACR,YAAY;KACf,CAAC,CAAC;AACP,CAAC;AAED,KAAK,UAAU,IAAI;IACf,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;IAElC,MAAM,MAAM,GAAG,IAAI,iBAAM,CAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IAE1G,MAAM,SAAS,GAAG,IAAI,iDAA6B,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,EAAE;QAC7E,YAAY,EAAE,QAAQ;KACzB,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC;IAErF,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACf,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.d.ts deleted file mode 100644 index e4b43db..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -export {}; -//# sourceMappingURL=simpleOAuthClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.d.ts.map deleted file mode 100644 index c09eef8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleOAuthClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.js deleted file mode 100644 index 4b74120..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.js +++ /dev/null @@ -1,413 +0,0 @@ -#!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const node_http_1 = require("node:http"); -const node_readline_1 = require("node:readline"); -const node_url_1 = require("node:url"); -const node_child_process_1 = require("node:child_process"); -const index_js_1 = require("../../client/index.js"); -const streamableHttp_js_1 = require("../../client/streamableHttp.js"); -const types_js_1 = require("../../types.js"); -const auth_js_1 = require("../../client/auth.js"); -const simpleOAuthClientProvider_js_1 = require("./simpleOAuthClientProvider.js"); -// Configuration -const DEFAULT_SERVER_URL = 'http://localhost:3000/mcp'; -const CALLBACK_PORT = 8090; // Use different port than auth server (3001) -const CALLBACK_URL = `http://localhost:${CALLBACK_PORT}/callback`; -/** - * Interactive MCP client with OAuth authentication - * Demonstrates the complete OAuth flow with browser-based authorization - */ -class InteractiveOAuthClient { - constructor(serverUrl, clientMetadataUrl) { - this.serverUrl = serverUrl; - this.clientMetadataUrl = clientMetadataUrl; - this.client = null; - this.rl = (0, node_readline_1.createInterface)({ - input: process.stdin, - output: process.stdout - }); - } - /** - * Prompts user for input via readline - */ - async question(query) { - return new Promise(resolve => { - this.rl.question(query, resolve); - }); - } - /** - * Opens the authorization URL in the user's default browser - */ - async openBrowser(url) { - console.log(`🌐 Opening browser for authorization: ${url}`); - const command = `open "${url}"`; - (0, node_child_process_1.exec)(command, error => { - if (error) { - console.error(`Failed to open browser: ${error.message}`); - console.log(`Please manually open: ${url}`); - } - }); - } - /** - * Example OAuth callback handler - in production, use a more robust approach - * for handling callbacks and storing tokens - */ - /** - * Starts a temporary HTTP server to receive the OAuth callback - */ - async waitForOAuthCallback() { - return new Promise((resolve, reject) => { - const server = (0, node_http_1.createServer)((req, res) => { - // Ignore favicon requests - if (req.url === '/favicon.ico') { - res.writeHead(404); - res.end(); - return; - } - console.log(`📥 Received callback: ${req.url}`); - const parsedUrl = new node_url_1.URL(req.url || '', 'http://localhost'); - const code = parsedUrl.searchParams.get('code'); - const error = parsedUrl.searchParams.get('error'); - if (code) { - console.log(`✅ Authorization code received: ${code?.substring(0, 10)}...`); - res.writeHead(200, { 'Content-Type': 'text/html' }); - res.end(` - - -

Authorization Successful!

-

You can close this window and return to the terminal.

- - - - `); - resolve(code); - setTimeout(() => server.close(), 3000); - } - else if (error) { - console.log(`❌ Authorization error: ${error}`); - res.writeHead(400, { 'Content-Type': 'text/html' }); - res.end(` - - -

Authorization Failed

-

Error: ${error}

- - - `); - reject(new Error(`OAuth authorization failed: ${error}`)); - } - else { - console.log(`❌ No authorization code or error in callback`); - res.writeHead(400); - res.end('Bad request'); - reject(new Error('No authorization code provided')); - } - }); - server.listen(CALLBACK_PORT, () => { - console.log(`OAuth callback server started on http://localhost:${CALLBACK_PORT}`); - }); - }); - } - async attemptConnection(oauthProvider) { - console.log('🚢 Creating transport with OAuth provider...'); - const baseUrl = new node_url_1.URL(this.serverUrl); - const transport = new streamableHttp_js_1.StreamableHTTPClientTransport(baseUrl, { - authProvider: oauthProvider - }); - console.log('🚢 Transport created'); - try { - console.log('🔌 Attempting connection (this will trigger OAuth redirect)...'); - await this.client.connect(transport); - console.log('✅ Connected successfully'); - } - catch (error) { - if (error instanceof auth_js_1.UnauthorizedError) { - console.log('🔐 OAuth required - waiting for authorization...'); - const callbackPromise = this.waitForOAuthCallback(); - const authCode = await callbackPromise; - await transport.finishAuth(authCode); - console.log('🔐 Authorization code received:', authCode); - console.log('🔌 Reconnecting with authenticated transport...'); - await this.attemptConnection(oauthProvider); - } - else { - console.error('❌ Connection failed with non-auth error:', error); - throw error; - } - } - } - /** - * Establishes connection to the MCP server with OAuth authentication - */ - async connect() { - console.log(`🔗 Attempting to connect to ${this.serverUrl}...`); - const clientMetadata = { - client_name: 'Simple OAuth MCP Client', - redirect_uris: [CALLBACK_URL], - grant_types: ['authorization_code', 'refresh_token'], - response_types: ['code'], - token_endpoint_auth_method: 'client_secret_post' - }; - console.log('🔐 Creating OAuth provider...'); - const oauthProvider = new simpleOAuthClientProvider_js_1.InMemoryOAuthClientProvider(CALLBACK_URL, clientMetadata, (redirectUrl) => { - console.log(`📌 OAuth redirect handler called - opening browser`); - console.log(`Opening browser to: ${redirectUrl.toString()}`); - this.openBrowser(redirectUrl.toString()); - }, this.clientMetadataUrl); - console.log('🔐 OAuth provider created'); - console.log('👤 Creating MCP client...'); - this.client = new index_js_1.Client({ - name: 'simple-oauth-client', - version: '1.0.0' - }, { capabilities: {} }); - console.log('👤 Client created'); - console.log('🔐 Starting OAuth flow...'); - await this.attemptConnection(oauthProvider); - // Start interactive loop - await this.interactiveLoop(); - } - /** - * Main interactive loop for user commands - */ - async interactiveLoop() { - console.log('\n🎯 Interactive MCP Client with OAuth'); - console.log('Commands:'); - console.log(' list - List available tools'); - console.log(' call [args] - Call a tool'); - console.log(' stream [args] - Call a tool with streaming (shows task status)'); - console.log(' quit - Exit the client'); - console.log(); - while (true) { - try { - const command = await this.question('mcp> '); - if (!command.trim()) { - continue; - } - if (command === 'quit') { - console.log('\n👋 Goodbye!'); - this.close(); - process.exit(0); - } - else if (command === 'list') { - await this.listTools(); - } - else if (command.startsWith('call ')) { - await this.handleCallTool(command); - } - else if (command.startsWith('stream ')) { - await this.handleStreamTool(command); - } - else { - console.log("❌ Unknown command. Try 'list', 'call ', 'stream ', or 'quit'"); - } - } - catch (error) { - if (error instanceof Error && error.message === 'SIGINT') { - console.log('\n\n👋 Goodbye!'); - break; - } - console.error('❌ Error:', error); - } - } - } - async listTools() { - if (!this.client) { - console.log('❌ Not connected to server'); - return; - } - try { - const request = { - method: 'tools/list', - params: {} - }; - const result = await this.client.request(request, types_js_1.ListToolsResultSchema); - if (result.tools && result.tools.length > 0) { - console.log('\n📋 Available tools:'); - result.tools.forEach((tool, index) => { - console.log(`${index + 1}. ${tool.name}`); - if (tool.description) { - console.log(` Description: ${tool.description}`); - } - console.log(); - }); - } - else { - console.log('No tools available'); - } - } - catch (error) { - console.error('❌ Failed to list tools:', error); - } - } - async handleCallTool(command) { - const parts = command.split(/\s+/); - const toolName = parts[1]; - if (!toolName) { - console.log('❌ Please specify a tool name'); - return; - } - // Parse arguments (simple JSON-like format) - let toolArgs = {}; - if (parts.length > 2) { - const argsString = parts.slice(2).join(' '); - try { - toolArgs = JSON.parse(argsString); - } - catch { - console.log('❌ Invalid arguments format (expected JSON)'); - return; - } - } - await this.callTool(toolName, toolArgs); - } - async callTool(toolName, toolArgs) { - if (!this.client) { - console.log('❌ Not connected to server'); - return; - } - try { - const request = { - method: 'tools/call', - params: { - name: toolName, - arguments: toolArgs - } - }; - const result = await this.client.request(request, types_js_1.CallToolResultSchema); - console.log(`\n🔧 Tool '${toolName}' result:`); - if (result.content) { - result.content.forEach(content => { - if (content.type === 'text') { - console.log(content.text); - } - else { - console.log(content); - } - }); - } - else { - console.log(result); - } - } - catch (error) { - console.error(`❌ Failed to call tool '${toolName}':`, error); - } - } - async handleStreamTool(command) { - const parts = command.split(/\s+/); - const toolName = parts[1]; - if (!toolName) { - console.log('❌ Please specify a tool name'); - return; - } - // Parse arguments (simple JSON-like format) - let toolArgs = {}; - if (parts.length > 2) { - const argsString = parts.slice(2).join(' '); - try { - toolArgs = JSON.parse(argsString); - } - catch { - console.log('❌ Invalid arguments format (expected JSON)'); - return; - } - } - await this.streamTool(toolName, toolArgs); - } - async streamTool(toolName, toolArgs) { - if (!this.client) { - console.log('❌ Not connected to server'); - return; - } - try { - // Using the experimental tasks API - WARNING: may change without notice - console.log(`\n🔧 Streaming tool '${toolName}'...`); - const stream = this.client.experimental.tasks.callToolStream({ - name: toolName, - arguments: toolArgs - }, types_js_1.CallToolResultSchema, { - task: { - taskId: `task-${Date.now()}`, - ttl: 60000 - } - }); - // Iterate through all messages yielded by the generator - for await (const message of stream) { - switch (message.type) { - case 'taskCreated': - console.log(`✓ Task created: ${message.task.taskId}`); - break; - case 'taskStatus': - console.log(`⟳ Status: ${message.task.status}`); - if (message.task.statusMessage) { - console.log(` ${message.task.statusMessage}`); - } - break; - case 'result': - console.log('✓ Completed!'); - message.result.content.forEach(content => { - if (content.type === 'text') { - console.log(content.text); - } - else { - console.log(content); - } - }); - break; - case 'error': - console.log('✗ Error:'); - console.log(` ${message.error.message}`); - break; - } - } - } - catch (error) { - console.error(`❌ Failed to stream tool '${toolName}':`, error); - } - } - close() { - this.rl.close(); - if (this.client) { - // Note: Client doesn't have a close method in the current implementation - // This would typically close the transport connection - } - } -} -/** - * Main entry point - */ -async function main() { - const args = process.argv.slice(2); - const serverUrl = args[0] || DEFAULT_SERVER_URL; - const clientMetadataUrl = args[1]; - console.log('🚀 Simple MCP OAuth Client'); - console.log(`Connecting to: ${serverUrl}`); - if (clientMetadataUrl) { - console.log(`Client Metadata URL: ${clientMetadataUrl}`); - } - console.log(); - const client = new InteractiveOAuthClient(serverUrl, clientMetadataUrl); - // Handle graceful shutdown - process.on('SIGINT', () => { - console.log('\n\n👋 Goodbye!'); - client.close(); - process.exit(0); - }); - try { - await client.connect(); - } - catch (error) { - console.error('Failed to start client:', error); - process.exit(1); - } - finally { - client.close(); - } -} -// Run if this file is executed directly -main().catch(error => { - console.error('Unhandled error:', error); - process.exit(1); -}); -//# sourceMappingURL=simpleOAuthClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.js.map deleted file mode 100644 index 3126524..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleOAuthClient.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClient.ts"],"names":[],"mappings":";;;AAEA,yCAAyC;AACzC,iDAAgD;AAChD,uCAA+B;AAC/B,2DAA0C;AAC1C,oDAA+C;AAC/C,sEAA+E;AAE/E,6CAAgH;AAChH,kDAAyD;AACzD,iFAA6E;AAE7E,gBAAgB;AAChB,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AACvD,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,6CAA6C;AACzE,MAAM,YAAY,GAAG,oBAAoB,aAAa,WAAW,CAAC;AAElE;;;GAGG;AACH,MAAM,sBAAsB;IAOxB,YACY,SAAiB,EACjB,iBAA0B;QAD1B,cAAS,GAAT,SAAS,CAAQ;QACjB,sBAAiB,GAAjB,iBAAiB,CAAS;QAR9B,WAAM,GAAkB,IAAI,CAAC;QACpB,OAAE,GAAG,IAAA,+BAAe,EAAC;YAClC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;SACzB,CAAC,CAAC;IAKA,CAAC;IAEJ;;OAEG;IACK,KAAK,CAAC,QAAQ,CAAC,KAAa;QAChC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACzB,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,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3B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC;QACD,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;YAAS,CAAC;QACP,MAAM,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;AACL,CAAC;AAED,wCAAwC;AACxC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.d.ts deleted file mode 100644 index 092616c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { OAuthClientProvider } from '../../client/auth.js'; -import { OAuthClientInformationMixed, OAuthClientMetadata, OAuthTokens } from '../../shared/auth.js'; -/** - * In-memory OAuth client provider for demonstration purposes - * In production, you should persist tokens securely - */ -export declare class InMemoryOAuthClientProvider implements OAuthClientProvider { - private readonly _redirectUrl; - private readonly _clientMetadata; - readonly clientMetadataUrl?: string | undefined; - private _clientInformation?; - private _tokens?; - private _codeVerifier?; - constructor(_redirectUrl: string | URL, _clientMetadata: OAuthClientMetadata, onRedirect?: (url: URL) => void, clientMetadataUrl?: string | undefined); - private _onRedirect; - get redirectUrl(): string | URL; - get clientMetadata(): OAuthClientMetadata; - clientInformation(): OAuthClientInformationMixed | undefined; - saveClientInformation(clientInformation: OAuthClientInformationMixed): void; - tokens(): OAuthTokens | undefined; - saveTokens(tokens: OAuthTokens): void; - redirectToAuthorization(authorizationUrl: URL): void; - saveCodeVerifier(codeVerifier: string): void; - codeVerifier(): string; -} -//# sourceMappingURL=simpleOAuthClientProvider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.d.ts.map deleted file mode 100644 index 21efe94..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleOAuthClientProvider.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClientProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAErG;;;GAGG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;IAM/D,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe;aAEhB,iBAAiB,CAAC,EAAE,MAAM;IAR9C,OAAO,CAAC,kBAAkB,CAAC,CAA8B;IACzD,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,aAAa,CAAC,CAAS;gBAGV,YAAY,EAAE,MAAM,GAAG,GAAG,EAC1B,eAAe,EAAE,mBAAmB,EACrD,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,EACf,iBAAiB,CAAC,EAAE,MAAM,YAAA;IAS9C,OAAO,CAAC,WAAW,CAAqB;IAExC,IAAI,WAAW,IAAI,MAAM,GAAG,GAAG,CAE9B;IAED,IAAI,cAAc,IAAI,mBAAmB,CAExC;IAED,iBAAiB,IAAI,2BAA2B,GAAG,SAAS;IAI5D,qBAAqB,CAAC,iBAAiB,EAAE,2BAA2B,GAAG,IAAI;IAI3E,MAAM,IAAI,WAAW,GAAG,SAAS;IAIjC,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAIrC,uBAAuB,CAAC,gBAAgB,EAAE,GAAG,GAAG,IAAI;IAIpD,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAI5C,YAAY,IAAI,MAAM;CAMzB"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.js deleted file mode 100644 index 58959bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.InMemoryOAuthClientProvider = void 0; -/** - * In-memory OAuth client provider for demonstration purposes - * In production, you should persist tokens securely - */ -class InMemoryOAuthClientProvider { - constructor(_redirectUrl, _clientMetadata, onRedirect, clientMetadataUrl) { - this._redirectUrl = _redirectUrl; - this._clientMetadata = _clientMetadata; - this.clientMetadataUrl = clientMetadataUrl; - this._onRedirect = - onRedirect || - (url => { - console.log(`Redirect to: ${url.toString()}`); - }); - } - get redirectUrl() { - return this._redirectUrl; - } - get clientMetadata() { - return this._clientMetadata; - } - clientInformation() { - return this._clientInformation; - } - saveClientInformation(clientInformation) { - this._clientInformation = clientInformation; - } - tokens() { - return this._tokens; - } - saveTokens(tokens) { - this._tokens = tokens; - } - redirectToAuthorization(authorizationUrl) { - this._onRedirect(authorizationUrl); - } - saveCodeVerifier(codeVerifier) { - this._codeVerifier = codeVerifier; - } - codeVerifier() { - if (!this._codeVerifier) { - throw new Error('No code verifier saved'); - } - return this._codeVerifier; - } -} -exports.InMemoryOAuthClientProvider = InMemoryOAuthClientProvider; -//# sourceMappingURL=simpleOAuthClientProvider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.js.map deleted file mode 100644 index 10771f8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleOAuthClientProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleOAuthClientProvider.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClientProvider.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACH,MAAa,2BAA2B;IAKpC,YACqB,YAA0B,EAC1B,eAAoC,EACrD,UAA+B,EACf,iBAA0B;QAHzB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,oBAAe,GAAf,eAAe,CAAqB;QAErC,sBAAiB,GAAjB,iBAAiB,CAAS;QAE1C,IAAI,CAAC,WAAW;YACZ,UAAU;gBACV,CAAC,GAAG,CAAC,EAAE;oBACH,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAClD,CAAC,CAAC,CAAC;IACX,CAAC;IAID,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,qBAAqB,CAAC,iBAA8C;QAChE,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;IAChD,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,UAAU,CAAC,MAAmB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,uBAAuB,CAAC,gBAAqB;QACzC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC;IAED,gBAAgB,CAAC,YAAoB;QACjC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACtC,CAAC;IAED,YAAY;QACR,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;CACJ;AA1DD,kEA0DC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.d.ts deleted file mode 100644 index a20be42..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=simpleStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.d.ts.map deleted file mode 100644 index 28406b0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.js deleted file mode 100644 index bb0dec9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.js +++ /dev/null @@ -1,818 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const index_js_1 = require("../../client/index.js"); -const streamableHttp_js_1 = require("../../client/streamableHttp.js"); -const node_readline_1 = require("node:readline"); -const types_js_1 = require("../../types.js"); -const metadataUtils_js_1 = require("../../shared/metadataUtils.js"); -const ajv_1 = require("ajv"); -// Create readline interface for user input -const readline = (0, node_readline_1.createInterface)({ - input: process.stdin, - output: process.stdout -}); -// Track received notifications for debugging resumability -let notificationCount = 0; -// Global client and transport for interactive commands -let client = null; -let transport = null; -let serverUrl = 'http://localhost:3000/mcp'; -let notificationsToolLastEventId = undefined; -let sessionId = undefined; -async function main() { - console.log('MCP Interactive Client'); - console.log('====================='); - // Connect to server immediately with default settings - await connect(); - // Print help and start the command loop - printHelp(); - commandLoop(); -} -function printHelp() { - console.log('\nAvailable commands:'); - console.log(' connect [url] - Connect to MCP server (default: http://localhost:3000/mcp)'); - console.log(' disconnect - Disconnect from server'); - console.log(' terminate-session - Terminate the current session'); - console.log(' reconnect - Reconnect to the server'); - console.log(' list-tools - List available tools'); - console.log(' call-tool [args] - Call a tool with optional JSON arguments'); - console.log(' call-tool-task [args] - Call a tool with task-based execution (example: call-tool-task delay {"duration":3000})'); - console.log(' greet [name] - Call the greet tool'); - console.log(' multi-greet [name] - Call the multi-greet tool with notifications'); - console.log(' collect-info [type] - Test form elicitation with collect-user-info tool (contact/preferences/feedback)'); - console.log(' start-notifications [interval] [count] - Start periodic notifications'); - console.log(' run-notifications-tool-with-resumability [interval] [count] - Run notification tool with resumability'); - console.log(' list-prompts - List available prompts'); - console.log(' get-prompt [name] [args] - Get a prompt with optional JSON arguments'); - console.log(' list-resources - List available resources'); - console.log(' read-resource - Read a specific resource by URI'); - console.log(' help - Show this help'); - console.log(' quit - Exit the program'); -} -function commandLoop() { - readline.question('\n> ', async (input) => { - const args = input.trim().split(/\s+/); - const command = args[0]?.toLowerCase(); - try { - switch (command) { - case 'connect': - await connect(args[1]); - break; - case 'disconnect': - await disconnect(); - break; - case 'terminate-session': - await terminateSession(); - break; - case 'reconnect': - await reconnect(); - break; - case 'list-tools': - await listTools(); - break; - case 'call-tool': - if (args.length < 2) { - console.log('Usage: call-tool [args]'); - } - else { - const toolName = args[1]; - let toolArgs = {}; - if (args.length > 2) { - try { - toolArgs = JSON.parse(args.slice(2).join(' ')); - } - catch { - console.log('Invalid JSON arguments. Using empty args.'); - } - } - await callTool(toolName, toolArgs); - } - break; - case 'greet': - await callGreetTool(args[1] || 'MCP User'); - break; - case 'multi-greet': - await callMultiGreetTool(args[1] || 'MCP User'); - break; - case 'collect-info': - await callCollectInfoTool(args[1] || 'contact'); - break; - case 'start-notifications': { - const interval = args[1] ? parseInt(args[1], 10) : 2000; - const count = args[2] ? parseInt(args[2], 10) : 10; - await startNotifications(interval, count); - break; - } - case 'run-notifications-tool-with-resumability': { - const interval = args[1] ? parseInt(args[1], 10) : 2000; - const count = args[2] ? parseInt(args[2], 10) : 10; - await runNotificationsToolWithResumability(interval, count); - break; - } - case 'call-tool-task': - if (args.length < 2) { - console.log('Usage: call-tool-task [args]'); - } - else { - const toolName = args[1]; - let toolArgs = {}; - if (args.length > 2) { - try { - toolArgs = JSON.parse(args.slice(2).join(' ')); - } - catch { - console.log('Invalid JSON arguments. Using empty args.'); - } - } - await callToolTask(toolName, toolArgs); - } - break; - case 'list-prompts': - await listPrompts(); - break; - case 'get-prompt': - if (args.length < 2) { - console.log('Usage: get-prompt [args]'); - } - else { - const promptName = args[1]; - let promptArgs = {}; - if (args.length > 2) { - try { - promptArgs = JSON.parse(args.slice(2).join(' ')); - } - catch { - console.log('Invalid JSON arguments. Using empty args.'); - } - } - await getPrompt(promptName, promptArgs); - } - break; - case 'list-resources': - await listResources(); - break; - case 'read-resource': - if (args.length < 2) { - console.log('Usage: read-resource '); - } - else { - await readResource(args[1]); - } - break; - case 'help': - printHelp(); - break; - case 'quit': - case 'exit': - await cleanup(); - return; - default: - if (command) { - console.log(`Unknown command: ${command}`); - } - break; - } - } - catch (error) { - console.error(`Error executing command: ${error}`); - } - // Continue the command loop - commandLoop(); - }); -} -async function connect(url) { - if (client) { - console.log('Already connected. Disconnect first.'); - return; - } - if (url) { - serverUrl = url; - } - console.log(`Connecting to ${serverUrl}...`); - try { - // Create a new client with form elicitation capability - client = new index_js_1.Client({ - name: 'example-client', - version: '1.0.0' - }, { - capabilities: { - elicitation: { - form: {} - } - } - }); - client.onerror = error => { - console.error('\x1b[31mClient error:', error, '\x1b[0m'); - }; - // Set up elicitation request handler with proper validation - client.setRequestHandler(types_js_1.ElicitRequestSchema, async (request) => { - if (request.params.mode !== 'form') { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Unsupported elicitation mode: ${request.params.mode}`); - } - console.log('\n🔔 Elicitation (form) Request Received:'); - console.log(`Message: ${request.params.message}`); - console.log(`Related Task: ${request.params._meta?.[types_js_1.RELATED_TASK_META_KEY]?.taskId}`); - console.log('Requested Schema:'); - console.log(JSON.stringify(request.params.requestedSchema, null, 2)); - const schema = request.params.requestedSchema; - const properties = schema.properties; - const required = schema.required || []; - // Set up AJV validator for the requested schema - const ajv = new ajv_1.Ajv(); - const validate = ajv.compile(schema); - let attempts = 0; - const maxAttempts = 3; - while (attempts < maxAttempts) { - attempts++; - console.log(`\nPlease provide the following information (attempt ${attempts}/${maxAttempts}):`); - const content = {}; - let inputCancelled = false; - // Collect input for each field - for (const [fieldName, fieldSchema] of Object.entries(properties)) { - const field = fieldSchema; - const isRequired = required.includes(fieldName); - let prompt = `${field.title || fieldName}`; - // Add helpful information to the prompt - if (field.description) { - prompt += ` (${field.description})`; - } - if (field.enum) { - prompt += ` [options: ${field.enum.join(', ')}]`; - } - if (field.type === 'number' || field.type === 'integer') { - if (field.minimum !== undefined && field.maximum !== undefined) { - prompt += ` [${field.minimum}-${field.maximum}]`; - } - else if (field.minimum !== undefined) { - prompt += ` [min: ${field.minimum}]`; - } - else if (field.maximum !== undefined) { - prompt += ` [max: ${field.maximum}]`; - } - } - if (field.type === 'string' && field.format) { - prompt += ` [format: ${field.format}]`; - } - if (isRequired) { - prompt += ' *required*'; - } - if (field.default !== undefined) { - prompt += ` [default: ${field.default}]`; - } - prompt += ': '; - const answer = await new Promise(resolve => { - readline.question(prompt, input => { - resolve(input.trim()); - }); - }); - // Check for cancellation - if (answer.toLowerCase() === 'cancel' || answer.toLowerCase() === 'c') { - inputCancelled = true; - break; - } - // Parse and validate the input - try { - if (answer === '' && field.default !== undefined) { - content[fieldName] = field.default; - } - else if (answer === '' && !isRequired) { - // Skip optional empty fields - continue; - } - else if (answer === '') { - throw new Error(`${fieldName} is required`); - } - else { - // Parse the value based on type - let parsedValue; - if (field.type === 'boolean') { - parsedValue = answer.toLowerCase() === 'true' || answer.toLowerCase() === 'yes' || answer === '1'; - } - else if (field.type === 'number') { - parsedValue = parseFloat(answer); - if (isNaN(parsedValue)) { - throw new Error(`${fieldName} must be a valid number`); - } - } - else if (field.type === 'integer') { - parsedValue = parseInt(answer, 10); - if (isNaN(parsedValue)) { - throw new Error(`${fieldName} must be a valid integer`); - } - } - else if (field.enum) { - if (!field.enum.includes(answer)) { - throw new Error(`${fieldName} must be one of: ${field.enum.join(', ')}`); - } - parsedValue = answer; - } - else { - parsedValue = answer; - } - content[fieldName] = parsedValue; - } - } - catch (error) { - console.log(`❌ Error: ${error}`); - // Continue to next attempt - break; - } - } - if (inputCancelled) { - return { action: 'cancel' }; - } - // If we didn't complete all fields due to an error, try again - if (Object.keys(content).length !== - Object.keys(properties).filter(name => required.includes(name) || content[name] !== undefined).length) { - if (attempts < maxAttempts) { - console.log('Please try again...'); - continue; - } - else { - console.log('Maximum attempts reached. Declining request.'); - return { action: 'decline' }; - } - } - // Validate the complete object against the schema - const isValid = validate(content); - if (!isValid) { - console.log('❌ Validation errors:'); - validate.errors?.forEach(error => { - console.log(` - ${error.instancePath || 'root'}: ${error.message}`); - }); - if (attempts < maxAttempts) { - console.log('Please correct the errors and try again...'); - continue; - } - else { - console.log('Maximum attempts reached. Declining request.'); - return { action: 'decline' }; - } - } - // Show the collected data and ask for confirmation - console.log('\n✅ Collected data:'); - console.log(JSON.stringify(content, null, 2)); - const confirmAnswer = await new Promise(resolve => { - readline.question('\nSubmit this information? (yes/no/cancel): ', input => { - resolve(input.trim().toLowerCase()); - }); - }); - if (confirmAnswer === 'yes' || confirmAnswer === 'y') { - return { - action: 'accept', - content - }; - } - else if (confirmAnswer === 'cancel' || confirmAnswer === 'c') { - return { action: 'cancel' }; - } - else if (confirmAnswer === 'no' || confirmAnswer === 'n') { - if (attempts < maxAttempts) { - console.log('Please re-enter the information...'); - continue; - } - else { - return { action: 'decline' }; - } - } - } - console.log('Maximum attempts reached. Declining request.'); - return { action: 'decline' }; - }); - transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(serverUrl), { - sessionId: sessionId - }); - // Set up notification handlers - client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, notification => { - notificationCount++; - console.log(`\nNotification #${notificationCount}: ${notification.params.level} - ${notification.params.data}`); - // Re-display the prompt - process.stdout.write('> '); - }); - client.setNotificationHandler(types_js_1.ResourceListChangedNotificationSchema, async (_) => { - console.log(`\nResource list changed notification received!`); - try { - if (!client) { - console.log('Client disconnected, cannot fetch resources'); - return; - } - const resourcesResult = await client.request({ - method: 'resources/list', - params: {} - }, types_js_1.ListResourcesResultSchema); - console.log('Available resources count:', resourcesResult.resources.length); - } - catch { - console.log('Failed to list resources after change notification'); - } - // Re-display the prompt - process.stdout.write('> '); - }); - // Connect the client - await client.connect(transport); - sessionId = transport.sessionId; - console.log('Transport created with session ID:', sessionId); - console.log('Connected to MCP server'); - } - catch (error) { - console.error('Failed to connect:', error); - client = null; - transport = null; - } -} -async function disconnect() { - if (!client || !transport) { - console.log('Not connected.'); - return; - } - try { - await transport.close(); - console.log('Disconnected from MCP server'); - client = null; - transport = null; - } - catch (error) { - console.error('Error disconnecting:', error); - } -} -async function terminateSession() { - if (!client || !transport) { - console.log('Not connected.'); - return; - } - try { - console.log('Terminating session with ID:', transport.sessionId); - await transport.terminateSession(); - console.log('Session terminated successfully'); - // Check if sessionId was cleared after termination - if (!transport.sessionId) { - console.log('Session ID has been cleared'); - sessionId = undefined; - // Also close the transport and clear client objects - await transport.close(); - console.log('Transport closed after session termination'); - client = null; - transport = null; - } - else { - console.log('Server responded with 405 Method Not Allowed (session termination not supported)'); - console.log('Session ID is still active:', transport.sessionId); - } - } - catch (error) { - console.error('Error terminating session:', error); - } -} -async function reconnect() { - if (client) { - await disconnect(); - } - await connect(); -} -async function listTools() { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const toolsRequest = { - method: 'tools/list', - params: {} - }; - const toolsResult = await client.request(toolsRequest, types_js_1.ListToolsResultSchema); - console.log('Available tools:'); - if (toolsResult.tools.length === 0) { - console.log(' No tools available'); - } - else { - for (const tool of toolsResult.tools) { - console.log(` - id: ${tool.name}, name: ${(0, metadataUtils_js_1.getDisplayName)(tool)}, description: ${tool.description}`); - } - } - } - catch (error) { - console.log(`Tools not supported by this server (${error})`); - } -} -async function callTool(name, args) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const request = { - method: 'tools/call', - params: { - name, - arguments: args - } - }; - console.log(`Calling tool '${name}' with args:`, args); - const result = await client.request(request, types_js_1.CallToolResultSchema); - console.log('Tool result:'); - const resourceLinks = []; - result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else if (item.type === 'resource_link') { - const resourceLink = item; - resourceLinks.push(resourceLink); - console.log(` 📁 Resource Link: ${resourceLink.name}`); - console.log(` URI: ${resourceLink.uri}`); - if (resourceLink.mimeType) { - console.log(` Type: ${resourceLink.mimeType}`); - } - if (resourceLink.description) { - console.log(` Description: ${resourceLink.description}`); - } - } - else if (item.type === 'resource') { - console.log(` [Embedded Resource: ${item.resource.uri}]`); - } - else if (item.type === 'image') { - console.log(` [Image: ${item.mimeType}]`); - } - else if (item.type === 'audio') { - console.log(` [Audio: ${item.mimeType}]`); - } - else { - console.log(` [Unknown content type]:`, item); - } - }); - // Offer to read resource links - if (resourceLinks.length > 0) { - console.log(`\nFound ${resourceLinks.length} resource link(s). Use 'read-resource ' to read their content.`); - } - } - catch (error) { - console.log(`Error calling tool ${name}: ${error}`); - } -} -async function callGreetTool(name) { - await callTool('greet', { name }); -} -async function callMultiGreetTool(name) { - console.log('Calling multi-greet tool with notifications...'); - await callTool('multi-greet', { name }); -} -async function callCollectInfoTool(infoType) { - console.log(`Testing form elicitation with collect-user-info tool (${infoType})...`); - await callTool('collect-user-info', { infoType }); -} -async function startNotifications(interval, count) { - console.log(`Starting notification stream: interval=${interval}ms, count=${count || 'unlimited'}`); - await callTool('start-notification-stream', { interval, count }); -} -async function runNotificationsToolWithResumability(interval, count) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - console.log(`Starting notification stream with resumability: interval=${interval}ms, count=${count || 'unlimited'}`); - console.log(`Using resumption token: ${notificationsToolLastEventId || 'none'}`); - const request = { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { interval, count } - } - }; - const onLastEventIdUpdate = (event) => { - notificationsToolLastEventId = event; - console.log(`Updated resumption token: ${event}`); - }; - const result = await client.request(request, types_js_1.CallToolResultSchema, { - resumptionToken: notificationsToolLastEventId, - onresumptiontoken: onLastEventIdUpdate - }); - console.log('Tool result:'); - result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else { - console.log(` ${item.type} content:`, item); - } - }); - } - catch (error) { - console.log(`Error starting notification stream: ${error}`); - } -} -async function listPrompts() { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const promptsRequest = { - method: 'prompts/list', - params: {} - }; - const promptsResult = await client.request(promptsRequest, types_js_1.ListPromptsResultSchema); - console.log('Available prompts:'); - if (promptsResult.prompts.length === 0) { - console.log(' No prompts available'); - } - else { - for (const prompt of promptsResult.prompts) { - console.log(` - id: ${prompt.name}, name: ${(0, metadataUtils_js_1.getDisplayName)(prompt)}, description: ${prompt.description}`); - } - } - } - catch (error) { - console.log(`Prompts not supported by this server (${error})`); - } -} -async function getPrompt(name, args) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const promptRequest = { - method: 'prompts/get', - params: { - name, - arguments: args - } - }; - const promptResult = await client.request(promptRequest, types_js_1.GetPromptResultSchema); - console.log('Prompt template:'); - promptResult.messages.forEach((msg, index) => { - console.log(` [${index + 1}] ${msg.role}: ${msg.content.type === 'text' ? msg.content.text : JSON.stringify(msg.content)}`); - }); - } - catch (error) { - console.log(`Error getting prompt ${name}: ${error}`); - } -} -async function listResources() { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const resourcesRequest = { - method: 'resources/list', - params: {} - }; - const resourcesResult = await client.request(resourcesRequest, types_js_1.ListResourcesResultSchema); - console.log('Available resources:'); - if (resourcesResult.resources.length === 0) { - console.log(' No resources available'); - } - else { - for (const resource of resourcesResult.resources) { - console.log(` - id: ${resource.name}, name: ${(0, metadataUtils_js_1.getDisplayName)(resource)}, description: ${resource.uri}`); - } - } - } - catch (error) { - console.log(`Resources not supported by this server (${error})`); - } -} -async function readResource(uri) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const request = { - method: 'resources/read', - params: { uri } - }; - console.log(`Reading resource: ${uri}`); - const result = await client.request(request, types_js_1.ReadResourceResultSchema); - console.log('Resource contents:'); - for (const content of result.contents) { - console.log(` URI: ${content.uri}`); - if (content.mimeType) { - console.log(` Type: ${content.mimeType}`); - } - if ('text' in content && typeof content.text === 'string') { - console.log(' Content:'); - console.log(' ---'); - console.log(content.text - .split('\n') - .map((line) => ' ' + line) - .join('\n')); - console.log(' ---'); - } - else if ('blob' in content && typeof content.blob === 'string') { - console.log(` [Binary data: ${content.blob.length} bytes]`); - } - } - } - catch (error) { - console.log(`Error reading resource ${uri}: ${error}`); - } -} -async function callToolTask(name, args) { - if (!client) { - console.log('Not connected to server.'); - return; - } - console.log(`Calling tool '${name}' with task-based execution...`); - console.log('Arguments:', args); - // Use task-based execution - call now, fetch later - // Using the experimental tasks API - WARNING: may change without notice - console.log('This will return immediately while processing continues in the background...'); - try { - // Call the tool with task metadata using streaming API - const stream = client.experimental.tasks.callToolStream({ - name, - arguments: args - }, types_js_1.CallToolResultSchema, { - task: { - ttl: 60000 // Keep results for 60 seconds - } - }); - console.log('Waiting for task completion...'); - let lastStatus = ''; - for await (const message of stream) { - switch (message.type) { - case 'taskCreated': - console.log('Task created successfully with ID:', message.task.taskId); - break; - case 'taskStatus': - if (lastStatus !== message.task.status) { - console.log(` ${message.task.status}${message.task.statusMessage ? ` - ${message.task.statusMessage}` : ''}`); - } - lastStatus = message.task.status; - break; - case 'result': - console.log('Task completed!'); - console.log('Tool result:'); - message.result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - }); - break; - case 'error': - throw message.error; - } - } - } - catch (error) { - console.log(`Error with task-based execution: ${error}`); - } -} -async function cleanup() { - if (client && transport) { - try { - // First try to terminate the session gracefully - if (transport.sessionId) { - try { - console.log('Terminating session before exit...'); - await transport.terminateSession(); - console.log('Session terminated successfully'); - } - catch (error) { - console.error('Error terminating session:', error); - } - } - // Then close the transport - await transport.close(); - } - catch (error) { - console.error('Error closing transport:', error); - } - } - process.stdin.setRawMode(false); - readline.close(); - console.log('\nGoodbye!'); - process.exit(0); -} -// Set up raw mode for keyboard input to capture Escape key -process.stdin.setRawMode(true); -process.stdin.on('data', async (data) => { - // Check for Escape key (27) - if (data.length === 1 && data[0] === 27) { - console.log('\nESC key pressed. Disconnecting from server...'); - // Abort current operation and disconnect from server - if (client && transport) { - await disconnect(); - console.log('Disconnected. Press Enter to continue.'); - } - else { - console.log('Not connected to server.'); - } - // Re-display the prompt - process.stdout.write('> '); - } -}); -// Handle Ctrl+C -process.on('SIGINT', async () => { - console.log('\nReceived SIGINT. Cleaning up...'); - await cleanup(); -}); -// Start the interactive client -main().catch((error) => { - console.error('Error running MCP client:', error); - process.exit(1); -}); -//# sourceMappingURL=simpleStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.js.map deleted file mode 100644 index f975269..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleStreamableHttp.ts"],"names":[],"mappings":";;AAAA,oDAA+C;AAC/C,sEAA+E;AAC/E,iDAAgD;AAChD,6CAoBwB;AACxB,oEAA+D;AAC/D,6BAA0B;AAE1B,2CAA2C;AAC3C,MAAM,QAAQ,GAAG,IAAA,+BAAe,EAAC;IAC7B,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,MAAM,EAAE,OAAO,CAAC,MAAM;CACzB,CAAC,CAAC;AAEH,0DAA0D;AAC1D,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAE1B,uDAAuD;AACvD,IAAI,MAAM,GAAkB,IAAI,CAAC;AACjC,IAAI,SAAS,GAAyC,IAAI,CAAC;AAC3D,IAAI,SAAS,GAAG,2BAA2B,CAAC;AAC5C,IAAI,4BAA4B,GAAuB,SAAS,CAAC;AACjE,IAAI,SAAS,GAAuB,SAAS,CAAC;AAE9C,KAAK,UAAU,IAAI;IACf,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAErC,sDAAsD;IACtD,MAAM,OAAO,EAAE,CAAC;IAEhB,wCAAwC;IACxC,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,CAAC;AAClB,CAAC;AAED,SAAS,SAAS;IACd,OAAO,CAAC,GAAG,CAAC,uBA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contextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.d.ts deleted file mode 100644 index c794066..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Simple interactive task client demonstrating elicitation and sampling responses. - * - * This client connects to simpleTaskInteractive.ts server and demonstrates: - * - Handling elicitation requests (y/n confirmation) - * - Handling sampling requests (returns a hardcoded haiku) - * - Using task-based tool execution with streaming - */ -export {}; -//# sourceMappingURL=simpleTaskInteractiveClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.d.ts.map deleted file mode 100644 index 89b7338..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleTaskInteractiveClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleTaskInteractiveClient.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.js deleted file mode 100644 index d08970d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.js +++ /dev/null @@ -1,157 +0,0 @@ -"use strict"; -/** - * Simple interactive task client demonstrating elicitation and sampling responses. - * - * This client connects to simpleTaskInteractive.ts server and demonstrates: - * - Handling elicitation requests (y/n confirmation) - * - Handling sampling requests (returns a hardcoded haiku) - * - Using task-based tool execution with streaming - */ -Object.defineProperty(exports, "__esModule", { value: true }); -const index_js_1 = require("../../client/index.js"); -const streamableHttp_js_1 = require("../../client/streamableHttp.js"); -const node_readline_1 = require("node:readline"); -const types_js_1 = require("../../types.js"); -// Create readline interface for user input -const readline = (0, node_readline_1.createInterface)({ - input: process.stdin, - output: process.stdout -}); -function question(prompt) { - return new Promise(resolve => { - readline.question(prompt, answer => { - resolve(answer.trim()); - }); - }); -} -function getTextContent(result) { - const textContent = result.content.find((c) => c.type === 'text'); - return textContent?.text ?? '(no text)'; -} -async function elicitationCallback(params) { - console.log(`\n[Elicitation] Server asks: ${params.message}`); - // Simple terminal prompt for y/n - const response = await question('Your response (y/n): '); - const confirmed = ['y', 'yes', 'true', '1'].includes(response.toLowerCase()); - console.log(`[Elicitation] Responding with: confirm=${confirmed}`); - return { action: 'accept', content: { confirm: confirmed } }; -} -async function samplingCallback(params) { - // Get the prompt from the first message - let prompt = 'unknown'; - if (params.messages && params.messages.length > 0) { - const firstMessage = params.messages[0]; - const content = firstMessage.content; - if (typeof content === 'object' && !Array.isArray(content) && content.type === 'text' && 'text' in content) { - prompt = content.text; - } - else if (Array.isArray(content)) { - const textPart = content.find(c => c.type === 'text' && 'text' in c); - if (textPart && 'text' in textPart) { - prompt = textPart.text; - } - } - } - console.log(`\n[Sampling] Server requests LLM completion for: ${prompt}`); - // Return a hardcoded haiku (in real use, call your LLM here) - const haiku = `Cherry blossoms fall -Softly on the quiet pond -Spring whispers goodbye`; - console.log('[Sampling] Responding with haiku'); - return { - model: 'mock-haiku-model', - role: 'assistant', - content: { type: 'text', text: haiku } - }; -} -async function run(url) { - console.log('Simple Task Interactive Client'); - console.log('=============================='); - console.log(`Connecting to ${url}...`); - // Create client with elicitation and sampling capabilities - const client = new index_js_1.Client({ name: 'simple-task-interactive-client', version: '1.0.0' }, { - capabilities: { - elicitation: { form: {} }, - sampling: {} - } - }); - // Set up elicitation request handler - client.setRequestHandler(types_js_1.ElicitRequestSchema, async (request) => { - if (request.params.mode && request.params.mode !== 'form') { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Unsupported elicitation mode: ${request.params.mode}`); - } - return elicitationCallback(request.params); - }); - // Set up sampling request handler - client.setRequestHandler(types_js_1.CreateMessageRequestSchema, async (request) => { - return samplingCallback(request.params); - }); - // Connect to server - const transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(url)); - await client.connect(transport); - console.log('Connected!\n'); - // List tools - const toolsResult = await client.listTools(); - console.log(`Available tools: ${toolsResult.tools.map(t => t.name).join(', ')}`); - // Demo 1: Elicitation (confirm_delete) - console.log('\n--- Demo 1: Elicitation ---'); - console.log('Calling confirm_delete tool...'); - const confirmStream = client.experimental.tasks.callToolStream({ name: 'confirm_delete', arguments: { filename: 'important.txt' } }, types_js_1.CallToolResultSchema, { task: { ttl: 60000 } }); - for await (const message of confirmStream) { - switch (message.type) { - case 'taskCreated': - console.log(`Task created: ${message.task.taskId}`); - break; - case 'taskStatus': - console.log(`Task status: ${message.task.status}`); - break; - case 'result': - console.log(`Result: ${getTextContent(message.result)}`); - break; - case 'error': - console.error(`Error: ${message.error}`); - break; - } - } - // Demo 2: Sampling (write_haiku) - console.log('\n--- Demo 2: Sampling ---'); - console.log('Calling write_haiku tool...'); - const haikuStream = client.experimental.tasks.callToolStream({ name: 'write_haiku', arguments: { topic: 'autumn leaves' } }, types_js_1.CallToolResultSchema, { - task: { ttl: 60000 } - }); - for await (const message of haikuStream) { - switch (message.type) { - case 'taskCreated': - console.log(`Task created: ${message.task.taskId}`); - break; - case 'taskStatus': - console.log(`Task status: ${message.task.status}`); - break; - case 'result': - console.log(`Result:\n${getTextContent(message.result)}`); - break; - case 'error': - console.error(`Error: ${message.error}`); - break; - } - } - // Cleanup - console.log('\nDemo complete. Closing connection...'); - await transport.close(); - readline.close(); -} -// Parse command line arguments -const args = process.argv.slice(2); -let url = 'http://localhost:8000/mcp'; -for (let i = 0; i < args.length; i++) { - if (args[i] === '--url' && args[i + 1]) { - url = args[i + 1]; - i++; - } -} -// Run the client -run(url).catch(error => { - console.error('Error running client:', error); - process.exit(1); -}); -//# sourceMappingURL=simpleTaskInteractiveClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.js.map deleted file mode 100644 index c766c87..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleTaskInteractiveClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleTaskInteractiveClient.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleTaskInteractiveClient.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAEH,oDAA+C;AAC/C,sEAA+E;AAC/E,iDAAgD;AAChD,6CASwB;AAExB,2CAA2C;AAC3C,MAAM,QAAQ,GAAG,IAAA,+BAAe,EAAC;IAC7B,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,MAAM,EAAE,OAAO,CAAC,MAAM;CACzB,CAAC,CAAC;AAEH,SAAS,QAAQ,CAAC,MAAc;IAC5B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QACzB,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;YAC/B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,cAAc,CAAC,MAA2D;IAC/E,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAoB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;IACpF,OAAO,WAAW,EAAE,IAAI,IAAI,WAAW,CAAC;AAC5C,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,MAIlC;IACG,OAAO,CAAC,GAAG,CAAC,gCAAgC,MAAM,CAAC,OAAO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UAAU;IACV,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IACtD,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,CAAC;AACrB,CAAC;AAED,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,IAAI,GAAG,GAAG,2BAA2B,CAAC;AAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;IACnC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACrC,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAClB,CAAC,EAAE,CAAC;IACR,CAAC;AACL,CAAC;AAED,iBAAiB;AACjB,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.d.ts deleted file mode 100644 index 134b4b0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=ssePollingClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.d.ts.map deleted file mode 100644 index 59e4153..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ssePollingClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/ssePollingClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.js deleted file mode 100644 index a529ae5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * SSE Polling Example Client (SEP-1699) - * - * This example demonstrates client-side behavior during server-initiated - * SSE stream disconnection and automatic reconnection. - * - * Key features demonstrated: - * - Automatic reconnection when server closes SSE stream - * - Event replay via Last-Event-ID header - * - Resumption token tracking via onresumptiontoken callback - * - * Run with: npx tsx src/examples/client/ssePollingClient.ts - * Requires: ssePollingExample.ts server running on port 3001 - */ -const index_js_1 = require("../../client/index.js"); -const streamableHttp_js_1 = require("../../client/streamableHttp.js"); -const types_js_1 = require("../../types.js"); -const SERVER_URL = 'http://localhost:3001/mcp'; -async function main() { - console.log('SSE Polling Example Client'); - console.log('=========================='); - console.log(`Connecting to ${SERVER_URL}...`); - console.log(''); - // Create transport with reconnection options - const transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(SERVER_URL), { - // Use default reconnection options - SDK handles automatic reconnection - }); - // Track the last event ID for debugging - let lastEventId; - // Set up transport error handler to observe disconnections - // Filter out expected errors from SSE reconnection - transport.onerror = error => { - // Skip abort errors during intentional close - if (error.message.includes('AbortError')) - return; - // Show SSE disconnect (expected when server closes stream) - if (error.message.includes('Unexpected end of JSON')) { - console.log('[Transport] SSE stream disconnected - client will auto-reconnect'); - return; - } - console.log(`[Transport] Error: ${error.message}`); - }; - // Set up transport close handler - transport.onclose = () => { - console.log('[Transport] Connection closed'); - }; - // Create and connect client - const client = new index_js_1.Client({ - name: 'sse-polling-client', - version: '1.0.0' - }); - // Set up notification handler to receive progress updates - client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, notification => { - const data = notification.params.data; - console.log(`[Notification] ${data}`); - }); - try { - await client.connect(transport); - console.log('[Client] Connected successfully'); - console.log(''); - // Call the long-task tool - console.log('[Client] Calling long-task tool...'); - console.log('[Client] Server will disconnect mid-task to demonstrate polling'); - console.log(''); - const result = await client.request({ - method: 'tools/call', - params: { - name: 'long-task', - arguments: {} - } - }, types_js_1.CallToolResultSchema, { - // Track resumption tokens for debugging - onresumptiontoken: token => { - lastEventId = token; - console.log(`[Event ID] ${token}`); - } - }); - console.log(''); - console.log('[Client] Tool completed!'); - console.log(`[Result] ${JSON.stringify(result.content, null, 2)}`); - console.log(''); - console.log(`[Debug] Final event ID: ${lastEventId}`); - } - catch (error) { - console.error('[Error]', error); - } - finally { - await transport.close(); - console.log('[Client] Disconnected'); - } -} -main().catch(console.error); -//# sourceMappingURL=ssePollingClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.js.map deleted file mode 100644 index bcc881d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/ssePollingClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ssePollingClient.js","sourceRoot":"","sources":["../../../../src/examples/client/ssePollingClient.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;GAaG;AACH,oDAA+C;AAC/C,sEAA+E;AAC/E,6CAAwF;AAExF,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAE/C,KAAK,UAAU,IAAI;IACf,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IA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AAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts deleted file mode 100644 index c2679e6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=streamableHttpWithSseFallbackClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts.map deleted file mode 100644 index b79ae2a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttpWithSseFallbackClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js deleted file mode 100644 index bf3e9a8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js +++ /dev/null @@ -1,168 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const index_js_1 = require("../../client/index.js"); -const streamableHttp_js_1 = require("../../client/streamableHttp.js"); -const sse_js_1 = require("../../client/sse.js"); -const types_js_1 = require("../../types.js"); -/** - * Simplified Backwards Compatible MCP Client - * - * This client demonstrates backward compatibility with both: - * 1. Modern servers using Streamable HTTP transport (protocol version 2025-03-26) - * 2. Older servers using HTTP+SSE transport (protocol version 2024-11-05) - * - * Following the MCP specification for backwards compatibility: - * - Attempts to POST an initialize request to the server URL first (modern transport) - * - If that fails with 4xx status, falls back to GET request for SSE stream (older transport) - */ -// Command line args processing -const args = process.argv.slice(2); -const serverUrl = args[0] || 'http://localhost:3000/mcp'; -async function main() { - console.log('MCP Backwards Compatible Client'); - console.log('==============================='); - console.log(`Connecting to server at: ${serverUrl}`); - let client; - let transport; - try { - // Try connecting with automatic transport detection - const connection = await connectWithBackwardsCompatibility(serverUrl); - client = connection.client; - transport = connection.transport; - // Set up notification handler - client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, notification => { - console.log(`Notification: ${notification.params.level} - ${notification.params.data}`); - }); - // DEMO WORKFLOW: - // 1. List available tools - console.log('\n=== Listing Available Tools ==='); - await listTools(client); - // 2. Call the notification tool - console.log('\n=== Starting Notification Stream ==='); - await startNotificationTool(client); - // 3. Wait for all notifications (5 seconds) - console.log('\n=== Waiting for all notifications ==='); - await new Promise(resolve => setTimeout(resolve, 5000)); - // 4. Disconnect - console.log('\n=== Disconnecting ==='); - await transport.close(); - console.log('Disconnected from MCP server'); - } - catch (error) { - console.error('Error running client:', error); - process.exit(1); - } -} -/** - * Connect to an MCP server with backwards compatibility - * Following the spec for client backward compatibility - */ -async function connectWithBackwardsCompatibility(url) { - console.log('1. Trying Streamable HTTP transport first...'); - // Step 1: Try Streamable HTTP transport first - const client = new index_js_1.Client({ - name: 'backwards-compatible-client', - version: '1.0.0' - }); - client.onerror = error => { - console.error('Client error:', error); - }; - const baseUrl = new URL(url); - try { - // Create modern transport - const streamableTransport = new streamableHttp_js_1.StreamableHTTPClientTransport(baseUrl); - await client.connect(streamableTransport); - console.log('Successfully connected using modern Streamable HTTP transport.'); - return { - client, - transport: streamableTransport, - transportType: 'streamable-http' - }; - } - catch (error) { - // Step 2: If transport fails, try the older SSE transport - console.log(`StreamableHttp transport connection failed: ${error}`); - console.log('2. Falling back to deprecated HTTP+SSE transport...'); - try { - // Create SSE transport pointing to /sse endpoint - const sseTransport = new sse_js_1.SSEClientTransport(baseUrl); - const sseClient = new index_js_1.Client({ - name: 'backwards-compatible-client', - version: '1.0.0' - }); - await sseClient.connect(sseTransport); - console.log('Successfully connected using deprecated HTTP+SSE transport.'); - return { - client: sseClient, - transport: sseTransport, - transportType: 'sse' - }; - } - catch (sseError) { - console.error(`Failed to connect with either transport method:\n1. Streamable HTTP error: ${error}\n2. SSE error: ${sseError}`); - throw new Error('Could not connect to server with any available transport'); - } - } -} -/** - * List available tools on the server - */ -async function listTools(client) { - try { - const toolsRequest = { - method: 'tools/list', - params: {} - }; - const toolsResult = await client.request(toolsRequest, types_js_1.ListToolsResultSchema); - console.log('Available tools:'); - if (toolsResult.tools.length === 0) { - console.log(' No tools available'); - } - else { - for (const tool of toolsResult.tools) { - console.log(` - ${tool.name}: ${tool.description}`); - } - } - } - catch (error) { - console.log(`Tools not supported by this server: ${error}`); - } -} -/** - * Start a notification stream by calling the notification tool - */ -async function startNotificationTool(client) { - try { - // Call the notification tool using reasonable defaults - const request = { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { - interval: 1000, // 1 second between notifications - count: 5 // Send 5 notifications - } - } - }; - console.log('Calling notification tool...'); - const result = await client.request(request, types_js_1.CallToolResultSchema); - console.log('Tool result:'); - result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else { - console.log(` ${item.type} content:`, item); - } - }); - } - catch (error) { - console.log(`Error calling notification tool: ${error}`); - } -} -// Start the client -main().catch((error) => { - console.error('Error running MCP client:', error); - process.exit(1); -}); -//# sourceMappingURL=streamableHttpWithSseFallbackClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js.map deleted file mode 100644 index f3bec99..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttpWithSseFallbackClient.js","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":";;AAAA,oDAA+C;AAC/C,sEAA+E;AAC/E,gDAAyD;AACzD,6CAMwB;AAExB;;;;;;;;;;GAUG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,2BAA2B,CAAC;AAEzD,KAAK,UAAU,IAAI;IACf,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,4BAA4B,SAAS,EAAE,CAAC,CAAC;IAErD,IAAI,MAAc,CAAC;IACnB,IAAI,SAA6D,CAAC;IAElE,IAAI,CAAC;QACD,oDAAoD;QACpD,MAAM,UAAU,GAAG,MAAM,iCAAiC,CAAC,SAAS,CAAC,CAAC;QACtE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC3B,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QAEjC,8BAA8B;QAC9B,MAAM,CAAC,sBAAsB,CAAC,2CAAgC,EAAE,YAAY,CAAC,EAAE;YAC3E,OAAO,CAAC,GAAG,CAAC,iBAAiB,YAAY,CAAC,MAAM,CAAC,KAAK,MAAM,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5F,CAAC,CAAC,CAAC;QAEH,iBAAiB;QACjB,0BAA0B;QAC1B,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QACjD,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC;QAExB,gCA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AAC;QACb,OAAO,CAAC,GAAG,CAAC,oCAAoC,KAAK,EAAE,CAAC,CAAC;IAC7D,CAAC;AACL,CAAC;AAED,mBAAmB;AACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts deleted file mode 100644 index 218aeac..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { AuthorizationParams, OAuthServerProvider } from '../../server/auth/provider.js'; -import { OAuthRegisteredClientsStore } from '../../server/auth/clients.js'; -import { OAuthClientInformationFull, OAuthMetadata, OAuthTokens } from '../../shared/auth.js'; -import { Response } from 'express'; -import { AuthInfo } from '../../server/auth/types.js'; -export declare class DemoInMemoryClientsStore implements OAuthRegisteredClientsStore { - private clients; - getClient(clientId: string): Promise<{ - redirect_uris: string[]; - client_id: string; - token_endpoint_auth_method?: string | undefined; - grant_types?: string[] | undefined; - response_types?: string[] | undefined; - client_name?: string | undefined; - client_uri?: string | undefined; - logo_uri?: string | undefined; - scope?: string | undefined; - contacts?: string[] | undefined; - tos_uri?: string | undefined; - policy_uri?: string | undefined; - jwks_uri?: string | undefined; - jwks?: any; - software_id?: string | undefined; - software_version?: string | undefined; - software_statement?: string | undefined; - client_secret?: string | undefined; - client_id_issued_at?: number | undefined; - client_secret_expires_at?: number | undefined; - } | undefined>; - registerClient(clientMetadata: OAuthClientInformationFull): Promise<{ - redirect_uris: string[]; - client_id: string; - token_endpoint_auth_method?: string | undefined; - grant_types?: string[] | undefined; - response_types?: string[] | undefined; - client_name?: string | undefined; - client_uri?: string | undefined; - logo_uri?: string | undefined; - scope?: string | undefined; - contacts?: string[] | undefined; - tos_uri?: string | undefined; - policy_uri?: string | undefined; - jwks_uri?: string | undefined; - jwks?: any; - software_id?: string | undefined; - software_version?: string | undefined; - software_statement?: string | undefined; - client_secret?: string | undefined; - client_id_issued_at?: number | undefined; - client_secret_expires_at?: number | undefined; - }>; -} -/** - * 🚨 DEMO ONLY - NOT FOR PRODUCTION - * - * This example demonstrates MCP OAuth flow but lacks some of the features required for production use, - * for example: - * - Persistent token storage - * - Rate limiting - */ -export declare class DemoInMemoryAuthProvider implements OAuthServerProvider { - private validateResource?; - clientsStore: DemoInMemoryClientsStore; - private codes; - private tokens; - constructor(validateResource?: ((resource?: URL) => boolean) | undefined); - authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; - challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise; - exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, _codeVerifier?: string): Promise; - exchangeRefreshToken(_client: OAuthClientInformationFull, _refreshToken: string, _scopes?: string[], _resource?: URL): Promise; - verifyAccessToken(token: string): Promise; -} -export declare const setupAuthServer: ({ authServerUrl, mcpServerUrl, strictResource }: { - authServerUrl: URL; - mcpServerUrl: URL; - strictResource: boolean; -}) => OAuthMetadata; -//# sourceMappingURL=demoInMemoryOAuthProvider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map deleted file mode 100644 index 8a4a43f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"demoInMemoryOAuthProvider.d.ts","sourceRoot":"","sources":["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AO,CAAC,EAAE,MAAM,EAAE,EAClB,SAAS,CAAC,EAAE,GAAG,GAChB,OAAO,CAAC,WAAW,CAAC;IAIjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAc5D;AAED,eAAO,MAAM,eAAe,oDAIzB;IACC,aAAa,EAAE,GAAG,CAAC;IACnB,YAAY,EAAE,GAAG,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;CAC3B,KAAG,aA+EH,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js deleted file mode 100644 index c439a34..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js +++ /dev/null @@ -1,205 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.setupAuthServer = exports.DemoInMemoryAuthProvider = exports.DemoInMemoryClientsStore = void 0; -const node_crypto_1 = require("node:crypto"); -const express_1 = __importDefault(require("express")); -const router_js_1 = require("../../server/auth/router.js"); -const auth_utils_js_1 = require("../../shared/auth-utils.js"); -const errors_js_1 = require("../../server/auth/errors.js"); -class DemoInMemoryClientsStore { - constructor() { - this.clients = new Map(); - } - async getClient(clientId) { - return this.clients.get(clientId); - } - async registerClient(clientMetadata) { - this.clients.set(clientMetadata.client_id, clientMetadata); - return clientMetadata; - } -} -exports.DemoInMemoryClientsStore = DemoInMemoryClientsStore; -/** - * 🚨 DEMO ONLY - NOT FOR PRODUCTION - * - * This example demonstrates MCP OAuth flow but lacks some of the features required for production use, - * for example: - * - Persistent token storage - * - Rate limiting - */ -class DemoInMemoryAuthProvider { - constructor(validateResource) { - this.validateResource = validateResource; - this.clientsStore = new DemoInMemoryClientsStore(); - this.codes = new Map(); - this.tokens = new Map(); - } - async authorize(client, params, res) { - const code = (0, node_crypto_1.randomUUID)(); - const searchParams = new URLSearchParams({ - code - }); - if (params.state !== undefined) { - searchParams.set('state', params.state); - } - this.codes.set(code, { - client, - params - }); - // Simulate a user login - // Set a secure HTTP-only session cookie with authorization info - if (res.cookie) { - const authCookieData = { - userId: 'demo_user', - name: 'Demo User', - timestamp: Date.now() - }; - res.cookie('demo_session', JSON.stringify(authCookieData), { - httpOnly: true, - secure: false, // In production, this should be true - sameSite: 'lax', - maxAge: 24 * 60 * 60 * 1000, // 24 hours - for demo purposes - path: '/' // Available to all routes - }); - } - if (!client.redirect_uris.includes(params.redirectUri)) { - throw new errors_js_1.InvalidRequestError('Unregistered redirect_uri'); - } - const targetUrl = new URL(params.redirectUri); - targetUrl.search = searchParams.toString(); - res.redirect(targetUrl.toString()); - } - async challengeForAuthorizationCode(client, authorizationCode) { - // Store the challenge with the code data - const codeData = this.codes.get(authorizationCode); - if (!codeData) { - throw new Error('Invalid authorization code'); - } - return codeData.params.codeChallenge; - } - async exchangeAuthorizationCode(client, authorizationCode, - // Note: code verifier is checked in token.ts by default - // it's unused here for that reason. - _codeVerifier) { - const codeData = this.codes.get(authorizationCode); - if (!codeData) { - throw new Error('Invalid authorization code'); - } - if (codeData.client.client_id !== client.client_id) { - throw new Error(`Authorization code was not issued to this client, ${codeData.client.client_id} != ${client.client_id}`); - } - if (this.validateResource && !this.validateResource(codeData.params.resource)) { - throw new Error(`Invalid resource: ${codeData.params.resource}`); - } - this.codes.delete(authorizationCode); - const token = (0, node_crypto_1.randomUUID)(); - const tokenData = { - token, - clientId: client.client_id, - scopes: codeData.params.scopes || [], - expiresAt: Date.now() + 3600000, // 1 hour - resource: codeData.params.resource, - type: 'access' - }; - this.tokens.set(token, tokenData); - return { - access_token: token, - token_type: 'bearer', - expires_in: 3600, - scope: (codeData.params.scopes || []).join(' ') - }; - } - async exchangeRefreshToken(_client, _refreshToken, _scopes, _resource) { - throw new Error('Not implemented for example demo'); - } - async verifyAccessToken(token) { - const tokenData = this.tokens.get(token); - if (!tokenData || !tokenData.expiresAt || tokenData.expiresAt < Date.now()) { - throw new Error('Invalid or expired token'); - } - return { - token, - clientId: tokenData.clientId, - scopes: tokenData.scopes, - expiresAt: Math.floor(tokenData.expiresAt / 1000), - resource: tokenData.resource - }; - } -} -exports.DemoInMemoryAuthProvider = DemoInMemoryAuthProvider; -const setupAuthServer = ({ authServerUrl, mcpServerUrl, strictResource }) => { - // Create separate auth server app - // NOTE: This is a separate app on a separate port to illustrate - // how to separate an OAuth Authorization Server from a Resource - // server in the SDK. The SDK is not intended to be provide a standalone - // authorization server. - const validateResource = strictResource - ? (resource) => { - if (!resource) - return false; - const expectedResource = (0, auth_utils_js_1.resourceUrlFromServerUrl)(mcpServerUrl); - return resource.toString() === expectedResource.toString(); - } - : undefined; - const provider = new DemoInMemoryAuthProvider(validateResource); - const authApp = (0, express_1.default)(); - authApp.use(express_1.default.json()); - // For introspection requests - authApp.use(express_1.default.urlencoded()); - // Add OAuth routes to the auth server - // NOTE: this will also add a protected resource metadata route, - // but it won't be used, so leave it. - authApp.use((0, router_js_1.mcpAuthRouter)({ - provider, - issuerUrl: authServerUrl, - scopesSupported: ['mcp:tools'] - })); - authApp.post('/introspect', async (req, res) => { - try { - const { token } = req.body; - if (!token) { - res.status(400).json({ error: 'Token is required' }); - return; - } - const tokenInfo = await provider.verifyAccessToken(token); - res.json({ - active: true, - client_id: tokenInfo.clientId, - scope: tokenInfo.scopes.join(' '), - exp: tokenInfo.expiresAt, - aud: tokenInfo.resource - }); - return; - } - catch (error) { - res.status(401).json({ - active: false, - error: 'Unauthorized', - error_description: `Invalid token: ${error}` - }); - } - }); - const auth_port = authServerUrl.port; - // Start the auth server - authApp.listen(auth_port, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`OAuth Authorization Server listening on port ${auth_port}`); - }); - // Note: we could fetch this from the server, but then we end up - // with some top level async which gets annoying. - const oauthMetadata = (0, router_js_1.createOAuthMetadata)({ - provider, - issuerUrl: authServerUrl, - scopesSupported: ['mcp:tools'] - }); - oauthMetadata.introspection_endpoint = new URL('/introspect', authServerUrl).href; - return oauthMetadata; -}; -exports.setupAuthServer = setupAuthServer; -//# sourceMappingURL=demoInMemoryOAuthProvider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map deleted file mode 100644 index e19a20d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"demoInMemoryOAuthProvider.js","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAyC;AAIzC,sDAAqD;AAErD,2DAAiF;AACjF,8DAAsE;AACtE,2DAAkE;AAElE,MAAa,wBAAwB;IAArC;QACY,YAAO,GAAG,IAAI,GAAG,EAAsC,CAAC;IAUpE,CAAC;IARG,KAAK,CAAC,SAAS,CAAC,QAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,cAA0C;QAC3D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAC3D,OAAO,cAAc,CAAC;IAC1B,CAAC;CACJ;AAXD,4DAWC;AAED;;;;;;;GAOG;AACH,MAAa,wBAAwB;IAWjC,YAAoB,gBAA8C;QAA9C,qBAAgB,GAAhB,gBAAgB,CAA8B;QAVlE,iBAAY,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACtC,UAAK,GAAG,IAAI,GAAG,EAMpB,CAAC;QACI,WAAM,GAAG,IAAI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,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC;IAElF,OAAO,aAAa,CAAC;AACzB,CAAC,CAAC;AAvFW,QAAA,eAAe,mBAuF1B"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts deleted file mode 100644 index e4b736e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=elicitationFormExample.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts.map deleted file mode 100644 index c569df4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationFormExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/elicitationFormExample.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js deleted file mode 100644 index d06af96..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js +++ /dev/null @@ -1,437 +0,0 @@ -"use strict"; -// Run with: npx tsx src/examples/server/elicitationFormExample.ts -// -// This example demonstrates how to use form elicitation to collect structured user input -// with JSON Schema validation via a local HTTP server with SSE streaming. -// Form elicitation allows servers to request *non-sensitive* user input through the client -// with schema-based validation. -// Note: See also elicitationUrlExample.ts for an example of using URL elicitation -// to collect *sensitive* user input via a browser. -Object.defineProperty(exports, "__esModule", { value: true }); -const node_crypto_1 = require("node:crypto"); -const mcp_js_1 = require("../../server/mcp.js"); -const streamableHttp_js_1 = require("../../server/streamableHttp.js"); -const types_js_1 = require("../../types.js"); -const express_js_1 = require("../../server/express.js"); -// Factory to create a new MCP server per session. -// Each session needs its own server+transport pair to avoid cross-session contamination. -const getServer = () => { - // Create MCP server - it will automatically use AjvJsonSchemaValidator with sensible defaults - // The validator supports format validation (email, date, etc.) if ajv-formats is installed - const mcpServer = new mcp_js_1.McpServer({ - name: 'form-elicitation-example-server', - version: '1.0.0' - }, { - capabilities: {} - }); - /** - * Example 1: Simple user registration tool - * Collects username, email, and password from the user - */ - mcpServer.registerTool('register_user', { - description: 'Register a new user account by collecting their information', - inputSchema: {} - }, async () => { - try { - // Request user information through form elicitation - const result = await mcpServer.server.elicitInput({ - mode: 'form', - message: 'Please provide your registration information:', - requestedSchema: { - type: 'object', - properties: { - username: { - type: 'string', - title: 'Username', - description: 'Your desired username (3-20 characters)', - minLength: 3, - maxLength: 20 - }, - email: { - type: 'string', - title: 'Email', - description: 'Your email address', - format: 'email' - }, - password: { - type: 'string', - title: 'Password', - description: 'Your password (min 8 characters)', - minLength: 8 - }, - newsletter: { - type: 'boolean', - title: 'Newsletter', - description: 'Subscribe to newsletter?', - default: false - } - }, - required: ['username', 'email', 'password'] - } - }); - // Handle the different possible actions - if (result.action === 'accept' && result.content) { - const { username, email, newsletter } = result.content; - return { - content: [ - { - type: 'text', - text: `Registration successful!\n\nUsername: ${username}\nEmail: ${email}\nNewsletter: ${newsletter ? 'Yes' : 'No'}` - } - ] - }; - } - else if (result.action === 'decline') { - return { - content: [ - { - type: 'text', - text: 'Registration cancelled by user.' - } - ] - }; - } - else { - return { - content: [ - { - type: 'text', - text: 'Registration was cancelled.' - } - ] - }; - } - } - catch (error) { - return { - content: [ - { - type: 'text', - text: `Registration failed: ${error instanceof Error ? error.message : String(error)}` - } - ], - isError: true - }; - } - }); - /** - * Example 2: Multi-step workflow with multiple form elicitation requests - * Demonstrates how to collect information in multiple steps - */ - mcpServer.registerTool('create_event', { - description: 'Create a calendar event by collecting event details', - inputSchema: {} - }, async () => { - try { - // Step 1: Collect basic event information - const basicInfo = await mcpServer.server.elicitInput({ - mode: 'form', - message: 'Step 1: Enter basic event information', - requestedSchema: { - type: 'object', - properties: { - title: { - type: 'string', - title: 'Event Title', - description: 'Name of the event', - minLength: 1 - }, - description: { - type: 'string', - title: 'Description', - description: 'Event description (optional)' - } - }, - required: ['title'] - } - }); - if (basicInfo.action !== 'accept' || !basicInfo.content) { - return { - content: [{ type: 'text', text: 'Event creation cancelled.' }] - }; - } - // Step 2: Collect date and time - const dateTime = await mcpServer.server.elicitInput({ - mode: 'form', - message: 'Step 2: Enter date and time', - requestedSchema: { - type: 'object', - properties: { - date: { - type: 'string', - title: 'Date', - description: 'Event date', - format: 'date' - }, - startTime: { - type: 'string', - title: 'Start Time', - description: 'Event start time (HH:MM)' - }, - duration: { - type: 'integer', - title: 'Duration', - description: 'Duration in minutes', - minimum: 15, - maximum: 480 - } - }, - required: ['date', 'startTime', 'duration'] - } - }); - if (dateTime.action !== 'accept' || !dateTime.content) { - return { - content: [{ type: 'text', text: 'Event creation cancelled.' }] - }; - } - // Combine all collected information - const event = { - ...basicInfo.content, - ...dateTime.content - }; - return { - content: [ - { - type: 'text', - text: `Event created successfully!\n\n${JSON.stringify(event, null, 2)}` - } - ] - }; - } - catch (error) { - return { - content: [ - { - type: 'text', - text: `Event creation failed: ${error instanceof Error ? error.message : String(error)}` - } - ], - isError: true - }; - } - }); - /** - * Example 3: Collecting address information - * Demonstrates validation with patterns and optional fields - */ - mcpServer.registerTool('update_shipping_address', { - description: 'Update shipping address with validation', - inputSchema: {} - }, async () => { - try { - const result = await mcpServer.server.elicitInput({ - mode: 'form', - message: 'Please provide your shipping address:', - requestedSchema: { - type: 'object', - properties: { - name: { - type: 'string', - title: 'Full Name', - description: 'Recipient name', - minLength: 1 - }, - street: { - type: 'string', - title: 'Street Address', - minLength: 1 - }, - city: { - type: 'string', - title: 'City', - minLength: 1 - }, - state: { - type: 'string', - title: 'State/Province', - minLength: 2, - maxLength: 2 - }, - zipCode: { - type: 'string', - title: 'ZIP/Postal Code', - description: '5-digit ZIP code' - }, - phone: { - type: 'string', - title: 'Phone Number (optional)', - description: 'Contact phone number' - } - }, - required: ['name', 'street', 'city', 'state', 'zipCode'] - } - }); - if (result.action === 'accept' && result.content) { - return { - content: [ - { - type: 'text', - text: `Address updated successfully!\n\n${JSON.stringify(result.content, null, 2)}` - } - ] - }; - } - else if (result.action === 'decline') { - return { - content: [{ type: 'text', text: 'Address update cancelled by user.' }] - }; - } - else { - return { - content: [{ type: 'text', text: 'Address update was cancelled.' }] - }; - } - } - catch (error) { - return { - content: [ - { - type: 'text', - text: `Address update failed: ${error instanceof Error ? error.message : String(error)}` - } - ], - isError: true - }; - } - }); - return mcpServer; -}; -async function main() { - const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000; - const app = (0, express_js_1.createMcpExpressApp)(); - // Map to store transports by session ID - const transports = {}; - // MCP POST endpoint - const mcpPostHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (sessionId) { - console.log(`Received MCP request for session: ${sessionId}`); - } - try { - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport for this session - transport = transports[sessionId]; - } - else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) { - // New initialization request - create new transport - transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ - sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}, removing from transports map`); - delete transports[sid]; - } - }; - // Create a new server per session and connect it to the transport - const mcpServer = getServer(); - await mcpServer.connect(transport); - await transport.handleRequest(req, res, req.body); - return; - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } - }; - app.post('/mcp', mcpPostHandler); - // Handle GET requests for SSE streams - const mcpGetHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Establishing SSE stream for session ${sessionId}`); - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - }; - app.get('/mcp', mcpGetHandler); - // Handle DELETE requests for session termination - const mcpDeleteHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Received session termination request for session ${sessionId}`); - try { - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - } - catch (error) { - console.error('Error handling session termination:', error); - if (!res.headersSent) { - res.status(500).send('Error processing session termination'); - } - } - }; - app.delete('/mcp', mcpDeleteHandler); - // Start listening - app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`Form elicitation example server is running on http://localhost:${PORT}/mcp`); - console.log('Available tools:'); - console.log(' - register_user: Collect user registration information'); - console.log(' - create_event: Multi-step event creation'); - console.log(' - update_shipping_address: Collect and validate address'); - console.log('\nConnect your MCP client to this server using the HTTP transport.'); - }); - // Handle server shutdown - process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); - }); -} -main().catch(error => { - console.error('Server error:', error); - process.exit(1); -}); -//# sourceMappingURL=elicitationFormExample.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js.map deleted file mode 100644 index 7dc1a50..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationFormExample.js","sourceRoot":"","sources":["../../../../src/examples/server/elicitationFormExample.ts"],"names":[],"mappings":";AAAA,kEAAkE;AAClE,EAAE;AACF,yFAAyF;AACzF,0EAA0E;AAC1E,2FAA2F;AAC3F,gCAAgC;AAChC,kFAAkF;AAClF,mDAAmD;;AAEnD,6CAAyC;AAEzC,gDAAgD;AAChD,sEAA+E;AAC/E,6CAAqD;AACrD,wDAA8D;AAE9D,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,8FAA8F;IAC9F,2FAA2F;IAC3F,MAAM,SAAS,GAAG,IAAI,kBAAS,CAC3B;QACI,IAAI,EAAE,iCAAiC;QACvC,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE,EAAE;KACnB,CACJ,CAAC;IAEF;;;OAGG;IACH,SAAS,CAAC,YAAY,CAClB,eAAe,EACf;QACI,WAAW,EAAE,6DAA6D;QAC1E,WAAW,EAAE,EAAE;KAClB,EACD,KAAK,IAAI,EAAE;QACP,IAAI,CAAC;YACD,oDAAoD;YACpD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC;gBAC9C,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,+CAA+C;gBACxD,eAAe,EAAE;oBACb,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,QAAQ,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,UAAU;4BACjB,WAAW,E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AA0B,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts deleted file mode 100644 index 611f6eb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=elicitationUrlExample.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts.map deleted file mode 100644 index 04acd66..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationUrlExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/elicitationUrlExample.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js deleted file mode 100644 index 53c860b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js +++ /dev/null @@ -1,656 +0,0 @@ -"use strict"; -// Run with: npx tsx src/examples/server/elicitationUrlExample.ts -// -// This example demonstrates how to use URL elicitation to securely collect -// *sensitive* user input in a remote (HTTP) server. -// URL elicitation allows servers to prompt the end-user to open a URL in their browser -// to collect sensitive information. -// Note: See also elicitationFormExample.ts for an example of using form (not URL) elicitation -// to collect *non-sensitive* user input with a structured schema. -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const express_1 = __importDefault(require("express")); -const node_crypto_1 = require("node:crypto"); -const zod_1 = require("zod"); -const mcp_js_1 = require("../../server/mcp.js"); -const express_js_1 = require("../../server/express.js"); -const streamableHttp_js_1 = require("../../server/streamableHttp.js"); -const router_js_1 = require("../../server/auth/router.js"); -const bearerAuth_js_1 = require("../../server/auth/middleware/bearerAuth.js"); -const types_js_1 = require("../../types.js"); -const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js"); -const demoInMemoryOAuthProvider_js_1 = require("./demoInMemoryOAuthProvider.js"); -const auth_utils_js_1 = require("../../shared/auth-utils.js"); -const cors_1 = __importDefault(require("cors")); -// Create an MCP server with implementation details -const getServer = () => { - const mcpServer = new mcp_js_1.McpServer({ - name: 'url-elicitation-http-server', - version: '1.0.0' - }, { - capabilities: { logging: {} } - }); - mcpServer.registerTool('payment-confirm', { - description: 'A tool that confirms a payment directly with a user', - inputSchema: { - cartId: zod_1.z.string().describe('The ID of the cart to confirm') - } - }, async ({ cartId }, extra) => { - /* - In a real world scenario, there would be some logic here to check if the user has the provided cartId. - For the purposes of this example, we'll throw an error (-> elicits the client to open a URL to confirm payment) - */ - const sessionId = extra.sessionId; - if (!sessionId) { - throw new Error('Expected a Session ID'); - } - // Create and track the elicitation - const elicitationId = generateTrackedElicitation(sessionId, elicitationId => mcpServer.server.createElicitationCompletionNotifier(elicitationId)); - throw new types_js_1.UrlElicitationRequiredError([ - { - mode: 'url', - message: 'This tool requires a payment confirmation. Open the link to confirm payment!', - url: `http://localhost:${MCP_PORT}/confirm-payment?session=${sessionId}&elicitation=${elicitationId}&cartId=${encodeURIComponent(cartId)}`, - elicitationId - } - ]); - }); - mcpServer.registerTool('third-party-auth', { - description: 'A demo tool that requires third-party OAuth credentials', - inputSchema: { - param1: zod_1.z.string().describe('First parameter') - } - }, async (_, extra) => { - /* - In a real world scenario, there would be some logic here to check if we already have a valid access token for the user. - Auth info (with a subject or `sub` claim) can be typically be found in `extra.authInfo`. - If we do, we can just return the result of the tool call. - If we don't, we can throw an ElicitationRequiredError to request the user to authenticate. - For the purposes of this example, we'll throw an error (-> elicits the client to open a URL to authenticate). - */ - const sessionId = extra.sessionId; - if (!sessionId) { - throw new Error('Expected a Session ID'); - } - // Create and track the elicitation - const elicitationId = generateTrackedElicitation(sessionId, elicitationId => mcpServer.server.createElicitationCompletionNotifier(elicitationId)); - // Simulate OAuth callback and token exchange after 5 seconds - // In a real app, this would be called from your OAuth callback handler - setTimeout(() => { - console.log(`Simulating OAuth token received for elicitation ${elicitationId}`); - completeURLElicitation(elicitationId); - }, 5000); - throw new types_js_1.UrlElicitationRequiredError([ - { - mode: 'url', - message: 'This tool requires access to your example.com account. Open the link to authenticate!', - url: 'https://www.example.com/oauth/authorize', - elicitationId - } - ]); - }); - return mcpServer; -}; -const elicitationsMap = new Map(); -// Clean up old elicitations after 1 hour to prevent memory leaks -const ELICITATION_TTL_MS = 60 * 60 * 1000; // 1 hour -const CLEANUP_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes -function cleanupOldElicitations() { - const now = new Date(); - for (const [id, metadata] of elicitationsMap.entries()) { - if (now.getTime() - metadata.createdAt.getTime() > ELICITATION_TTL_MS) { - elicitationsMap.delete(id); - console.log(`Cleaned up expired elicitation: ${id}`); - } - } -} -setInterval(cleanupOldElicitations, CLEANUP_INTERVAL_MS); -/** - * Elicitation IDs must be unique strings within the MCP session - * UUIDs are used in this example for simplicity - */ -function generateElicitationId() { - return (0, node_crypto_1.randomUUID)(); -} -/** - * Helper function to create and track a new elicitation. - */ -function generateTrackedElicitation(sessionId, createCompletionNotifier) { - const elicitationId = generateElicitationId(); - // Create a Promise and its resolver for tracking completion - let completeResolver; - const completedPromise = new Promise(resolve => { - completeResolver = resolve; - }); - const completionNotifier = createCompletionNotifier ? createCompletionNotifier(elicitationId) : undefined; - // Store the elicitation in our map - elicitationsMap.set(elicitationId, { - status: 'pending', - completedPromise, - completeResolver: completeResolver, - createdAt: new Date(), - sessionId, - completionNotifier - }); - return elicitationId; -} -/** - * Helper function to complete an elicitation. - */ -function completeURLElicitation(elicitationId) { - const elicitation = elicitationsMap.get(elicitationId); - if (!elicitation) { - console.warn(`Attempted to complete unknown elicitation: ${elicitationId}`); - return; - } - if (elicitation.status === 'complete') { - console.warn(`Elicitation already complete: ${elicitationId}`); - return; - } - // Update metadata - elicitation.status = 'complete'; - // Send completion notification to the client - if (elicitation.completionNotifier) { - console.log(`Sending notifications/elicitation/complete notification for elicitation ${elicitationId}`); - elicitation.completionNotifier().catch(error => { - console.error(`Failed to send completion notification for elicitation ${elicitationId}:`, error); - }); - } - // Resolve the promise to unblock any waiting code - elicitation.completeResolver(); -} -const MCP_PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000; -const AUTH_PORT = process.env.MCP_AUTH_PORT ? parseInt(process.env.MCP_AUTH_PORT, 10) : 3001; -const app = (0, express_js_1.createMcpExpressApp)(); -// Allow CORS all domains, expose the Mcp-Session-Id header -app.use((0, cors_1.default)({ - origin: '*', // Allow all origins - exposedHeaders: ['Mcp-Session-Id'], - credentials: true // Allow cookies to be sent cross-origin -})); -// Set up OAuth (required for this example) -let authMiddleware = null; -// Create auth middleware for MCP endpoints -const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}/mcp`); -const authServerUrl = new URL(`http://localhost:${AUTH_PORT}`); -const oauthMetadata = (0, demoInMemoryOAuthProvider_js_1.setupAuthServer)({ authServerUrl, mcpServerUrl, strictResource: true }); -const tokenVerifier = { - verifyAccessToken: async (token) => { - const endpoint = oauthMetadata.introspection_endpoint; - if (!endpoint) { - throw new Error('No token verification endpoint available in metadata'); - } - const response = await fetch(endpoint, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: new URLSearchParams({ - token: token - }).toString() - }); - if (!response.ok) { - const text = await response.text().catch(() => null); - throw new Error(`Invalid or expired token: ${text}`); - } - const data = await response.json(); - if (!data.aud) { - throw new Error(`Resource Indicator (RFC8707) missing`); - } - if (!(0, auth_utils_js_1.checkResourceAllowed)({ requestedResource: data.aud, configuredResource: mcpServerUrl })) { - throw new Error(`Expected resource indicator ${mcpServerUrl}, got: ${data.aud}`); - } - // Convert the response to AuthInfo format - return { - token, - clientId: data.client_id, - scopes: data.scope ? data.scope.split(' ') : [], - expiresAt: data.exp - }; - } -}; -// Add metadata routes to the main MCP server -app.use((0, router_js_1.mcpAuthMetadataRouter)({ - oauthMetadata, - resourceServerUrl: mcpServerUrl, - scopesSupported: ['mcp:tools'], - resourceName: 'MCP Demo Server' -})); -authMiddleware = (0, bearerAuth_js_1.requireBearerAuth)({ - verifier: tokenVerifier, - requiredScopes: [], - resourceMetadataUrl: (0, router_js_1.getOAuthProtectedResourceMetadataUrl)(mcpServerUrl) -}); -/** - * API Key Form Handling - * - * Many servers today require an API key to operate, but there's no scalable way to do this dynamically for remote servers within MCP protocol. - * URL-mode elicitation enables the server to host a simple form and get the secret data securely from the user without involving the LLM or client. - **/ -async function sendApiKeyElicitation(sessionId, sender, createCompletionNotifier) { - if (!sessionId) { - console.error('No session ID provided'); - throw new Error('Expected a Session ID to track elicitation'); - } - console.log('🔑 URL elicitation demo: Requesting API key from client...'); - const elicitationId = generateTrackedElicitation(sessionId, createCompletionNotifier); - try { - const result = await sender({ - mode: 'url', - message: 'Please provide your API key to authenticate with this server', - // Host the form on the same server. In a real app, you might coordinate passing these state variables differently. - url: `http://localhost:${MCP_PORT}/api-key-form?session=${sessionId}&elicitation=${elicitationId}`, - elicitationId - }); - switch (result.action) { - case 'accept': - console.log('🔑 URL elicitation demo: Client accepted the API key elicitation (now pending form submission)'); - // Wait for the API key to be submitted via the form - // The form submission will complete the elicitation - break; - default: - console.log('🔑 URL elicitation demo: Client declined to provide an API key'); - // In a real app, this might close the connection, but for the demo, we'll continue - break; - } - } - catch (error) { - console.error('Error during API key elicitation:', error); - } -} -// API Key Form endpoint - serves a simple HTML form -app.get('/api-key-form', (req, res) => { - const mcpSessionId = req.query.session; - const elicitationId = req.query.elicitation; - if (!mcpSessionId || !elicitationId) { - res.status(400).send('

Error

Missing required parameters

'); - return; - } - // Check for user session cookie - // In production, this is often handled by some user auth middleware to ensure the user has a valid session - // This session is different from the MCP session. - // This userSession is the cookie that the MCP Server's Authorization Server sets for the user when they log in. - const userSession = getUserSessionCookie(req.headers.cookie); - if (!userSession) { - res.status(401).send('

Error

Unauthorized - please reconnect to login again

'); - return; - } - // Serve a simple HTML form - res.send(` - - - - Submit Your API Key - - - -

API Key Required

-
✓ Logged in as: ${userSession.name}
-
- - - - - -
This is a demo showing how a server can securely elicit sensitive data from a user using a URL.
- - - `); -}); -// Handle API key form submission -app.post('/api-key-form', express_1.default.urlencoded(), (req, res) => { - const { session: sessionId, apiKey, elicitation: elicitationId } = req.body; - if (!sessionId || !apiKey || !elicitationId) { - res.status(400).send('

Error

Missing required parameters

'); - return; - } - // Check for user session cookie here too - const userSession = getUserSessionCookie(req.headers.cookie); - if (!userSession) { - res.status(401).send('

Error

Unauthorized - please reconnect to login again

'); - return; - } - // A real app might store this API key to be used later for the user. - console.log(`🔑 Received API key \x1b[32m${apiKey}\x1b[0m for session ${sessionId}`); - // If we have an elicitationId, complete the elicitation - completeURLElicitation(elicitationId); - // Send a success response - res.send(` - - - - Success - - - -
-

Success ✓

-

API key received.

-
-

You can close this window and return to your MCP client.

- - - `); -}); -// Helper to get the user session from the demo_session cookie -function getUserSessionCookie(cookieHeader) { - if (!cookieHeader) - return null; - const cookies = cookieHeader.split(';'); - for (const cookie of cookies) { - const [name, value] = cookie.trim().split('='); - if (name === 'demo_session' && value) { - try { - return JSON.parse(decodeURIComponent(value)); - } - catch (error) { - console.error('Failed to parse demo_session cookie:', error); - return null; - } - } - } - return null; -} -/** - * Payment Confirmation Form Handling - * - * This demonstrates how a server can use URL-mode elicitation to get user confirmation - * for sensitive operations like payment processing. - **/ -// Payment Confirmation Form endpoint - serves a simple HTML form -app.get('/confirm-payment', (req, res) => { - const mcpSessionId = req.query.session; - const elicitationId = req.query.elicitation; - const cartId = req.query.cartId; - if (!mcpSessionId || !elicitationId) { - res.status(400).send('

Error

Missing required parameters

'); - return; - } - // Check for user session cookie - // In production, this is often handled by some user auth middleware to ensure the user has a valid session - // This session is different from the MCP session. - // This userSession is the cookie that the MCP Server's Authorization Server sets for the user when they log in. - const userSession = getUserSessionCookie(req.headers.cookie); - if (!userSession) { - res.status(401).send('

Error

Unauthorized - please reconnect to login again

'); - return; - } - // Serve a simple HTML form - res.send(` - - - - Confirm Payment - - - -

Confirm Payment

-
✓ Logged in as: ${userSession.name}
- ${cartId ? `
Cart ID: ${cartId}
` : ''} -
- ⚠️ Please review your order before confirming. -
-
- - - ${cartId ? `` : ''} - - - -
This is a demo showing how a server can securely get user confirmation for sensitive operations using URL-mode elicitation.
- - - `); -}); -// Handle Payment Confirmation form submission -app.post('/confirm-payment', express_1.default.urlencoded(), (req, res) => { - const { session: sessionId, elicitation: elicitationId, cartId, action } = req.body; - if (!sessionId || !elicitationId) { - res.status(400).send('

Error

Missing required parameters

'); - return; - } - // Check for user session cookie here too - const userSession = getUserSessionCookie(req.headers.cookie); - if (!userSession) { - res.status(401).send('

Error

Unauthorized - please reconnect to login again

'); - return; - } - if (action === 'confirm') { - // A real app would process the payment here - console.log(`💳 Payment confirmed for cart ${cartId || 'unknown'} by user ${userSession.name} (session ${sessionId})`); - // Complete the elicitation - completeURLElicitation(elicitationId); - // Send a success response - res.send(` - - - - Payment Confirmed - - - -
-

Payment Confirmed ✓

-

Your payment has been successfully processed.

- ${cartId ? `

Cart ID: ${cartId}

` : ''} -
-

You can close this window and return to your MCP client.

- - - `); - } - else if (action === 'cancel') { - console.log(`💳 Payment cancelled for cart ${cartId || 'unknown'} by user ${userSession.name} (session ${sessionId})`); - // The client will still receive a notifications/elicitation/complete notification, - // which indicates that the out-of-band interaction is complete (but not necessarily successful) - completeURLElicitation(elicitationId); - res.send(` - - - - Payment Cancelled - - - -
-

Payment Cancelled

-

Your payment has been cancelled.

-
-

You can close this window and return to your MCP client.

- - - `); - } - else { - res.status(400).send('

Error

Invalid action

'); - } -}); -// Map to store transports by session ID -const transports = {}; -const sessionsNeedingElicitation = {}; -// MCP POST endpoint -const mcpPostHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - console.debug(`Received MCP POST for session: ${sessionId || 'unknown'}`); - try { - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport - transport = transports[sessionId]; - } - else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) { - const server = getServer(); - // New initialization request - const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore(); - transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ - sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), - eventStore, // Enable resumability - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - // This avoids race conditions where requests might come in before the session is stored - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - sessionsNeedingElicitation[sessionId] = { - elicitationSender: params => server.server.elicitInput(params), - createCompletionNotifier: elicitationId => server.server.createElicitationCompletionNotifier(elicitationId) - }; - } - }); - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}, removing from transports map`); - delete transports[sid]; - delete sessionsNeedingElicitation[sid]; - } - }; - // Connect the transport to the MCP server BEFORE handling the request - // so responses can flow back through the same transport - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - return; // Already handled - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - no need to reconnect - // The existing transport is already connected to the server - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}; -// Set up routes with auth middleware -app.post('/mcp', authMiddleware, mcpPostHandler); -// Handle GET requests for SSE streams (using built-in support from StreamableHTTP) -const mcpGetHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - // Check for Last-Event-ID header for resumability - const lastEventId = req.headers['last-event-id']; - if (lastEventId) { - console.log(`Client reconnecting with Last-Event-ID: ${lastEventId}`); - } - else { - console.log(`Establishing new SSE stream for session ${sessionId}`); - } - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - if (sessionsNeedingElicitation[sessionId]) { - const { elicitationSender, createCompletionNotifier } = sessionsNeedingElicitation[sessionId]; - // Send an elicitation request to the client in the background - sendApiKeyElicitation(sessionId, elicitationSender, createCompletionNotifier) - .then(() => { - // Only delete on successful send for this demo - delete sessionsNeedingElicitation[sessionId]; - console.log(`🔑 URL elicitation demo: Finished sending API key elicitation request for session ${sessionId}`); - }) - .catch(error => { - console.error('Error sending API key elicitation:', error); - // Keep in map to potentially retry on next reconnect - }); - } -}; -// Set up GET route with conditional auth middleware -app.get('/mcp', authMiddleware, mcpGetHandler); -// Handle DELETE requests for session termination (according to MCP spec) -const mcpDeleteHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Received session termination request for session ${sessionId}`); - try { - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - } - catch (error) { - console.error('Error handling session termination:', error); - if (!res.headersSent) { - res.status(500).send('Error processing session termination'); - } - } -}; -// Set up DELETE route with auth middleware -app.delete('/mcp', authMiddleware, mcpDeleteHandler); -app.listen(MCP_PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`MCP Streamable HTTP Server listening on port ${MCP_PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - delete sessionsNeedingElicitation[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=elicitationUrlExample.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js.map deleted file mode 100644 index a37e196..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationUrlExample.js","sourceRoot":"","sources":["../../../../src/examples/server/elicitationUrlExample.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,oDAAoD;AACpD,uFAAuF;AACvF,oCAAoC;AACpC,8FAA8F;AAC9F,kEAAkE;;;;;AAElE,sDAAqD;AACrD,6CAAyC;AACzC,6BAAwB;AACxB,gDAAgD;AAChD,wDAA8D;AAC9D,sEAA+E;AAC/E,2DAA0G;AAC1G,8EAA+E;AAC/E,6CAAwI;AACxI,2EAAqE;AACrE,iFAAiE;AAEjE,8DAAkE;AAElE,gDAAwB;AAExB,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,SAAS,GAAG,IAAI,kBAAS,CAC3B;QACI,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;KAChC,CAC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ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts deleted file mode 100644 index bc6abdd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Example MCP server using Hono with WebStandardStreamableHTTPServerTransport - * - * This example demonstrates using the Web Standard transport directly with Hono, - * which works on any runtime: Node.js, Cloudflare Workers, Deno, Bun, etc. - * - * Run with: npx tsx src/examples/server/honoWebStandardStreamableHttp.ts - */ -export {}; -//# sourceMappingURL=honoWebStandardStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts.map deleted file mode 100644 index a6a6199..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"honoWebStandardStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/honoWebStandardStreamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js deleted file mode 100644 index b45127e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -/** - * Example MCP server using Hono with WebStandardStreamableHTTPServerTransport - * - * This example demonstrates using the Web Standard transport directly with Hono, - * which works on any runtime: Node.js, Cloudflare Workers, Deno, Bun, etc. - * - * Run with: npx tsx src/examples/server/honoWebStandardStreamableHttp.ts - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const hono_1 = require("hono"); -const cors_1 = require("hono/cors"); -const node_server_1 = require("@hono/node-server"); -const z = __importStar(require("zod/v4")); -const mcp_js_1 = require("../../server/mcp.js"); -const webStandardStreamableHttp_js_1 = require("../../server/webStandardStreamableHttp.js"); -// Factory function to create a new MCP server per request (stateless mode) -const getServer = () => { - const server = new mcp_js_1.McpServer({ - name: 'hono-webstandard-mcp-server', - version: '1.0.0' - }); - // Register a simple greeting tool - server.registerTool('greet', { - title: 'Greeting Tool', - description: 'A simple greeting tool', - inputSchema: { name: z.string().describe('Name to greet') } - }, async ({ name }) => { - return { - content: [{ type: 'text', text: `Hello, ${name}! (from Hono + WebStandard transport)` }] - }; - }); - return server; -}; -// Create the Hono app -const app = new hono_1.Hono(); -// Enable CORS for all origins -app.use('*', (0, cors_1.cors)({ - origin: '*', - allowMethods: ['GET', 'POST', 'DELETE', 'OPTIONS'], - allowHeaders: ['Content-Type', 'mcp-session-id', 'Last-Event-ID', 'mcp-protocol-version'], - exposeHeaders: ['mcp-session-id', 'mcp-protocol-version'] -})); -// Health check endpoint -app.get('/health', c => c.json({ status: 'ok' })); -// MCP endpoint - create a fresh transport and server per request (stateless) -app.all('/mcp', async (c) => { - const transport = new webStandardStreamableHttp_js_1.WebStandardStreamableHTTPServerTransport(); - const server = getServer(); - await server.connect(transport); - return transport.handleRequest(c.req.raw); -}); -// Start the server -const PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000; -console.log(`Starting Hono MCP server on port ${PORT}`); -console.log(`Health check: http://localhost:${PORT}/health`); -console.log(`MCP endpoint: http://localhost:${PORT}/mcp`); -(0, node_server_1.serve)({ - fetch: app.fetch, - port: PORT -}); -//# sourceMappingURL=honoWebStandardStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js.map deleted file mode 100644 index 8c23f27..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"honoWebStandardStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/honoWebStandardStreamableHttp.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+BAA4B;AAC5B,oCAAiC;AACjC,mDAA0C;AAC1C,0CAA4B;AAC5B,gDAAgD;AAChD,4FAAqG;AAGrG,2EAA2E;AAC3E,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QACzB,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,OAAO;KACnB,CAAC,CAAC;IAEH,kCAAkC;IAClC,MAAM,CAAC,YAAY,CACf,OAAO,EACP;QACI,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,wBAAwB;QACrC,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC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Q,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAE9E,OAAO,CAAC,GAAG,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC;AACxD,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,SAAS,CAAC,CAAC;AAC7D,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,MAAM,CAAC,CAAC;AAE1D,IAAA,mBAAK,EAAC;IACF,KAAK,EAAE,GAAG,CAAC,KAAK;IAChB,IAAI,EAAE,IAAI;CACb,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts deleted file mode 100644 index 477fa6b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=jsonResponseStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map deleted file mode 100644 index ee8117e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jsonResponseStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js deleted file mode 100644 index ecd769b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js +++ /dev/null @@ -1,171 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const node_crypto_1 = require("node:crypto"); -const mcp_js_1 = require("../../server/mcp.js"); -const streamableHttp_js_1 = require("../../server/streamableHttp.js"); -const z = __importStar(require("zod/v4")); -const types_js_1 = require("../../types.js"); -const express_js_1 = require("../../server/express.js"); -// Create an MCP server with implementation details -const getServer = () => { - const server = new mcp_js_1.McpServer({ - name: 'json-response-streamable-http-server', - version: '1.0.0' - }, { - capabilities: { - logging: {} - } - }); - // Register a simple tool that returns a greeting - server.registerTool('greet', { - description: 'A simple greeting tool', - inputSchema: { - name: z.string().describe('Name to greet') - } - }, async ({ name }) => { - return { - content: [ - { - type: 'text', - text: `Hello, ${name}!` - } - ] - }; - }); - // Register a tool that sends multiple greetings with notifications - server.registerTool('multi-greet', { - description: 'A tool that sends different greetings with delays between them', - inputSchema: { - name: z.string().describe('Name to greet') - } - }, async ({ name }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - await server.sendLoggingMessage({ - level: 'debug', - data: `Starting multi-greet for ${name}` - }, extra.sessionId); - await sleep(1000); // Wait 1 second before first greeting - await server.sendLoggingMessage({ - level: 'info', - data: `Sending first greeting to ${name}` - }, extra.sessionId); - await sleep(1000); // Wait another second before second greeting - await server.sendLoggingMessage({ - level: 'info', - data: `Sending second greeting to ${name}` - }, extra.sessionId); - return { - content: [ - { - type: 'text', - text: `Good morning, ${name}!` - } - ] - }; - }); - return server; -}; -const app = (0, express_js_1.createMcpExpressApp)(); -// Map to store transports by session ID -const transports = {}; -app.post('/mcp', async (req, res) => { - console.log('Received MCP request:', req.body); - try { - // Check for existing session ID - const sessionId = req.headers['mcp-session-id']; - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport - transport = transports[sessionId]; - } - else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) { - // New initialization request - use JSON response mode - transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ - sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), - enableJsonResponse: true, // Enable JSON response mode - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - // This avoids race conditions where requests might come in before the session is stored - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Connect the transport to the MCP server BEFORE handling the request - const server = getServer(); - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - return; // Already handled - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - no need to reconnect - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}); -// Handle GET requests for SSE streams according to spec -app.get('/mcp', async (req, res) => { - // Since this is a very simple example, we don't support GET requests for this server - // The spec requires returning 405 Method Not Allowed in this case - res.status(405).set('Allow', 'POST').send('Method Not Allowed'); -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`MCP Streamable HTTP Server listening on port ${PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - process.exit(0); -}); -//# sourceMappingURL=jsonResponseStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map deleted file mode 100644 index dd8782c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jsonResponseStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,0CAA4B;AAC5B,6CAAqE;AACrE,wDAA8D;AAE9D,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EAAE,sCAAsC;QAC5C,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE;YACV,OAAO,EAAE,EAAE;SACd;KACJ,CACJ,CAAC;IAEF,iDAAiD;IACjD,MAAM,CAAC,YAAY,CACf,OAAO,EACP;QACI,WAAW,EAAE,wBAAwB;QACrC,WAAW,EAAE;YACT,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;SAC7C;KACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAA2B,EAAE;QACxC,OAAO;YACH,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,IAAI,G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B,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,gDAAgD,IAAI,EAAE,CAAC,CAAC;AACxE,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts deleted file mode 100644 index a6cb497..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -/** - * Example MCP server using the high-level McpServer API with outputSchema - * This demonstrates how to easily create tools with structured output - */ -export {}; -//# sourceMappingURL=mcpServerOutputSchema.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map deleted file mode 100644 index bd3abdc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcpServerOutputSchema.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";AACA;;;GAGG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js deleted file mode 100644 index 4ac7e5c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env node -"use strict"; -/** - * Example MCP server using the high-level McpServer API with outputSchema - * This demonstrates how to easily create tools with structured output - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const mcp_js_1 = require("../../server/mcp.js"); -const stdio_js_1 = require("../../server/stdio.js"); -const z = __importStar(require("zod/v4")); -const server = new mcp_js_1.McpServer({ - name: 'mcp-output-schema-high-level-example', - version: '1.0.0' -}); -// Define a tool with structured output - Weather data -server.registerTool('get_weather', { - description: 'Get weather information for a city', - inputSchema: { - city: z.string().describe('City name'), - country: z.string().describe('Country code (e.g., US, UK)') - }, - outputSchema: { - temperature: z.object({ - celsius: z.number(), - fahrenheit: z.number() - }), - conditions: z.enum(['sunny', 'cloudy', 'rainy', 'stormy', 'snowy']), - humidity: z.number().min(0).max(100), - wind: z.object({ - speed_kmh: z.number(), - direction: z.string() - }) - } -}, async ({ city, country }) => { - // Parameters are available but not used in this example - void city; - void country; - // Simulate weather API call - const temp_c = Math.round((Math.random() * 35 - 5) * 10) / 10; - const conditions = ['sunny', 'cloudy', 'rainy', 'stormy', 'snowy'][Math.floor(Math.random() * 5)]; - const structuredContent = { - temperature: { - celsius: temp_c, - fahrenheit: Math.round(((temp_c * 9) / 5 + 32) * 10) / 10 - }, - conditions, - humidity: Math.round(Math.random() * 100), - wind: { - speed_kmh: Math.round(Math.random() * 50), - direction: ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'][Math.floor(Math.random() * 8)] - } - }; - return { - content: [ - { - type: 'text', - text: JSON.stringify(structuredContent, null, 2) - } - ], - structuredContent - }; -}); -async function main() { - const transport = new stdio_js_1.StdioServerTransport(); - await server.connect(transport); - console.error('High-level Output Schema Example Server running on stdio'); -} -main().catch(error => { - console.error('Server error:', error); - process.exit(1); -}); -//# sourceMappingURL=mcpServerOutputSchema.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js.map deleted file mode 100644 index ba0f8b2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcpServerOutputSchema.js","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";;AACA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAgD;AAChD,oDAA6D;AAC7D,0CAA4B;AAE5B,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;IACzB,IAAI,EAAE,sCAAsC;IAC5C,OAAO,EAAE,OAAO;CACnB,CAAC,CAAC;AAEH,sDAAsD;AACtD,MAAM,CAAC,YAAY,CACf,aAAa,EACb;IACI,WAAW,EAAE,oCAAoC;IACjD,WAAW,EAAE;QACT,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;QACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAA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QACV,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;QACzC,IAAI,EAAE;YACF,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;YACzC,SAAS,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;SACzF;KACJ,CAAC;IAEF,OAAO;QACH,OAAO,EAAE;YACL;gBACI,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;aACnD;SACJ;QACD,iBAAiB;KACpB,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC9E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts deleted file mode 100644 index 4269b78..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=simpleSseServer.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts.map deleted file mode 100644 index 08a1b45..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleSseServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js deleted file mode 100644 index ed1efd5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js +++ /dev/null @@ -1,168 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const mcp_js_1 = require("../../server/mcp.js"); -const sse_js_1 = require("../../server/sse.js"); -const z = __importStar(require("zod/v4")); -const express_js_1 = require("../../server/express.js"); -/** - * This example server demonstrates the deprecated HTTP+SSE transport - * (protocol version 2024-11-05). It mainly used for testing backward compatible clients. - * - * The server exposes two endpoints: - * - /mcp: For establishing the SSE stream (GET) - * - /messages: For receiving client messages (POST) - * - */ -// Create an MCP server instance -const getServer = () => { - const server = new mcp_js_1.McpServer({ - name: 'simple-sse-server', - version: '1.0.0' - }, { capabilities: { logging: {} } }); - server.registerTool('start-notification-stream', { - description: 'Starts sending periodic notifications', - inputSchema: { - interval: z.number().describe('Interval in milliseconds between notifications').default(1000), - count: z.number().describe('Number of notifications to send').default(10) - } - }, async ({ interval, count }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - let counter = 0; - // Send the initial notification - await server.sendLoggingMessage({ - level: 'info', - data: `Starting notification stream with ${count} messages every ${interval}ms` - }, extra.sessionId); - // Send periodic notifications - while (counter < count) { - counter++; - await sleep(interval); - try { - await server.sendLoggingMessage({ - level: 'info', - data: `Notification #${counter} at ${new Date().toISOString()}` - }, extra.sessionId); - } - catch (error) { - console.error('Error sending notification:', error); - } - } - return { - content: [ - { - type: 'text', - text: `Completed sending ${count} notifications every ${interval}ms` - } - ] - }; - }); - return server; -}; -const app = (0, express_js_1.createMcpExpressApp)(); -// Store transports by session ID -const transports = {}; -// SSE endpoint for establishing the stream -app.get('/mcp', async (req, res) => { - console.log('Received GET request to /sse (establishing SSE stream)'); - try { - // Create a new SSE transport for the client - // The endpoint for POST messages is '/messages' - const transport = new sse_js_1.SSEServerTransport('/messages', res); - // Store the transport by session ID - const sessionId = transport.sessionId; - transports[sessionId] = transport; - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - console.log(`SSE transport closed for session ${sessionId}`); - delete transports[sessionId]; - }; - // Connect the transport to the MCP server - const server = getServer(); - await server.connect(transport); - console.log(`Established SSE stream with session ID: ${sessionId}`); - } - catch (error) { - console.error('Error establishing SSE stream:', error); - if (!res.headersSent) { - res.status(500).send('Error establishing SSE stream'); - } - } -}); -// Messages endpoint for receiving client JSON-RPC requests -app.post('/messages', async (req, res) => { - console.log('Received POST request to /messages'); - // Extract session ID from URL query parameter - // In the SSE protocol, this is added by the client based on the endpoint event - const sessionId = req.query.sessionId; - if (!sessionId) { - console.error('No session ID provided in request URL'); - res.status(400).send('Missing sessionId parameter'); - return; - } - const transport = transports[sessionId]; - if (!transport) { - console.error(`No active transport found for session ID: ${sessionId}`); - res.status(404).send('Session not found'); - return; - } - try { - // Handle the POST message with the transport - await transport.handlePostMessage(req, res, req.body); - } - catch (error) { - console.error('Error handling request:', error); - if (!res.headersSent) { - res.status(500).send('Error handling request'); - } - } -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`Simple SSE Server (deprecated protocol version 2024-11-05) listening on port ${PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=simpleSseServer.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js.map deleted file mode 100644 index e3a334c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleSseServer.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAgD;AAChD,gDAAyD;AACzD,0CAA4B;AAE5B,wDAA8D;AAE9D;;;;;;;;GAQG;AAEH,gCAAgC;AAChC,MAAM,SAAS,GA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AAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;IACrB,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,gFAAgF,IAAI,EAAE,CAAC,CAAC;AACxG,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts deleted file mode 100644 index 0aa4ad2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=simpleStatelessStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map deleted file mode 100644 index 92deb06..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStatelessStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js deleted file mode 100644 index 87601ab..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js +++ /dev/null @@ -1,166 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const mcp_js_1 = require("../../server/mcp.js"); -const streamableHttp_js_1 = require("../../server/streamableHttp.js"); -const z = __importStar(require("zod/v4")); -const express_js_1 = require("../../server/express.js"); -const getServer = () => { - // Create an MCP server with implementation details - const server = new mcp_js_1.McpServer({ - name: 'stateless-streamable-http-server', - version: '1.0.0' - }, { capabilities: { logging: {} } }); - // Register a simple prompt - server.registerPrompt('greeting-template', { - description: 'A simple greeting prompt template', - argsSchema: { - name: z.string().describe('Name to include in greeting') - } - }, async ({ name }) => { - return { - messages: [ - { - role: 'user', - content: { - type: 'text', - text: `Please greet ${name} in a friendly manner.` - } - } - ] - }; - }); - // Register a tool specifically for testing resumability - server.registerTool('start-notification-stream', { - description: 'Starts sending periodic notifications for testing resumability', - inputSchema: { - interval: z.number().describe('Interval in milliseconds between notifications').default(100), - count: z.number().describe('Number of notifications to send (0 for 100)').default(10) - } - }, async ({ interval, count }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - let counter = 0; - while (count === 0 || counter < count) { - counter++; - try { - await server.sendLoggingMessage({ - level: 'info', - data: `Periodic notification #${counter} at ${new Date().toISOString()}` - }, extra.sessionId); - } - catch (error) { - console.error('Error sending notification:', error); - } - // Wait for the specified interval - await sleep(interval); - } - return { - content: [ - { - type: 'text', - text: `Started sending periodic notifications every ${interval}ms` - } - ] - }; - }); - // Create a simple resource at a fixed URI - server.registerResource('greeting-resource', 'https://example.com/greetings/default', { mimeType: 'text/plain' }, async () => { - return { - contents: [ - { - uri: 'https://example.com/greetings/default', - text: 'Hello, world!' - } - ] - }; - }); - return server; -}; -const app = (0, express_js_1.createMcpExpressApp)(); -app.post('/mcp', async (req, res) => { - const server = getServer(); - try { - const transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ - sessionIdGenerator: undefined - }); - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - res.on('close', () => { - console.log('Request closed'); - transport.close(); - server.close(); - }); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}); -app.get('/mcp', async (req, res) => { - console.log('Received GET MCP request'); - res.writeHead(405).end(JSON.stringify({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Method not allowed.' - }, - id: null - })); -}); -app.delete('/mcp', async (req, res) => { - console.log('Received DELETE MCP request'); - res.writeHead(405).end(JSON.stringify({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Method not allowed.' - }, - id: null - })); -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`MCP Stateless Streamable HTTP Server listening on port ${PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - process.exit(0); -}); -//# sourceMappingURL=simpleStatelessStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map deleted file mode 100644 index e87774a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStatelessStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAgD;AAChD,sEAA+E;AAC/E,0CAA4B;AAE5B,wDAA8D;AAE9D,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,mDAAmD;IACnD,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EA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B,IAAI,CAAC,SAAS,CAAC;QACX,OAAO,EAAE,KAAK;QACd,KAAK,EAAE;YACH,IAAI,EAAE,CAAC,KAAK;YACZ,OAAO,EAAE,qBAAqB;SACjC;QACD,EAAE,EAAE,IAAI;KACX,CAAC,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;IACrB,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0DAA0D,IAAI,EAAE,CAAC,CAAC;AAClF,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts deleted file mode 100644 index a20be42..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=simpleStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map deleted file mode 100644 index e3cf042..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js deleted file mode 100644 index 5fb8e3c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js +++ /dev/null @@ -1,661 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const node_crypto_1 = require("node:crypto"); -const z = __importStar(require("zod/v4")); -const mcp_js_1 = require("../../server/mcp.js"); -const streamableHttp_js_1 = require("../../server/streamableHttp.js"); -const router_js_1 = require("../../server/auth/router.js"); -const bearerAuth_js_1 = require("../../server/auth/middleware/bearerAuth.js"); -const express_js_1 = require("../../server/express.js"); -const types_js_1 = require("../../types.js"); -const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js"); -const in_memory_js_1 = require("../../experimental/tasks/stores/in-memory.js"); -const demoInMemoryOAuthProvider_js_1 = require("./demoInMemoryOAuthProvider.js"); -const auth_utils_js_1 = require("../../shared/auth-utils.js"); -// Check for OAuth flag -const useOAuth = process.argv.includes('--oauth'); -const strictOAuth = process.argv.includes('--oauth-strict'); -// Create shared task store for demonstration -const taskStore = new in_memory_js_1.InMemoryTaskStore(); -// Create an MCP server with implementation details -const getServer = () => { - const server = new mcp_js_1.McpServer({ - name: 'simple-streamable-http-server', - version: '1.0.0', - icons: [{ src: './mcp.svg', sizes: ['512x512'], mimeType: 'image/svg+xml' }], - websiteUrl: 'https://github.com/modelcontextprotocol/typescript-sdk' - }, { - capabilities: { logging: {}, tasks: { requests: { tools: { call: {} } } } }, - taskStore, // Enable task support - taskMessageQueue: new in_memory_js_1.InMemoryTaskMessageQueue() - }); - // Register a simple tool that returns a greeting - server.registerTool('greet', { - title: 'Greeting Tool', // Display name for UI - description: 'A simple greeting tool', - inputSchema: { - name: z.string().describe('Name to greet') - } - }, async ({ name }) => { - return { - content: [ - { - type: 'text', - text: `Hello, ${name}!` - } - ] - }; - }); - // Register a tool that sends multiple greetings with notifications (with annotations) - server.registerTool('multi-greet', { - description: 'A tool that sends different greetings with delays between them', - inputSchema: { - name: z.string().describe('Name to greet') - }, - annotations: { - title: 'Multiple Greeting Tool', - readOnlyHint: true, - openWorldHint: false - } - }, async ({ name }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - await server.sendLoggingMessage({ - level: 'debug', - data: `Starting multi-greet for ${name}` - }, extra.sessionId); - await sleep(1000); // Wait 1 second before first greeting - await server.sendLoggingMessage({ - level: 'info', - data: `Sending first greeting to ${name}` - }, extra.sessionId); - await sleep(1000); // Wait another second before second greeting - await server.sendLoggingMessage({ - level: 'info', - data: `Sending second greeting to ${name}` - }, extra.sessionId); - return { - content: [ - { - type: 'text', - text: `Good morning, ${name}!` - } - ] - }; - }); - // Register a tool that demonstrates form elicitation (user input collection with a schema) - // This creates a closure that captures the server instance - server.registerTool('collect-user-info', { - description: 'A tool that collects user information through form elicitation', - inputSchema: { - infoType: z.enum(['contact', 'preferences', 'feedback']).describe('Type of information to collect') - } - }, async ({ infoType }, extra) => { - let message; - let requestedSchema; - switch (infoType) { - case 'contact': - message = 'Please provide your contact information'; - requestedSchema = { - type: 'object', - properties: { - name: { - type: 'string', - title: 'Full Name', - description: 'Your full name' - }, - email: { - type: 'string', - title: 'Email Address', - description: 'Your email address', - format: 'email' - }, - phone: { - type: 'string', - title: 'Phone Number', - description: 'Your phone number (optional)' - } - }, - required: ['name', 'email'] - }; - break; - case 'preferences': - message = 'Please set your preferences'; - requestedSchema = { - type: 'object', - properties: { - theme: { - type: 'string', - title: 'Theme', - description: 'Choose your preferred theme', - enum: ['light', 'dark', 'auto'], - enumNames: ['Light', 'Dark', 'Auto'] - }, - notifications: { - type: 'boolean', - title: 'Enable Notifications', - description: 'Would you like to receive notifications?', - default: true - }, - frequency: { - type: 'string', - title: 'Notification Frequency', - description: 'How often would you like notifications?', - enum: ['daily', 'weekly', 'monthly'], - enumNames: ['Daily', 'Weekly', 'Monthly'] - } - }, - required: ['theme'] - }; - break; - case 'feedback': - message = 'Please provide your feedback'; - requestedSchema = { - type: 'object', - properties: { - rating: { - type: 'integer', - title: 'Rating', - description: 'Rate your experience (1-5)', - minimum: 1, - maximum: 5 - }, - comments: { - type: 'string', - title: 'Comments', - description: 'Additional comments (optional)', - maxLength: 500 - }, - recommend: { - type: 'boolean', - title: 'Would you recommend this?', - description: 'Would you recommend this to others?' - } - }, - required: ['rating', 'recommend'] - }; - break; - default: - throw new Error(`Unknown info type: ${infoType}`); - } - try { - // Use sendRequest through the extra parameter to elicit input - const result = await extra.sendRequest({ - method: 'elicitation/create', - params: { - mode: 'form', - message, - requestedSchema - } - }, types_js_1.ElicitResultSchema); - if (result.action === 'accept') { - return { - content: [ - { - type: 'text', - text: `Thank you! Collected ${infoType} information: ${JSON.stringify(result.content, null, 2)}` - } - ] - }; - } - else if (result.action === 'decline') { - return { - content: [ - { - type: 'text', - text: `No information was collected. User declined ${infoType} information request.` - } - ] - }; - } - else { - return { - content: [ - { - type: 'text', - text: `Information collection was cancelled by the user.` - } - ] - }; - } - } - catch (error) { - return { - content: [ - { - type: 'text', - text: `Error collecting ${infoType} information: ${error}` - } - ] - }; - } - }); - // Register a simple prompt with title - server.registerPrompt('greeting-template', { - title: 'Greeting Template', // Display name for UI - description: 'A simple greeting prompt template', - argsSchema: { - name: z.string().describe('Name to include in greeting') - } - }, async ({ name }) => { - return { - messages: [ - { - role: 'user', - content: { - type: 'text', - text: `Please greet ${name} in a friendly manner.` - } - } - ] - }; - }); - // Register a tool specifically for testing resumability - server.registerTool('start-notification-stream', { - description: 'Starts sending periodic notifications for testing resumability', - inputSchema: { - interval: z.number().describe('Interval in milliseconds between notifications').default(100), - count: z.number().describe('Number of notifications to send (0 for 100)').default(50) - } - }, async ({ interval, count }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - let counter = 0; - while (count === 0 || counter < count) { - counter++; - try { - await server.sendLoggingMessage({ - level: 'info', - data: `Periodic notification #${counter} at ${new Date().toISOString()}` - }, extra.sessionId); - } - catch (error) { - console.error('Error sending notification:', error); - } - // Wait for the specified interval - await sleep(interval); - } - return { - content: [ - { - type: 'text', - text: `Started sending periodic notifications every ${interval}ms` - } - ] - }; - }); - // Create a simple resource at a fixed URI - server.registerResource('greeting-resource', 'https://example.com/greetings/default', { - title: 'Default Greeting', // Display name for UI - description: 'A simple greeting resource', - mimeType: 'text/plain' - }, async () => { - return { - contents: [ - { - uri: 'https://example.com/greetings/default', - text: 'Hello, world!' - } - ] - }; - }); - // Create additional resources for ResourceLink demonstration - server.registerResource('example-file-1', 'file:///example/file1.txt', { - title: 'Example File 1', - description: 'First example file for ResourceLink demonstration', - mimeType: 'text/plain' - }, async () => { - return { - contents: [ - { - uri: 'file:///example/file1.txt', - text: 'This is the content of file 1' - } - ] - }; - }); - server.registerResource('example-file-2', 'file:///example/file2.txt', { - title: 'Example File 2', - description: 'Second example file for ResourceLink demonstration', - mimeType: 'text/plain' - }, async () => { - return { - contents: [ - { - uri: 'file:///example/file2.txt', - text: 'This is the content of file 2' - } - ] - }; - }); - // Register a tool that returns ResourceLinks - server.registerTool('list-files', { - title: 'List Files with ResourceLinks', - description: 'Returns a list of files as ResourceLinks without embedding their content', - inputSchema: { - includeDescriptions: z.boolean().optional().describe('Whether to include descriptions in the resource links') - } - }, async ({ includeDescriptions = true }) => { - const resourceLinks = [ - { - type: 'resource_link', - uri: 'https://example.com/greetings/default', - name: 'Default Greeting', - mimeType: 'text/plain', - ...(includeDescriptions && { description: 'A simple greeting resource' }) - }, - { - type: 'resource_link', - uri: 'file:///example/file1.txt', - name: 'Example File 1', - mimeType: 'text/plain', - ...(includeDescriptions && { description: 'First example file for ResourceLink demonstration' }) - }, - { - type: 'resource_link', - uri: 'file:///example/file2.txt', - name: 'Example File 2', - mimeType: 'text/plain', - ...(includeDescriptions && { description: 'Second example file for ResourceLink demonstration' }) - } - ]; - return { - content: [ - { - type: 'text', - text: 'Here are the available files as resource links:' - }, - ...resourceLinks, - { - type: 'text', - text: '\nYou can read any of these resources using their URI.' - } - ] - }; - }); - // Register a long-running tool that demonstrates task execution - // Using the experimental tasks API - WARNING: may change without notice - server.experimental.tasks.registerToolTask('delay', { - title: 'Delay', - description: 'A simple tool that delays for a specified duration, useful for testing task execution', - inputSchema: { - duration: z.number().describe('Duration in milliseconds').default(5000) - } - }, { - async createTask({ duration }, { taskStore, taskRequestedTtl }) { - // Create the task - const task = await taskStore.createTask({ - ttl: taskRequestedTtl - }); - // Simulate out-of-band work - (async () => { - await new Promise(resolve => setTimeout(resolve, duration)); - await taskStore.storeTaskResult(task.taskId, 'completed', { - content: [ - { - type: 'text', - text: `Completed ${duration}ms delay` - } - ] - }); - })(); - // Return CreateTaskResult with the created task - return { - task - }; - }, - async getTask(_args, { taskId, taskStore }) { - return await taskStore.getTask(taskId); - }, - async getTaskResult(_args, { taskId, taskStore }) { - const result = await taskStore.getTaskResult(taskId); - return result; - } - }); - return server; -}; -const MCP_PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000; -const AUTH_PORT = process.env.MCP_AUTH_PORT ? parseInt(process.env.MCP_AUTH_PORT, 10) : 3001; -const app = (0, express_js_1.createMcpExpressApp)(); -// Set up OAuth if enabled -let authMiddleware = null; -if (useOAuth) { - // Create auth middleware for MCP endpoints - const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}/mcp`); - const authServerUrl = new URL(`http://localhost:${AUTH_PORT}`); - const oauthMetadata = (0, demoInMemoryOAuthProvider_js_1.setupAuthServer)({ authServerUrl, mcpServerUrl, strictResource: strictOAuth }); - const tokenVerifier = { - verifyAccessToken: async (token) => { - const endpoint = oauthMetadata.introspection_endpoint; - if (!endpoint) { - throw new Error('No token verification endpoint available in metadata'); - } - const response = await fetch(endpoint, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: new URLSearchParams({ - token: token - }).toString() - }); - if (!response.ok) { - const text = await response.text().catch(() => null); - throw new Error(`Invalid or expired token: ${text}`); - } - const data = await response.json(); - if (strictOAuth) { - if (!data.aud) { - throw new Error(`Resource Indicator (RFC8707) missing`); - } - if (!(0, auth_utils_js_1.checkResourceAllowed)({ requestedResource: data.aud, configuredResource: mcpServerUrl })) { - throw new Error(`Expected resource indicator ${mcpServerUrl}, got: ${data.aud}`); - } - } - // Convert the response to AuthInfo format - return { - token, - clientId: data.client_id, - scopes: data.scope ? data.scope.split(' ') : [], - expiresAt: data.exp - }; - } - }; - // Add metadata routes to the main MCP server - app.use((0, router_js_1.mcpAuthMetadataRouter)({ - oauthMetadata, - resourceServerUrl: mcpServerUrl, - scopesSupported: ['mcp:tools'], - resourceName: 'MCP Demo Server' - })); - authMiddleware = (0, bearerAuth_js_1.requireBearerAuth)({ - verifier: tokenVerifier, - requiredScopes: [], - resourceMetadataUrl: (0, router_js_1.getOAuthProtectedResourceMetadataUrl)(mcpServerUrl) - }); -} -// Map to store transports by session ID -const transports = {}; -// MCP POST endpoint with optional auth -const mcpPostHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (sessionId) { - console.log(`Received MCP request for session: ${sessionId}`); - } - else { - console.log('Request body:', req.body); - } - if (useOAuth && req.auth) { - console.log('Authenticated user:', req.auth); - } - try { - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport - transport = transports[sessionId]; - } - else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) { - // New initialization request - const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore(); - transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ - sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), - eventStore, // Enable resumability - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - // This avoids race conditions where requests might come in before the session is stored - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}, removing from transports map`); - delete transports[sid]; - } - }; - // Connect the transport to the MCP server BEFORE handling the request - // so responses can flow back through the same transport - const server = getServer(); - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - return; // Already handled - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - no need to reconnect - // The existing transport is already connected to the server - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}; -// Set up routes with conditional auth middleware -if (useOAuth && authMiddleware) { - app.post('/mcp', authMiddleware, mcpPostHandler); -} -else { - app.post('/mcp', mcpPostHandler); -} -// Handle GET requests for SSE streams (using built-in support from StreamableHTTP) -const mcpGetHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - if (useOAuth && req.auth) { - console.log('Authenticated SSE connection from user:', req.auth); - } - // Check for Last-Event-ID header for resumability - const lastEventId = req.headers['last-event-id']; - if (lastEventId) { - console.log(`Client reconnecting with Last-Event-ID: ${lastEventId}`); - } - else { - console.log(`Establishing new SSE stream for session ${sessionId}`); - } - const transport = transports[sessionId]; - await transport.handleRequest(req, res); -}; -// Set up GET route with conditional auth middleware -if (useOAuth && authMiddleware) { - app.get('/mcp', authMiddleware, mcpGetHandler); -} -else { - app.get('/mcp', mcpGetHandler); -} -// Handle DELETE requests for session termination (according to MCP spec) -const mcpDeleteHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Received session termination request for session ${sessionId}`); - try { - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - } - catch (error) { - console.error('Error handling session termination:', error); - if (!res.headersSent) { - res.status(500).send('Error processing session termination'); - } - } -}; -// Set up DELETE route with conditional auth middleware -if (useOAuth && authMiddleware) { - app.delete('/mcp', authMiddleware, mcpDeleteHandler); -} -else { - app.delete('/mcp', mcpDeleteHandler); -} -app.listen(MCP_PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`MCP Streamable HTTP Server listening on port ${MCP_PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=simpleStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js.map deleted file mode 100644 index bd27afc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleStreamableHttp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAyC;AACzC,0CAA4B;AAC5B,gDAAgD;AAChD,sEAA+E;AAC/E,2DAA0G;AAC1G,8EAA+E;AAC/E,wDAA8D;AAC9D,6CAQwB;AACxB,2EAAqE;AACrE,+EAA2G;AAC3G,iFAAiE;AAEjE,8DAAkE;AAElE,uBAAuB;AACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAClD,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAE5D,6CAA6C;AAC7C,MAAM,SAAS,GAAG,IAAI,gCAAiB,EAAE,CAAC;AAE1C,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;QAC5E,UAAU,EAAE,wDAAwD;KACvE,EACD;QACI,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;QAC3E,SAAS,EAAE,s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,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts deleted file mode 100644 index 661c9f0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Simple interactive task server demonstrating elicitation and sampling. - * - * This server demonstrates the task message queue pattern from the MCP Tasks spec: - * - confirm_delete: Uses elicitation to ask the user for confirmation - * - write_haiku: Uses sampling to request an LLM to generate content - * - * Both tools use the "call-now, fetch-later" pattern where the initial call - * creates a task, and the result is fetched via tasks/result endpoint. - */ -export {}; -//# sourceMappingURL=simpleTaskInteractive.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts.map deleted file mode 100644 index 3e48b9e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleTaskInteractive.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleTaskInteractive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js deleted file mode 100644 index cd95140..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js +++ /dev/null @@ -1,600 +0,0 @@ -"use strict"; -/** - * Simple interactive task server demonstrating elicitation and sampling. - * - * This server demonstrates the task message queue pattern from the MCP Tasks spec: - * - confirm_delete: Uses elicitation to ask the user for confirmation - * - write_haiku: Uses sampling to request an LLM to generate content - * - * Both tools use the "call-now, fetch-later" pattern where the initial call - * creates a task, and the result is fetched via tasks/result endpoint. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -const node_crypto_1 = require("node:crypto"); -const index_js_1 = require("../../server/index.js"); -const express_js_1 = require("../../server/express.js"); -const streamableHttp_js_1 = require("../../server/streamableHttp.js"); -const types_js_1 = require("../../types.js"); -const interfaces_js_1 = require("../../experimental/tasks/interfaces.js"); -const in_memory_js_1 = require("../../experimental/tasks/stores/in-memory.js"); -// ============================================================================ -// Resolver - Promise-like for passing results between async operations -// ============================================================================ -class Resolver { - constructor() { - this._done = false; - this._promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - }); - } - setResult(value) { - if (this._done) - return; - this._done = true; - this._resolve(value); - } - setException(error) { - if (this._done) - return; - this._done = true; - this._reject(error); - } - wait() { - return this._promise; - } - done() { - return this._done; - } -} -class TaskMessageQueueWithResolvers { - constructor() { - this.queues = new Map(); - this.waitResolvers = new Map(); - } - getQueue(taskId) { - let queue = this.queues.get(taskId); - if (!queue) { - queue = []; - this.queues.set(taskId, queue); - } - return queue; - } - async enqueue(taskId, message, _sessionId, maxSize) { - const queue = this.getQueue(taskId); - if (maxSize !== undefined && queue.length >= maxSize) { - throw new Error(`Task message queue overflow: queue size (${queue.length}) exceeds maximum (${maxSize})`); - } - queue.push(message); - // Notify any waiters - this.notifyWaiters(taskId); - } - async enqueueWithResolver(taskId, message, resolver, originalRequestId) { - const queue = this.getQueue(taskId); - const queuedMessage = { - type: 'request', - message, - timestamp: Date.now(), - resolver, - originalRequestId - }; - queue.push(queuedMessage); - this.notifyWaiters(taskId); - } - async dequeue(taskId, _sessionId) { - const queue = this.getQueue(taskId); - return queue.shift(); - } - async dequeueAll(taskId, _sessionId) { - const queue = this.queues.get(taskId) ?? []; - this.queues.delete(taskId); - return queue; - } - async waitForMessage(taskId) { - // Check if there are already messages - const queue = this.getQueue(taskId); - if (queue.length > 0) - return; - // Wait for a message to be added - return new Promise(resolve => { - let waiters = this.waitResolvers.get(taskId); - if (!waiters) { - waiters = []; - this.waitResolvers.set(taskId, waiters); - } - waiters.push(resolve); - }); - } - notifyWaiters(taskId) { - const waiters = this.waitResolvers.get(taskId); - if (waiters) { - this.waitResolvers.delete(taskId); - for (const resolve of waiters) { - resolve(); - } - } - } - cleanup() { - this.queues.clear(); - this.waitResolvers.clear(); - } -} -// ============================================================================ -// Extended task store with wait functionality -// ============================================================================ -class TaskStoreWithNotifications extends in_memory_js_1.InMemoryTaskStore { - constructor() { - super(...arguments); - this.updateResolvers = new Map(); - } - async updateTaskStatus(taskId, status, statusMessage, sessionId) { - await super.updateTaskStatus(taskId, status, statusMessage, sessionId); - this.notifyUpdate(taskId); - } - async storeTaskResult(taskId, status, result, sessionId) { - await super.storeTaskResult(taskId, status, result, sessionId); - this.notifyUpdate(taskId); - } - async waitForUpdate(taskId) { - return new Promise(resolve => { - let waiters = this.updateResolvers.get(taskId); - if (!waiters) { - waiters = []; - this.updateResolvers.set(taskId, waiters); - } - waiters.push(resolve); - }); - } - notifyUpdate(taskId) { - const waiters = this.updateResolvers.get(taskId); - if (waiters) { - this.updateResolvers.delete(taskId); - for (const resolve of waiters) { - resolve(); - } - } - } -} -// ============================================================================ -// Task Result Handler - delivers queued messages and routes responses -// ============================================================================ -class TaskResultHandler { - constructor(store, queue) { - this.store = store; - this.queue = queue; - this.pendingRequests = new Map(); - } - async handle(taskId, server, _sessionId) { - while (true) { - // Get fresh task state - const task = await this.store.getTask(taskId); - if (!task) { - throw new Error(`Task not found: ${taskId}`); - } - // Dequeue and send all pending messages - await this.deliverQueuedMessages(taskId, server, _sessionId); - // If task is terminal, return result - if ((0, interfaces_js_1.isTerminal)(task.status)) { - const result = await this.store.getTaskResult(taskId); - // Add related-task metadata per spec - return { - ...result, - _meta: { - ...(result._meta || {}), - [types_js_1.RELATED_TASK_META_KEY]: { taskId } - } - }; - } - // Wait for task update or new message - await this.waitForUpdate(taskId); - } - } - async deliverQueuedMessages(taskId, server, _sessionId) { - while (true) { - const message = await this.queue.dequeue(taskId); - if (!message) - break; - console.log(`[Server] Delivering queued ${message.type} message for task ${taskId}`); - if (message.type === 'request') { - const reqMessage = message; - // Send the request via the server - // Store the resolver so we can route the response back - if (reqMessage.resolver && reqMessage.originalRequestId) { - this.pendingRequests.set(reqMessage.originalRequestId, reqMessage.resolver); - } - // Send the message - for elicitation/sampling, we use the server's methods - // But since we're in tasks/result context, we need to send via transport - // This is simplified - in production you'd use proper message routing - try { - const request = reqMessage.message; - let response; - if (request.method === 'elicitation/create') { - // Send elicitation request to client - const params = request.params; - response = await server.elicitInput(params); - } - else if (request.method === 'sampling/createMessage') { - // Send sampling request to client - const params = request.params; - response = await server.createMessage(params); - } - else { - throw new Error(`Unknown request method: ${request.method}`); - } - // Route response back to resolver - if (reqMessage.resolver) { - reqMessage.resolver.setResult(response); - } - } - catch (error) { - if (reqMessage.resolver) { - reqMessage.resolver.setException(error instanceof Error ? error : new Error(String(error))); - } - } - } - // For notifications, we'd send them too but this example focuses on requests - } - } - async waitForUpdate(taskId) { - // Race between store update and queue message - await Promise.race([this.store.waitForUpdate(taskId), this.queue.waitForMessage(taskId)]); - } - routeResponse(requestId, response) { - const resolver = this.pendingRequests.get(requestId); - if (resolver && !resolver.done()) { - this.pendingRequests.delete(requestId); - resolver.setResult(response); - return true; - } - return false; - } - routeError(requestId, error) { - const resolver = this.pendingRequests.get(requestId); - if (resolver && !resolver.done()) { - this.pendingRequests.delete(requestId); - resolver.setException(error); - return true; - } - return false; - } -} -// ============================================================================ -// Task Session - wraps server to enqueue requests during task execution -// ============================================================================ -class TaskSession { - constructor(server, taskId, store, queue) { - this.server = server; - this.taskId = taskId; - this.store = store; - this.queue = queue; - this.requestCounter = 0; - } - nextRequestId() { - return `task-${this.taskId}-${++this.requestCounter}`; - } - async elicit(message, requestedSchema) { - // Update task status to input_required - await this.store.updateTaskStatus(this.taskId, 'input_required'); - const requestId = this.nextRequestId(); - // Build the elicitation request with related-task metadata - const params = { - message, - requestedSchema, - mode: 'form', - _meta: { - [types_js_1.RELATED_TASK_META_KEY]: { taskId: this.taskId } - } - }; - const jsonrpcRequest = { - jsonrpc: '2.0', - id: requestId, - method: 'elicitation/create', - params - }; - // Create resolver to wait for response - const resolver = new Resolver(); - // Enqueue the request - await this.queue.enqueueWithResolver(this.taskId, jsonrpcRequest, resolver, requestId); - try { - // Wait for response - const response = await resolver.wait(); - // Update status back to working - await this.store.updateTaskStatus(this.taskId, 'working'); - return response; - } - catch (error) { - await this.store.updateTaskStatus(this.taskId, 'working'); - throw error; - } - } - async createMessage(messages, maxTokens) { - // Update task status to input_required - await this.store.updateTaskStatus(this.taskId, 'input_required'); - const requestId = this.nextRequestId(); - // Build the sampling request with related-task metadata - const params = { - messages, - maxTokens, - _meta: { - [types_js_1.RELATED_TASK_META_KEY]: { taskId: this.taskId } - } - }; - const jsonrpcRequest = { - jsonrpc: '2.0', - id: requestId, - method: 'sampling/createMessage', - params - }; - // Create resolver to wait for response - const resolver = new Resolver(); - // Enqueue the request - await this.queue.enqueueWithResolver(this.taskId, jsonrpcRequest, resolver, requestId); - try { - // Wait for response - const response = await resolver.wait(); - // Update status back to working - await this.store.updateTaskStatus(this.taskId, 'working'); - return response; - } - catch (error) { - await this.store.updateTaskStatus(this.taskId, 'working'); - throw error; - } - } -} -// ============================================================================ -// Server Setup -// ============================================================================ -const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 8000; -// Create shared stores -const taskStore = new TaskStoreWithNotifications(); -const messageQueue = new TaskMessageQueueWithResolvers(); -const taskResultHandler = new TaskResultHandler(taskStore, messageQueue); -// Track active task executions -const activeTaskExecutions = new Map(); -// Create the server -const createServer = () => { - const server = new index_js_1.Server({ name: 'simple-task-interactive', version: '1.0.0' }, { - capabilities: { - tools: {}, - tasks: { - requests: { - tools: { call: {} } - } - } - } - }); - // Register tools - server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => { - return { - tools: [ - { - name: 'confirm_delete', - description: 'Asks for confirmation before deleting (demonstrates elicitation)', - inputSchema: { - type: 'object', - properties: { - filename: { type: 'string' } - } - }, - execution: { taskSupport: 'required' } - }, - { - name: 'write_haiku', - description: 'Asks LLM to write a haiku (demonstrates sampling)', - inputSchema: { - type: 'object', - properties: { - topic: { type: 'string' } - } - }, - execution: { taskSupport: 'required' } - } - ] - }; - }); - // Handle tool calls - server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request, extra) => { - const { name, arguments: args } = request.params; - const taskParams = (request.params._meta?.task || request.params.task); - // Validate task mode - these tools require tasks - if (!taskParams) { - throw new Error(`Tool ${name} requires task mode`); - } - // Create task - const taskOptions = { - ttl: taskParams.ttl, - pollInterval: taskParams.pollInterval ?? 1000 - }; - const task = await taskStore.createTask(taskOptions, extra.requestId, request, extra.sessionId); - console.log(`\n[Server] ${name} called, task created: ${task.taskId}`); - // Start background task execution - const taskExecution = (async () => { - try { - const taskSession = new TaskSession(server, task.taskId, taskStore, messageQueue); - if (name === 'confirm_delete') { - const filename = args?.filename ?? 'unknown.txt'; - console.log(`[Server] confirm_delete: asking about '${filename}'`); - console.log('[Server] Sending elicitation request to client...'); - const result = await taskSession.elicit(`Are you sure you want to delete '${filename}'?`, { - type: 'object', - properties: { - confirm: { type: 'boolean' } - }, - required: ['confirm'] - }); - console.log(`[Server] Received elicitation response: action=${result.action}, content=${JSON.stringify(result.content)}`); - let text; - if (result.action === 'accept' && result.content) { - const confirmed = result.content.confirm; - text = confirmed ? `Deleted '${filename}'` : 'Deletion cancelled'; - } - else { - text = 'Deletion cancelled'; - } - console.log(`[Server] Completing task with result: ${text}`); - await taskStore.storeTaskResult(task.taskId, 'completed', { - content: [{ type: 'text', text }] - }); - } - else if (name === 'write_haiku') { - const topic = args?.topic ?? 'nature'; - console.log(`[Server] write_haiku: topic '${topic}'`); - console.log('[Server] Sending sampling request to client...'); - const result = await taskSession.createMessage([ - { - role: 'user', - content: { type: 'text', text: `Write a haiku about ${topic}` } - } - ], 50); - let haiku = 'No response'; - if (result.content && 'text' in result.content) { - haiku = result.content.text; - } - console.log(`[Server] Received sampling response: ${haiku.substring(0, 50)}...`); - console.log('[Server] Completing task with haiku'); - await taskStore.storeTaskResult(task.taskId, 'completed', { - content: [{ type: 'text', text: `Haiku:\n${haiku}` }] - }); - } - } - catch (error) { - console.error(`[Server] Task ${task.taskId} failed:`, error); - await taskStore.storeTaskResult(task.taskId, 'failed', { - content: [{ type: 'text', text: `Error: ${error}` }], - isError: true - }); - } - finally { - activeTaskExecutions.delete(task.taskId); - } - })(); - activeTaskExecutions.set(task.taskId, { - promise: taskExecution, - server, - sessionId: extra.sessionId ?? '' - }); - return { task }; - }); - // Handle tasks/get - server.setRequestHandler(types_js_1.GetTaskRequestSchema, async (request) => { - const { taskId } = request.params; - const task = await taskStore.getTask(taskId); - if (!task) { - throw new Error(`Task ${taskId} not found`); - } - return task; - }); - // Handle tasks/result - server.setRequestHandler(types_js_1.GetTaskPayloadRequestSchema, async (request, extra) => { - const { taskId } = request.params; - console.log(`[Server] tasks/result called for task ${taskId}`); - return taskResultHandler.handle(taskId, server, extra.sessionId ?? ''); - }); - return server; -}; -// ============================================================================ -// Express App Setup -// ============================================================================ -const app = (0, express_js_1.createMcpExpressApp)(); -// Map to store transports by session ID -const transports = {}; -// Helper to check if request is initialize -const isInitializeRequest = (body) => { - return typeof body === 'object' && body !== null && 'method' in body && body.method === 'initialize'; -}; -// MCP POST endpoint -app.post('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - try { - let transport; - if (sessionId && transports[sessionId]) { - transport = transports[sessionId]; - } - else if (!sessionId && isInitializeRequest(req.body)) { - transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ - sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), - onsessioninitialized: sid => { - console.log(`Session initialized: ${sid}`); - transports[sid] = transport; - } - }); - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}`); - delete transports[sid]; - } - }; - const server = createServer(); - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - return; - } - else { - res.status(400).json({ - jsonrpc: '2.0', - error: { code: -32000, message: 'Bad Request: No valid session ID' }, - id: null - }); - return; - } - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { code: -32603, message: 'Internal server error' }, - id: null - }); - } - } -}); -// Handle GET requests for SSE streams -app.get('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - const transport = transports[sessionId]; - await transport.handleRequest(req, res); -}); -// Handle DELETE requests for session termination -app.delete('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Session termination request: ${sessionId}`); - const transport = transports[sessionId]; - await transport.handleRequest(req, res); -}); -// Start server -app.listen(PORT, () => { - console.log(`Starting server on http://localhost:${PORT}/mcp`); - console.log('\nAvailable tools:'); - console.log(' - confirm_delete: Demonstrates elicitation (asks user y/n)'); - console.log(' - write_haiku: Demonstrates sampling (requests LLM completion)'); -}); -// Handle shutdown -process.on('SIGINT', async () => { - console.log('\nShutting down server...'); - for (const sessionId of Object.keys(transports)) { - try { - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing session ${sessionId}:`, error); - } - } - taskStore.cleanup(); - messageQueue.cleanup(); - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=simpleTaskInteractive.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js.map deleted file mode 100644 index faabd3f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleTaskInteractive.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleTaskInteractive.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAGH,6CAAyC;AACzC,oDAA+C;AAC/C,wDAA8D;AAC9D,sEAA+E;AAC/E,6CAsBwB;AACxB,0EAAuI;AACvI,+EAAiF;AAEjF,+EAA+E;AAC/E,uEAAuE;AACvE,+EAA+E;AAE/E,MAAM,QAAQ;IAMV;QAFQ,UAAK,GAAG,KAAK,CAAC;QAGlB,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC/C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,CAAC,CAAC,CAAC;IACP,CAAC;IAED,SAAS,CAAC,KAAQ;QACd,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED,YAAY,CAAC,KAAY;QACrB,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;CACJ;AAaD,MAAM,6BAA6B;IAAnC;QACY,WAAM,GAAG,IAAI,GAAG,EAAuC,CAAC;QACxD,kBAAa,GAAG,IAAI,GAAG,EAA0B,CAAC;IAgF9D,CAAC;I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AC,GAAG,CAAC,uCAAuC,IAAI,MAAM,CAAC,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAClC,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;AACpF,CAAC,CAAC,CAAC;AAEH,kBAAkB;AAClB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACzC,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9C,IAAI,CAAC;YACD,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,yBAAyB,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;IACD,SAAS,CAAC,OAAO,EAAE,CAAC;IACpB,YAAY,CAAC,OAAO,EAAE,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts deleted file mode 100644 index c536d0c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map deleted file mode 100644 index fb982c8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sseAndStreamableHttpCompatibleServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js deleted file mode 100644 index 6e2c1b4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js +++ /dev/null @@ -1,256 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const node_crypto_1 = require("node:crypto"); -const mcp_js_1 = require("../../server/mcp.js"); -const streamableHttp_js_1 = require("../../server/streamableHttp.js"); -const sse_js_1 = require("../../server/sse.js"); -const z = __importStar(require("zod/v4")); -const types_js_1 = require("../../types.js"); -const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js"); -const express_js_1 = require("../../server/express.js"); -/** - * This example server demonstrates backwards compatibility with both: - * 1. The deprecated HTTP+SSE transport (protocol version 2024-11-05) - * 2. The Streamable HTTP transport (protocol version 2025-11-25) - * - * It maintains a single MCP server instance but exposes two transport options: - * - /mcp: The new Streamable HTTP endpoint (supports GET/POST/DELETE) - * - /sse: The deprecated SSE endpoint for older clients (GET to establish stream) - * - /messages: The deprecated POST endpoint for older clients (POST to send messages) - */ -const getServer = () => { - const server = new mcp_js_1.McpServer({ - name: 'backwards-compatible-server', - version: '1.0.0' - }, { capabilities: { logging: {} } }); - // Register a simple tool that sends notifications over time - server.registerTool('start-notification-stream', { - description: 'Starts sending periodic notifications for testing resumability', - inputSchema: { - interval: z.number().describe('Interval in milliseconds between notifications').default(100), - count: z.number().describe('Number of notifications to send (0 for 100)').default(50) - } - }, async ({ interval, count }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - let counter = 0; - while (count === 0 || counter < count) { - counter++; - try { - await server.sendLoggingMessage({ - level: 'info', - data: `Periodic notification #${counter} at ${new Date().toISOString()}` - }, extra.sessionId); - } - catch (error) { - console.error('Error sending notification:', error); - } - // Wait for the specified interval - await sleep(interval); - } - return { - content: [ - { - type: 'text', - text: `Started sending periodic notifications every ${interval}ms` - } - ] - }; - }); - return server; -}; -// Create Express application -const app = (0, express_js_1.createMcpExpressApp)(); -// Store transports by session ID -const transports = {}; -//============================================================================= -// STREAMABLE HTTP TRANSPORT (PROTOCOL VERSION 2025-11-25) -//============================================================================= -// Handle all MCP Streamable HTTP requests (GET, POST, DELETE) on a single endpoint -app.all('/mcp', async (req, res) => { - console.log(`Received ${req.method} request to /mcp`); - try { - // Check for existing session ID - const sessionId = req.headers['mcp-session-id']; - let transport; - if (sessionId && transports[sessionId]) { - // Check if the transport is of the correct type - const existingTransport = transports[sessionId]; - if (existingTransport instanceof streamableHttp_js_1.StreamableHTTPServerTransport) { - // Reuse existing transport - transport = existingTransport; - } - else { - // Transport exists but is not a StreamableHTTPServerTransport (could be SSEServerTransport) - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: Session exists but uses a different transport protocol' - }, - id: null - }); - return; - } - } - else if (!sessionId && req.method === 'POST' && (0, types_js_1.isInitializeRequest)(req.body)) { - const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore(); - transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ - sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), - eventStore, // Enable resumability - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - console.log(`StreamableHTTP session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}, removing from transports map`); - delete transports[sid]; - } - }; - // Connect the transport to the MCP server - const server = getServer(); - await server.connect(transport); - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with the transport - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}); -//============================================================================= -// DEPRECATED HTTP+SSE TRANSPORT (PROTOCOL VERSION 2024-11-05) -//============================================================================= -app.get('/sse', async (req, res) => { - console.log('Received GET request to /sse (deprecated SSE transport)'); - const transport = new sse_js_1.SSEServerTransport('/messages', res); - transports[transport.sessionId] = transport; - res.on('close', () => { - delete transports[transport.sessionId]; - }); - const server = getServer(); - await server.connect(transport); -}); -app.post('/messages', async (req, res) => { - const sessionId = req.query.sessionId; - let transport; - const existingTransport = transports[sessionId]; - if (existingTransport instanceof sse_js_1.SSEServerTransport) { - // Reuse existing transport - transport = existingTransport; - } - else { - // Transport exists but is not a SSEServerTransport (could be StreamableHTTPServerTransport) - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: Session exists but uses a different transport protocol' - }, - id: null - }); - return; - } - if (transport) { - await transport.handlePostMessage(req, res, req.body); - } - else { - res.status(400).send('No transport found for sessionId'); - } -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`Backwards compatible MCP server listening on port ${PORT}`); - console.log(` -============================================== -SUPPORTED TRANSPORT OPTIONS: - -1. Streamable Http(Protocol version: 2025-11-25) - Endpoint: /mcp - Methods: GET, POST, DELETE - Usage: - - Initialize with POST to /mcp - - Establish SSE stream with GET to /mcp - - Send requests with POST to /mcp - - Terminate session with DELETE to /mcp - -2. Http + SSE (Protocol version: 2024-11-05) - Endpoints: /sse (GET) and /messages (POST) - Usage: - - Establish SSE stream with GET to /sse - - Send requests with POST to /messages?sessionId= -============================================== -`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map deleted file mode 100644 index 3f6331a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sseAndStreamableHttpCompatibleServer.js","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,gDAAyD;AACzD,0CAA4B;AAC5B,6CAAqE;AACrE,2EAAqE;AACrE,wDAA8D;AAE9D;;;;;;;;;GASG;AAEH,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,OAAO;KACnB,EACD,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CACpC,CAAC;IAEF,4DAA4D;IAC5D,MAAM,CAAC,YAAY,CACf,2BAA2B,EAC3B;QACI,WAAW,EAAE,gEAAgE;QAC7E,WAAW,EAAE;YACT,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;YAC5F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;SACxF;KACJ,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,EAA2B,EAAE;QAC1D,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9E,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,OAAO,KAAK,KAAK,CAAC,IAAI,OAAO,GAAG,KAAK,EAAE,CAAC;YACpC,OAAO,EAAE,CAAC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C,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,qDAAqD,IAAI,EAAE,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;CAmBf,CAAC,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts deleted file mode 100644 index 63e4554..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=ssePollingExample.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts.map deleted file mode 100644 index 9382731..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ssePollingExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/ssePollingExample.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js deleted file mode 100644 index ea5c9ed..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const node_crypto_1 = require("node:crypto"); -const mcp_js_1 = require("../../server/mcp.js"); -const express_js_1 = require("../../server/express.js"); -const streamableHttp_js_1 = require("../../server/streamableHttp.js"); -const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js"); -const cors_1 = __importDefault(require("cors")); -// Factory to create a new MCP server per session. -// Each session needs its own server+transport pair to avoid cross-session contamination. -const getServer = () => { - const server = new mcp_js_1.McpServer({ - name: 'sse-polling-example', - version: '1.0.0' - }, { - capabilities: { logging: {} } - }); - // Register a long-running tool that demonstrates server-initiated disconnect - server.tool('long-task', 'A long-running task that sends progress updates. Server will disconnect mid-task to demonstrate polling.', {}, async (_args, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - console.log(`[${extra.sessionId}] Starting long-task...`); - // Send first progress notification - await server.sendLoggingMessage({ - level: 'info', - data: 'Progress: 25% - Starting work...' - }, extra.sessionId); - await sleep(1000); - // Send second progress notification - await server.sendLoggingMessage({ - level: 'info', - data: 'Progress: 50% - Halfway there...' - }, extra.sessionId); - await sleep(1000); - // Server decides to disconnect the client to free resources - // Client will reconnect via GET with Last-Event-ID after the transport's retryInterval - // Use extra.closeSSEStream callback - available when eventStore is configured - if (extra.closeSSEStream) { - console.log(`[${extra.sessionId}] Closing SSE stream to trigger client polling...`); - extra.closeSSEStream(); - } - // Continue processing while client is disconnected - // Events are stored in eventStore and will be replayed on reconnect - await sleep(500); - await server.sendLoggingMessage({ - level: 'info', - data: 'Progress: 75% - Almost done (sent while client disconnected)...' - }, extra.sessionId); - await sleep(500); - await server.sendLoggingMessage({ - level: 'info', - data: 'Progress: 100% - Complete!' - }, extra.sessionId); - console.log(`[${extra.sessionId}] Task complete`); - return { - content: [ - { - type: 'text', - text: 'Long task completed successfully!' - } - ] - }; - }); - return server; -}; -// Set up Express app -const app = (0, express_js_1.createMcpExpressApp)(); -app.use((0, cors_1.default)()); -// Create event store for resumability -const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore(); -// Track transports by session ID for session reuse -const transports = new Map(); -// Handle all MCP requests -app.all('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - // Reuse existing transport or create new one - let transport = sessionId ? transports.get(sessionId) : undefined; - if (!transport) { - transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ - sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), - eventStore, - retryInterval: 2000, // Default retry interval for priming events - onsessioninitialized: id => { - console.log(`[${id}] Session initialized`); - transports.set(id, transport); - } - }); - // Create a new server per session and connect it to the transport - const server = getServer(); - await server.connect(transport); - } - await transport.handleRequest(req, res, req.body); -}); -// Start the server -const PORT = 3001; -app.listen(PORT, () => { - console.log(`SSE Polling Example Server running on http://localhost:${PORT}/mcp`); - console.log(''); - console.log('This server demonstrates SEP-1699 SSE polling:'); - console.log('- retryInterval: 2000ms (client waits 2s before reconnecting)'); - console.log('- eventStore: InMemoryEventStore (events are persisted for replay)'); - console.log(''); - console.log('Try calling the "long-task" tool to see server-initiated disconnect in action.'); -}); -//# sourceMappingURL=ssePollingExample.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js.map deleted file mode 100644 index d001a5b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ssePollingExample.js","sourceRoot":"","sources":["../../../../src/examples/server/ssePollingExample.ts"],"names":[],"mappings":";;;;;AAeA,6CAAyC;AACzC,gDAAgD;AAChD,wDAA8D;AAC9D,sEAA+E;AAE/E,2EAAqE;AACrE,gDAAwB;AAExB,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;KAChC,CACJ,CAAC;IAEF,6EAA6E;IAC7E,MAAM,CAAC,IAAI,CACP,WAAW,EACX,0GAA0G,EAC1G,EAAE,EACF,KAAK,EAAE,KAAK,EAAE,KAAK,EAA2B,EAAE;QAC5C,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QAE9E,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,SAAS,yBAAyB,CAAC,CAAC;QAE1D,mCAAmC;QACnC,MAAM,MAAM,CAAC,kBAAkB,CAC3B;YACI,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,kCAAkC;SAC3C,EACD,KAAK,CAAC,SAAS,CAClB,CAAC;QACF,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QAElB,oCAAoC;QACpC,MAAM,MAAM,CAAC,kBAAkB,CAC3B;YACI,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,kCAAkC;SAC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AO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;AAClG,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts deleted file mode 100644 index 4df1783..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=standaloneSseWithGetStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map deleted file mode 100644 index df60dc5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"standaloneSseWithGetStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js deleted file mode 100644 index 129980e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js +++ /dev/null @@ -1,124 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const node_crypto_1 = require("node:crypto"); -const mcp_js_1 = require("../../server/mcp.js"); -const streamableHttp_js_1 = require("../../server/streamableHttp.js"); -const types_js_1 = require("../../types.js"); -const express_js_1 = require("../../server/express.js"); -// Factory to create a new MCP server per session. -// Each session needs its own server+transport pair to avoid cross-session contamination. -const getServer = () => { - const server = new mcp_js_1.McpServer({ - name: 'resource-list-changed-notification-server', - version: '1.0.0' - }); - const addResource = (name, content) => { - const uri = `https://mcp-example.com/dynamic/${encodeURIComponent(name)}`; - server.registerResource(name, uri, { mimeType: 'text/plain', description: `Dynamic resource: ${name}` }, async () => { - return { - contents: [{ uri, text: content }] - }; - }); - }; - addResource('example-resource', 'Initial content for example-resource'); - // Periodically add new resources to demonstrate notifications - const resourceChangeInterval = setInterval(() => { - const name = (0, node_crypto_1.randomUUID)(); - addResource(name, `Content for ${name}`); - }, 5000); - // Clean up the interval when the server closes - server.server.onclose = () => { - clearInterval(resourceChangeInterval); - }; - return server; -}; -// Store transports by session ID to send notifications -const transports = {}; -const app = (0, express_js_1.createMcpExpressApp)(); -app.post('/mcp', async (req, res) => { - console.log('Received MCP request:', req.body); - try { - // Check for existing session ID - const sessionId = req.headers['mcp-session-id']; - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport - transport = transports[sessionId]; - } - else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) { - // New initialization request - transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ - sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - // This avoids race conditions where requests might come in before the session is stored - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Create a new server per session and connect it to the transport - const server = getServer(); - await server.connect(transport); - // Handle the request - the onsessioninitialized callback will store the transport - await transport.handleRequest(req, res, req.body); - return; // Already handled - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}); -// Handle GET requests for SSE streams (now using built-in support from StreamableHTTP) -app.get('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Establishing SSE stream for session ${sessionId}`); - const transport = transports[sessionId]; - await transport.handleRequest(req, res); -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`Server listening on port ${PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - for (const sessionId in transports) { - await transports[sessionId].close(); - delete transports[sessionId]; - } - process.exit(0); -}); -//# sourceMappingURL=standaloneSseWithGetStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map deleted file mode 100644 index f5c8acd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"standaloneSseWithGetStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":";;AACA,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,6CAAyE;AACzE,wDAA8D;AAE9D,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QACzB,IAAI,EAAE,2CAA2C;QACjD,OAAO,EAAE,OAAO;KACnB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE;QAClD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E,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;QACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts deleted file mode 100644 index acc24b6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=toolWithSampleServer.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts.map deleted file mode 100644 index bd0cebc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"toolWithSampleServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/toolWithSampleServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js deleted file mode 100644 index 45d3837..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -// Run with: npx tsx src/examples/server/toolWithSampleServer.ts -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const mcp_js_1 = require("../../server/mcp.js"); -const stdio_js_1 = require("../../server/stdio.js"); -const z = __importStar(require("zod/v4")); -const mcpServer = new mcp_js_1.McpServer({ - name: 'tools-with-sample-server', - version: '1.0.0' -}); -// Tool that uses LLM sampling to summarize any text -mcpServer.registerTool('summarize', { - description: 'Summarize any text using an LLM', - inputSchema: { - text: z.string().describe('Text to summarize') - } -}, async ({ text }) => { - // Call the LLM through MCP sampling - const response = await mcpServer.server.createMessage({ - messages: [ - { - role: 'user', - content: { - type: 'text', - text: `Please summarize the following text concisely:\n\n${text}` - } - } - ], - maxTokens: 500 - }); - // Since we're not passing tools param to createMessage, response.content is single content - return { - content: [ - { - type: 'text', - text: response.content.type === 'text' ? response.content.text : 'Unable to generate summary' - } - ] - }; -}); -async function main() { - const transport = new stdio_js_1.StdioServerTransport(); - await mcpServer.connect(transport); - console.log('MCP server is running...'); -} -main().catch(error => { - console.error('Server error:', error); - process.exit(1); -}); -//# sourceMappingURL=toolWithSampleServer.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js.map deleted file mode 100644 index 287e11e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"toolWithSampleServer.js","sourceRoot":"","sources":["../../../../src/examples/server/toolWithSampleServer.ts"],"names":[],"mappings":";AAAA,gEAAgE;;;;;;;;;;;;;;;;;;;;;;;;;AAEhE,gDAAgD;AAChD,oDAA6D;AAC7D,0CAA4B;AAE5B,MAAM,SAAS,GAAG,IAAI,kBAAS,CAAC;IAC5B,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,OAAO;CACnB,CAAC,CAAC;AAEH,oDAAoD;AACpD,SAAS,CAAC,YAAY,CAClB,WAAW,EACX;IACI,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE;QACT,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KACjD;CACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACf,oCAAoC;IACpC,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC;QAClD,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACL,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,qDAAqD,IAAI,EAAE;iBACpE;aACJ;SACJ;QACD,SAAS,EAAE,GAAG;KACjB,CAAC,CAAC;IAEH,2FAA2F;IAC3F,OAAO;QACH,OAAO,EAAE;YACL;gBACI,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,4BAA4B;aAChG;SACJ;KACJ,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC5C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts deleted file mode 100644 index 26ff38c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { JSONRPCMessage } from '../../types.js'; -import { EventStore } from '../../server/streamableHttp.js'; -/** - * Simple in-memory implementation of the EventStore interface for resumability - * This is primarily intended for examples and testing, not for production use - * where a persistent storage solution would be more appropriate. - */ -export declare class InMemoryEventStore implements EventStore { - private events; - /** - * Generates a unique event ID for a given stream ID - */ - private generateEventId; - /** - * Extracts the stream ID from an event ID - */ - private getStreamIdFromEventId; - /** - * Stores an event with a generated event ID - * Implements EventStore.storeEvent - */ - storeEvent(streamId: string, message: JSONRPCMessage): Promise; - /** - * Replays events that occurred after a specific event ID - * Implements EventStore.replayEventsAfter - */ - replayEventsAfter(lastEventId: string, { send }: { - send: (eventId: string, message: JSONRPCMessage) => Promise; - }): Promise; -} -//# sourceMappingURL=inMemoryEventStore.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map deleted file mode 100644 index a67ee6c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemoryEventStore.d.ts","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,UAAU;IACjD,OAAO,CAAC,MAAM,CAAyE;IAEvF;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAK9B;;;OAGG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAM5E;;;OAGG;IACG,iBAAiB,CACnB,WAAW,EAAE,MAAM,EACnB,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,GAChF,OAAO,CAAC,MAAM,CAAC;CAkCrB"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js deleted file mode 100644 index d33ffdb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.InMemoryEventStore = void 0; -/** - * Simple in-memory implementation of the EventStore interface for resumability - * This is primarily intended for examples and testing, not for production use - * where a persistent storage solution would be more appropriate. - */ -class InMemoryEventStore { - constructor() { - this.events = new Map(); - } - /** - * Generates a unique event ID for a given stream ID - */ - generateEventId(streamId) { - return `${streamId}_${Date.now()}_${Math.random().toString(36).substring(2, 10)}`; - } - /** - * Extracts the stream ID from an event ID - */ - getStreamIdFromEventId(eventId) { - const parts = eventId.split('_'); - return parts.length > 0 ? parts[0] : ''; - } - /** - * Stores an event with a generated event ID - * Implements EventStore.storeEvent - */ - async storeEvent(streamId, message) { - const eventId = this.generateEventId(streamId); - this.events.set(eventId, { streamId, message }); - return eventId; - } - /** - * Replays events that occurred after a specific event ID - * Implements EventStore.replayEventsAfter - */ - async replayEventsAfter(lastEventId, { send }) { - if (!lastEventId || !this.events.has(lastEventId)) { - return ''; - } - // Extract the stream ID from the event ID - const streamId = this.getStreamIdFromEventId(lastEventId); - if (!streamId) { - return ''; - } - let foundLastEvent = false; - // Sort events by eventId for chronological ordering - const sortedEvents = [...this.events.entries()].sort((a, b) => a[0].localeCompare(b[0])); - for (const [eventId, { streamId: eventStreamId, message }] of sortedEvents) { - // Only include events from the same stream - if (eventStreamId !== streamId) { - continue; - } - // Start sending events after we find the lastEventId - if (eventId === lastEventId) { - foundLastEvent = true; - continue; - } - if (foundLastEvent) { - await send(eventId, message); - } - } - return streamId; - } -} -exports.InMemoryEventStore = InMemoryEventStore; -//# sourceMappingURL=inMemoryEventStore.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js.map deleted file mode 100644 index d696450..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemoryEventStore.js","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH,MAAa,kBAAkB;IAA/B;QACY,WAAM,GAA+D,IAAI,GAAG,EAA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AAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzF,KAAK,MAAM,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC;YACzE,2CAA2C;YAC3C,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;gBAC7B,SAAS;YACb,CAAC;YAED,qDAAqD;YACrD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;gBAC1B,cAAc,GAAG,IAAI,CAAC;gBACtB,SAAS;YACb,CAAC;YAED,IAAI,cAAc,EAAE,CAAC;gBACjB,MAAM,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACjC,CAAC;QACL,CAAC;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AArED,gDAqEC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts deleted file mode 100644 index 2a86335..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Experimental MCP SDK features. - * WARNING: These APIs are experimental and may change without notice. - * - * Import experimental features from this module: - * ```typescript - * import { TaskStore, InMemoryTaskStore } from '@modelcontextprotocol/sdk/experimental'; - * ``` - * - * @experimental - */ -export * from './tasks/index.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts.map deleted file mode 100644 index 410892a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/experimental/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js deleted file mode 100644 index 7634e67..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -/** - * Experimental MCP SDK features. - * WARNING: These APIs are experimental and may change without notice. - * - * Import experimental features from this module: - * ```typescript - * import { TaskStore, InMemoryTaskStore } from '@modelcontextprotocol/sdk/experimental'; - * ``` - * - * @experimental - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./tasks/index.js"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js.map deleted file mode 100644 index 110189e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/experimental/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;AAEH,mDAAiC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts deleted file mode 100644 index 9c7a928..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Experimental client task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import type { Client } from '../../client/index.js'; -import type { RequestOptions } from '../../shared/protocol.js'; -import type { ResponseMessage } from '../../shared/responseMessage.js'; -import type { AnyObjectSchema, SchemaOutput } from '../../server/zod-compat.js'; -import type { CallToolRequest, ClientRequest, Notification, Request, Result } from '../../types.js'; -import { CallToolResultSchema, type CompatibilityCallToolResultSchema } from '../../types.js'; -import type { GetTaskResult, ListTasksResult, CancelTaskResult } from './types.js'; -/** - * Experimental task features for MCP clients. - * - * Access via `client.experimental.tasks`: - * ```typescript - * const stream = client.experimental.tasks.callToolStream({ name: 'tool', arguments: {} }); - * const task = await client.experimental.tasks.getTask(taskId); - * ``` - * - * @experimental - */ -export declare class ExperimentalClientTasks { - private readonly _client; - constructor(_client: Client); - /** - * Calls a tool and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to tool execution, allowing you to - * observe intermediate task status updates for long-running tool calls. - * Automatically validates structured output if the tool has an outputSchema. - * - * @example - * ```typescript - * const stream = client.experimental.tasks.callToolStream({ name: 'myTool', arguments: {} }); - * for await (const message of stream) { - * switch (message.type) { - * case 'taskCreated': - * console.log('Tool execution started:', message.task.taskId); - * break; - * case 'taskStatus': - * console.log('Tool status:', message.task.status); - * break; - * case 'result': - * console.log('Tool result:', message.result); - * break; - * case 'error': - * console.error('Tool error:', message.error); - * break; - * } - * } - * ``` - * - * @param params - Tool call parameters (name and arguments) - * @param resultSchema - Zod schema for validating the result (defaults to CallToolResultSchema) - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - callToolStream(params: CallToolRequest['params'], resultSchema?: T, options?: RequestOptions): AsyncGenerator>, void, void>; - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * @returns The task status - * - * @experimental - */ - getTask(taskId: string, options?: RequestOptions): Promise; - /** - * Retrieves the result of a completed task. - * - * @param taskId - The task identifier - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options - * @returns The task result - * - * @experimental - */ - getTaskResult(taskId: string, resultSchema?: T, options?: RequestOptions): Promise>; - /** - * Lists tasks with optional pagination. - * - * @param cursor - Optional pagination cursor - * @param options - Optional request options - * @returns List of tasks with optional next cursor - * - * @experimental - */ - listTasks(cursor?: string, options?: RequestOptions): Promise; - /** - * Cancels a running task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * - * @experimental - */ - cancelTask(taskId: string, options?: RequestOptions): Promise; - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to request processing, allowing you to - * observe intermediate task status updates for task-augmented requests. - * - * @param request - The request to send - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - requestStream(request: ClientRequest | RequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>; -} -//# sourceMappingURL=client.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts.map deleted file mode 100644 index e54158d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/client.ts"],"names":[],"mappings":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G,aAAa,CAAC,CAAC,SAAS,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAapI;;;;;;;;OAQG;IACG,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IASpF;;;;;;;OAOG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IASrF;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,CAAC,SAAS,eAAe,EACnC,OAAO,EAAE,aAAa,GAAG,QAAQ,EACjC,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,EAAE,cAAc,GACzB,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;CAWlE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js deleted file mode 100644 index cb7d26f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js +++ /dev/null @@ -1,188 +0,0 @@ -"use strict"; -/** - * Experimental client task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExperimentalClientTasks = void 0; -const types_js_1 = require("../../types.js"); -/** - * Experimental task features for MCP clients. - * - * Access via `client.experimental.tasks`: - * ```typescript - * const stream = client.experimental.tasks.callToolStream({ name: 'tool', arguments: {} }); - * const task = await client.experimental.tasks.getTask(taskId); - * ``` - * - * @experimental - */ -class ExperimentalClientTasks { - constructor(_client) { - this._client = _client; - } - /** - * Calls a tool and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to tool execution, allowing you to - * observe intermediate task status updates for long-running tool calls. - * Automatically validates structured output if the tool has an outputSchema. - * - * @example - * ```typescript - * const stream = client.experimental.tasks.callToolStream({ name: 'myTool', arguments: {} }); - * for await (const message of stream) { - * switch (message.type) { - * case 'taskCreated': - * console.log('Tool execution started:', message.task.taskId); - * break; - * case 'taskStatus': - * console.log('Tool status:', message.task.status); - * break; - * case 'result': - * console.log('Tool result:', message.result); - * break; - * case 'error': - * console.error('Tool error:', message.error); - * break; - * } - * } - * ``` - * - * @param params - Tool call parameters (name and arguments) - * @param resultSchema - Zod schema for validating the result (defaults to CallToolResultSchema) - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - async *callToolStream(params, resultSchema = types_js_1.CallToolResultSchema, options) { - // Access Client's internal methods - const clientInternal = this._client; - // Add task creation parameters if server supports it and not explicitly provided - const optionsWithTask = { - ...options, - // We check if the tool is known to be a task during auto-configuration, but assume - // the caller knows what they're doing if they pass this explicitly - task: options?.task ?? (clientInternal.isToolTask(params.name) ? {} : undefined) - }; - const stream = clientInternal.requestStream({ method: 'tools/call', params }, resultSchema, optionsWithTask); - // Get the validator for this tool (if it has an output schema) - const validator = clientInternal.getToolOutputValidator(params.name); - // Iterate through the stream and validate the final result if needed - for await (const message of stream) { - // If this is a result message and the tool has an output schema, validate it - if (message.type === 'result' && validator) { - const result = message.result; - // If tool has outputSchema, it MUST return structuredContent (unless it's an error) - if (!result.structuredContent && !result.isError) { - yield { - type: 'error', - error: new types_js_1.McpError(types_js_1.ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`) - }; - return; - } - // Only validate structured content if present (not when there's an error) - if (result.structuredContent) { - try { - // Validate the structured content against the schema - const validationResult = validator(result.structuredContent); - if (!validationResult.valid) { - yield { - type: 'error', - error: new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`) - }; - return; - } - } - catch (error) { - if (error instanceof types_js_1.McpError) { - yield { type: 'error', error }; - return; - } - yield { - type: 'error', - error: new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`) - }; - return; - } - } - } - // Yield the message (either validated result or any other message type) - yield message; - } - } - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * @returns The task status - * - * @experimental - */ - async getTask(taskId, options) { - return this._client.getTask({ taskId }, options); - } - /** - * Retrieves the result of a completed task. - * - * @param taskId - The task identifier - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options - * @returns The task result - * - * @experimental - */ - async getTaskResult(taskId, resultSchema, options) { - // Delegate to the client's underlying Protocol method - return this._client.getTaskResult({ taskId }, resultSchema, options); - } - /** - * Lists tasks with optional pagination. - * - * @param cursor - Optional pagination cursor - * @param options - Optional request options - * @returns List of tasks with optional next cursor - * - * @experimental - */ - async listTasks(cursor, options) { - // Delegate to the client's underlying Protocol method - return this._client.listTasks(cursor ? { cursor } : undefined, options); - } - /** - * Cancels a running task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * - * @experimental - */ - async cancelTask(taskId, options) { - // Delegate to the client's underlying Protocol method - return this._client.cancelTask({ taskId }, options); - } - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to request processing, allowing you to - * observe intermediate task status updates for task-augmented requests. - * - * @param request - The request to send - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - requestStream(request, resultSchema, options) { - return this._client.requestStream(request, resultSchema, options); - } -} -exports.ExperimentalClientTasks = ExperimentalClientTasks; -//# sourceMappingURL=client.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js.map deleted file mode 100644 index a5dd7bd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAOH,6CAAmH;AAkBnH;;;;;;;;;;GAUG;AACH,MAAa,uBAAuB;IAKhC,YAA6B,OAAiD;QAAjD,YAAO,GAAP,OAAO,CAA0C;IAAG,CAAC;IAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,KAAK,CAAC,CAAC,cAAc,CACjB,MAAiC,EACjC,eAAkB,+BAAyB,EAC3C,OAAwB;QAExB,mCAAmC;QACnC,MAAM,cAAc,GAAG,IAAI,CAAC,OAA8C,CAAC;QAE3E,iFAAiF;QACjF,MAAM,eAAe,GAAG;YACpB,GAAG,OAAO;YACV,mFAAmF;YACnF,mEAAmE;YACnE,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;SACnF,CAAC;QAEF,MAAM,MAAM,GAAG,cAAc,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC;QAE7G,+DAA+D;QAC/D,MAAM,SAAS,GAAG,cAAc,CAAC,sBAAsB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAErE,qEAAqE;QACrE,IAAI,KAAK,EAAE,MAAM,OAAO,IAAI,MAAM,EAAE,CAAC;YACjC,6EAA6E;YAC7E,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,SAAS,EAAE,CAAC;gBACzC,MAAM,MAAM,GAAG,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;IACH,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAwB;QAGlD,OAAQ,IAAI,CAAC,OAAwC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,aAAa,CAA4B,MAAc,EAAE,YAAgB,EAAE,OAAwB;QACrG,sDAAsD;QACtD,OACI,IAAI,CAAC,OAOR,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,SAAS,CAAC,MAAe,EAAE,OAAwB;QACrD,sDAAsD;QACtD,OACI,IAAI,CAAC,OAGR,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,OAAwB;QACrD,sDAAsD;QACtD,OACI,IAAI,CAAC,OAGR,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,aAAa,CACT,OAAiC,EACjC,YAAe,EACf,OAAwB;QAUxB,OAAQ,IAAI,CAAC,OAA8C,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;CACJ;AA9ND,0DA8NC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts deleted file mode 100644 index f5e505f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Experimental task capability assertion helpers. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -/** - * Type representing the task requests capability structure. - * This is derived from ClientTasksCapability.requests and ServerTasksCapability.requests. - */ -interface TaskRequestsCapability { - tools?: { - call?: object; - }; - sampling?: { - createMessage?: object; - }; - elicitation?: { - create?: object; - }; -} -/** - * Asserts that task creation is supported for tools/call. - * Used by Client.assertTaskCapability and Server.assertTaskHandlerCapability. - * - * @param requests - The task requests capability object - * @param method - The method being checked - * @param entityName - 'Server' or 'Client' for error messages - * @throws Error if the capability is not supported - * - * @experimental - */ -export declare function assertToolsCallTaskCapability(requests: TaskRequestsCapability | undefined, method: string, entityName: 'Server' | 'Client'): void; -/** - * Asserts that task creation is supported for sampling/createMessage or elicitation/create. - * Used by Server.assertTaskCapability and Client.assertTaskHandlerCapability. - * - * @param requests - The task requests capability object - * @param method - The method being checked - * @param entityName - 'Server' or 'Client' for error messages - * @throws Error if the capability is not supported - * - * @experimental - */ -export declare function assertClientRequestTaskCapability(requests: TaskRequestsCapability | undefined, method: string, entityName: 'Server' | 'Client'): void; -export {}; -//# sourceMappingURL=helpers.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts.map deleted file mode 100644 index 99dc903..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,UAAU,sBAAsB;IAC5B,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,WAAW,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CACzC,QAAQ,EAAE,sBAAsB,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAChC,IAAI,CAgBN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iCAAiC,CAC7C,QAAQ,EAAE,sBAAsB,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAChC,IAAI,CAsBN"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js deleted file mode 100644 index 6348ab0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; -/** - * Experimental task capability assertion helpers. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.assertToolsCallTaskCapability = assertToolsCallTaskCapability; -exports.assertClientRequestTaskCapability = assertClientRequestTaskCapability; -/** - * Asserts that task creation is supported for tools/call. - * Used by Client.assertTaskCapability and Server.assertTaskHandlerCapability. - * - * @param requests - The task requests capability object - * @param method - The method being checked - * @param entityName - 'Server' or 'Client' for error messages - * @throws Error if the capability is not supported - * - * @experimental - */ -function assertToolsCallTaskCapability(requests, method, entityName) { - if (!requests) { - throw new Error(`${entityName} does not support task creation (required for ${method})`); - } - switch (method) { - case 'tools/call': - if (!requests.tools?.call) { - throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`); - } - break; - default: - // Method doesn't support tasks, which is fine - no error - break; - } -} -/** - * Asserts that task creation is supported for sampling/createMessage or elicitation/create. - * Used by Server.assertTaskCapability and Client.assertTaskHandlerCapability. - * - * @param requests - The task requests capability object - * @param method - The method being checked - * @param entityName - 'Server' or 'Client' for error messages - * @throws Error if the capability is not supported - * - * @experimental - */ -function assertClientRequestTaskCapability(requests, method, entityName) { - if (!requests) { - throw new Error(`${entityName} does not support task creation (required for ${method})`); - } - switch (method) { - case 'sampling/createMessage': - if (!requests.sampling?.createMessage) { - throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`); - } - break; - case 'elicitation/create': - if (!requests.elicitation?.create) { - throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`); - } - break; - default: - // Method doesn't support tasks, which is fine - no error - break; - } -} -//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js.map deleted file mode 100644 index 1054273..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/helpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAuBH,sEAoBC;AAaD,8EA0BC;AAtED;;;;;;;;;;GAUG;AACH,SAAgB,6BAA6B,CACzC,QAA4C,EAC5C,MAAc,EACd,UAA+B;IAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,iDAAiD,MAAM,GAAG,CAAC,CAAC;IAC7F,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,YAAY;YACb,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,gEAAgE,MAAM,GAAG,CAAC,CAAC;YAC5G,CAAC;YACD,MAAM;QAEV;YACI,yDAAyD;YACzD,MAAM;IACd,CAAC;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,iCAAiC,CAC7C,QAA4C,EAC5C,MAAc,EACd,UAA+B;IAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,iDAAiD,MAAM,GAAG,CAAC,CAAC;IAC7F,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,wBAAwB;YACzB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC;gBACpC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,4EAA4E,MAAM,GAAG,CAAC,CAAC;YACxH,CAAC;YACD,MAAM;QAEV,KAAK,oBAAoB;YACrB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,wEAAwE,MAAM,GAAG,CAAC,CAAC;YACpH,CAAC;YACD,MAAM;QAEV;YACI,yDAAyD;YACzD,MAAM;IACd,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts deleted file mode 100644 index 33ab791..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Experimental task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -export * from './types.js'; -export * from './interfaces.js'; -export * from './helpers.js'; -export * from './client.js'; -export * from './server.js'; -export * from './mcp-server.js'; -export * from './stores/in-memory.js'; -export type { ResponseMessage, TaskStatusMessage, TaskCreatedMessage, ResultMessage, ErrorMessage, BaseResponseMessage } from '../../shared/responseMessage.js'; -export { takeResult, toArrayAsync } from '../../shared/responseMessage.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts.map deleted file mode 100644 index cf117ed..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,cAAc,CAAC;AAG7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,uBAAuB,CAAC;AAGtC,YAAY,EACR,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js deleted file mode 100644 index 25296f6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -/** - * Experimental task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toArrayAsync = exports.takeResult = void 0; -// Re-export spec types for convenience -__exportStar(require("./types.js"), exports); -// SDK implementation interfaces -__exportStar(require("./interfaces.js"), exports); -// Assertion helpers -__exportStar(require("./helpers.js"), exports); -// Wrapper classes -__exportStar(require("./client.js"), exports); -__exportStar(require("./server.js"), exports); -__exportStar(require("./mcp-server.js"), exports); -// Store implementations -__exportStar(require("./stores/in-memory.js"), exports); -var responseMessage_js_1 = require("../../shared/responseMessage.js"); -Object.defineProperty(exports, "takeResult", { enumerable: true, get: function () { return responseMessage_js_1.takeResult; } }); -Object.defineProperty(exports, "toArrayAsync", { enumerable: true, get: function () { return responseMessage_js_1.toArrayAsync; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js.map deleted file mode 100644 index 3d57065..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;AAEH,uCAAuC;AACvC,6CAA2B;AAE3B,gCAAgC;AAChC,kDAAgC;AAEhC,oBAAoB;AACpB,+CAA6B;AAE7B,kBAAkB;AAClB,8CAA4B;AAC5B,8CAA4B;AAC5B,kDAAgC;AAEhC,wBAAwB;AACxB,wDAAsC;AAWtC,sEAA2E;AAAlE,gHAAA,UAAU,OAAA;AAAE,kHAAA,YAAY,OAAA"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts deleted file mode 100644 index b0bb989..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts +++ /dev/null @@ -1,232 +0,0 @@ -/** - * Experimental task interfaces for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - */ -import { Task, RequestId, Result, JSONRPCRequest, JSONRPCNotification, JSONRPCResultResponse, JSONRPCErrorResponse, ServerRequest, ServerNotification, CallToolResult, GetTaskResult, ToolExecution, Request } from '../../types.js'; -import { CreateTaskResult } from './types.js'; -import type { RequestHandlerExtra, RequestTaskStore } from '../../shared/protocol.js'; -import type { ZodRawShapeCompat, AnySchema, ShapeOutput } from '../../server/zod-compat.js'; -/** - * Extended handler extra with task store for task creation. - * @experimental - */ -export interface CreateTaskRequestHandlerExtra extends RequestHandlerExtra { - taskStore: RequestTaskStore; -} -/** - * Extended handler extra with task ID and store for task operations. - * @experimental - */ -export interface TaskRequestHandlerExtra extends RequestHandlerExtra { - taskId: string; - taskStore: RequestTaskStore; -} -/** - * Base callback type for tool handlers. - * @experimental - */ -export type BaseToolCallback, Args extends undefined | ZodRawShapeCompat | AnySchema = undefined> = Args extends ZodRawShapeCompat ? (args: ShapeOutput, extra: ExtraT) => SendResultT | Promise : Args extends AnySchema ? (args: unknown, extra: ExtraT) => SendResultT | Promise : (extra: ExtraT) => SendResultT | Promise; -/** - * Handler for creating a task. - * @experimental - */ -export type CreateTaskRequestHandler = BaseToolCallback; -/** - * Handler for task operations (get, getResult). - * @experimental - */ -export type TaskRequestHandler = BaseToolCallback; -/** - * Interface for task-based tool handlers. - * @experimental - */ -export interface ToolTaskHandler { - createTask: CreateTaskRequestHandler; - getTask: TaskRequestHandler; - getTaskResult: TaskRequestHandler; -} -/** - * Task-specific execution configuration. - * taskSupport cannot be 'forbidden' for task-based tools. - * @experimental - */ -export type TaskToolExecution = Omit & { - taskSupport: TaskSupport extends 'forbidden' | undefined ? never : TaskSupport; -}; -/** - * Represents a message queued for side-channel delivery via tasks/result. - * - * This is a serializable data structure that can be stored in external systems. - * All fields are JSON-serializable. - */ -export type QueuedMessage = QueuedRequest | QueuedNotification | QueuedResponse | QueuedError; -export interface BaseQueuedMessage { - /** Type of message */ - type: string; - /** When the message was queued (milliseconds since epoch) */ - timestamp: number; -} -export interface QueuedRequest extends BaseQueuedMessage { - type: 'request'; - /** The actual JSONRPC request */ - message: JSONRPCRequest; -} -export interface QueuedNotification extends BaseQueuedMessage { - type: 'notification'; - /** The actual JSONRPC notification */ - message: JSONRPCNotification; -} -export interface QueuedResponse extends BaseQueuedMessage { - type: 'response'; - /** The actual JSONRPC response */ - message: JSONRPCResultResponse; -} -export interface QueuedError extends BaseQueuedMessage { - type: 'error'; - /** The actual JSONRPC error */ - message: JSONRPCErrorResponse; -} -/** - * Interface for managing per-task FIFO message queues. - * - * Similar to TaskStore, this allows pluggable queue implementations - * (in-memory, Redis, other distributed queues, etc.). - * - * Each method accepts taskId and optional sessionId parameters to enable - * a single queue instance to manage messages for multiple tasks, with - * isolation based on task ID and session ID. - * - * All methods are async to support external storage implementations. - * All data in QueuedMessage must be JSON-serializable. - * - * @experimental - */ -export interface TaskMessageQueue { - /** - * Adds a message to the end of the queue for a specific task. - * Atomically checks queue size and throws if maxSize would be exceeded. - * @param taskId The task identifier - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error - * @throws Error if maxSize is specified and would be exceeded - */ - enqueue(taskId: string, message: QueuedMessage, sessionId?: string, maxSize?: number): Promise; - /** - * Removes and returns the first message from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns The first message, or undefined if the queue is empty - */ - dequeue(taskId: string, sessionId?: string): Promise; - /** - * Removes and returns all messages from the queue for a specific task. - * Used when tasks are cancelled or failed to clean up pending messages. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns Array of all messages that were in the queue - */ - dequeueAll(taskId: string, sessionId?: string): Promise; -} -/** - * Task creation options. - * @experimental - */ -export interface CreateTaskOptions { - /** - * Time in milliseconds to keep task results available after completion. - * If null, the task has unlimited lifetime until manually cleaned up. - */ - ttl?: number | null; - /** - * Time in milliseconds to wait between task status requests. - */ - pollInterval?: number; - /** - * Additional context to pass to the task store. - */ - context?: Record; -} -/** - * Interface for storing and retrieving task state and results. - * - * Similar to Transport, this allows pluggable task storage implementations - * (in-memory, database, distributed cache, etc.). - * - * @experimental - */ -export interface TaskStore { - /** - * Creates a new task with the given creation parameters and original request. - * The implementation must generate a unique taskId and createdAt timestamp. - * - * TTL Management: - * - The implementation receives the TTL suggested by the requestor via taskParams.ttl - * - The implementation MAY override the requested TTL (e.g., to enforce limits) - * - The actual TTL used MUST be returned in the Task object - * - Null TTL indicates unlimited task lifetime (no automatic cleanup) - * - Cleanup SHOULD occur automatically after TTL expires, regardless of task status - * - * @param taskParams - The task creation parameters from the request (ttl, pollInterval) - * @param requestId - The JSON-RPC request ID - * @param request - The original request that triggered task creation - * @param sessionId - Optional session ID for binding the task to a specific session - * @returns The created task object - */ - createTask(taskParams: CreateTaskOptions, requestId: RequestId, request: Request, sessionId?: string): Promise; - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param sessionId - Optional session ID for binding the query to a specific session - * @returns The task object, or null if it does not exist - */ - getTask(taskId: string, sessionId?: string): Promise; - /** - * Stores the result of a task and sets its final status. - * - * @param taskId - The task identifier - * @param status - The final status: 'completed' for success, 'failed' for errors - * @param result - The result to store - * @param sessionId - Optional session ID for binding the operation to a specific session - */ - storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result, sessionId?: string): Promise; - /** - * Retrieves the stored result of a task. - * - * @param taskId - The task identifier - * @param sessionId - Optional session ID for binding the query to a specific session - * @returns The stored result - */ - getTaskResult(taskId: string, sessionId?: string): Promise; - /** - * Updates a task's status (e.g., to 'cancelled', 'failed', 'completed'). - * - * @param taskId - The task identifier - * @param status - The new status - * @param statusMessage - Optional diagnostic message for failed tasks or other status information - * @param sessionId - Optional session ID for binding the operation to a specific session - */ - updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string, sessionId?: string): Promise; - /** - * Lists tasks, optionally starting from a pagination cursor. - * - * @param cursor - Optional cursor for pagination - * @param sessionId - Optional session ID for binding the query to a specific session - * @returns An object containing the tasks array and an optional nextCursor - */ - listTasks(cursor?: string, sessionId?: string): Promise<{ - tasks: Task[]; - nextCursor?: string; - }>; -} -/** - * Checks if a task status represents a terminal state. - * Terminal states are those where the task has finished and will not change. - * - * @param status - The task status to check - * @returns True if the status is terminal (completed, failed, or cancelled) - * @experimental - */ -export declare function isTerminal(status: Task['status']): boolean; -//# sourceMappingURL=interfaces.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts.map deleted file mode 100644 index afd1d70..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,IAAI,EACJ,SAAS,EACT,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,OAAO,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAM5F;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB,CAAC,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,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnE;;;;;;;OAOG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpH;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnG;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,OAAO,CAE1D"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js deleted file mode 100644 index 8f533bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -/** - * Experimental task interfaces for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isTerminal = isTerminal; -/** - * Checks if a task status represents a terminal state. - * Terminal states are those where the task has finished and will not change. - * - * @param status - The task status to check - * @returns True if the status is terminal (completed, failed, or cancelled) - * @experimental - */ -function isTerminal(status) { - return status === 'completed' || status === 'failed' || status === 'cancelled'; -} -//# sourceMappingURL=interfaces.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js.map deleted file mode 100644 index c3cd4ed..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA2RH,gCAEC;AAVD;;;;;;;GAOG;AACH,SAAgB,UAAU,CAAC,MAAsB;IAC7C,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,CAAC;AACnF,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts deleted file mode 100644 index b3244f9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Experimental McpServer task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import type { McpServer, RegisteredTool } from '../../server/mcp.js'; -import type { ZodRawShapeCompat, AnySchema } from '../../server/zod-compat.js'; -import type { ToolAnnotations } from '../../types.js'; -import type { ToolTaskHandler, TaskToolExecution } from './interfaces.js'; -/** - * Experimental task features for McpServer. - * - * Access via `server.experimental.tasks`: - * ```typescript - * server.experimental.tasks.registerToolTask('long-running', config, handler); - * ``` - * - * @experimental - */ -export declare class ExperimentalMcpServerTasks { - private readonly _mcpServer; - constructor(_mcpServer: McpServer); - /** - * Registers a task-based tool with a config object and handler. - * - * Task-based tools support long-running operations that can be polled for status - * and results. The handler must implement `createTask`, `getTask`, and `getTaskResult` - * methods. - * - * @example - * ```typescript - * server.experimental.tasks.registerToolTask('long-computation', { - * description: 'Performs a long computation', - * inputSchema: { input: z.string() }, - * execution: { taskSupport: 'required' } - * }, { - * createTask: async (args, extra) => { - * const task = await extra.taskStore.createTask({ ttl: 300000 }); - * startBackgroundWork(task.taskId, args); - * return { task }; - * }, - * getTask: async (args, extra) => { - * return extra.taskStore.getTask(extra.taskId); - * }, - * getTaskResult: async (args, extra) => { - * return extra.taskStore.getTaskResult(extra.taskId); - * } - * }); - * ``` - * - * @param name - The tool name - * @param config - Tool configuration (description, schemas, etc.) - * @param handler - Task handler with createTask, getTask, getTaskResult methods - * @returns RegisteredTool for managing the tool's lifecycle - * - * @experimental - */ - registerToolTask(name: string, config: { - title?: string; - description?: string; - outputSchema?: OutputArgs; - annotations?: ToolAnnotations; - execution?: TaskToolExecution; - _meta?: Record; - }, handler: ToolTaskHandler): RegisteredTool; - registerToolTask(name: string, config: { - title?: string; - description?: string; - inputSchema: InputArgs; - outputSchema?: OutputArgs; - annotations?: ToolAnnotations; - execution?: TaskToolExecution; - _meta?: Record; - }, handler: ToolTaskHandler): RegisteredTool; -} -//# sourceMappingURL=mcp-server.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts.map deleted file mode 100644 index 84ee9e0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/mcp-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAoB1E;;;;;;;;;GASG;AACH,qBAAa,0BAA0B;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,SAAS;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,gBAAgB,CAAC,UAAU,SAAS,SAAS,GAAG,iBAAiB,GAAG,SAAS,EACzE,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,UAAU,CAAC;QAC1B,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,SAAS,CAAC,EAAE,iBAAiB,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,EACD,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,GACpC,cAAc;IAEjB,gBAAgB,CAAC,SAAS,SAAS,iBAAiB,GAAG,SAAS,EAAE,UAAU,SAAS,SAAS,GAAG,iBAAiB,GAAG,SAAS,EAC1H,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,SAAS,CAAC;QACvB,YAAY,CAAC,EAAE,UAAU,CAAC;QAC1B,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,SAAS,CAAC,EAAE,iBAAiB,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,EACD,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,GACpC,cAAc;CAsCpB"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js deleted file mode 100644 index a2718e1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -/** - * Experimental McpServer task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExperimentalMcpServerTasks = void 0; -/** - * Experimental task features for McpServer. - * - * Access via `server.experimental.tasks`: - * ```typescript - * server.experimental.tasks.registerToolTask('long-running', config, handler); - * ``` - * - * @experimental - */ -class ExperimentalMcpServerTasks { - constructor(_mcpServer) { - this._mcpServer = _mcpServer; - } - registerToolTask(name, config, handler) { - // Validate that taskSupport is not 'forbidden' for task-based tools - const execution = { taskSupport: 'required', ...config.execution }; - if (execution.taskSupport === 'forbidden') { - throw new Error(`Cannot register task-based tool '${name}' with taskSupport 'forbidden'. Use registerTool() instead.`); - } - // Access McpServer's internal _createRegisteredTool method - const mcpServerInternal = this._mcpServer; - return mcpServerInternal._createRegisteredTool(name, config.title, config.description, config.inputSchema, config.outputSchema, config.annotations, execution, config._meta, handler); - } -} -exports.ExperimentalMcpServerTasks = ExperimentalMcpServerTasks; -//# sourceMappingURL=mcp-server.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js.map deleted file mode 100644 index ff3e8c4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/mcp-server.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAyBH;;;;;;;;;GASG;AACH,MAAa,0BAA0B;IACnC,YAA6B,UAAqB;QAArB,eAAU,GAAV,UAAU,CAAW;IAAG,CAAC;IAgEtD,gBAAgB,CAIZ,IAAY,EACZ,MAQC,EACD,OAAmC;QAEnC,oEAAoE;QACpE,MAAM,SAAS,GAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAClF,IAAI,SAAS,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,6DAA6D,CAAC,CAAC;QAC3H,CAAC;QAED,2DAA2D;QAC3D,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAA0C,CAAC;QAC1E,OAAO,iBAAiB,CAAC,qBAAqB,CAC1C,IAAI,EACJ,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,WAAW,EAClB,SAAS,EACT,MAAM,CAAC,KAAK,EACZ,OAAwD,CAC3D,CAAC;IACN,CAAC;CACJ;AArGD,gEAqGC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts deleted file mode 100644 index 185e0ba..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Experimental server task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import type { Server } from '../../server/index.js'; -import type { RequestOptions } from '../../shared/protocol.js'; -import type { ResponseMessage } from '../../shared/responseMessage.js'; -import type { AnySchema, SchemaOutput } from '../../server/zod-compat.js'; -import type { ServerRequest, Notification, Request, Result, GetTaskResult, ListTasksResult, CancelTaskResult } from '../../types.js'; -/** - * Experimental task features for low-level MCP servers. - * - * Access via `server.experimental.tasks`: - * ```typescript - * const stream = server.experimental.tasks.requestStream(request, schema, options); - * ``` - * - * For high-level server usage with task-based tools, use `McpServer.experimental.tasks` instead. - * - * @experimental - */ -export declare class ExperimentalServerTasks { - private readonly _server; - constructor(_server: Server); - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to request processing, allowing you to - * observe intermediate task status updates for task-augmented requests. - * - * @param request - The request to send - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - requestStream(request: ServerRequest | RequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>; - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * @returns The task status - * - * @experimental - */ - getTask(taskId: string, options?: RequestOptions): Promise; - /** - * Retrieves the result of a completed task. - * - * @param taskId - The task identifier - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options - * @returns The task result - * - * @experimental - */ - getTaskResult(taskId: string, resultSchema?: T, options?: RequestOptions): Promise>; - /** - * Lists tasks with optional pagination. - * - * @param cursor - Optional pagination cursor - * @param options - Optional request options - * @returns List of tasks with optional next cursor - * - * @experimental - */ - listTasks(cursor?: string, options?: RequestOptions): Promise; - /** - * Cancels a running task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * - * @experimental - */ - cancelTask(taskId: string, options?: RequestOptions): Promise; -} -//# sourceMappingURL=server.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts.map deleted file mode 100644 index a168185..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CA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AO,CAAC,gBAAgB,CAAC;CAOxF"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js deleted file mode 100644 index 200d4b9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js +++ /dev/null @@ -1,93 +0,0 @@ -"use strict"; -/** - * Experimental server task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExperimentalServerTasks = void 0; -/** - * Experimental task features for low-level MCP servers. - * - * Access via `server.experimental.tasks`: - * ```typescript - * const stream = server.experimental.tasks.requestStream(request, schema, options); - * ``` - * - * For high-level server usage with task-based tools, use `McpServer.experimental.tasks` instead. - * - * @experimental - */ -class ExperimentalServerTasks { - constructor(_server) { - this._server = _server; - } - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to request processing, allowing you to - * observe intermediate task status updates for task-augmented requests. - * - * @param request - The request to send - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - requestStream(request, resultSchema, options) { - return this._server.requestStream(request, resultSchema, options); - } - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * @returns The task status - * - * @experimental - */ - async getTask(taskId, options) { - return this._server.getTask({ taskId }, options); - } - /** - * Retrieves the result of a completed task. - * - * @param taskId - The task identifier - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options - * @returns The task result - * - * @experimental - */ - async getTaskResult(taskId, resultSchema, options) { - return this._server.getTaskResult({ taskId }, resultSchema, options); - } - /** - * Lists tasks with optional pagination. - * - * @param cursor - Optional pagination cursor - * @param options - Optional request options - * @returns List of tasks with optional next cursor - * - * @experimental - */ - async listTasks(cursor, options) { - return this._server.listTasks(cursor ? { cursor } : undefined, options); - } - /** - * Cancels a running task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * - * @experimental - */ - async cancelTask(taskId, options) { - return this._server.cancelTask({ taskId }, options); - } -} -exports.ExperimentalServerTasks = ExperimentalServerTasks; -//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js.map deleted file mode 100644 index 905631d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/server.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAQH;;;;;;;;;;;GAWG;AACH,MAAa,uBAAuB;IAKhC,YAA6B,OAAiD;QAAjD,YAAO,GAAP,OAAO,CAA0C;IAAG,CAAC;IAElF;;;;;;;;;;;;;OAaG;IACH,aAAa,CACT,OAAiC,EACjC,YAAe,EACf,OAAwB;QAUxB,OAAQ,IAAI,CAAC,OAA8C,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAwB;QAElD,OAAQ,IAAI,CAAC,OAAwC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,aAAa,CAAsB,MAAc,EAAE,YAAgB,EAAE,OAAwB;QAC/F,OACI,IAAI,CAAC,OAOR,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,SAAS,CAAC,MAAe,EAAE,OAAwB;QACrD,OACI,IAAI,CAAC,OAGR,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,OAAwB;QACrD,OACI,IAAI,CAAC,OAGR,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AAzGD,0DAyGC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts deleted file mode 100644 index d30795e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * In-memory implementations of TaskStore and TaskMessageQueue. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import { Task, RequestId, Result, Request } from '../../../types.js'; -import { TaskStore, TaskMessageQueue, QueuedMessage, CreateTaskOptions } from '../interfaces.js'; -/** - * A simple in-memory implementation of TaskStore for demonstration purposes. - * - * This implementation stores all tasks in memory and provides automatic cleanup - * based on the ttl duration specified in the task creation parameters. - * - * Note: This is not suitable for production use as all data is lost on restart. - * For production, consider implementing TaskStore with a database or distributed cache. - * - * @experimental - */ -export declare class InMemoryTaskStore implements TaskStore { - private tasks; - private cleanupTimers; - /** - * Generates a unique task ID. - * Uses 16 bytes of random data encoded as hex (32 characters). - */ - private generateTaskId; - createTask(taskParams: CreateTaskOptions, requestId: RequestId, request: Request, _sessionId?: string): Promise; - getTask(taskId: string, _sessionId?: string): Promise; - storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result, _sessionId?: string): Promise; - getTaskResult(taskId: string, _sessionId?: string): Promise; - updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string, _sessionId?: string): Promise; - listTasks(cursor?: string, _sessionId?: string): Promise<{ - tasks: Task[]; - nextCursor?: string; - }>; - /** - * Cleanup all timers (useful for testing or graceful shutdown) - */ - cleanup(): void; - /** - * Get all tasks (useful for debugging) - */ - getAllTasks(): Task[]; -} -/** - * A simple in-memory implementation of TaskMessageQueue for demonstration purposes. - * - * This implementation stores messages in memory, organized by task ID and optional session ID. - * Messages are stored in FIFO queues per task. - * - * Note: This is not suitable for production use in distributed systems. - * For production, consider implementing TaskMessageQueue with Redis or other distributed queues. - * - * @experimental - */ -export declare class InMemoryTaskMessageQueue implements TaskMessageQueue { - private queues; - /** - * Generates a queue key from taskId. - * SessionId is intentionally ignored because taskIds are globally unique - * and tasks need to be accessible across HTTP requests/sessions. - */ - private getQueueKey; - /** - * Gets or creates a queue for the given task and session. - */ - private getQueue; - /** - * Adds a message to the end of the queue for a specific task. - * Atomically checks queue size and throws if maxSize would be exceeded. - * @param taskId The task identifier - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error - * @throws Error if maxSize is specified and would be exceeded - */ - enqueue(taskId: string, message: QueuedMessage, sessionId?: string, maxSize?: number): Promise; - /** - * Removes and returns the first message from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns The first message, or undefined if the queue is empty - */ - dequeue(taskId: string, sessionId?: string): Promise; - /** - * Removes and returns all messages from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns Array of all messages that were in the queue - */ - dequeueAll(taskId: string, sessionId?: string): Promise; -} -//# sourceMappingURL=in-memory.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts.map deleted file mode 100644 index 1825e87..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"in-memory.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/tasks/stores/in-memory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAc,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAU7G;;;;;;;;;;GAUG;AACH,qBAAa,iBAAkB,YAAW,SAAS;IAC/C,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,aAAa,CAAoD;IAEzE;;;OAGG;IACH,OAAO,CAAC,cAAc;IAIhB,UAAU,CAAC,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CrH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAKlE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCnH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAanE,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCpH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IA0BtG;;OAEG;IACH,OAAO,IAAI,IAAI;IAQf;;OAEG;IACH,WAAW,IAAI,IAAI,EAAE;CAGxB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,wBAAyB,YAAW,gBAAgB;IAC7D,OAAO,CAAC,MAAM,CAAsC;IAEpD;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAInB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAUhB;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW1G;;;;;OAKG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAKrF;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAMjF"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js deleted file mode 100644 index fe1b1e7..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js +++ /dev/null @@ -1,251 +0,0 @@ -"use strict"; -/** - * In-memory implementations of TaskStore and TaskMessageQueue. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.InMemoryTaskMessageQueue = exports.InMemoryTaskStore = void 0; -const interfaces_js_1 = require("../interfaces.js"); -const node_crypto_1 = require("node:crypto"); -/** - * A simple in-memory implementation of TaskStore for demonstration purposes. - * - * This implementation stores all tasks in memory and provides automatic cleanup - * based on the ttl duration specified in the task creation parameters. - * - * Note: This is not suitable for production use as all data is lost on restart. - * For production, consider implementing TaskStore with a database or distributed cache. - * - * @experimental - */ -class InMemoryTaskStore { - constructor() { - this.tasks = new Map(); - this.cleanupTimers = new Map(); - } - /** - * Generates a unique task ID. - * Uses 16 bytes of random data encoded as hex (32 characters). - */ - generateTaskId() { - return (0, node_crypto_1.randomBytes)(16).toString('hex'); - } - async createTask(taskParams, requestId, request, _sessionId) { - // Generate a unique task ID - const taskId = this.generateTaskId(); - // Ensure uniqueness - if (this.tasks.has(taskId)) { - throw new Error(`Task with ID ${taskId} already exists`); - } - const actualTtl = taskParams.ttl ?? null; - // Create task with generated ID and timestamps - const createdAt = new Date().toISOString(); - const task = { - taskId, - status: 'working', - ttl: actualTtl, - createdAt, - lastUpdatedAt: createdAt, - pollInterval: taskParams.pollInterval ?? 1000 - }; - this.tasks.set(taskId, { - task, - request, - requestId - }); - // Schedule cleanup if ttl is specified - // Cleanup occurs regardless of task status - if (actualTtl) { - const timer = setTimeout(() => { - this.tasks.delete(taskId); - this.cleanupTimers.delete(taskId); - }, actualTtl); - this.cleanupTimers.set(taskId, timer); - } - return task; - } - async getTask(taskId, _sessionId) { - const stored = this.tasks.get(taskId); - return stored ? { ...stored.task } : null; - } - async storeTaskResult(taskId, status, result, _sessionId) { - const stored = this.tasks.get(taskId); - if (!stored) { - throw new Error(`Task with ID ${taskId} not found`); - } - // Don't allow storing results for tasks already in terminal state - if ((0, interfaces_js_1.isTerminal)(stored.task.status)) { - throw new Error(`Cannot store result for task ${taskId} in terminal status '${stored.task.status}'. Task results can only be stored once.`); - } - stored.result = result; - stored.task.status = status; - stored.task.lastUpdatedAt = new Date().toISOString(); - // Reset cleanup timer to start from now (if ttl is set) - if (stored.task.ttl) { - const existingTimer = this.cleanupTimers.get(taskId); - if (existingTimer) { - clearTimeout(existingTimer); - } - const timer = setTimeout(() => { - this.tasks.delete(taskId); - this.cleanupTimers.delete(taskId); - }, stored.task.ttl); - this.cleanupTimers.set(taskId, timer); - } - } - async getTaskResult(taskId, _sessionId) { - const stored = this.tasks.get(taskId); - if (!stored) { - throw new Error(`Task with ID ${taskId} not found`); - } - if (!stored.result) { - throw new Error(`Task ${taskId} has no result stored`); - } - return stored.result; - } - async updateTaskStatus(taskId, status, statusMessage, _sessionId) { - const stored = this.tasks.get(taskId); - if (!stored) { - throw new Error(`Task with ID ${taskId} not found`); - } - // Don't allow transitions from terminal states - if ((0, interfaces_js_1.isTerminal)(stored.task.status)) { - throw new Error(`Cannot update task ${taskId} from terminal status '${stored.task.status}' to '${status}'. Terminal states (completed, failed, cancelled) cannot transition to other states.`); - } - stored.task.status = status; - if (statusMessage) { - stored.task.statusMessage = statusMessage; - } - stored.task.lastUpdatedAt = new Date().toISOString(); - // If task is in a terminal state and has ttl, start cleanup timer - if ((0, interfaces_js_1.isTerminal)(status) && stored.task.ttl) { - const existingTimer = this.cleanupTimers.get(taskId); - if (existingTimer) { - clearTimeout(existingTimer); - } - const timer = setTimeout(() => { - this.tasks.delete(taskId); - this.cleanupTimers.delete(taskId); - }, stored.task.ttl); - this.cleanupTimers.set(taskId, timer); - } - } - async listTasks(cursor, _sessionId) { - const PAGE_SIZE = 10; - const allTaskIds = Array.from(this.tasks.keys()); - let startIndex = 0; - if (cursor) { - const cursorIndex = allTaskIds.indexOf(cursor); - if (cursorIndex >= 0) { - startIndex = cursorIndex + 1; - } - else { - // Invalid cursor - throw error - throw new Error(`Invalid cursor: ${cursor}`); - } - } - const pageTaskIds = allTaskIds.slice(startIndex, startIndex + PAGE_SIZE); - const tasks = pageTaskIds.map(taskId => { - const stored = this.tasks.get(taskId); - return { ...stored.task }; - }); - const nextCursor = startIndex + PAGE_SIZE < allTaskIds.length ? pageTaskIds[pageTaskIds.length - 1] : undefined; - return { tasks, nextCursor }; - } - /** - * Cleanup all timers (useful for testing or graceful shutdown) - */ - cleanup() { - for (const timer of this.cleanupTimers.values()) { - clearTimeout(timer); - } - this.cleanupTimers.clear(); - this.tasks.clear(); - } - /** - * Get all tasks (useful for debugging) - */ - getAllTasks() { - return Array.from(this.tasks.values()).map(stored => ({ ...stored.task })); - } -} -exports.InMemoryTaskStore = InMemoryTaskStore; -/** - * A simple in-memory implementation of TaskMessageQueue for demonstration purposes. - * - * This implementation stores messages in memory, organized by task ID and optional session ID. - * Messages are stored in FIFO queues per task. - * - * Note: This is not suitable for production use in distributed systems. - * For production, consider implementing TaskMessageQueue with Redis or other distributed queues. - * - * @experimental - */ -class InMemoryTaskMessageQueue { - constructor() { - this.queues = new Map(); - } - /** - * Generates a queue key from taskId. - * SessionId is intentionally ignored because taskIds are globally unique - * and tasks need to be accessible across HTTP requests/sessions. - */ - getQueueKey(taskId, _sessionId) { - return taskId; - } - /** - * Gets or creates a queue for the given task and session. - */ - getQueue(taskId, sessionId) { - const key = this.getQueueKey(taskId, sessionId); - let queue = this.queues.get(key); - if (!queue) { - queue = []; - this.queues.set(key, queue); - } - return queue; - } - /** - * Adds a message to the end of the queue for a specific task. - * Atomically checks queue size and throws if maxSize would be exceeded. - * @param taskId The task identifier - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error - * @throws Error if maxSize is specified and would be exceeded - */ - async enqueue(taskId, message, sessionId, maxSize) { - const queue = this.getQueue(taskId, sessionId); - // Atomically check size and enqueue - if (maxSize !== undefined && queue.length >= maxSize) { - throw new Error(`Task message queue overflow: queue size (${queue.length}) exceeds maximum (${maxSize})`); - } - queue.push(message); - } - /** - * Removes and returns the first message from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns The first message, or undefined if the queue is empty - */ - async dequeue(taskId, sessionId) { - const queue = this.getQueue(taskId, sessionId); - return queue.shift(); - } - /** - * Removes and returns all messages from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns Array of all messages that were in the queue - */ - async dequeueAll(taskId, sessionId) { - const key = this.getQueueKey(taskId, sessionId); - const queue = this.queues.get(key) ?? []; - this.queues.delete(key); - return queue; - } -} -exports.InMemoryTaskMessageQueue = InMemoryTaskMessageQueue; -//# sourceMappingURL=in-memory.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js.map deleted file mode 100644 index a4d21a9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"in-memory.js","sourceRoot":"","sources":["../../../../../src/experimental/tasks/stores/in-memory.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,oDAA6G;AAC7G,6CAA0C;AAS1C;;;;;;;;;;GAUG;AACH,MAAa,iBAAiB;IAA9B;QACY,UAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;QACtC,kBAAa,GAAG,IAAI,GAAG,EAAyC,CAAC;IAsL7E,CAAC;IApLG;;;OAGG;IACK,cAAc;QAClB,OAAO,IAAA,yBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,UAA6B,EAAE,SAAoB,EAAE,OAAgB,EAAE,UAAmB;QACvG,4BAA4B;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAErC,oBAAoB;QACpB,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,gBAAgB,MAAM,iBAAiB,CAAC,CAAC;QAC7D,CAAC;QAED,MAAM,SAAS,GAAG,U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AsB,EAAE,SAAkB,EAAE,OAAgB;QACtF,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAE/C,oCAAoC;QACpC,IAAI,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,IAAI,OAAO,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CAAC,4CAA4C,KAAK,CAAC,MAAM,sBAAsB,OAAO,GAAG,CAAC,CAAC;QAC9G,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,SAAkB;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC/C,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,SAAkB;QAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACxB,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AApED,4DAoEC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts deleted file mode 100644 index 6022e19..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Re-exports of task-related types from the MCP protocol spec. - * WARNING: These APIs are experimental and may change without notice. - * - * These types are defined in types.ts (matching the protocol spec) and - * re-exported here for convenience when working with experimental task features. - */ -export { TaskCreationParamsSchema, RelatedTaskMetadataSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema } from '../../types.js'; -export type { Task, TaskCreationParams, RelatedTaskMetadata, CreateTaskResult, TaskStatusNotificationParams, TaskStatusNotification, GetTaskRequest, GetTaskResult, GetTaskPayloadRequest, ListTasksRequest, ListTasksResult, CancelTaskRequest, CancelTaskResult } from '../../types.js'; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts.map deleted file mode 100644 index f7b9ead..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACH,wBAAwB,EACxB,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,kCAAkC,EAClC,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC9B,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACR,IAAI,EACJ,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACnB,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js deleted file mode 100644 index b051c84..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * Re-exports of task-related types from the MCP protocol spec. - * WARNING: These APIs are experimental and may change without notice. - * - * These types are defined in types.ts (matching the protocol spec) and - * re-exported here for convenience when working with experimental task features. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ServerTasksCapabilitySchema = exports.ClientTasksCapabilitySchema = exports.CancelTaskResultSchema = exports.CancelTaskRequestSchema = exports.ListTasksResultSchema = exports.ListTasksRequestSchema = exports.GetTaskPayloadRequestSchema = exports.GetTaskResultSchema = exports.GetTaskRequestSchema = exports.TaskStatusNotificationSchema = exports.TaskStatusNotificationParamsSchema = exports.CreateTaskResultSchema = exports.TaskSchema = exports.RelatedTaskMetadataSchema = exports.TaskCreationParamsSchema = void 0; -// Task schemas (Zod) -var types_js_1 = require("../../types.js"); -Object.defineProperty(exports, "TaskCreationParamsSchema", { enumerable: true, get: function () { return types_js_1.TaskCreationParamsSchema; } }); -Object.defineProperty(exports, "RelatedTaskMetadataSchema", { enumerable: true, get: function () { return types_js_1.RelatedTaskMetadataSchema; } }); -Object.defineProperty(exports, "TaskSchema", { enumerable: true, get: function () { return types_js_1.TaskSchema; } }); -Object.defineProperty(exports, "CreateTaskResultSchema", { enumerable: true, get: function () { return types_js_1.CreateTaskResultSchema; } }); -Object.defineProperty(exports, "TaskStatusNotificationParamsSchema", { enumerable: true, get: function () { return types_js_1.TaskStatusNotificationParamsSchema; } }); -Object.defineProperty(exports, "TaskStatusNotificationSchema", { enumerable: true, get: function () { return types_js_1.TaskStatusNotificationSchema; } }); -Object.defineProperty(exports, "GetTaskRequestSchema", { enumerable: true, get: function () { return types_js_1.GetTaskRequestSchema; } }); -Object.defineProperty(exports, "GetTaskResultSchema", { enumerable: true, get: function () { return types_js_1.GetTaskResultSchema; } }); -Object.defineProperty(exports, "GetTaskPayloadRequestSchema", { enumerable: true, get: function () { return types_js_1.GetTaskPayloadRequestSchema; } }); -Object.defineProperty(exports, "ListTasksRequestSchema", { enumerable: true, get: function () { return types_js_1.ListTasksRequestSchema; } }); -Object.defineProperty(exports, "ListTasksResultSchema", { enumerable: true, get: function () { return types_js_1.ListTasksResultSchema; } }); -Object.defineProperty(exports, "CancelTaskRequestSchema", { enumerable: true, get: function () { return types_js_1.CancelTaskRequestSchema; } }); -Object.defineProperty(exports, "CancelTaskResultSchema", { enumerable: true, get: function () { return types_js_1.CancelTaskResultSchema; } }); -Object.defineProperty(exports, "ClientTasksCapabilitySchema", { enumerable: true, get: function () { return types_js_1.ClientTasksCapabilitySchema; } }); -Object.defineProperty(exports, "ServerTasksCapabilitySchema", { enumerable: true, get: function () { return types_js_1.ServerTasksCapabilitySchema; } }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js.map deleted file mode 100644 index adfc3ab..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/types.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,qBAAqB;AACrB,2CAgBwB;AAfpB,oHAAA,wBAAwB,OAAA;AACxB,qHAAA,yBAAyB,OAAA;AACzB,sGAAA,UAAU,OAAA;AACV,kHAAA,sBAAsB,OAAA;AACtB,8HAAA,kCAAkC,OAAA;AAClC,wHAAA,4BAA4B,OAAA;AAC5B,gHAAA,oBAAoB,OAAA;AACpB,+GAAA,mBAAmB,OAAA;AACnB,uHAAA,2BAA2B,OAAA;AAC3B,kHAAA,sBAAsB,OAAA;AACtB,iHAAA,qBAAqB,OAAA;AACrB,mHAAA,uBAAuB,OAAA;AACvB,kHAAA,sBAAsB,OAAA;AACtB,uHAAA,2BAA2B,OAAA;AAC3B,uHAAA,2BAA2B,OAAA"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts deleted file mode 100644 index 32a931a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Transport } from './shared/transport.js'; -import { JSONRPCMessage, RequestId } from './types.js'; -import { AuthInfo } from './server/auth/types.js'; -/** - * In-memory transport for creating clients and servers that talk to each other within the same process. - */ -export declare class InMemoryTransport implements Transport { - private _otherTransport?; - private _messageQueue; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage, extra?: { - authInfo?: AuthInfo; - }) => void; - sessionId?: string; - /** - * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. - */ - static createLinkedPair(): [InMemoryTransport, InMemoryTransport]; - start(): Promise; - close(): Promise; - /** - * Sends a message with optional auth info. - * This is useful for testing authentication scenarios. - */ - send(message: JSONRPCMessage, options?: { - relatedRequestId?: RequestId; - authInfo?: AuthInfo; - }): Promise; -} -//# sourceMappingURL=inMemory.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts.map deleted file mode 100644 index 46bc74b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemory.d.ts","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOlD;;GAEG;AACH,qBAAa,iBAAkB,YAAW,SAAS;IAC/C,OAAO,CAAC,eAAe,CAAC,CAAoB;IAC5C,OAAO,CAAC,aAAa,CAAuB;IAE5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAQ3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAWtH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js deleted file mode 100644 index 9c6cb0e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.InMemoryTransport = void 0; -/** - * In-memory transport for creating clients and servers that talk to each other within the same process. - */ -class InMemoryTransport { - constructor() { - this._messageQueue = []; - } - /** - * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. - */ - static createLinkedPair() { - const clientTransport = new InMemoryTransport(); - const serverTransport = new InMemoryTransport(); - clientTransport._otherTransport = serverTransport; - serverTransport._otherTransport = clientTransport; - return [clientTransport, serverTransport]; - } - async start() { - // Process any messages that were queued before start was called - while (this._messageQueue.length > 0) { - const queuedMessage = this._messageQueue.shift(); - this.onmessage?.(queuedMessage.message, queuedMessage.extra); - } - } - async close() { - const other = this._otherTransport; - this._otherTransport = undefined; - await other?.close(); - this.onclose?.(); - } - /** - * Sends a message with optional auth info. - * This is useful for testing authentication scenarios. - */ - async send(message, options) { - if (!this._otherTransport) { - throw new Error('Not connected'); - } - if (this._otherTransport.onmessage) { - this._otherTransport.onmessage(message, { authInfo: options?.authInfo }); - } - else { - this._otherTransport._messageQueue.push({ message, extra: { authInfo: options?.authInfo } }); - } - } -} -exports.InMemoryTransport = InMemoryTransport; -//# sourceMappingURL=inMemory.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js.map deleted file mode 100644 index a45f3a8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemory.js","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":";;;AASA;;GAEG;AACH,MAAa,iBAAiB;IAA9B;QAEY,kBAAa,GAAoB,EAAE,CAAC;IAgDhD,CAAC;IAzCG;;OAEG;IACH,MAAM,CAAC,gBAAgB;QACnB,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,KAAK;QACP,gEAAgE;QAChE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAG,CAAC;YAClD,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QACjE,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACP,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,MAAM,KAAK,EAAE,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuB,EAAE,OAA+D;QAC/F,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7E,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACjG,CAAC;IACL,CAAC;CACJ;AAlDD,8CAkDC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/package.json b/node_modules/@modelcontextprotocol/sdk/dist/cjs/package.json deleted file mode 100644 index b731bd6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type": "commonjs"} diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts deleted file mode 100644 index be6899a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { OAuthClientInformationFull } from '../../shared/auth.js'; -/** - * Stores information about registered OAuth clients for this server. - */ -export interface OAuthRegisteredClientsStore { - /** - * Returns information about a registered client, based on its ID. - */ - getClient(clientId: string): OAuthClientInformationFull | undefined | Promise; - /** - * Registers a new client with the server. The client ID and secret will be automatically generated by the library. A modified version of the client information can be returned to reflect specific values enforced by the server. - * - * NOTE: Implementations should NOT delete expired client secrets in-place. Auth middleware provided by this library will automatically check the `client_secret_expires_at` field and reject requests with expired secrets. Any custom logic for authenticating clients should check the `client_secret_expires_at` field as well. - * - * If unimplemented, dynamic client registration is unsupported. - */ - registerClient?(client: Omit): OAuthClientInformationFull | Promise; -} -//# sourceMappingURL=clients.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts.map deleted file mode 100644 index ab3851d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;IAEtH;;;;;;OAMG;IACH,cAAc,CAAC,CACX,MAAM,EAAE,IAAI,CAAC,0BAA0B,EAAE,WAAW,GAAG,qBAAqB,CAAC,GAC9E,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACvE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js deleted file mode 100644 index 866b88b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=clients.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js.map deleted file mode 100644 index 0210104..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts deleted file mode 100644 index 7fddf95..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { OAuthErrorResponse } from '../../shared/auth.js'; -/** - * Base class for all OAuth errors - */ -export declare class OAuthError extends Error { - readonly errorUri?: string | undefined; - static errorCode: string; - constructor(message: string, errorUri?: string | undefined); - /** - * Converts the error to a standard OAuth error response object - */ - toResponseObject(): OAuthErrorResponse; - get errorCode(): string; -} -/** - * Invalid request error - The request is missing a required parameter, - * includes an invalid parameter value, includes a parameter more than once, - * or is otherwise malformed. - */ -export declare class InvalidRequestError extends OAuthError { - static errorCode: string; -} -/** - * Invalid client error - Client authentication failed (e.g., unknown client, no client - * authentication included, or unsupported authentication method). - */ -export declare class InvalidClientError extends OAuthError { - static errorCode: string; -} -/** - * Invalid grant error - The provided authorization grant or refresh token is - * invalid, expired, revoked, does not match the redirection URI used in the - * authorization request, or was issued to another client. - */ -export declare class InvalidGrantError extends OAuthError { - static errorCode: string; -} -/** - * Unauthorized client error - The authenticated client is not authorized to use - * this authorization grant type. - */ -export declare class UnauthorizedClientError extends OAuthError { - static errorCode: string; -} -/** - * Unsupported grant type error - The authorization grant type is not supported - * by the authorization server. - */ -export declare class UnsupportedGrantTypeError extends OAuthError { - static errorCode: string; -} -/** - * Invalid scope error - The requested scope is invalid, unknown, malformed, or - * exceeds the scope granted by the resource owner. - */ -export declare class InvalidScopeError extends OAuthError { - static errorCode: string; -} -/** - * Access denied error - The resource owner or authorization server denied the request. - */ -export declare class AccessDeniedError extends OAuthError { - static errorCode: string; -} -/** - * Server error - The authorization server encountered an unexpected condition - * that prevented it from fulfilling the request. - */ -export declare class ServerError extends OAuthError { - static errorCode: string; -} -/** - * Temporarily unavailable error - The authorization server is currently unable to - * handle the request due to a temporary overloading or maintenance of the server. - */ -export declare class TemporarilyUnavailableError extends OAuthError { - static errorCode: string; -} -/** - * Unsupported response type error - The authorization server does not support - * obtaining an authorization code using this method. - */ -export declare class UnsupportedResponseTypeError extends OAuthError { - static errorCode: string; -} -/** - * Unsupported token type error - The authorization server does not support - * the requested token type. - */ -export declare class UnsupportedTokenTypeError extends OAuthError { - static errorCode: string; -} -/** - * Invalid token error - The access token provided is expired, revoked, malformed, - * or invalid for other reasons. - */ -export declare class InvalidTokenError extends OAuthError { - static errorCode: string; -} -/** - * Method not allowed error - The HTTP method used is not allowed for this endpoint. - * (Custom, non-standard error) - */ -export declare class MethodNotAllowedError extends OAuthError { - static errorCode: string; -} -/** - * Too many requests error - Rate limit exceeded. - * (Custom, non-standard error based on RFC 6585) - */ -export declare class TooManyRequestsError extends OAuthError { - static errorCode: string; -} -/** - * Invalid client metadata error - The client metadata is invalid. - * (Custom error for dynamic client registration - RFC 7591) - */ -export declare class InvalidClientMetadataError extends OAuthError { - static errorCode: string; -} -/** - * Insufficient scope error - The request requires higher privileges than provided by the access token. - */ -export declare class InsufficientScopeError extends OAuthError { - static errorCode: string; -} -/** - * Invalid target error - The requested resource is invalid, missing, unknown, or malformed. - * (Custom error for resource indicators - RFC 8707) - */ -export declare class InvalidTargetError extends OAuthError { - static errorCode: string; -} -/** - * A utility class for defining one-off error codes - */ -export declare class CustomOAuthError extends OAuthError { - private readonly customErrorCode; - constructor(customErrorCode: string, message: string, errorUri?: string); - get errorCode(): string; -} -/** - * A full list of all OAuthErrors, enabling parsing from error responses - */ -export declare const OAUTH_ERRORS: { - readonly [x: string]: typeof InvalidRequestError; -}; -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts.map deleted file mode 100644 index 5c0e992..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAKb,QAAQ,CAAC,EAAE,MAAM;IAJrC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC;gBAGrB,OAAO,EAAE,MAAM,EACC,QAAQ,CAAC,EAAE,MAAM,YAAA;IAMrC;;OAEG;IACH,gBAAgB,IAAI,kBAAkB;IAatC,IAAI,SAAS,IAAI,MAAM,CAEtB;CACJ;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;IAC/C,MAAM,CAAC,SAAS,SAAqB;CACxC;AAED;;;GAGG;AACH,qBAAa,kBAAmB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;CAC3C;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;IAC9C,MAAM,CAAC,SAAS,SAAoB;CACvC;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAExC,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,MAAM,EACxC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM;IAKrB,IAAI,SAAS,IAAI,MAAM,CAEtB;CACJ;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;;CAkBf,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js deleted file mode 100644 index e67478c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.OAUTH_ERRORS = exports.CustomOAuthError = exports.InvalidTargetError = exports.InsufficientScopeError = exports.InvalidClientMetadataError = exports.TooManyRequestsError = exports.MethodNotAllowedError = exports.InvalidTokenError = exports.UnsupportedTokenTypeError = exports.UnsupportedResponseTypeError = exports.TemporarilyUnavailableError = exports.ServerError = exports.AccessDeniedError = exports.InvalidScopeError = exports.UnsupportedGrantTypeError = exports.UnauthorizedClientError = exports.InvalidGrantError = exports.InvalidClientError = exports.InvalidRequestError = exports.OAuthError = void 0; -/** - * Base class for all OAuth errors - */ -class OAuthError extends Error { - constructor(message, errorUri) { - super(message); - this.errorUri = errorUri; - this.name = this.constructor.name; - } - /** - * Converts the error to a standard OAuth error response object - */ - toResponseObject() { - const response = { - error: this.errorCode, - error_description: this.message - }; - if (this.errorUri) { - response.error_uri = this.errorUri; - } - return response; - } - get errorCode() { - return this.constructor.errorCode; - } -} -exports.OAuthError = OAuthError; -/** - * Invalid request error - The request is missing a required parameter, - * includes an invalid parameter value, includes a parameter more than once, - * or is otherwise malformed. - */ -class InvalidRequestError extends OAuthError { -} -exports.InvalidRequestError = InvalidRequestError; -InvalidRequestError.errorCode = 'invalid_request'; -/** - * Invalid client error - Client authentication failed (e.g., unknown client, no client - * authentication included, or unsupported authentication method). - */ -class InvalidClientError extends OAuthError { -} -exports.InvalidClientError = InvalidClientError; -InvalidClientError.errorCode = 'invalid_client'; -/** - * Invalid grant error - The provided authorization grant or refresh token is - * invalid, expired, revoked, does not match the redirection URI used in the - * authorization request, or was issued to another client. - */ -class InvalidGrantError extends OAuthError { -} -exports.InvalidGrantError = InvalidGrantError; -InvalidGrantError.errorCode = 'invalid_grant'; -/** - * Unauthorized client error - The authenticated client is not authorized to use - * this authorization grant type. - */ -class UnauthorizedClientError extends OAuthError { -} -exports.UnauthorizedClientError = UnauthorizedClientError; -UnauthorizedClientError.errorCode = 'unauthorized_client'; -/** - * Unsupported grant type error - The authorization grant type is not supported - * by the authorization server. - */ -class UnsupportedGrantTypeError extends OAuthError { -} -exports.UnsupportedGrantTypeError = UnsupportedGrantTypeError; -UnsupportedGrantTypeError.errorCode = 'unsupported_grant_type'; -/** - * Invalid scope error - The requested scope is invalid, unknown, malformed, or - * exceeds the scope granted by the resource owner. - */ -class InvalidScopeError extends OAuthError { -} -exports.InvalidScopeError = InvalidScopeError; -InvalidScopeError.errorCode = 'invalid_scope'; -/** - * Access denied error - The resource owner or authorization server denied the request. - */ -class AccessDeniedError extends OAuthError { -} -exports.AccessDeniedError = AccessDeniedError; -AccessDeniedError.errorCode = 'access_denied'; -/** - * Server error - The authorization server encountered an unexpected condition - * that prevented it from fulfilling the request. - */ -class ServerError extends OAuthError { -} -exports.ServerError = ServerError; -ServerError.errorCode = 'server_error'; -/** - * Temporarily unavailable error - The authorization server is currently unable to - * handle the request due to a temporary overloading or maintenance of the server. - */ -class TemporarilyUnavailableError extends OAuthError { -} -exports.TemporarilyUnavailableError = TemporarilyUnavailableError; -TemporarilyUnavailableError.errorCode = 'temporarily_unavailable'; -/** - * Unsupported response type error - The authorization server does not support - * obtaining an authorization code using this method. - */ -class UnsupportedResponseTypeError extends OAuthError { -} -exports.UnsupportedResponseTypeError = UnsupportedResponseTypeError; -UnsupportedResponseTypeError.errorCode = 'unsupported_response_type'; -/** - * Unsupported token type error - The authorization server does not support - * the requested token type. - */ -class UnsupportedTokenTypeError extends OAuthError { -} -exports.UnsupportedTokenTypeError = UnsupportedTokenTypeError; -UnsupportedTokenTypeError.errorCode = 'unsupported_token_type'; -/** - * Invalid token error - The access token provided is expired, revoked, malformed, - * or invalid for other reasons. - */ -class InvalidTokenError extends OAuthError { -} -exports.InvalidTokenError = InvalidTokenError; -InvalidTokenError.errorCode = 'invalid_token'; -/** - * Method not allowed error - The HTTP method used is not allowed for this endpoint. - * (Custom, non-standard error) - */ -class MethodNotAllowedError extends OAuthError { -} -exports.MethodNotAllowedError = MethodNotAllowedError; -MethodNotAllowedError.errorCode = 'method_not_allowed'; -/** - * Too many requests error - Rate limit exceeded. - * (Custom, non-standard error based on RFC 6585) - */ -class TooManyRequestsError extends OAuthError { -} -exports.TooManyRequestsError = TooManyRequestsError; -TooManyRequestsError.errorCode = 'too_many_requests'; -/** - * Invalid client metadata error - The client metadata is invalid. - * (Custom error for dynamic client registration - RFC 7591) - */ -class InvalidClientMetadataError extends OAuthError { -} -exports.InvalidClientMetadataError = InvalidClientMetadataError; -InvalidClientMetadataError.errorCode = 'invalid_client_metadata'; -/** - * Insufficient scope error - The request requires higher privileges than provided by the access token. - */ -class InsufficientScopeError extends OAuthError { -} -exports.InsufficientScopeError = InsufficientScopeError; -InsufficientScopeError.errorCode = 'insufficient_scope'; -/** - * Invalid target error - The requested resource is invalid, missing, unknown, or malformed. - * (Custom error for resource indicators - RFC 8707) - */ -class InvalidTargetError extends OAuthError { -} -exports.InvalidTargetError = InvalidTargetError; -InvalidTargetError.errorCode = 'invalid_target'; -/** - * A utility class for defining one-off error codes - */ -class CustomOAuthError extends OAuthError { - constructor(customErrorCode, message, errorUri) { - super(message, errorUri); - this.customErrorCode = customErrorCode; - } - get errorCode() { - return this.customErrorCode; - } -} -exports.CustomOAuthError = CustomOAuthError; -/** - * A full list of all OAuthErrors, enabling parsing from error responses - */ -exports.OAUTH_ERRORS = { - [InvalidRequestError.errorCode]: InvalidRequestError, - [InvalidClientError.errorCode]: InvalidClientError, - [InvalidGrantError.errorCode]: InvalidGrantError, - [UnauthorizedClientError.errorCode]: UnauthorizedClientError, - [UnsupportedGrantTypeError.errorCode]: UnsupportedGrantTypeError, - [InvalidScopeError.errorCode]: InvalidScopeError, - [AccessDeniedError.errorCode]: AccessDeniedError, - [ServerError.errorCode]: ServerError, - [TemporarilyUnavailableError.errorCode]: TemporarilyUnavailableError, - [UnsupportedResponseTypeError.errorCode]: UnsupportedResponseTypeError, - [UnsupportedTokenTypeError.errorCode]: UnsupportedTokenTypeError, - [InvalidTokenError.errorCode]: InvalidTokenError, - [MethodNotAllowedError.errorCode]: MethodNotAllowedError, - [TooManyRequestsError.errorCode]: TooManyRequestsError, - [InvalidClientMetadataError.errorCode]: InvalidClientMetadataError, - [InsufficientScopeError.errorCode]: InsufficientScopeError, - [InvalidTargetError.errorCode]: InvalidTargetError -}; -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js.map deleted file mode 100644 index f802594..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,UAAW,SAAQ,KAAK;IAGjC,YACI,OAAe,EACC,QAAiB;QAEjC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,aAAQ,GAAR,QAAQ,CAAS;QAGjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC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AC,SAAS,CAAC,EAAE,iBAAiB;IAChD,CAAC,uBAAuB,CAAC,SAAS,CAAC,EAAE,uBAAuB;IAC5D,CAAC,yBAAyB,CAAC,SAAS,CAAC,EAAE,yBAAyB;IAChE,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,iBAAiB;IAChD,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,iBAAiB;IAChD,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,2BAA2B,CAAC,SAAS,CAAC,EAAE,2BAA2B;IACpE,CAAC,4BAA4B,CAAC,SAAS,CAAC,EAAE,4BAA4B;IACtE,CAAC,yBAAyB,CAAC,SAAS,CAAC,EAAE,yBAAyB;IAChE,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,iBAAiB;IAChD,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,qBAAqB;IACxD,CAAC,oBAAoB,CAAC,SAAS,CAAC,EAAE,oBAAoB;IACtD,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,0BAA0B;IAClE,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,sBAAsB;IAC1D,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE,kBAAkB;CAC5C,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts deleted file mode 100644 index 38e9829..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthServerProvider } from '../provider.js'; -import { Options as RateLimitOptions } from 'express-rate-limit'; -export type AuthorizationHandlerOptions = { - provider: OAuthServerProvider; - /** - * Rate limiting configuration for the authorization endpoint. - * Set to false to disable rate limiting for this endpoint. - */ - rateLimit?: Partial | false; -}; -export declare function authorizationHandler({ provider, rateLimit: rateLimitConfig }: AuthorizationHandlerOptions): RequestHandler; -//# sourceMappingURL=authorize.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts.map deleted file mode 100644 index b067988..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,2BAA2B,GAAG;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAqBF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAgH1H"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js deleted file mode 100644 index 9022082..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js +++ /dev/null @@ -1,167 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.authorizationHandler = authorizationHandler; -const z = __importStar(require("zod/v4")); -const express_1 = __importDefault(require("express")); -const express_rate_limit_1 = require("express-rate-limit"); -const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); -const errors_js_1 = require("../errors.js"); -// Parameters that must be validated in order to issue redirects. -const ClientAuthorizationParamsSchema = z.object({ - client_id: z.string(), - redirect_uri: z - .string() - .optional() - .refine(value => value === undefined || URL.canParse(value), { message: 'redirect_uri must be a valid URL' }) -}); -// Parameters that must be validated for a successful authorization request. Failure can be reported to the redirect URI. -const RequestAuthorizationParamsSchema = z.object({ - response_type: z.literal('code'), - code_challenge: z.string(), - code_challenge_method: z.literal('S256'), - scope: z.string().optional(), - state: z.string().optional(), - resource: z.string().url().optional() -}); -function authorizationHandler({ provider, rateLimit: rateLimitConfig }) { - // Create a router to apply middleware - const router = express_1.default.Router(); - router.use((0, allowedMethods_js_1.allowedMethods)(['GET', 'POST'])); - router.use(express_1.default.urlencoded({ extended: false })); - // Apply rate limiting unless explicitly disabled - if (rateLimitConfig !== false) { - router.use((0, express_rate_limit_1.rateLimit)({ - windowMs: 15 * 60 * 1000, // 15 minutes - max: 100, // 100 requests per windowMs - standardHeaders: true, - legacyHeaders: false, - message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for authorization requests').toResponseObject(), - ...rateLimitConfig - })); - } - router.all('/', async (req, res) => { - res.setHeader('Cache-Control', 'no-store'); - // In the authorization flow, errors are split into two categories: - // 1. Pre-redirect errors (direct response with 400) - // 2. Post-redirect errors (redirect with error parameters) - // Phase 1: Validate client_id and redirect_uri. Any errors here must be direct responses. - let client_id, redirect_uri, client; - try { - const result = ClientAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query); - if (!result.success) { - throw new errors_js_1.InvalidRequestError(result.error.message); - } - client_id = result.data.client_id; - redirect_uri = result.data.redirect_uri; - client = await provider.clientsStore.getClient(client_id); - if (!client) { - throw new errors_js_1.InvalidClientError('Invalid client_id'); - } - if (redirect_uri !== undefined) { - if (!client.redirect_uris.includes(redirect_uri)) { - throw new errors_js_1.InvalidRequestError('Unregistered redirect_uri'); - } - } - else if (client.redirect_uris.length === 1) { - redirect_uri = client.redirect_uris[0]; - } - else { - throw new errors_js_1.InvalidRequestError('redirect_uri must be specified when client has multiple registered URIs'); - } - } - catch (error) { - // Pre-redirect errors - return direct response - // - // These don't need to be JSON encoded, as they'll be displayed in a user - // agent, but OTOH they all represent exceptional situations (arguably, - // "programmer error"), so presenting a nice HTML page doesn't help the - // user anyway. - if (error instanceof errors_js_1.OAuthError) { - const status = error instanceof errors_js_1.ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new errors_js_1.ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - return; - } - // Phase 2: Validate other parameters. Any errors here should go into redirect responses. - let state; - try { - // Parse and validate authorization parameters - const parseResult = RequestAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query); - if (!parseResult.success) { - throw new errors_js_1.InvalidRequestError(parseResult.error.message); - } - const { scope, code_challenge, resource } = parseResult.data; - state = parseResult.data.state; - // Validate scopes - let requestedScopes = []; - if (scope !== undefined) { - requestedScopes = scope.split(' '); - } - // All validation passed, proceed with authorization - await provider.authorize(client, { - state, - scopes: requestedScopes, - redirectUri: redirect_uri, - codeChallenge: code_challenge, - resource: resource ? new URL(resource) : undefined - }, res); - } - catch (error) { - // Post-redirect errors - redirect with error parameters - if (error instanceof errors_js_1.OAuthError) { - res.redirect(302, createErrorRedirect(redirect_uri, error, state)); - } - else { - const serverError = new errors_js_1.ServerError('Internal Server Error'); - res.redirect(302, createErrorRedirect(redirect_uri, serverError, state)); - } - } - }); - return router; -} -/** - * Helper function to create redirect URL with error parameters - */ -function createErrorRedirect(redirectUri, error, state) { - const errorUrl = new URL(redirectUri); - errorUrl.searchParams.set('error', error.errorCode); - errorUrl.searchParams.set('error_description', error.message); - if (error.errorUri) { - errorUrl.searchParams.set('error_uri', error.errorUri); - } - if (state) { - errorUrl.searchParams.set('state', state); - } - return errorUrl.href; -} -//# sourceMappingURL=authorize.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js.map deleted file mode 100644 index 28e8762..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorize.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,oDAgHC;AAnJD,0CAA4B;AAC5B,sDAA8B;AAE9B,2DAA4E;AAC5E,uEAAiE;AACjE,4CAAsH;AAWtH,iEAAiE;AACjE,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,GAAG,CAAC,QAAQ,CAAC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AAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACR,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts deleted file mode 100644 index 4d03286..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthMetadata, OAuthProtectedResourceMetadata } from '../../../shared/auth.js'; -export declare function metadataHandler(metadata: OAuthMetadata | OAuthProtectedResourceMetadata): RequestHandler; -//# sourceMappingURL=metadata.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts.map deleted file mode 100644 index 55e3a50..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAIxF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,8BAA8B,GAAG,cAAc,CAaxG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js deleted file mode 100644 index 4e00bc5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.metadataHandler = metadataHandler; -const express_1 = __importDefault(require("express")); -const cors_1 = __importDefault(require("cors")); -const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); -function metadataHandler(metadata) { - // Nested router so we can configure middleware and restrict HTTP method - const router = express_1.default.Router(); - // Configure CORS to allow any origin, to make accessible to web-based MCP clients - router.use((0, cors_1.default)()); - router.use((0, allowedMethods_js_1.allowedMethods)(['GET', 'OPTIONS'])); - router.get('/', (req, res) => { - res.status(200).json(metadata); - }); - return router; -} -//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js.map deleted file mode 100644 index 9679c9f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":";;;;;AAKA,0CAaC;AAlBD,sDAAkD;AAElD,gDAAwB;AACxB,uEAAiE;AAEjE,SAAgB,eAAe,CAAC,QAAwD;IACpF,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACzB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts deleted file mode 100644 index e9add28..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthRegisteredClientsStore } from '../clients.js'; -import { Options as RateLimitOptions } from 'express-rate-limit'; -export type ClientRegistrationHandlerOptions = { - /** - * A store used to save information about dynamically registered OAuth clients. - */ - clientsStore: OAuthRegisteredClientsStore; - /** - * The number of seconds after which to expire issued client secrets, or 0 to prevent expiration of client secrets (not recommended). - * - * If not set, defaults to 30 days. - */ - clientSecretExpirySeconds?: number; - /** - * Rate limiting configuration for the client registration endpoint. - * Set to false to disable rate limiting for this endpoint. - * Registration endpoints are particularly sensitive to abuse and should be rate limited. - */ - rateLimit?: Partial | false; - /** - * Whether to generate a client ID before calling the client registration endpoint. - * - * If not set, defaults to true. - */ - clientIdGeneration?: boolean; -}; -export declare function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds, rateLimit: rateLimitConfig, clientIdGeneration }: ClientRegistrationHandlerOptions): RequestHandler; -//# sourceMappingURL=register.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts.map deleted file mode 100644 index a38ebdb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,gCAAgC,GAAG;IAC3C;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;IAE1C;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;IAE9C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAIF,wBAAgB,yBAAyB,CAAC,EACtC,YAAY,EACZ,yBAAgE,EAChE,SAAS,EAAE,eAAe,EAC1B,kBAAyB,EAC5B,EAAE,gCAAgC,GAAG,cAAc,CA0EnD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js deleted file mode 100644 index e40c5c9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clientRegistrationHandler = clientRegistrationHandler; -const express_1 = __importDefault(require("express")); -const auth_js_1 = require("../../../shared/auth.js"); -const node_crypto_1 = __importDefault(require("node:crypto")); -const cors_1 = __importDefault(require("cors")); -const express_rate_limit_1 = require("express-rate-limit"); -const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); -const errors_js_1 = require("../errors.js"); -const DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS = 30 * 24 * 60 * 60; // 30 days -function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS, rateLimit: rateLimitConfig, clientIdGeneration = true }) { - if (!clientsStore.registerClient) { - throw new Error('Client registration store does not support registering clients'); - } - // Nested router so we can configure middleware and restrict HTTP method - const router = express_1.default.Router(); - // Configure CORS to allow any origin, to make accessible to web-based MCP clients - router.use((0, cors_1.default)()); - router.use((0, allowedMethods_js_1.allowedMethods)(['POST'])); - router.use(express_1.default.json()); - // Apply rate limiting unless explicitly disabled - stricter limits for registration - if (rateLimitConfig !== false) { - router.use((0, express_rate_limit_1.rateLimit)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 20, // 20 requests per hour - stricter as registration is sensitive - standardHeaders: true, - legacyHeaders: false, - message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for client registration requests').toResponseObject(), - ...rateLimitConfig - })); - } - router.post('/', async (req, res) => { - res.setHeader('Cache-Control', 'no-store'); - try { - const parseResult = auth_js_1.OAuthClientMetadataSchema.safeParse(req.body); - if (!parseResult.success) { - throw new errors_js_1.InvalidClientMetadataError(parseResult.error.message); - } - const clientMetadata = parseResult.data; - const isPublicClient = clientMetadata.token_endpoint_auth_method === 'none'; - // Generate client credentials - const clientSecret = isPublicClient ? undefined : node_crypto_1.default.randomBytes(32).toString('hex'); - const clientIdIssuedAt = Math.floor(Date.now() / 1000); - // Calculate client secret expiry time - const clientsDoExpire = clientSecretExpirySeconds > 0; - const secretExpiryTime = clientsDoExpire ? clientIdIssuedAt + clientSecretExpirySeconds : 0; - const clientSecretExpiresAt = isPublicClient ? undefined : secretExpiryTime; - let clientInfo = { - ...clientMetadata, - client_secret: clientSecret, - client_secret_expires_at: clientSecretExpiresAt - }; - if (clientIdGeneration) { - clientInfo.client_id = node_crypto_1.default.randomUUID(); - clientInfo.client_id_issued_at = clientIdIssuedAt; - } - clientInfo = await clientsStore.registerClient(clientInfo); - res.status(201).json(clientInfo); - } - catch (error) { - if (error instanceof errors_js_1.OAuthError) { - const status = error instanceof errors_js_1.ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new errors_js_1.ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }); - return router; -} -//# sourceMappingURL=register.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js.map deleted file mode 100644 index e116a47..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":";;;;;AAuCA,8DA+EC;AAtHD,sDAAkD;AAClD,qDAAgG;AAChG,8DAAiC;AACjC,gDAAwB;AAExB,2DAA4E;AAC5E,uEAAiE;AACjE,4CAAyG;AA8BzG,MAAM,oCAAoC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;AAE1E,SAAgB,yBAAyB,CAAC,EACtC,YAAY,EACZ,yBAAyB,GAAG,oCAAoC,EAChE,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAG,IAAI,EACM;IAC/B,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACtF,CAAC;IAED,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,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line at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts deleted file mode 100644 index 2be32bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { OAuthServerProvider } from '../provider.js'; -import { RequestHandler } from 'express'; -import { Options as RateLimitOptions } from 'express-rate-limit'; -export type RevocationHandlerOptions = { - provider: OAuthServerProvider; - /** - * Rate limiting configuration for the token revocation endpoint. - * Set to false to disable rate limiting for this endpoint. - */ - rateLimit?: Partial | false; -}; -export declare function revocationHandler({ provider, rateLimit: rateLimitConfig }: RevocationHandlerOptions): RequestHandler; -//# sourceMappingURL=revoke.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts.map deleted file mode 100644 index fb13cf1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,cAAc,CA4DpH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js deleted file mode 100644 index 4fb1da7..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.revocationHandler = revocationHandler; -const express_1 = __importDefault(require("express")); -const cors_1 = __importDefault(require("cors")); -const clientAuth_js_1 = require("../middleware/clientAuth.js"); -const auth_js_1 = require("../../../shared/auth.js"); -const express_rate_limit_1 = require("express-rate-limit"); -const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); -const errors_js_1 = require("../errors.js"); -function revocationHandler({ provider, rateLimit: rateLimitConfig }) { - if (!provider.revokeToken) { - throw new Error('Auth provider does not support revoking tokens'); - } - // Nested router so we can configure middleware and restrict HTTP method - const router = express_1.default.Router(); - // Configure CORS to allow any origin, to make accessible to web-based MCP clients - router.use((0, cors_1.default)()); - router.use((0, allowedMethods_js_1.allowedMethods)(['POST'])); - router.use(express_1.default.urlencoded({ extended: false })); - // Apply rate limiting unless explicitly disabled - if (rateLimitConfig !== false) { - router.use((0, express_rate_limit_1.rateLimit)({ - windowMs: 15 * 60 * 1000, // 15 minutes - max: 50, // 50 requests per windowMs - standardHeaders: true, - legacyHeaders: false, - message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for token revocation requests').toResponseObject(), - ...rateLimitConfig - })); - } - // Authenticate and extract client details - router.use((0, clientAuth_js_1.authenticateClient)({ clientsStore: provider.clientsStore })); - router.post('/', async (req, res) => { - res.setHeader('Cache-Control', 'no-store'); - try { - const parseResult = auth_js_1.OAuthTokenRevocationRequestSchema.safeParse(req.body); - if (!parseResult.success) { - throw new errors_js_1.InvalidRequestError(parseResult.error.message); - } - const client = req.client; - if (!client) { - // This should never happen - throw new errors_js_1.ServerError('Internal Server Error'); - } - await provider.revokeToken(client, parseResult.data); - res.status(200).json({}); - } - catch (error) { - if (error instanceof errors_js_1.OAuthError) { - const status = error instanceof errors_js_1.ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new errors_js_1.ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }); - return router; -} -//# sourceMappingURL=revoke.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js.map deleted file mode 100644 index ca01fee..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"revoke.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":";;;;;AAkBA,8CA4DC;AA7ED,sDAAkD;AAClD,gDAAwB;AACxB,+DAAiE;AACjE,qDAA4E;AAC5E,2DAA4E;AAC5E,uEAAiE;AACjE,4CAAkG;AAWlG,SAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAA4B;IAChG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACtE,CAAC;IAED,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,GAAG,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M,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBAC9B,MAAM,MAAM,GAAG,KAAK,YAAY,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts deleted file mode 100644 index 24d1c87..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthServerProvider } from '../provider.js'; -import { Options as RateLimitOptions } from 'express-rate-limit'; -export type TokenHandlerOptions = { - provider: OAuthServerProvider; - /** - * Rate limiting configuration for the token endpoint. - * Set to false to disable rate limiting for this endpoint. - */ - rateLimit?: Partial | false; -}; -export declare function tokenHandler({ provider, rateLimit: rateLimitConfig }: TokenHandlerOptions): RequestHandler; -//# sourceMappingURL=token.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts.map deleted file mode 100644 index 68189b0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAmBF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,mBAAmB,GAAG,cAAc,CA+G1G"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js deleted file mode 100644 index 8318de6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js +++ /dev/null @@ -1,136 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.tokenHandler = tokenHandler; -const z = __importStar(require("zod/v4")); -const express_1 = __importDefault(require("express")); -const cors_1 = __importDefault(require("cors")); -const pkce_challenge_1 = require("pkce-challenge"); -const clientAuth_js_1 = require("../middleware/clientAuth.js"); -const express_rate_limit_1 = require("express-rate-limit"); -const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); -const errors_js_1 = require("../errors.js"); -const TokenRequestSchema = z.object({ - grant_type: z.string() -}); -const AuthorizationCodeGrantSchema = z.object({ - code: z.string(), - code_verifier: z.string(), - redirect_uri: z.string().optional(), - resource: z.string().url().optional() -}); -const RefreshTokenGrantSchema = z.object({ - refresh_token: z.string(), - scope: z.string().optional(), - resource: z.string().url().optional() -}); -function tokenHandler({ provider, rateLimit: rateLimitConfig }) { - // Nested router so we can configure middleware and restrict HTTP method - const router = express_1.default.Router(); - // Configure CORS to allow any origin, to make accessible to web-based MCP clients - router.use((0, cors_1.default)()); - router.use((0, allowedMethods_js_1.allowedMethods)(['POST'])); - router.use(express_1.default.urlencoded({ extended: false })); - // Apply rate limiting unless explicitly disabled - if (rateLimitConfig !== false) { - router.use((0, express_rate_limit_1.rateLimit)({ - windowMs: 15 * 60 * 1000, // 15 minutes - max: 50, // 50 requests per windowMs - standardHeaders: true, - legacyHeaders: false, - message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for token requests').toResponseObject(), - ...rateLimitConfig - })); - } - // Authenticate and extract client details - router.use((0, clientAuth_js_1.authenticateClient)({ clientsStore: provider.clientsStore })); - router.post('/', async (req, res) => { - res.setHeader('Cache-Control', 'no-store'); - try { - const parseResult = TokenRequestSchema.safeParse(req.body); - if (!parseResult.success) { - throw new errors_js_1.InvalidRequestError(parseResult.error.message); - } - const { grant_type } = parseResult.data; - const client = req.client; - if (!client) { - // This should never happen - throw new errors_js_1.ServerError('Internal Server Error'); - } - switch (grant_type) { - case 'authorization_code': { - const parseResult = AuthorizationCodeGrantSchema.safeParse(req.body); - if (!parseResult.success) { - throw new errors_js_1.InvalidRequestError(parseResult.error.message); - } - const { code, code_verifier, redirect_uri, resource } = parseResult.data; - const skipLocalPkceValidation = provider.skipLocalPkceValidation; - // Perform local PKCE validation unless explicitly skipped - // (e.g. to validate code_verifier in upstream server) - if (!skipLocalPkceValidation) { - const codeChallenge = await provider.challengeForAuthorizationCode(client, code); - if (!(await (0, pkce_challenge_1.verifyChallenge)(code_verifier, codeChallenge))) { - throw new errors_js_1.InvalidGrantError('code_verifier does not match the challenge'); - } - } - // Passes the code_verifier to the provider if PKCE validation didn't occur locally - const tokens = await provider.exchangeAuthorizationCode(client, code, skipLocalPkceValidation ? code_verifier : undefined, redirect_uri, resource ? new URL(resource) : undefined); - res.status(200).json(tokens); - break; - } - case 'refresh_token': { - const parseResult = RefreshTokenGrantSchema.safeParse(req.body); - if (!parseResult.success) { - throw new errors_js_1.InvalidRequestError(parseResult.error.message); - } - const { refresh_token, scope, resource } = parseResult.data; - const scopes = scope?.split(' '); - const tokens = await provider.exchangeRefreshToken(client, refresh_token, scopes, resource ? new URL(resource) : undefined); - res.status(200).json(tokens); - break; - } - // Additional auth methods will not be added on the server side of the SDK. - case 'client_credentials': - default: - throw new errors_js_1.UnsupportedGrantTypeError('The grant type is not supported by this authorization server.'); - } - } - catch (error) { - if (error instanceof errors_js_1.OAuthError) { - const status = error instanceof errors_js_1.ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new errors_js_1.ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }); - return router; -} -//# sourceMappingURL=token.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js.map deleted file mode 100644 index b6b6406..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,oCA+GC;AA1JD,0CAA4B;AAC5B,sDAAkD;AAElD,gDAAwB;AACxB,mDAAiD;AACjD,+DAAiE;AACjE,2DAA4E;AAC5E,uEAAiE;AACjE,4CAOsB;AAWtB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAEH,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAEH,SAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAuB;IACtF,wEAAwE;IACxE,MAAM,MAAM,GAAG,i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,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts deleted file mode 100644 index ee6037e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { RequestHandler } from 'express'; -/** - * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response. - * - * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST']) - * @returns Express middleware that returns a 405 error if method not in allowed list - */ -export declare function allowedMethods(allowedMethods: string[]): RequestHandler; -//# sourceMappingURL=allowedMethods.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map deleted file mode 100644 index d3de93e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"allowedMethods.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,cAAc,CAUvE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js deleted file mode 100644 index f445537..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.allowedMethods = allowedMethods; -const errors_js_1 = require("../errors.js"); -/** - * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response. - * - * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST']) - * @returns Express middleware that returns a 405 error if method not in allowed list - */ -function allowedMethods(allowedMethods) { - return (req, res, next) => { - if (allowedMethods.includes(req.method)) { - next(); - return; - } - const error = new errors_js_1.MethodNotAllowedError(`The method ${req.method} is not allowed for this endpoint`); - res.status(405).set('Allow', allowedMethods.join(', ')).json(error.toResponseObject()); - }; -} -//# sourceMappingURL=allowedMethods.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js.map deleted file mode 100644 index be69f33..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"allowedMethods.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":";;AASA,wCAUC;AAlBD,4CAAqD;AAErD;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,cAAwB;IACnD,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACtB,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,IAAI,EAAE,CAAC;YACP,OAAO;QACX,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,iCAAqB,CAAC,cAAc,GAAG,CAAC,MAAM,mCAAmC,CAAC,CAAC;QACrG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC3F,CAAC,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts deleted file mode 100644 index 1073075..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthTokenVerifier } from '../provider.js'; -import { AuthInfo } from '../types.js'; -export type BearerAuthMiddlewareOptions = { - /** - * A provider used to verify tokens. - */ - verifier: OAuthTokenVerifier; - /** - * Optional scopes that the token must have. - */ - requiredScopes?: string[]; - /** - * Optional resource metadata URL to include in WWW-Authenticate header. - */ - resourceMetadataUrl?: string; -}; -declare module 'express-serve-static-core' { - interface Request { - /** - * Information about the validated access token, if the `requireBearerAuth` middleware was used. - */ - auth?: AuthInfo; - } -} -/** - * Middleware that requires a valid Bearer token in the Authorization header. - * - * This will validate the token with the auth provider and add the resulting auth info to the request object. - * - * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header - * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec. - */ -export declare function requireBearerAuth({ verifier, requiredScopes, resourceMetadataUrl }: BearerAuthMiddlewareOptions): RequestHandler; -//# sourceMappingURL=bearerAuth.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map deleted file mode 100644 index c9d939f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bearerAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,2BAA2B,GAAG;IACtC;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,CAAC;KACnB;CACJ;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,cAAmB,EAAE,mBAAmB,EAAE,EAAE,2BAA2B,GAAG,cAAc,CA8DrI"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js deleted file mode 100644 index dcfc509..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.requireBearerAuth = requireBearerAuth; -const errors_js_1 = require("../errors.js"); -/** - * Middleware that requires a valid Bearer token in the Authorization header. - * - * This will validate the token with the auth provider and add the resulting auth info to the request object. - * - * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header - * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec. - */ -function requireBearerAuth({ verifier, requiredScopes = [], resourceMetadataUrl }) { - return async (req, res, next) => { - try { - const authHeader = req.headers.authorization; - if (!authHeader) { - throw new errors_js_1.InvalidTokenError('Missing Authorization header'); - } - const [type, token] = authHeader.split(' '); - if (type.toLowerCase() !== 'bearer' || !token) { - throw new errors_js_1.InvalidTokenError("Invalid Authorization header format, expected 'Bearer TOKEN'"); - } - const authInfo = await verifier.verifyAccessToken(token); - // Check if token has the required scopes (if any) - if (requiredScopes.length > 0) { - const hasAllScopes = requiredScopes.every(scope => authInfo.scopes.includes(scope)); - if (!hasAllScopes) { - throw new errors_js_1.InsufficientScopeError('Insufficient scope'); - } - } - // Check if the token is set to expire or if it is expired - if (typeof authInfo.expiresAt !== 'number' || isNaN(authInfo.expiresAt)) { - throw new errors_js_1.InvalidTokenError('Token has no expiration time'); - } - else if (authInfo.expiresAt < Date.now() / 1000) { - throw new errors_js_1.InvalidTokenError('Token has expired'); - } - req.auth = authInfo; - next(); - } - catch (error) { - // Build WWW-Authenticate header parts - const buildWwwAuthHeader = (errorCode, message) => { - let header = `Bearer error="${errorCode}", error_description="${message}"`; - if (requiredScopes.length > 0) { - header += `, scope="${requiredScopes.join(' ')}"`; - } - if (resourceMetadataUrl) { - header += `, resource_metadata="${resourceMetadataUrl}"`; - } - return header; - }; - if (error instanceof errors_js_1.InvalidTokenError) { - res.set('WWW-Authenticate', buildWwwAuthHeader(error.errorCode, error.message)); - res.status(401).json(error.toResponseObject()); - } - else if (error instanceof errors_js_1.InsufficientScopeError) { - res.set('WWW-Authenticate', buildWwwAuthHeader(error.errorCode, error.message)); - res.status(403).json(error.toResponseObject()); - } - else if (error instanceof errors_js_1.ServerError) { - res.status(500).json(error.toResponseObject()); - } - else if (error instanceof errors_js_1.OAuthError) { - res.status(400).json(error.toResponseObject()); - } - else { - const serverError = new errors_js_1.ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }; -} -//# sourceMappingURL=bearerAuth.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js.map deleted file mode 100644 index d111d36..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bearerAuth.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":";;AAuCA,8CA8DC;AApGD,4CAAkG;AA8BlG;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,cAAc,GAAG,EAAE,EAAE,mBAAmB,EAA+B;IACjH,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC5B,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC;YAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;gBACd,MAAM,IAAI,6BAAiB,CAAC,8BAA8B,CAAC,CAAC;YAChE,CAAC;YAED,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC5C,MAAM,IAAI,6BAAiB,CAAC,8DAA8D,CAAC,CAAC;YAChG,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAEzD,kDAAkD;YAClD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5B,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CA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AAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACnD,CAAC;iBAAM,IAAI,KAAK,YAAY,kCAAsB,EAAE,CAAC;gBACjD,GAAG,CAAC,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACnD,CAAC;iBAAM,IAAI,KAAK,YAAY,uBAAW,EAAE,CAAC;gBACtC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACnD,CAAC;iBAAM,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBACrC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts deleted file mode 100644 index 837f95f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthRegisteredClientsStore } from '../clients.js'; -import { OAuthClientInformationFull } from '../../../shared/auth.js'; -export type ClientAuthenticationMiddlewareOptions = { - /** - * A store used to read information about registered OAuth clients. - */ - clientsStore: OAuthRegisteredClientsStore; -}; -declare module 'express-serve-static-core' { - interface Request { - /** - * The authenticated client for this request, if the `authenticateClient` middleware was used. - */ - client?: OAuthClientInformationFull; - } -} -export declare function authenticateClient({ clientsStore }: ClientAuthenticationMiddlewareOptions): RequestHandler; -//# sourceMappingURL=clientAuth.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts.map deleted file mode 100644 index 5455132..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clientAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/clientAuth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAGrE,MAAM,MAAM,qCAAqC,GAAG;IAChD;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;CAC7C,CAAC;AAOF,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb;;WAEG;QACH,MAAM,CAAC,EAAE,0BAA0B,CAAC;KACvC;CACJ;AAED,wBAAgB,kBAAkB,CAAC,EAAE,YAAY,EAAE,EAAE,qCAAqC,GAAG,cAAc,CAoC1G"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js deleted file mode 100644 index e54dd10..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.authenticateClient = authenticateClient; -const z = __importStar(require("zod/v4")); -const errors_js_1 = require("../errors.js"); -const ClientAuthenticatedRequestSchema = z.object({ - client_id: z.string(), - client_secret: z.string().optional() -}); -function authenticateClient({ clientsStore }) { - return async (req, res, next) => { - try { - const result = ClientAuthenticatedRequestSchema.safeParse(req.body); - if (!result.success) { - throw new errors_js_1.InvalidRequestError(String(result.error)); - } - const { client_id, client_secret } = result.data; - const client = await clientsStore.getClient(client_id); - if (!client) { - throw new errors_js_1.InvalidClientError('Invalid client_id'); - } - if (client.client_secret) { - if (!client_secret) { - throw new errors_js_1.InvalidClientError('Client secret is required'); - } - if (client.client_secret !== client_secret) { - throw new errors_js_1.InvalidClientError('Invalid client_secret'); - } - if (client.client_secret_expires_at && client.client_secret_expires_at < Math.floor(Date.now() / 1000)) { - throw new errors_js_1.InvalidClientError('Client secret has expired'); - } - } - req.client = client; - next(); - } - catch (error) { - if (error instanceof errors_js_1.OAuthError) { - const status = error instanceof errors_js_1.ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new errors_js_1.ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }; -} -//# sourceMappingURL=clientAuth.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js.map deleted file mode 100644 index 63184f4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clientAuth.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/clientAuth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,gDAoCC;AA/DD,0CAA4B;AAI5B,4CAAgG;AAShG,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAWH,SAAgB,kBAAkB,CAAC,EAAE,YAAY,EAAyC;IACtF,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC5B,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,gCAAgC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,MAAM,IAAI,+BAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACxD,CAAC;YACD,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;YACjD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YACvD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,MAAM,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js/server/auth/provider.d.ts deleted file mode 100644 index 3e4eca3..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Response } from 'express'; -import { OAuthRegisteredClientsStore } from './clients.js'; -import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '../../shared/auth.js'; -import { AuthInfo } from './types.js'; -export type AuthorizationParams = { - state?: string; - scopes?: string[]; - codeChallenge: string; - redirectUri: string; - resource?: URL; -}; -/** - * Implements an end-to-end OAuth server. - */ -export interface OAuthServerProvider { - /** - * A store used to read information about registered OAuth clients. - */ - get clientsStore(): OAuthRegisteredClientsStore; - /** - * Begins the authorization flow, which can either be implemented by this server itself or via redirection to a separate authorization server. - * - * This server must eventually issue a redirect with an authorization response or an error response to the given redirect URI. Per OAuth 2.1: - * - In the successful case, the redirect MUST include the `code` and `state` (if present) query parameters. - * - In the error case, the redirect MUST include the `error` query parameter, and MAY include an optional `error_description` query parameter. - */ - authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; - /** - * Returns the `codeChallenge` that was used when the indicated authorization began. - */ - challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise; - /** - * Exchanges an authorization code for an access token. - */ - exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string, resource?: URL): Promise; - /** - * Exchanges a refresh token for an access token. - */ - exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[], resource?: URL): Promise; - /** - * Verifies an access token and returns information about it. - */ - verifyAccessToken(token: string): Promise; - /** - * Revokes an access or refresh token. If unimplemented, token revocation is not supported (not recommended). - * - * If the given token is invalid or already revoked, this method should do nothing. - */ - revokeToken?(client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise; - /** - * Whether to skip local PKCE validation. - * - * If true, the server will not perform PKCE validation locally and will pass the code_verifier to the upstream server. - * - * NOTE: This should only be true if the upstream server is performing the actual PKCE validation. - */ - skipLocalPkceValidation?: boolean; -} -/** - * Slim implementation useful for token verification - */ -export interface OAuthTokenVerifier { - /** - * Verifies an access token and returns information about it. - */ - verifyAccessToken(token: string): Promise; -} -//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts.map deleted file mode 100644 index d1a4bff..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC;;OAEG;IACH,IAAI,YAAY,IAAI,2BAA2B,CAAC;IAEhD;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,EAAE,0BAA0B,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzG;;OAEG;IACH,6BAA6B,CAAC,MAAM,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9G;;OAEG;IACH,yBAAyB,CACrB,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,GAAG,GACf,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAExI;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpD;;;;OAIG;IACH,WAAW,CAAC,CAAC,MAAM,EAAE,0BAA0B,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtG;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js deleted file mode 100644 index 0903bb2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=provider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js.map deleted file mode 100644 index b968414..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts deleted file mode 100644 index ee6f350..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Response } from 'express'; -import { OAuthRegisteredClientsStore } from '../clients.js'; -import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '../../../shared/auth.js'; -import { AuthInfo } from '../types.js'; -import { AuthorizationParams, OAuthServerProvider } from '../provider.js'; -import { FetchLike } from '../../../shared/transport.js'; -export type ProxyEndpoints = { - authorizationUrl: string; - tokenUrl: string; - revocationUrl?: string; - registrationUrl?: string; -}; -export type ProxyOptions = { - /** - * Individual endpoint URLs for proxying specific OAuth operations - */ - endpoints: ProxyEndpoints; - /** - * Function to verify access tokens and return auth info - */ - verifyAccessToken: (token: string) => Promise; - /** - * Function to fetch client information from the upstream server - */ - getClient: (clientId: string) => Promise; - /** - * Custom fetch implementation used for all network requests. - */ - fetch?: FetchLike; -}; -/** - * Implements an OAuth server that proxies requests to another OAuth server. - */ -export declare class ProxyOAuthServerProvider implements OAuthServerProvider { - protected readonly _endpoints: ProxyEndpoints; - protected readonly _verifyAccessToken: (token: string) => Promise; - protected readonly _getClient: (clientId: string) => Promise; - protected readonly _fetch?: FetchLike; - skipLocalPkceValidation: boolean; - revokeToken?: (client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest) => Promise; - constructor(options: ProxyOptions); - get clientsStore(): OAuthRegisteredClientsStore; - authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; - challengeForAuthorizationCode(_client: OAuthClientInformationFull, _authorizationCode: string): Promise; - exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string, resource?: URL): Promise; - exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[], resource?: URL): Promise; - verifyAccessToken(token: string): Promise; -} -//# sourceMappingURL=proxyProvider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts.map deleted file mode 100644 index 124c105..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"proxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/providers/proxyProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACH,0BAA0B,EAE1B,2BAA2B,EAC3B,WAAW,EAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,MAAM,MAAM,cAAc,GAAG;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB;;OAEG;IACH,SAAS,EAAE,cAAc,CAAC;IAE1B;;OAEG;IACH,iBAAiB,EAAE,CAAC,KAAK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CjB,oBAAoB,CACtB,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,MAAM,EAAE,EACjB,QAAQ,CAAC,EAAE,GAAG,GACf,OAAO,CAAC,WAAW,CAAC;IAoCjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAG5D"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js deleted file mode 100644 index 1707894..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js +++ /dev/null @@ -1,159 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProxyOAuthServerProvider = void 0; -const auth_js_1 = require("../../../shared/auth.js"); -const errors_js_1 = require("../errors.js"); -/** - * Implements an OAuth server that proxies requests to another OAuth server. - */ -class ProxyOAuthServerProvider { - constructor(options) { - this.skipLocalPkceValidation = true; - this._endpoints = options.endpoints; - this._verifyAccessToken = options.verifyAccessToken; - this._getClient = options.getClient; - this._fetch = options.fetch; - if (options.endpoints?.revocationUrl) { - this.revokeToken = async (client, request) => { - const revocationUrl = this._endpoints.revocationUrl; - if (!revocationUrl) { - throw new Error('No revocation endpoint configured'); - } - const params = new URLSearchParams(); - params.set('token', request.token); - params.set('client_id', client.client_id); - if (client.client_secret) { - params.set('client_secret', client.client_secret); - } - if (request.token_type_hint) { - params.set('token_type_hint', request.token_type_hint); - } - const response = await (this._fetch ?? fetch)(revocationUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: params.toString() - }); - await response.body?.cancel(); - if (!response.ok) { - throw new errors_js_1.ServerError(`Token revocation failed: ${response.status}`); - } - }; - } - } - get clientsStore() { - const registrationUrl = this._endpoints.registrationUrl; - return { - getClient: this._getClient, - ...(registrationUrl && { - registerClient: async (client) => { - const response = await (this._fetch ?? fetch)(registrationUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(client) - }); - if (!response.ok) { - await response.body?.cancel(); - throw new errors_js_1.ServerError(`Client registration failed: ${response.status}`); - } - const data = await response.json(); - return auth_js_1.OAuthClientInformationFullSchema.parse(data); - } - }) - }; - } - async authorize(client, params, res) { - // Start with required OAuth parameters - const targetUrl = new URL(this._endpoints.authorizationUrl); - const searchParams = new URLSearchParams({ - client_id: client.client_id, - response_type: 'code', - redirect_uri: params.redirectUri, - code_challenge: params.codeChallenge, - code_challenge_method: 'S256' - }); - // Add optional standard OAuth parameters - if (params.state) - searchParams.set('state', params.state); - if (params.scopes?.length) - searchParams.set('scope', params.scopes.join(' ')); - if (params.resource) - searchParams.set('resource', params.resource.href); - targetUrl.search = searchParams.toString(); - res.redirect(targetUrl.toString()); - } - async challengeForAuthorizationCode(_client, _authorizationCode) { - // In a proxy setup, we don't store the code challenge ourselves - // Instead, we proxy the token request and let the upstream server validate it - return ''; - } - async exchangeAuthorizationCode(client, authorizationCode, codeVerifier, redirectUri, resource) { - const params = new URLSearchParams({ - grant_type: 'authorization_code', - client_id: client.client_id, - code: authorizationCode - }); - if (client.client_secret) { - params.append('client_secret', client.client_secret); - } - if (codeVerifier) { - params.append('code_verifier', codeVerifier); - } - if (redirectUri) { - params.append('redirect_uri', redirectUri); - } - if (resource) { - params.append('resource', resource.href); - } - const response = await (this._fetch ?? fetch)(this._endpoints.tokenUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: params.toString() - }); - if (!response.ok) { - await response.body?.cancel(); - throw new errors_js_1.ServerError(`Token exchange failed: ${response.status}`); - } - const data = await response.json(); - return auth_js_1.OAuthTokensSchema.parse(data); - } - async exchangeRefreshToken(client, refreshToken, scopes, resource) { - const params = new URLSearchParams({ - grant_type: 'refresh_token', - client_id: client.client_id, - refresh_token: refreshToken - }); - if (client.client_secret) { - params.set('client_secret', client.client_secret); - } - if (scopes?.length) { - params.set('scope', scopes.join(' ')); - } - if (resource) { - params.set('resource', resource.href); - } - const response = await (this._fetch ?? fetch)(this._endpoints.tokenUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: params.toString() - }); - if (!response.ok) { - await response.body?.cancel(); - throw new errors_js_1.ServerError(`Token refresh failed: ${response.status}`); - } - const data = await response.json(); - return auth_js_1.OAuthTokensSchema.parse(data); - } - async verifyAccessToken(token) { - return this._verifyAccessToken(token); - } -} -exports.ProxyOAuthServerProvider = ProxyOAuthServerProvider; -//# sourceMappingURL=proxyProvider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js.map deleted file mode 100644 index 7f16e74..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"proxyProvider.js","sourceRoot":"","sources":["../../../../../src/server/auth/providers/proxyProvider.ts"],"names":[],"mappings":";;;AAEA,qDAMiC;AAGjC,4CAA2C;AAgC3C;;GAEG;AACH,MAAa,wBAAwB;IAUjC,YAAY,OAAqB;QAJjC,4BAAuB,GAAG,IAAI,CAAC;QAK3B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,OAAO,CAAC,SAAS,EAAE,aAAa,EAAE,CAAC;YACnC,IAAI,CAAC,WAAW,GAAG,KAAK,EAAE,MAAkC,EAAE,OAAoC,EAAE,EAAE;gBAClG,MAAM,aAAa,GAAG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d,OAAO,EAAE;gBACL,cAAc,EAAE,mCAAmC;aACtD;YACD,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE;SAC1B,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;YAC9B,MAAM,IAAI,uBAAW,CAAC,yBAAyB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACtE,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,2BAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAAa;QACjC,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;CACJ;AA/LD,4DA+LC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts deleted file mode 100644 index 43dabde..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -import express, { RequestHandler } from 'express'; -import { ClientRegistrationHandlerOptions } from './handlers/register.js'; -import { TokenHandlerOptions } from './handlers/token.js'; -import { AuthorizationHandlerOptions } from './handlers/authorize.js'; -import { RevocationHandlerOptions } from './handlers/revoke.js'; -import { OAuthServerProvider } from './provider.js'; -import { OAuthMetadata } from '../../shared/auth.js'; -export type AuthRouterOptions = { - /** - * A provider implementing the actual authorization logic for this router. - */ - provider: OAuthServerProvider; - /** - * The authorization server's issuer identifier, which is a URL that uses the "https" scheme and has no query or fragment components. - */ - issuerUrl: URL; - /** - * The base URL of the authorization server to use for the metadata endpoints. - * - * If not provided, the issuer URL will be used as the base URL. - */ - baseUrl?: URL; - /** - * An optional URL of a page containing human-readable information that developers might want or need to know when using the authorization server. - */ - serviceDocumentationUrl?: URL; - /** - * An optional list of scopes supported by this authorization server - */ - scopesSupported?: string[]; - /** - * The resource name to be displayed in protected resource metadata - */ - resourceName?: string; - /** - * The URL of the protected resource (RS) whose metadata we advertise. - * If not provided, falls back to `baseUrl` and then to `issuerUrl` (AS=RS). - */ - resourceServerUrl?: URL; - authorizationOptions?: Omit; - clientRegistrationOptions?: Omit; - revocationOptions?: Omit; - tokenOptions?: Omit; -}; -export declare const createOAuthMetadata: (options: { - provider: OAuthServerProvider; - issuerUrl: URL; - baseUrl?: URL; - serviceDocumentationUrl?: URL; - scopesSupported?: string[]; -}) => OAuthMetadata; -/** - * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported). - * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients. - * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead. - * - * By default, rate limiting is applied to all endpoints to prevent abuse. - * - * This router MUST be installed at the application root, like so: - * - * const app = express(); - * app.use(mcpAuthRouter(...)); - */ -export declare function mcpAuthRouter(options: AuthRouterOptions): RequestHandler; -export type AuthMetadataOptions = { - /** - * OAuth Metadata as would be returned from the authorization server - * this MCP server relies on - */ - oauthMetadata: OAuthMetadata; - /** - * The url of the MCP server, for use in protected resource metadata - */ - resourceServerUrl: URL; - /** - * The url for documentation for the MCP server - */ - serviceDocumentationUrl?: URL; - /** - * An optional list of scopes supported by this MCP server - */ - scopesSupported?: string[]; - /** - * An optional resource name to display in resource metadata - */ - resourceName?: string; -}; -export declare function mcpAuthMetadataRouter(options: AuthMetadataOptions): express.Router; -/** - * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL - * from a given server URL. This replaces the path with the standard metadata endpoint. - * - * @param serverUrl - The base URL of the protected resource server - * @returns The URL for the OAuth protected resource metadata endpoint - * - * @example - * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp')) - * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource/mcp' - */ -export declare function getOAuthProtectedResourceMetadataUrl(serverUrl: URL): string; -//# sourceMappingURL=router.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts.map deleted file mode 100644 index 615cb96..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAA6B,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAgB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAwB,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAqB,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,aAAa,EAAkC,MAAM,sBAAsB,CAAC;AAUrF,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,mBAAmB,CAAC;IAE9B;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;IAEd;;OAEG;IACH,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC;IAGxB,oBAAoB,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAC;IACrE,yBAAyB,CAAC,EAAE,IAAI,CAAC,gCAAgC,EAAE,cAAc,CAAC,CAAC;IACnF,iBAAiB,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;CACxD,CAAC;AAeF,eAAO,MAAM,mBAAmB,YAAa;IACzC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,SAAS,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,KAAG,aAgCH,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,cAAc,CAyCxE;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;;OAGG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,iBAAiB,EAAE,GAAG,CAAC;IAEvB;;OAEG;IACH,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAuBlF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oCAAoC,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,CAI3E"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js deleted file mode 100644 index 5827119..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js +++ /dev/null @@ -1,128 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createOAuthMetadata = void 0; -exports.mcpAuthRouter = mcpAuthRouter; -exports.mcpAuthMetadataRouter = mcpAuthMetadataRouter; -exports.getOAuthProtectedResourceMetadataUrl = getOAuthProtectedResourceMetadataUrl; -const express_1 = __importDefault(require("express")); -const register_js_1 = require("./handlers/register.js"); -const token_js_1 = require("./handlers/token.js"); -const authorize_js_1 = require("./handlers/authorize.js"); -const revoke_js_1 = require("./handlers/revoke.js"); -const metadata_js_1 = require("./handlers/metadata.js"); -// Check for dev mode flag that allows HTTP issuer URLs (for development/testing only) -const allowInsecureIssuerUrl = process.env.MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === 'true' || process.env.MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === '1'; -if (allowInsecureIssuerUrl) { - // eslint-disable-next-line no-console - console.warn('MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL is enabled - HTTP issuer URLs are allowed. Do not use in production.'); -} -const checkIssuerUrl = (issuer) => { - // Technically RFC 8414 does not permit a localhost HTTPS exemption, but this will be necessary for ease of testing - if (issuer.protocol !== 'https:' && issuer.hostname !== 'localhost' && issuer.hostname !== '127.0.0.1' && !allowInsecureIssuerUrl) { - throw new Error('Issuer URL must be HTTPS'); - } - if (issuer.hash) { - throw new Error(`Issuer URL must not have a fragment: ${issuer}`); - } - if (issuer.search) { - throw new Error(`Issuer URL must not have a query string: ${issuer}`); - } -}; -const createOAuthMetadata = (options) => { - const issuer = options.issuerUrl; - const baseUrl = options.baseUrl; - checkIssuerUrl(issuer); - const authorization_endpoint = '/authorize'; - const token_endpoint = '/token'; - const registration_endpoint = options.provider.clientsStore.registerClient ? '/register' : undefined; - const revocation_endpoint = options.provider.revokeToken ? '/revoke' : undefined; - const metadata = { - issuer: issuer.href, - service_documentation: options.serviceDocumentationUrl?.href, - authorization_endpoint: new URL(authorization_endpoint, baseUrl || issuer).href, - response_types_supported: ['code'], - code_challenge_methods_supported: ['S256'], - token_endpoint: new URL(token_endpoint, baseUrl || issuer).href, - token_endpoint_auth_methods_supported: ['client_secret_post', 'none'], - grant_types_supported: ['authorization_code', 'refresh_token'], - scopes_supported: options.scopesSupported, - revocation_endpoint: revocation_endpoint ? new URL(revocation_endpoint, baseUrl || issuer).href : undefined, - revocation_endpoint_auth_methods_supported: revocation_endpoint ? ['client_secret_post'] : undefined, - registration_endpoint: registration_endpoint ? new URL(registration_endpoint, baseUrl || issuer).href : undefined - }; - return metadata; -}; -exports.createOAuthMetadata = createOAuthMetadata; -/** - * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported). - * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients. - * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead. - * - * By default, rate limiting is applied to all endpoints to prevent abuse. - * - * This router MUST be installed at the application root, like so: - * - * const app = express(); - * app.use(mcpAuthRouter(...)); - */ -function mcpAuthRouter(options) { - const oauthMetadata = (0, exports.createOAuthMetadata)(options); - const router = express_1.default.Router(); - router.use(new URL(oauthMetadata.authorization_endpoint).pathname, (0, authorize_js_1.authorizationHandler)({ provider: options.provider, ...options.authorizationOptions })); - router.use(new URL(oauthMetadata.token_endpoint).pathname, (0, token_js_1.tokenHandler)({ provider: options.provider, ...options.tokenOptions })); - router.use(mcpAuthMetadataRouter({ - oauthMetadata, - // Prefer explicit RS; otherwise fall back to AS baseUrl, then to issuer (back-compat) - resourceServerUrl: options.resourceServerUrl ?? options.baseUrl ?? new URL(oauthMetadata.issuer), - serviceDocumentationUrl: options.serviceDocumentationUrl, - scopesSupported: options.scopesSupported, - resourceName: options.resourceName - })); - if (oauthMetadata.registration_endpoint) { - router.use(new URL(oauthMetadata.registration_endpoint).pathname, (0, register_js_1.clientRegistrationHandler)({ - clientsStore: options.provider.clientsStore, - ...options.clientRegistrationOptions - })); - } - if (oauthMetadata.revocation_endpoint) { - router.use(new URL(oauthMetadata.revocation_endpoint).pathname, (0, revoke_js_1.revocationHandler)({ provider: options.provider, ...options.revocationOptions })); - } - return router; -} -function mcpAuthMetadataRouter(options) { - checkIssuerUrl(new URL(options.oauthMetadata.issuer)); - const router = express_1.default.Router(); - const protectedResourceMetadata = { - resource: options.resourceServerUrl.href, - authorization_servers: [options.oauthMetadata.issuer], - scopes_supported: options.scopesSupported, - resource_name: options.resourceName, - resource_documentation: options.serviceDocumentationUrl?.href - }; - // Serve PRM at the path-specific URL per RFC 9728 - const rsPath = new URL(options.resourceServerUrl.href).pathname; - router.use(`/.well-known/oauth-protected-resource${rsPath === '/' ? '' : rsPath}`, (0, metadata_js_1.metadataHandler)(protectedResourceMetadata)); - // Always add this for OAuth Authorization Server metadata per RFC 8414 - router.use('/.well-known/oauth-authorization-server', (0, metadata_js_1.metadataHandler)(options.oauthMetadata)); - return router; -} -/** - * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL - * from a given server URL. This replaces the path with the standard metadata endpoint. - * - * @param serverUrl - The base URL of the protected resource server - * @returns The URL for the OAuth protected resource metadata endpoint - * - * @example - * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp')) - * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource/mcp' - */ -function getOAuthProtectedResourceMetadataUrl(serverUrl) { - const u = new URL(serverUrl.href); - const rsPath = u.pathname && u.pathname !== '/' ? u.pathname : ''; - return new URL(`/.well-known/oauth-protected-resource${rsPath}`, u).href; -} -//# sourceMappingURL=router.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js.map deleted file mode 100644 index 991898b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":";;;;;;AAgIA,sCAyCC;AA8BD,sDAuB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KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,OAAO,IAAI,GAAG,CAAC,wCAAwC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7E,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts deleted file mode 100644 index 05ec848..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Information about a validated access token, provided to request handlers. - */ -export interface AuthInfo { - /** - * The access token. - */ - token: string; - /** - * The client ID associated with this token. - */ - clientId: string; - /** - * Scopes associated with this token. - */ - scopes: string[]; - /** - * When the token expires (in seconds since epoch). - */ - expiresAt?: number; - /** - * The RFC 8707 resource server identifier for which this token is valid. - * If set, this MUST match the MCP server's resource identifier (minus hash fragment). - */ - resource?: URL; - /** - * Additional data associated with the token. - * This field should be used for any additional data that needs to be attached to the auth info. - */ - extra?: Record; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts.map deleted file mode 100644 index 021e947..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js deleted file mode 100644 index 11e638d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js.map deleted file mode 100644 index 0d8063d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts deleted file mode 100644 index 1b3159a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { AnySchema, SchemaInput } from './zod-compat.js'; -export declare const COMPLETABLE_SYMBOL: unique symbol; -export type CompleteCallback = (value: SchemaInput, context?: { - arguments?: Record; -}) => SchemaInput[] | Promise[]>; -export type CompletableMeta = { - complete: CompleteCallback; -}; -export type CompletableSchema = T & { - [COMPLETABLE_SYMBOL]: CompletableMeta; -}; -/** - * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP. - * Works with both Zod v3 and v4 schemas. - */ -export declare function completable(schema: T, complete: CompleteCallback): CompletableSchema; -/** - * Checks if a schema is completable (has completion metadata). - */ -export declare function isCompletable(schema: unknown): schema is CompletableSchema; -/** - * Gets the completer callback from a completable schema, if it exists. - */ -export declare function getCompleter(schema: T): CompleteCallback | undefined; -/** - * Unwraps a completable schema to get the underlying schema. - * For backward compatibility with code that called `.unwrap()`. - */ -export declare function unwrapCompletable(schema: CompletableSchema): T; -export declare enum McpZodTypeKind { - Completable = "McpCompletable" -} -export interface CompletableDef { - type: T; - complete: CompleteCallback; - typeName: McpZodTypeKind.Completable; -} -//# sourceMappingURL=completable.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts.map deleted file mode 100644 index 83ea2f1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"completable.d.ts","sourceRoot":"","sources":["../../../src/server/completable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzD,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAAsC,CAAC;AAE/E,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,CAC5D,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EACrB,OAAO,CAAC,EAAE;IACN,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,KACA,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAElD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI;IAC3D,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,GAAG;IACrD,CAAC,kBAAkB,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAQ/G;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAErF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAG5F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAEtF;AAID,oBAAY,cAAc;IACtB,WAAW,mBAAmB;CACjC;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC3D,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC9B,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC;CACxC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js deleted file mode 100644 index 58f1873..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.McpZodTypeKind = exports.COMPLETABLE_SYMBOL = void 0; -exports.completable = completable; -exports.isCompletable = isCompletable; -exports.getCompleter = getCompleter; -exports.unwrapCompletable = unwrapCompletable; -exports.COMPLETABLE_SYMBOL = Symbol.for('mcp.completable'); -/** - * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP. - * Works with both Zod v3 and v4 schemas. - */ -function completable(schema, complete) { - Object.defineProperty(schema, exports.COMPLETABLE_SYMBOL, { - value: { complete }, - enumerable: false, - writable: false, - configurable: false - }); - return schema; -} -/** - * Checks if a schema is completable (has completion metadata). - */ -function isCompletable(schema) { - return !!schema && typeof schema === 'object' && exports.COMPLETABLE_SYMBOL in schema; -} -/** - * Gets the completer callback from a completable schema, if it exists. - */ -function getCompleter(schema) { - const meta = schema[exports.COMPLETABLE_SYMBOL]; - return meta?.complete; -} -/** - * Unwraps a completable schema to get the underlying schema. - * For backward compatibility with code that called `.unwrap()`. - */ -function unwrapCompletable(schema) { - return schema; -} -// Legacy exports for backward compatibility -// These types are deprecated but kept for existing code -var McpZodTypeKind; -(function (McpZodTypeKind) { - McpZodTypeKind["Completable"] = "McpCompletable"; -})(McpZodTypeKind || (exports.McpZodTypeKind = McpZodTypeKind = {})); -//# sourceMappingURL=completable.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js.map deleted file mode 100644 index 6b20bd6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"completable.js","sourceRoot":"","sources":["../../../src/server/completable.ts"],"names":[],"mappings":";;;AAuBA,kCAQC;AAKD,sCAEC;AAKD,oCAGC;AAMD,8CAEC;AApDY,QAAA,kBAAkB,GAAkB,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAiB/E;;;GAGG;AACH,SAAgB,WAAW,CAAsB,MAAS,EAAE,QAA6B;IACrF,MAAM,CAAC,cAAc,CAAC,MAAgB,EAAE,0BAAkB,EAAE;QACxD,KAAK,EAAE,EAAE,QAAQ,EAAwB;QACzC,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,KAAK;KACtB,CAAC,CAAC;IACH,OAAO,MAA8B,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,MAAe;IACzC,OAAO,CAAC,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,0BAAkB,IAAK,MAAiB,CAAC;AAC9F,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAsB,MAAS;IACvD,MAAM,IAAI,GAAI,MAAmE,CAAC,0BAAkB,CAAC,CAAC;IACtG,OAAO,IAAI,EAAE,QAA2C,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAsB,MAA4B;IAC/E,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,4CAA4C;AAC5C,wDAAwD;AACxD,IAAY,cAEX;AAFD,WAAY,cAAc;IACtB,gDAA8B,CAAA;AAClC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts deleted file mode 100644 index 7746e82..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Express } from 'express'; -/** - * Options for creating an MCP Express application. - */ -export interface CreateMcpExpressAppOptions { - /** - * The hostname to bind to. Defaults to '127.0.0.1'. - * When set to '127.0.0.1', 'localhost', or '::1', DNS rebinding protection is automatically enabled. - */ - host?: string; - /** - * List of allowed hostnames for DNS rebinding protection. - * If provided, host header validation will be applied using this list. - * For IPv6, provide addresses with brackets (e.g., '[::1]'). - * - * This is useful when binding to '0.0.0.0' or '::' but still wanting - * to restrict which hostnames are allowed. - */ - allowedHosts?: string[]; -} -/** - * Creates an Express application pre-configured for MCP servers. - * - * When the host is '127.0.0.1', 'localhost', or '::1' (the default is '127.0.0.1'), - * DNS rebinding protection middleware is automatically applied to protect against - * DNS rebinding attacks on localhost servers. - * - * @param options - Configuration options - * @returns A configured Express application - * - * @example - * ```typescript - * // Basic usage - defaults to 127.0.0.1 with DNS rebinding protection - * const app = createMcpExpressApp(); - * - * // Custom host - DNS rebinding protection only applied for localhost hosts - * const app = createMcpExpressApp({ host: '0.0.0.0' }); // No automatic DNS rebinding protection - * const app = createMcpExpressApp({ host: 'localhost' }); // DNS rebinding protection enabled - * - * // Custom allowed hosts for non-localhost binding - * const app = createMcpExpressApp({ host: '0.0.0.0', allowedHosts: ['myapp.local', 'localhost'] }); - * ``` - */ -export declare function createMcpExpressApp(options?: CreateMcpExpressAppOptions): Express; -//# sourceMappingURL=express.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts.map deleted file mode 100644 index 5f607a9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../../src/server/express.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,0BAA+B,GAAG,OAAO,CA0BrF"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js deleted file mode 100644 index 1d37a8d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createMcpExpressApp = createMcpExpressApp; -const express_1 = __importDefault(require("express")); -const hostHeaderValidation_js_1 = require("./middleware/hostHeaderValidation.js"); -/** - * Creates an Express application pre-configured for MCP servers. - * - * When the host is '127.0.0.1', 'localhost', or '::1' (the default is '127.0.0.1'), - * DNS rebinding protection middleware is automatically applied to protect against - * DNS rebinding attacks on localhost servers. - * - * @param options - Configuration options - * @returns A configured Express application - * - * @example - * ```typescript - * // Basic usage - defaults to 127.0.0.1 with DNS rebinding protection - * const app = createMcpExpressApp(); - * - * // Custom host - DNS rebinding protection only applied for localhost hosts - * const app = createMcpExpressApp({ host: '0.0.0.0' }); // No automatic DNS rebinding protection - * const app = createMcpExpressApp({ host: 'localhost' }); // DNS rebinding protection enabled - * - * // Custom allowed hosts for non-localhost binding - * const app = createMcpExpressApp({ host: '0.0.0.0', allowedHosts: ['myapp.local', 'localhost'] }); - * ``` - */ -function createMcpExpressApp(options = {}) { - const { host = '127.0.0.1', allowedHosts } = options; - const app = (0, express_1.default)(); - app.use(express_1.default.json()); - // If allowedHosts is explicitly provided, use that for validation - if (allowedHosts) { - app.use((0, hostHeaderValidation_js_1.hostHeaderValidation)(allowedHosts)); - } - else { - // Apply DNS rebinding protection automatically for localhost hosts - const localhostHosts = ['127.0.0.1', 'localhost', '::1']; - if (localhostHosts.includes(host)) { - app.use((0, hostHeaderValidation_js_1.localhostHostValidation)()); - } - else if (host === '0.0.0.0' || host === '::') { - // Warn when binding to all interfaces without DNS rebinding protection - // eslint-disable-next-line no-console - console.warn(`Warning: Server is binding to ${host} without DNS rebinding protection. ` + - 'Consider using the allowedHosts option to restrict allowed hosts, ' + - 'or use authentication to protect your server.'); - } - } - return app; -} -//# sourceMappingURL=express.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js.map deleted file mode 100644 index f15b40d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"express.js","sourceRoot":"","sources":["../../../src/server/express.ts"],"names":[],"mappings":";;;;;AA+CA,kDA0BC;AAzED,sDAA2C;AAC3C,kFAAqG;AAuBrG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,mBAAmB,CAAC,UAAsC,EAAE;IACxE,MAAM,EAAE,IAAI,GAAG,WAAW,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAErD,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;IACtB,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAExB,kEAAkE;IAClE,IAAI,YAAY,EAAE,CAAC;QACf,GAAG,CAAC,GAAG,CAAC,IAAA,8CAAoB,EAAC,YAAY,CAAC,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACJ,mEAAmE;QACnE,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,GAAG,CAAC,GAAG,CAAC,IAAA,iDAAuB,GAAE,CAAC,CAAC;QACvC,CAAC;aAAM,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC7C,uEAAuE;YACvE,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACR,iCAAiC,IAAI,qCAAqC;gBACtE,oEAAoE;gBACpE,+CAA+C,CACtD,CAAC;QACN,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts deleted file mode 100644 index cfa236e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { Protocol, type NotificationOptions, type ProtocolOptions, type RequestOptions } from '../shared/protocol.js'; -import { type ClientCapabilities, type CreateMessageRequest, type CreateMessageResult, type CreateMessageResultWithTools, type CreateMessageRequestParamsBase, type CreateMessageRequestParamsWithTools, type ElicitRequestFormParams, type ElicitRequestURLParams, type ElicitResult, type Implementation, type ListRootsRequest, type LoggingMessageNotification, type ResourceUpdatedNotification, type ServerCapabilities, type ServerNotification, type ServerRequest, type ServerResult, type Request, type Notification, type Result } from '../types.js'; -import type { jsonSchemaValidator } from '../validation/types.js'; -import { AnyObjectSchema, SchemaOutput } from './zod-compat.js'; -import { RequestHandlerExtra } from '../shared/protocol.js'; -import { ExperimentalServerTasks } from '../experimental/tasks/server.js'; -export type ServerOptions = ProtocolOptions & { - /** - * Capabilities to advertise as being supported by this server. - */ - capabilities?: ServerCapabilities; - /** - * Optional instructions describing how to use the server and its features. - */ - instructions?: string; - /** - * JSON Schema validator for elicitation response validation. - * - * The validator is used to validate user input returned from elicitation - * requests against the requested schema. - * - * @default AjvJsonSchemaValidator - * - * @example - * ```typescript - * // ajv (default) - * const server = new Server( - * { name: 'my-server', version: '1.0.0' }, - * { - * capabilities: {} - * jsonSchemaValidator: new AjvJsonSchemaValidator() - * } - * ); - * - * // @cfworker/json-schema - * const server = new Server( - * { name: 'my-server', version: '1.0.0' }, - * { - * capabilities: {}, - * jsonSchemaValidator: new CfWorkerJsonSchemaValidator() - * } - * ); - * ``` - */ - jsonSchemaValidator?: jsonSchemaValidator; -}; -/** - * An MCP server on top of a pluggable transport. - * - * This server will automatically respond to the initialization flow as initiated from the client. - * - * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: - * - * ```typescript - * // Custom schemas - * const CustomRequestSchema = RequestSchema.extend({...}) - * const CustomNotificationSchema = NotificationSchema.extend({...}) - * const CustomResultSchema = ResultSchema.extend({...}) - * - * // Type aliases - * type CustomRequest = z.infer - * type CustomNotification = z.infer - * type CustomResult = z.infer - * - * // Create typed server - * const server = new Server({ - * name: "CustomServer", - * version: "1.0.0" - * }) - * ``` - * @deprecated Use `McpServer` instead for the high-level API. Only use `Server` for advanced use cases. - */ -export declare class Server extends Protocol { - private _serverInfo; - private _clientCapabilities?; - private _clientVersion?; - private _capabilities; - private _instructions?; - private _jsonSchemaValidator; - private _experimental?; - /** - * Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification). - */ - oninitialized?: () => void; - /** - * Initializes this server with the given name and version information. - */ - constructor(_serverInfo: Implementation, options?: ServerOptions); - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental(): { - tasks: ExperimentalServerTasks; - }; - private _loggingLevels; - private readonly LOG_LEVEL_SEVERITY; - private isMessageIgnored; - /** - * Registers new capabilities. This can only be called before connecting to a transport. - * - * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). - */ - registerCapabilities(capabilities: ServerCapabilities): void; - /** - * Override request handler registration to enforce server-side validation for tools/call. - */ - setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => ServerResult | ResultT | Promise): void; - protected assertCapabilityForMethod(method: RequestT['method']): void; - protected assertNotificationCapability(method: (ServerNotification | NotificationT)['method']): void; - protected assertRequestHandlerCapability(method: string): void; - protected assertTaskCapability(method: string): void; - protected assertTaskHandlerCapability(method: string): void; - private _oninitialize; - /** - * After initialization has completed, this will be populated with the client's reported capabilities. - */ - getClientCapabilities(): ClientCapabilities | undefined; - /** - * After initialization has completed, this will be populated with information about the client's name and version. - */ - getClientVersion(): Implementation | undefined; - private getCapabilities; - ping(): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - /** - * Request LLM sampling from the client (without tools). - * Returns single content block for backwards compatibility. - */ - createMessage(params: CreateMessageRequestParamsBase, options?: RequestOptions): Promise; - /** - * Request LLM sampling from the client with tool support. - * Returns content that may be a single block or array (for parallel tool calls). - */ - createMessage(params: CreateMessageRequestParamsWithTools, options?: RequestOptions): Promise; - /** - * Request LLM sampling from the client. - * When tools may or may not be present, returns the union type. - */ - createMessage(params: CreateMessageRequest['params'], options?: RequestOptions): Promise; - /** - * Creates an elicitation request for the given parameters. - * For backwards compatibility, `mode` may be omitted for form requests and will default to `'form'`. - * @param params The parameters for the elicitation request. - * @param options Optional request options. - * @returns The result of the elicitation request. - */ - elicitInput(params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions): Promise; - /** - * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete` - * notification for the specified elicitation ID. - * - * @param elicitationId The ID of the elicitation to mark as complete. - * @param options Optional notification options. Useful when the completion notification should be related to a prior request. - * @returns A function that emits the completion notification when awaited. - */ - createElicitationCompletionNotifier(elicitationId: string, options?: NotificationOptions): () => Promise; - listRoots(params?: ListRootsRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - roots: { - uri: string; - name?: string | undefined; - _meta?: Record | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - /** - * Sends a logging message to the client, if connected. - * Note: You only need to send the parameters object, not the entire JSON RPC message - * @see LoggingMessageNotification - * @param params - * @param sessionId optional for stateless and backward compatibility - */ - sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise; - sendResourceUpdated(params: ResourceUpdatedNotification['params']): Promise; - sendResourceListChanged(): Promise; - sendToolListChanged(): Promise; - sendPromptListChanged(): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map deleted file mode 100644 index fe0fa65..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACzI,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,KAAK,4BAA4B,EAEjC,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAIjB,KAAK,cAAc,EAMnB,KAAK,gBAAgB,EAIrB,KAAK,0BAA0B,EAE/B,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EAQjB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,MAAM,EACd,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAkB,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EACH,eAAe,EAIf,YAAY,EAGf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAG1E,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC1C;;OAEG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAElC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC7C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;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C,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;IAI7E;;;;;;OAMG;IACG,kBAAkB,CAAC,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM;IAQnF,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC;IAOjE,uBAAuB;IAMvB,mBAAmB;IAInB,qBAAqB;CAG9B"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js deleted file mode 100644 index e183dd4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js +++ /dev/null @@ -1,444 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Server = void 0; -const protocol_js_1 = require("../shared/protocol.js"); -const types_js_1 = require("../types.js"); -const ajv_provider_js_1 = require("../validation/ajv-provider.js"); -const zod_compat_js_1 = require("./zod-compat.js"); -const server_js_1 = require("../experimental/tasks/server.js"); -const helpers_js_1 = require("../experimental/tasks/helpers.js"); -/** - * An MCP server on top of a pluggable transport. - * - * This server will automatically respond to the initialization flow as initiated from the client. - * - * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: - * - * ```typescript - * // Custom schemas - * const CustomRequestSchema = RequestSchema.extend({...}) - * const CustomNotificationSchema = NotificationSchema.extend({...}) - * const CustomResultSchema = ResultSchema.extend({...}) - * - * // Type aliases - * type CustomRequest = z.infer - * type CustomNotification = z.infer - * type CustomResult = z.infer - * - * // Create typed server - * const server = new Server({ - * name: "CustomServer", - * version: "1.0.0" - * }) - * ``` - * @deprecated Use `McpServer` instead for the high-level API. Only use `Server` for advanced use cases. - */ -class Server extends protocol_js_1.Protocol { - /** - * Initializes this server with the given name and version information. - */ - constructor(_serverInfo, options) { - super(options); - this._serverInfo = _serverInfo; - // Map log levels by session id - this._loggingLevels = new Map(); - // Map LogLevelSchema to severity index - this.LOG_LEVEL_SEVERITY = new Map(types_js_1.LoggingLevelSchema.options.map((level, index) => [level, index])); - // Is a message with the given level ignored in the log level set for the given session id? - this.isMessageIgnored = (level, sessionId) => { - const currentLevel = this._loggingLevels.get(sessionId); - return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false; - }; - this._capabilities = options?.capabilities ?? {}; - this._instructions = options?.instructions; - this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new ajv_provider_js_1.AjvJsonSchemaValidator(); - this.setRequestHandler(types_js_1.InitializeRequestSchema, request => this._oninitialize(request)); - this.setNotificationHandler(types_js_1.InitializedNotificationSchema, () => this.oninitialized?.()); - if (this._capabilities.logging) { - this.setRequestHandler(types_js_1.SetLevelRequestSchema, async (request, extra) => { - const transportSessionId = extra.sessionId || extra.requestInfo?.headers['mcp-session-id'] || undefined; - const { level } = request.params; - const parseResult = types_js_1.LoggingLevelSchema.safeParse(level); - if (parseResult.success) { - this._loggingLevels.set(transportSessionId, parseResult.data); - } - return {}; - }); - } - } - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental() { - if (!this._experimental) { - this._experimental = { - tasks: new server_js_1.ExperimentalServerTasks(this) - }; - } - return this._experimental; - } - /** - * Registers new capabilities. This can only be called before connecting to a transport. - * - * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). - */ - registerCapabilities(capabilities) { - if (this.transport) { - throw new Error('Cannot register capabilities after connecting to transport'); - } - this._capabilities = (0, protocol_js_1.mergeCapabilities)(this._capabilities, capabilities); - } - /** - * Override request handler registration to enforce server-side validation for tools/call. - */ - setRequestHandler(requestSchema, handler) { - const shape = (0, zod_compat_js_1.getObjectShape)(requestSchema); - const methodSchema = shape?.method; - if (!methodSchema) { - throw new Error('Schema is missing a method literal'); - } - // Extract literal value using type-safe property access - let methodValue; - if ((0, zod_compat_js_1.isZ4Schema)(methodSchema)) { - const v4Schema = methodSchema; - const v4Def = v4Schema._zod?.def; - methodValue = v4Def?.value ?? v4Schema.value; - } - else { - const v3Schema = methodSchema; - const legacyDef = v3Schema._def; - methodValue = legacyDef?.value ?? v3Schema.value; - } - if (typeof methodValue !== 'string') { - throw new Error('Schema method literal must be a string'); - } - const method = methodValue; - if (method === 'tools/call') { - const wrappedHandler = async (request, extra) => { - const validatedRequest = (0, zod_compat_js_1.safeParse)(types_js_1.CallToolRequestSchema, request); - if (!validatedRequest.success) { - const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid tools/call request: ${errorMessage}`); - } - const { params } = validatedRequest.data; - const result = await Promise.resolve(handler(request, extra)); - // When task creation is requested, validate and return CreateTaskResult - if (params.task) { - const taskValidationResult = (0, zod_compat_js_1.safeParse)(types_js_1.CreateTaskResultSchema, result); - if (!taskValidationResult.success) { - const errorMessage = taskValidationResult.error instanceof Error - ? taskValidationResult.error.message - : String(taskValidationResult.error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`); - } - return taskValidationResult.data; - } - // For non-task requests, validate against CallToolResultSchema - const validationResult = (0, zod_compat_js_1.safeParse)(types_js_1.CallToolResultSchema, result); - if (!validationResult.success) { - const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid tools/call result: ${errorMessage}`); - } - return validationResult.data; - }; - // Install the wrapped handler - return super.setRequestHandler(requestSchema, wrappedHandler); - } - // Other handlers use default behavior - return super.setRequestHandler(requestSchema, handler); - } - assertCapabilityForMethod(method) { - switch (method) { - case 'sampling/createMessage': - if (!this._clientCapabilities?.sampling) { - throw new Error(`Client does not support sampling (required for ${method})`); - } - break; - case 'elicitation/create': - if (!this._clientCapabilities?.elicitation) { - throw new Error(`Client does not support elicitation (required for ${method})`); - } - break; - case 'roots/list': - if (!this._clientCapabilities?.roots) { - throw new Error(`Client does not support listing roots (required for ${method})`); - } - break; - case 'ping': - // No specific capability required for ping - break; - } - } - assertNotificationCapability(method) { - switch (method) { - case 'notifications/message': - if (!this._capabilities.logging) { - throw new Error(`Server does not support logging (required for ${method})`); - } - break; - case 'notifications/resources/updated': - case 'notifications/resources/list_changed': - if (!this._capabilities.resources) { - throw new Error(`Server does not support notifying about resources (required for ${method})`); - } - break; - case 'notifications/tools/list_changed': - if (!this._capabilities.tools) { - throw new Error(`Server does not support notifying of tool list changes (required for ${method})`); - } - break; - case 'notifications/prompts/list_changed': - if (!this._capabilities.prompts) { - throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`); - } - break; - case 'notifications/elicitation/complete': - if (!this._clientCapabilities?.elicitation?.url) { - throw new Error(`Client does not support URL elicitation (required for ${method})`); - } - break; - case 'notifications/cancelled': - // Cancellation notifications are always allowed - break; - case 'notifications/progress': - // Progress notifications are always allowed - break; - } - } - assertRequestHandlerCapability(method) { - // Task handlers are registered in Protocol constructor before _capabilities is initialized - // Skip capability check for task methods during initialization - if (!this._capabilities) { - return; - } - switch (method) { - case 'completion/complete': - if (!this._capabilities.completions) { - throw new Error(`Server does not support completions (required for ${method})`); - } - break; - case 'logging/setLevel': - if (!this._capabilities.logging) { - throw new Error(`Server does not support logging (required for ${method})`); - } - break; - case 'prompts/get': - case 'prompts/list': - if (!this._capabilities.prompts) { - throw new Error(`Server does not support prompts (required for ${method})`); - } - break; - case 'resources/list': - case 'resources/templates/list': - case 'resources/read': - if (!this._capabilities.resources) { - throw new Error(`Server does not support resources (required for ${method})`); - } - break; - case 'tools/call': - case 'tools/list': - if (!this._capabilities.tools) { - throw new Error(`Server does not support tools (required for ${method})`); - } - break; - case 'tasks/get': - case 'tasks/list': - case 'tasks/result': - case 'tasks/cancel': - if (!this._capabilities.tasks) { - throw new Error(`Server does not support tasks capability (required for ${method})`); - } - break; - case 'ping': - case 'initialize': - // No specific capability required for these methods - break; - } - } - assertTaskCapability(method) { - (0, helpers_js_1.assertClientRequestTaskCapability)(this._clientCapabilities?.tasks?.requests, method, 'Client'); - } - assertTaskHandlerCapability(method) { - // Task handlers are registered in Protocol constructor before _capabilities is initialized - // Skip capability check for task methods during initialization - if (!this._capabilities) { - return; - } - (0, helpers_js_1.assertToolsCallTaskCapability)(this._capabilities.tasks?.requests, method, 'Server'); - } - async _oninitialize(request) { - const requestedVersion = request.params.protocolVersion; - this._clientCapabilities = request.params.capabilities; - this._clientVersion = request.params.clientInfo; - const protocolVersion = types_js_1.SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) ? requestedVersion : types_js_1.LATEST_PROTOCOL_VERSION; - return { - protocolVersion, - capabilities: this.getCapabilities(), - serverInfo: this._serverInfo, - ...(this._instructions && { instructions: this._instructions }) - }; - } - /** - * After initialization has completed, this will be populated with the client's reported capabilities. - */ - getClientCapabilities() { - return this._clientCapabilities; - } - /** - * After initialization has completed, this will be populated with information about the client's name and version. - */ - getClientVersion() { - return this._clientVersion; - } - getCapabilities() { - return this._capabilities; - } - async ping() { - return this.request({ method: 'ping' }, types_js_1.EmptyResultSchema); - } - // Implementation - async createMessage(params, options) { - // Capability check - only required when tools/toolChoice are provided - if (params.tools || params.toolChoice) { - if (!this._clientCapabilities?.sampling?.tools) { - throw new Error('Client does not support sampling tools capability.'); - } - } - // Message structure validation - always validate tool_use/tool_result pairs. - // These may appear even without tools/toolChoice in the current request when - // a previous sampling request returned tool_use and this is a follow-up with results. - if (params.messages.length > 0) { - const lastMessage = params.messages[params.messages.length - 1]; - const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content]; - const hasToolResults = lastContent.some(c => c.type === 'tool_result'); - const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined; - const previousContent = previousMessage - ? Array.isArray(previousMessage.content) - ? previousMessage.content - : [previousMessage.content] - : []; - const hasPreviousToolUse = previousContent.some(c => c.type === 'tool_use'); - if (hasToolResults) { - if (lastContent.some(c => c.type !== 'tool_result')) { - throw new Error('The last message must contain only tool_result content if any is present'); - } - if (!hasPreviousToolUse) { - throw new Error('tool_result blocks are not matching any tool_use from the previous message'); - } - } - if (hasPreviousToolUse) { - const toolUseIds = new Set(previousContent.filter(c => c.type === 'tool_use').map(c => c.id)); - const toolResultIds = new Set(lastContent.filter(c => c.type === 'tool_result').map(c => c.toolUseId)); - if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every(id => toolResultIds.has(id))) { - throw new Error('ids of tool_result blocks and tool_use blocks from previous message do not match'); - } - } - } - // Use different schemas based on whether tools are provided - if (params.tools) { - return this.request({ method: 'sampling/createMessage', params }, types_js_1.CreateMessageResultWithToolsSchema, options); - } - return this.request({ method: 'sampling/createMessage', params }, types_js_1.CreateMessageResultSchema, options); - } - /** - * Creates an elicitation request for the given parameters. - * For backwards compatibility, `mode` may be omitted for form requests and will default to `'form'`. - * @param params The parameters for the elicitation request. - * @param options Optional request options. - * @returns The result of the elicitation request. - */ - async elicitInput(params, options) { - const mode = (params.mode ?? 'form'); - switch (mode) { - case 'url': { - if (!this._clientCapabilities?.elicitation?.url) { - throw new Error('Client does not support url elicitation.'); - } - const urlParams = params; - return this.request({ method: 'elicitation/create', params: urlParams }, types_js_1.ElicitResultSchema, options); - } - case 'form': { - if (!this._clientCapabilities?.elicitation?.form) { - throw new Error('Client does not support form elicitation.'); - } - const formParams = params.mode === 'form' ? params : { ...params, mode: 'form' }; - const result = await this.request({ method: 'elicitation/create', params: formParams }, types_js_1.ElicitResultSchema, options); - if (result.action === 'accept' && result.content && formParams.requestedSchema) { - try { - const validator = this._jsonSchemaValidator.getValidator(formParams.requestedSchema); - const validationResult = validator(result.content); - if (!validationResult.valid) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`); - } - } - catch (error) { - if (error instanceof types_js_1.McpError) { - throw error; - } - throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Error validating elicitation response: ${error instanceof Error ? error.message : String(error)}`); - } - } - return result; - } - } - } - /** - * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete` - * notification for the specified elicitation ID. - * - * @param elicitationId The ID of the elicitation to mark as complete. - * @param options Optional notification options. Useful when the completion notification should be related to a prior request. - * @returns A function that emits the completion notification when awaited. - */ - createElicitationCompletionNotifier(elicitationId, options) { - if (!this._clientCapabilities?.elicitation?.url) { - throw new Error('Client does not support URL elicitation (required for notifications/elicitation/complete)'); - } - return () => this.notification({ - method: 'notifications/elicitation/complete', - params: { - elicitationId - } - }, options); - } - async listRoots(params, options) { - return this.request({ method: 'roots/list', params }, types_js_1.ListRootsResultSchema, options); - } - /** - * Sends a logging message to the client, if connected. - * Note: You only need to send the parameters object, not the entire JSON RPC message - * @see LoggingMessageNotification - * @param params - * @param sessionId optional for stateless and backward compatibility - */ - async sendLoggingMessage(params, sessionId) { - if (this._capabilities.logging) { - if (!this.isMessageIgnored(params.level, sessionId)) { - return this.notification({ method: 'notifications/message', params }); - } - } - } - async sendResourceUpdated(params) { - return this.notification({ - method: 'notifications/resources/updated', - params - }); - } - async sendResourceListChanged() { - return this.notification({ - method: 'notifications/resources/list_changed' - }); - } - async sendToolListChanged() { - return this.notification({ method: 'notifications/tools/list_changed' }); - } - async sendPromptListChanged() { - return this.notification({ method: 'notifications/prompts/list_changed' }); - } -} -exports.Server = Server; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map deleted file mode 100644 index 32ed405..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":";;;AAAA,uDAAyI;AACzI,0CA0CqB;AACrB,mEAAuE;AAEvE,mDAQyB;AAEzB,+DAA0E;AAC1E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M,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;gBAClD,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,EAAE,CAAC,CAAC;YAC1E,CAAC;QACL,CAAC;IACL,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,MAA6C;QACnE,OAAO,IAAI,CAAC,YAAY,CAAC;YACrB,MAAM,EAAE,iCAAiC;YACzC,MAAM;SACT,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,uBAAuB;QACzB,OAAO,IAAI,CAAC,YAAY,CAAC;YACrB,MAAM,EAAE,sCAAsC;SACjD,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,mBAAmB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,qBAAqB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ;AA5hBD,wBA4hBC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts deleted file mode 100644 index 1bc0c68..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts +++ /dev/null @@ -1,364 +0,0 @@ -import { Server, ServerOptions } from './index.js'; -import { AnySchema, AnyObjectSchema, ZodRawShapeCompat, SchemaOutput, ShapeOutput } from './zod-compat.js'; -import { Implementation, CallToolResult, Resource, ListResourcesResult, GetPromptResult, ReadResourceResult, ServerRequest, ServerNotification, ToolAnnotations, LoggingMessageNotification, Result, ToolExecution } from '../types.js'; -import { UriTemplate, Variables } from '../shared/uriTemplate.js'; -import { RequestHandlerExtra } from '../shared/protocol.js'; -import { Transport } from '../shared/transport.js'; -import { ExperimentalMcpServerTasks } from '../experimental/tasks/mcp-server.js'; -import type { ToolTaskHandler } from '../experimental/tasks/interfaces.js'; -/** - * High-level MCP server that provides a simpler API for working with resources, tools, and prompts. - * For advanced usage (like sending notifications or setting custom request handlers), use the underlying - * Server instance available via the `server` property. - */ -export declare class McpServer { - /** - * The underlying Server instance, useful for advanced operations like sending notifications. - */ - readonly server: Server; - private _registeredResources; - private _registeredResourceTemplates; - private _registeredTools; - private _registeredPrompts; - private _experimental?; - constructor(serverInfo: Implementation, options?: ServerOptions); - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental(): { - tasks: ExperimentalMcpServerTasks; - }; - /** - * Attaches to the given transport, starts it, and starts listening for messages. - * - * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. - */ - connect(transport: Transport): Promise; - /** - * Closes the connection. - */ - close(): Promise; - private _toolHandlersInitialized; - private setToolRequestHandlers; - /** - * Creates a tool error result. - * - * @param errorMessage - The error message. - * @returns The tool error result. - */ - private createToolError; - /** - * Validates tool input arguments against the tool's input schema. - */ - private validateToolInput; - /** - * Validates tool output against the tool's output schema. - */ - private validateToolOutput; - /** - * Executes a tool handler (either regular or task-based). - */ - private executeToolHandler; - /** - * Handles automatic task polling for tools with taskSupport 'optional'. - */ - private handleAutomaticTaskPolling; - private _completionHandlerInitialized; - private setCompletionRequestHandler; - private handlePromptCompletion; - private handleResourceCompletion; - private _resourceHandlersInitialized; - private setResourceRequestHandlers; - private _promptHandlersInitialized; - private setPromptRequestHandlers; - /** - * Registers a resource `name` at a fixed URI, which will use the given callback to respond to read requests. - * @deprecated Use `registerResource` instead. - */ - resource(name: string, uri: string, readCallback: ReadResourceCallback): RegisteredResource; - /** - * Registers a resource `name` at a fixed URI with metadata, which will use the given callback to respond to read requests. - * @deprecated Use `registerResource` instead. - */ - resource(name: string, uri: string, metadata: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource; - /** - * Registers a resource `name` with a template pattern, which will use the given callback to respond to read requests. - * @deprecated Use `registerResource` instead. - */ - resource(name: string, template: ResourceTemplate, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; - /** - * Registers a resource `name` with a template pattern and metadata, which will use the given callback to respond to read requests. - * @deprecated Use `registerResource` instead. - */ - resource(name: string, template: ResourceTemplate, metadata: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; - /** - * Registers a resource with a config object and callback. - * For static resources, use a URI string. For dynamic resources, use a ResourceTemplate. - */ - registerResource(name: string, uriOrTemplate: string, config: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource; - registerResource(name: string, uriOrTemplate: ResourceTemplate, config: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; - private _createRegisteredResource; - private _createRegisteredResourceTemplate; - private _createRegisteredPrompt; - private _createRegisteredTool; - /** - * Registers a zero-argument tool `name`, which will run the given function when the client calls it. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, cb: ToolCallback): RegisteredTool; - /** - * Registers a zero-argument tool `name` (with a description) which will run the given function when the client calls it. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, description: string, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool taking either a parameter schema for validation or annotations for additional metadata. - * This unified overload handles both `tool(name, paramsSchema, cb)` and `tool(name, annotations, cb)` cases. - * - * Note: We use a union type for the second parameter because TypeScript cannot reliably disambiguate - * between ToolAnnotations and ZodRawShapeCompat during overload resolution, as both are plain object types. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool `name` (with a description) taking either parameter schema or annotations. - * This unified overload handles both `tool(name, description, paramsSchema, cb)` and - * `tool(name, description, annotations, cb)` cases. - * - * Note: We use a union type for the third parameter because TypeScript cannot reliably disambiguate - * between ToolAnnotations and ZodRawShapeCompat during overload resolution, as both are plain object types. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, description: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool with both parameter schema and annotations. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool with description, parameter schema, and annotations. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, description: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool with a config object and callback. - */ - registerTool(name: string, config: { - title?: string; - description?: string; - inputSchema?: InputArgs; - outputSchema?: OutputArgs; - annotations?: ToolAnnotations; - _meta?: Record; - }, cb: ToolCallback): RegisteredTool; - /** - * Registers a zero-argument prompt `name`, which will run the given function when the client calls it. - * @deprecated Use `registerPrompt` instead. - */ - prompt(name: string, cb: PromptCallback): RegisteredPrompt; - /** - * Registers a zero-argument prompt `name` (with a description) which will run the given function when the client calls it. - * @deprecated Use `registerPrompt` instead. - */ - prompt(name: string, description: string, cb: PromptCallback): RegisteredPrompt; - /** - * Registers a prompt `name` accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. - * @deprecated Use `registerPrompt` instead. - */ - prompt(name: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; - /** - * Registers a prompt `name` (with a description) accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. - * @deprecated Use `registerPrompt` instead. - */ - prompt(name: string, description: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; - /** - * Registers a prompt with a config object and callback. - */ - registerPrompt(name: string, config: { - title?: string; - description?: string; - argsSchema?: Args; - }, cb: PromptCallback): RegisteredPrompt; - /** - * Checks if the server is connected to a transport. - * @returns True if the server is connected - */ - isConnected(): boolean; - /** - * Sends a logging message to the client, if connected. - * Note: You only need to send the parameters object, not the entire JSON RPC message - * @see LoggingMessageNotification - * @param params - * @param sessionId optional for stateless and backward compatibility - */ - sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise; - /** - * Sends a resource list changed event to the client, if connected. - */ - sendResourceListChanged(): void; - /** - * Sends a tool list changed event to the client, if connected. - */ - sendToolListChanged(): void; - /** - * Sends a prompt list changed event to the client, if connected. - */ - sendPromptListChanged(): void; -} -/** - * A callback to complete one variable within a resource template's URI template. - */ -export type CompleteResourceTemplateCallback = (value: string, context?: { - arguments?: Record; -}) => string[] | Promise; -/** - * A resource template combines a URI pattern with optional functionality to enumerate - * all resources matching that pattern. - */ -export declare class ResourceTemplate { - private _callbacks; - private _uriTemplate; - constructor(uriTemplate: string | UriTemplate, _callbacks: { - /** - * A callback to list all resources matching this template. This is required to specified, even if `undefined`, to avoid accidentally forgetting resource listing. - */ - list: ListResourcesCallback | undefined; - /** - * An optional callback to autocomplete variables within the URI template. Useful for clients and users to discover possible values. - */ - complete?: { - [variable: string]: CompleteResourceTemplateCallback; - }; - }); - /** - * Gets the URI template pattern. - */ - get uriTemplate(): UriTemplate; - /** - * Gets the list callback, if one was provided. - */ - get listCallback(): ListResourcesCallback | undefined; - /** - * Gets the callback for completing a specific URI template variable, if one was provided. - */ - completeCallback(variable: string): CompleteResourceTemplateCallback | undefined; -} -export type BaseToolCallback, Args extends undefined | ZodRawShapeCompat | AnySchema> = Args extends ZodRawShapeCompat ? (args: ShapeOutput, extra: Extra) => SendResultT | Promise : Args extends AnySchema ? (args: SchemaOutput, extra: Extra) => SendResultT | Promise : (extra: Extra) => SendResultT | Promise; -/** - * Callback for a tool handler registered with Server.tool(). - * - * Parameters will include tool arguments, if applicable, as well as other request handler context. - * - * The callback should return: - * - `structuredContent` if the tool has an outputSchema defined - * - `content` if the tool does not have an outputSchema - * - Both fields are optional but typically one should be provided - */ -export type ToolCallback = BaseToolCallback, Args>; -/** - * Supertype that can handle both regular tools (simple callback) and task-based tools (task handler object). - */ -export type AnyToolHandler = ToolCallback | ToolTaskHandler; -export type RegisteredTool = { - title?: string; - description?: string; - inputSchema?: AnySchema; - outputSchema?: AnySchema; - annotations?: ToolAnnotations; - execution?: ToolExecution; - _meta?: Record; - handler: AnyToolHandler; - enabled: boolean; - enable(): void; - disable(): void; - update(updates: { - name?: string | null; - title?: string; - description?: string; - paramsSchema?: InputArgs; - outputSchema?: OutputArgs; - annotations?: ToolAnnotations; - _meta?: Record; - callback?: ToolCallback; - enabled?: boolean; - }): void; - remove(): void; -}; -/** - * Additional, optional information for annotating a resource. - */ -export type ResourceMetadata = Omit; -/** - * Callback to list all resources matching a given template. - */ -export type ListResourcesCallback = (extra: RequestHandlerExtra) => ListResourcesResult | Promise; -/** - * Callback to read a resource at a given URI. - */ -export type ReadResourceCallback = (uri: URL, extra: RequestHandlerExtra) => ReadResourceResult | Promise; -export type RegisteredResource = { - name: string; - title?: string; - metadata?: ResourceMetadata; - readCallback: ReadResourceCallback; - enabled: boolean; - enable(): void; - disable(): void; - update(updates: { - name?: string; - title?: string; - uri?: string | null; - metadata?: ResourceMetadata; - callback?: ReadResourceCallback; - enabled?: boolean; - }): void; - remove(): void; -}; -/** - * Callback to read a resource at a given URI, following a filled-in URI template. - */ -export type ReadResourceTemplateCallback = (uri: URL, variables: Variables, extra: RequestHandlerExtra) => ReadResourceResult | Promise; -export type RegisteredResourceTemplate = { - resourceTemplate: ResourceTemplate; - title?: string; - metadata?: ResourceMetadata; - readCallback: ReadResourceTemplateCallback; - enabled: boolean; - enable(): void; - disable(): void; - update(updates: { - name?: string | null; - title?: string; - template?: ResourceTemplate; - metadata?: ResourceMetadata; - callback?: ReadResourceTemplateCallback; - enabled?: boolean; - }): void; - remove(): void; -}; -type PromptArgsRawShape = ZodRawShapeCompat; -export type PromptCallback = Args extends PromptArgsRawShape ? (args: ShapeOutput, extra: RequestHandlerExtra) => GetPromptResult | Promise : (extra: RequestHandlerExtra) => GetPromptResult | Promise; -export type RegisteredPrompt = { - title?: string; - description?: string; - argsSchema?: AnyObjectSchema; - callback: PromptCallback; - enabled: boolean; - enable(): void; - disable(): void; - update(updates: { - name?: string | null; - title?: string; - description?: string; - argsSchema?: Args; - callback?: PromptCallback; - enabled?: boolean; - }): void; - remove(): void; -}; -export {}; -//# sourceMappingURL=mcp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts.map deleted file mode 100644 index 0b460bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/server/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EACH,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,WAAW,EASd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACH,cAAc,EAGd,cAAc,EAOd,QAAQ,EACR,mBAAmB,EAYnB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,0BAA0B,EAE1B,MAAM,EAMN,aAAa,EAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAG3E;;;;GAIG;AACH,qBAAa,SAAS;IAClB;;OAEG;IACH,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,oBAAoB,CAA6C;IACzE,OAAO,CAAC,4BAA4B,CAE7B;IACP,OAAO,CAAC,gBAAgB,CAA0C;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AI,CAAC;CAClB,CAAC;AAEF,KAAK,kBAAkB,GAAG,iBAAiB,CAAC;AAE5C,MAAM,MAAM,cAAc,CAAC,IAAI,SAAS,SAAS,GAAG,kBAAkB,GAAG,SAAS,IAAI,IAAI,SAAS,kBAAkB,GAC/G,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,KAAK,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,GACtI,CAAC,KAAK,EAAE,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,KAAK,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEpH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,QAAQ,EAAE,cAAc,CAAC,SAAS,GAAG,kBAAkB,CAAC,CAAC;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,MAAM,CAAC,IAAI,SAAS,kBAAkB,EAAE,OAAO,EAAE;QAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,IAAI,CAAC;QAClB,QAAQ,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,GAAG,IAAI,CAAC;IACT,MAAM,IAAI,IAAI,CAAC;CAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js deleted file mode 100644 index e10bb3d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js +++ /dev/null @@ -1,918 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResourceTemplate = exports.McpServer = void 0; -const index_js_1 = require("./index.js"); -const zod_compat_js_1 = require("./zod-compat.js"); -const zod_json_schema_compat_js_1 = require("./zod-json-schema-compat.js"); -const types_js_1 = require("../types.js"); -const completable_js_1 = require("./completable.js"); -const uriTemplate_js_1 = require("../shared/uriTemplate.js"); -const toolNameValidation_js_1 = require("../shared/toolNameValidation.js"); -const mcp_server_js_1 = require("../experimental/tasks/mcp-server.js"); -const zod_1 = require("zod"); -/** - * High-level MCP server that provides a simpler API for working with resources, tools, and prompts. - * For advanced usage (like sending notifications or setting custom request handlers), use the underlying - * Server instance available via the `server` property. - */ -class McpServer { - constructor(serverInfo, options) { - this._registeredResources = {}; - this._registeredResourceTemplates = {}; - this._registeredTools = {}; - this._registeredPrompts = {}; - this._toolHandlersInitialized = false; - this._completionHandlerInitialized = false; - this._resourceHandlersInitialized = false; - this._promptHandlersInitialized = false; - this.server = new index_js_1.Server(serverInfo, options); - } - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental() { - if (!this._experimental) { - this._experimental = { - tasks: new mcp_server_js_1.ExperimentalMcpServerTasks(this) - }; - } - return this._experimental; - } - /** - * Attaches to the given transport, starts it, and starts listening for messages. - * - * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. - */ - async connect(transport) { - return await this.server.connect(transport); - } - /** - * Closes the connection. - */ - async close() { - await this.server.close(); - } - setToolRequestHandlers() { - if (this._toolHandlersInitialized) { - return; - } - this.server.assertCanSetRequestHandler(getMethodValue(types_js_1.ListToolsRequestSchema)); - this.server.assertCanSetRequestHandler(getMethodValue(types_js_1.CallToolRequestSchema)); - this.server.registerCapabilities({ - tools: { - listChanged: true - } - }); - this.server.setRequestHandler(types_js_1.ListToolsRequestSchema, () => ({ - tools: Object.entries(this._registeredTools) - .filter(([, tool]) => tool.enabled) - .map(([name, tool]) => { - const toolDefinition = { - name, - title: tool.title, - description: tool.description, - inputSchema: (() => { - const obj = (0, zod_compat_js_1.normalizeObjectSchema)(tool.inputSchema); - return obj - ? (0, zod_json_schema_compat_js_1.toJsonSchemaCompat)(obj, { - strictUnions: true, - pipeStrategy: 'input' - }) - : EMPTY_OBJECT_JSON_SCHEMA; - })(), - annotations: tool.annotations, - execution: tool.execution, - _meta: tool._meta - }; - if (tool.outputSchema) { - const obj = (0, zod_compat_js_1.normalizeObjectSchema)(tool.outputSchema); - if (obj) { - toolDefinition.outputSchema = (0, zod_json_schema_compat_js_1.toJsonSchemaCompat)(obj, { - strictUnions: true, - pipeStrategy: 'output' - }); - } - } - return toolDefinition; - }) - })); - this.server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request, extra) => { - try { - const tool = this._registeredTools[request.params.name]; - if (!tool) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Tool ${request.params.name} not found`); - } - if (!tool.enabled) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`); - } - const isTaskRequest = !!request.params.task; - const taskSupport = tool.execution?.taskSupport; - const isTaskHandler = 'createTask' in tool.handler; - // Validate task hint configuration - if ((taskSupport === 'required' || taskSupport === 'optional') && !isTaskHandler) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Tool ${request.params.name} has taskSupport '${taskSupport}' but was not registered with registerToolTask`); - } - // Handle taskSupport 'required' without task augmentation - if (taskSupport === 'required' && !isTaskRequest) { - throw new types_js_1.McpError(types_js_1.ErrorCode.MethodNotFound, `Tool ${request.params.name} requires task augmentation (taskSupport: 'required')`); - } - // Handle taskSupport 'optional' without task augmentation - automatic polling - if (taskSupport === 'optional' && !isTaskRequest && isTaskHandler) { - return await this.handleAutomaticTaskPolling(tool, request, extra); - } - // Normal execution path - const args = await this.validateToolInput(tool, request.params.arguments, request.params.name); - const result = await this.executeToolHandler(tool, args, extra); - // Return CreateTaskResult immediately for task requests - if (isTaskRequest) { - return result; - } - // Validate output schema for non-task requests - await this.validateToolOutput(tool, result, request.params.name); - return result; - } - catch (error) { - if (error instanceof types_js_1.McpError) { - if (error.code === types_js_1.ErrorCode.UrlElicitationRequired) { - throw error; // Return the error to the caller without wrapping in CallToolResult - } - } - return this.createToolError(error instanceof Error ? error.message : String(error)); - } - }); - this._toolHandlersInitialized = true; - } - /** - * Creates a tool error result. - * - * @param errorMessage - The error message. - * @returns The tool error result. - */ - createToolError(errorMessage) { - return { - content: [ - { - type: 'text', - text: errorMessage - } - ], - isError: true - }; - } - /** - * Validates tool input arguments against the tool's input schema. - */ - async validateToolInput(tool, args, toolName) { - if (!tool.inputSchema) { - return undefined; - } - // Try to normalize to object schema first (for raw shapes and object schemas) - // If that fails, use the schema directly (for union/intersection/etc) - const inputObj = (0, zod_compat_js_1.normalizeObjectSchema)(tool.inputSchema); - const schemaToParse = inputObj ?? tool.inputSchema; - const parseResult = await (0, zod_compat_js_1.safeParseAsync)(schemaToParse, args); - if (!parseResult.success) { - const error = 'error' in parseResult ? parseResult.error : 'Unknown error'; - const errorMessage = (0, zod_compat_js_1.getParseErrorMessage)(error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${errorMessage}`); - } - return parseResult.data; - } - /** - * Validates tool output against the tool's output schema. - */ - async validateToolOutput(tool, result, toolName) { - if (!tool.outputSchema) { - return; - } - // Only validate CallToolResult, not CreateTaskResult - if (!('content' in result)) { - return; - } - if (result.isError) { - return; - } - if (!result.structuredContent) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Output validation error: Tool ${toolName} has an output schema but no structured content was provided`); - } - // if the tool has an output schema, validate structured content - const outputObj = (0, zod_compat_js_1.normalizeObjectSchema)(tool.outputSchema); - const parseResult = await (0, zod_compat_js_1.safeParseAsync)(outputObj, result.structuredContent); - if (!parseResult.success) { - const error = 'error' in parseResult ? parseResult.error : 'Unknown error'; - const errorMessage = (0, zod_compat_js_1.getParseErrorMessage)(error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${errorMessage}`); - } - } - /** - * Executes a tool handler (either regular or task-based). - */ - async executeToolHandler(tool, args, extra) { - const handler = tool.handler; - const isTaskHandler = 'createTask' in handler; - if (isTaskHandler) { - if (!extra.taskStore) { - throw new Error('No task store provided.'); - } - const taskExtra = { ...extra, taskStore: extra.taskStore }; - if (tool.inputSchema) { - const typedHandler = handler; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(typedHandler.createTask(args, taskExtra)); - } - else { - const typedHandler = handler; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(typedHandler.createTask(taskExtra)); - } - } - if (tool.inputSchema) { - const typedHandler = handler; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(typedHandler(args, extra)); - } - else { - const typedHandler = handler; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(typedHandler(extra)); - } - } - /** - * Handles automatic task polling for tools with taskSupport 'optional'. - */ - async handleAutomaticTaskPolling(tool, request, extra) { - if (!extra.taskStore) { - throw new Error('No task store provided for task-capable tool.'); - } - // Validate input and create task - const args = await this.validateToolInput(tool, request.params.arguments, request.params.name); - const handler = tool.handler; - const taskExtra = { ...extra, taskStore: extra.taskStore }; - const createTaskResult = args // undefined only if tool.inputSchema is undefined - ? await Promise.resolve(handler.createTask(args, taskExtra)) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - await Promise.resolve(handler.createTask(taskExtra)); - // Poll until completion - const taskId = createTaskResult.task.taskId; - let task = createTaskResult.task; - const pollInterval = task.pollInterval ?? 5000; - while (task.status !== 'completed' && task.status !== 'failed' && task.status !== 'cancelled') { - await new Promise(resolve => setTimeout(resolve, pollInterval)); - const updatedTask = await extra.taskStore.getTask(taskId); - if (!updatedTask) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Task ${taskId} not found during polling`); - } - task = updatedTask; - } - // Return the final result - return (await extra.taskStore.getTaskResult(taskId)); - } - setCompletionRequestHandler() { - if (this._completionHandlerInitialized) { - return; - } - this.server.assertCanSetRequestHandler(getMethodValue(types_js_1.CompleteRequestSchema)); - this.server.registerCapabilities({ - completions: {} - }); - this.server.setRequestHandler(types_js_1.CompleteRequestSchema, async (request) => { - switch (request.params.ref.type) { - case 'ref/prompt': - (0, types_js_1.assertCompleteRequestPrompt)(request); - return this.handlePromptCompletion(request, request.params.ref); - case 'ref/resource': - (0, types_js_1.assertCompleteRequestResourceTemplate)(request); - return this.handleResourceCompletion(request, request.params.ref); - default: - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`); - } - }); - this._completionHandlerInitialized = true; - } - async handlePromptCompletion(request, ref) { - const prompt = this._registeredPrompts[ref.name]; - if (!prompt) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Prompt ${ref.name} not found`); - } - if (!prompt.enabled) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Prompt ${ref.name} disabled`); - } - if (!prompt.argsSchema) { - return EMPTY_COMPLETION_RESULT; - } - const promptShape = (0, zod_compat_js_1.getObjectShape)(prompt.argsSchema); - const field = promptShape?.[request.params.argument.name]; - if (!(0, completable_js_1.isCompletable)(field)) { - return EMPTY_COMPLETION_RESULT; - } - const completer = (0, completable_js_1.getCompleter)(field); - if (!completer) { - return EMPTY_COMPLETION_RESULT; - } - const suggestions = await completer(request.params.argument.value, request.params.context); - return createCompletionResult(suggestions); - } - async handleResourceCompletion(request, ref) { - const template = Object.values(this._registeredResourceTemplates).find(t => t.resourceTemplate.uriTemplate.toString() === ref.uri); - if (!template) { - if (this._registeredResources[ref.uri]) { - // Attempting to autocomplete a fixed resource URI is not an error in the spec (but probably should be). - return EMPTY_COMPLETION_RESULT; - } - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`); - } - const completer = template.resourceTemplate.completeCallback(request.params.argument.name); - if (!completer) { - return EMPTY_COMPLETION_RESULT; - } - const suggestions = await completer(request.params.argument.value, request.params.context); - return createCompletionResult(suggestions); - } - setResourceRequestHandlers() { - if (this._resourceHandlersInitialized) { - return; - } - this.server.assertCanSetRequestHandler(getMethodValue(types_js_1.ListResourcesRequestSchema)); - this.server.assertCanSetRequestHandler(getMethodValue(types_js_1.ListResourceTemplatesRequestSchema)); - this.server.assertCanSetRequestHandler(getMethodValue(types_js_1.ReadResourceRequestSchema)); - this.server.registerCapabilities({ - resources: { - listChanged: true - } - }); - this.server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async (request, extra) => { - const resources = Object.entries(this._registeredResources) - .filter(([_, resource]) => resource.enabled) - .map(([uri, resource]) => ({ - uri, - name: resource.name, - ...resource.metadata - })); - const templateResources = []; - for (const template of Object.values(this._registeredResourceTemplates)) { - if (!template.resourceTemplate.listCallback) { - continue; - } - const result = await template.resourceTemplate.listCallback(extra); - for (const resource of result.resources) { - templateResources.push({ - ...template.metadata, - // the defined resource metadata should override the template metadata if present - ...resource - }); - } - } - return { resources: [...resources, ...templateResources] }; - }); - this.server.setRequestHandler(types_js_1.ListResourceTemplatesRequestSchema, async () => { - const resourceTemplates = Object.entries(this._registeredResourceTemplates).map(([name, template]) => ({ - name, - uriTemplate: template.resourceTemplate.uriTemplate.toString(), - ...template.metadata - })); - return { resourceTemplates }; - }); - this.server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request, extra) => { - const uri = new URL(request.params.uri); - // First check for exact resource match - const resource = this._registeredResources[uri.toString()]; - if (resource) { - if (!resource.enabled) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Resource ${uri} disabled`); - } - return resource.readCallback(uri, extra); - } - // Then check templates - for (const template of Object.values(this._registeredResourceTemplates)) { - const variables = template.resourceTemplate.uriTemplate.match(uri.toString()); - if (variables) { - return template.readCallback(uri, variables, extra); - } - } - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Resource ${uri} not found`); - }); - this._resourceHandlersInitialized = true; - } - setPromptRequestHandlers() { - if (this._promptHandlersInitialized) { - return; - } - this.server.assertCanSetRequestHandler(getMethodValue(types_js_1.ListPromptsRequestSchema)); - this.server.assertCanSetRequestHandler(getMethodValue(types_js_1.GetPromptRequestSchema)); - this.server.registerCapabilities({ - prompts: { - listChanged: true - } - }); - this.server.setRequestHandler(types_js_1.ListPromptsRequestSchema, () => ({ - prompts: Object.entries(this._registeredPrompts) - .filter(([, prompt]) => prompt.enabled) - .map(([name, prompt]) => { - return { - name, - title: prompt.title, - description: prompt.description, - arguments: prompt.argsSchema ? promptArgumentsFromSchema(prompt.argsSchema) : undefined - }; - }) - })); - this.server.setRequestHandler(types_js_1.GetPromptRequestSchema, async (request, extra) => { - const prompt = this._registeredPrompts[request.params.name]; - if (!prompt) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Prompt ${request.params.name} not found`); - } - if (!prompt.enabled) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Prompt ${request.params.name} disabled`); - } - if (prompt.argsSchema) { - const argsObj = (0, zod_compat_js_1.normalizeObjectSchema)(prompt.argsSchema); - const parseResult = await (0, zod_compat_js_1.safeParseAsync)(argsObj, request.params.arguments); - if (!parseResult.success) { - const error = 'error' in parseResult ? parseResult.error : 'Unknown error'; - const errorMessage = (0, zod_compat_js_1.getParseErrorMessage)(error); - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid arguments for prompt ${request.params.name}: ${errorMessage}`); - } - const args = parseResult.data; - const cb = prompt.callback; - return await Promise.resolve(cb(args, extra)); - } - else { - const cb = prompt.callback; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(cb(extra)); - } - }); - this._promptHandlersInitialized = true; - } - resource(name, uriOrTemplate, ...rest) { - let metadata; - if (typeof rest[0] === 'object') { - metadata = rest.shift(); - } - const readCallback = rest[0]; - if (typeof uriOrTemplate === 'string') { - if (this._registeredResources[uriOrTemplate]) { - throw new Error(`Resource ${uriOrTemplate} is already registered`); - } - const registeredResource = this._createRegisteredResource(name, undefined, uriOrTemplate, metadata, readCallback); - this.setResourceRequestHandlers(); - this.sendResourceListChanged(); - return registeredResource; - } - else { - if (this._registeredResourceTemplates[name]) { - throw new Error(`Resource template ${name} is already registered`); - } - const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, undefined, uriOrTemplate, metadata, readCallback); - this.setResourceRequestHandlers(); - this.sendResourceListChanged(); - return registeredResourceTemplate; - } - } - registerResource(name, uriOrTemplate, config, readCallback) { - if (typeof uriOrTemplate === 'string') { - if (this._registeredResources[uriOrTemplate]) { - throw new Error(`Resource ${uriOrTemplate} is already registered`); - } - const registeredResource = this._createRegisteredResource(name, config.title, uriOrTemplate, config, readCallback); - this.setResourceRequestHandlers(); - this.sendResourceListChanged(); - return registeredResource; - } - else { - if (this._registeredResourceTemplates[name]) { - throw new Error(`Resource template ${name} is already registered`); - } - const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config.title, uriOrTemplate, config, readCallback); - this.setResourceRequestHandlers(); - this.sendResourceListChanged(); - return registeredResourceTemplate; - } - } - _createRegisteredResource(name, title, uri, metadata, readCallback) { - const registeredResource = { - name, - title, - metadata, - readCallback, - enabled: true, - disable: () => registeredResource.update({ enabled: false }), - enable: () => registeredResource.update({ enabled: true }), - remove: () => registeredResource.update({ uri: null }), - update: updates => { - if (typeof updates.uri !== 'undefined' && updates.uri !== uri) { - delete this._registeredResources[uri]; - if (updates.uri) - this._registeredResources[updates.uri] = registeredResource; - } - if (typeof updates.name !== 'undefined') - registeredResource.name = updates.name; - if (typeof updates.title !== 'undefined') - registeredResource.title = updates.title; - if (typeof updates.metadata !== 'undefined') - registeredResource.metadata = updates.metadata; - if (typeof updates.callback !== 'undefined') - registeredResource.readCallback = updates.callback; - if (typeof updates.enabled !== 'undefined') - registeredResource.enabled = updates.enabled; - this.sendResourceListChanged(); - } - }; - this._registeredResources[uri] = registeredResource; - return registeredResource; - } - _createRegisteredResourceTemplate(name, title, template, metadata, readCallback) { - const registeredResourceTemplate = { - resourceTemplate: template, - title, - metadata, - readCallback, - enabled: true, - disable: () => registeredResourceTemplate.update({ enabled: false }), - enable: () => registeredResourceTemplate.update({ enabled: true }), - remove: () => registeredResourceTemplate.update({ name: null }), - update: updates => { - if (typeof updates.name !== 'undefined' && updates.name !== name) { - delete this._registeredResourceTemplates[name]; - if (updates.name) - this._registeredResourceTemplates[updates.name] = registeredResourceTemplate; - } - if (typeof updates.title !== 'undefined') - registeredResourceTemplate.title = updates.title; - if (typeof updates.template !== 'undefined') - registeredResourceTemplate.resourceTemplate = updates.template; - if (typeof updates.metadata !== 'undefined') - registeredResourceTemplate.metadata = updates.metadata; - if (typeof updates.callback !== 'undefined') - registeredResourceTemplate.readCallback = updates.callback; - if (typeof updates.enabled !== 'undefined') - registeredResourceTemplate.enabled = updates.enabled; - this.sendResourceListChanged(); - } - }; - this._registeredResourceTemplates[name] = registeredResourceTemplate; - // If the resource template has any completion callbacks, enable completions capability - const variableNames = template.uriTemplate.variableNames; - const hasCompleter = Array.isArray(variableNames) && variableNames.some(v => !!template.completeCallback(v)); - if (hasCompleter) { - this.setCompletionRequestHandler(); - } - return registeredResourceTemplate; - } - _createRegisteredPrompt(name, title, description, argsSchema, callback) { - const registeredPrompt = { - title, - description, - argsSchema: argsSchema === undefined ? undefined : (0, zod_compat_js_1.objectFromShape)(argsSchema), - callback, - enabled: true, - disable: () => registeredPrompt.update({ enabled: false }), - enable: () => registeredPrompt.update({ enabled: true }), - remove: () => registeredPrompt.update({ name: null }), - update: updates => { - if (typeof updates.name !== 'undefined' && updates.name !== name) { - delete this._registeredPrompts[name]; - if (updates.name) - this._registeredPrompts[updates.name] = registeredPrompt; - } - if (typeof updates.title !== 'undefined') - registeredPrompt.title = updates.title; - if (typeof updates.description !== 'undefined') - registeredPrompt.description = updates.description; - if (typeof updates.argsSchema !== 'undefined') - registeredPrompt.argsSchema = (0, zod_compat_js_1.objectFromShape)(updates.argsSchema); - if (typeof updates.callback !== 'undefined') - registeredPrompt.callback = updates.callback; - if (typeof updates.enabled !== 'undefined') - registeredPrompt.enabled = updates.enabled; - this.sendPromptListChanged(); - } - }; - this._registeredPrompts[name] = registeredPrompt; - // If any argument uses a Completable schema, enable completions capability - if (argsSchema) { - const hasCompletable = Object.values(argsSchema).some(field => { - const inner = field instanceof zod_1.ZodOptional ? field._def?.innerType : field; - return (0, completable_js_1.isCompletable)(inner); - }); - if (hasCompletable) { - this.setCompletionRequestHandler(); - } - } - return registeredPrompt; - } - _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, execution, _meta, handler) { - // Validate tool name according to SEP specification - (0, toolNameValidation_js_1.validateAndWarnToolName)(name); - const registeredTool = { - title, - description, - inputSchema: getZodSchemaObject(inputSchema), - outputSchema: getZodSchemaObject(outputSchema), - annotations, - execution, - _meta, - handler: handler, - enabled: true, - disable: () => registeredTool.update({ enabled: false }), - enable: () => registeredTool.update({ enabled: true }), - remove: () => registeredTool.update({ name: null }), - update: updates => { - if (typeof updates.name !== 'undefined' && updates.name !== name) { - if (typeof updates.name === 'string') { - (0, toolNameValidation_js_1.validateAndWarnToolName)(updates.name); - } - delete this._registeredTools[name]; - if (updates.name) - this._registeredTools[updates.name] = registeredTool; - } - if (typeof updates.title !== 'undefined') - registeredTool.title = updates.title; - if (typeof updates.description !== 'undefined') - registeredTool.description = updates.description; - if (typeof updates.paramsSchema !== 'undefined') - registeredTool.inputSchema = (0, zod_compat_js_1.objectFromShape)(updates.paramsSchema); - if (typeof updates.outputSchema !== 'undefined') - registeredTool.outputSchema = (0, zod_compat_js_1.objectFromShape)(updates.outputSchema); - if (typeof updates.callback !== 'undefined') - registeredTool.handler = updates.callback; - if (typeof updates.annotations !== 'undefined') - registeredTool.annotations = updates.annotations; - if (typeof updates._meta !== 'undefined') - registeredTool._meta = updates._meta; - if (typeof updates.enabled !== 'undefined') - registeredTool.enabled = updates.enabled; - this.sendToolListChanged(); - } - }; - this._registeredTools[name] = registeredTool; - this.setToolRequestHandlers(); - this.sendToolListChanged(); - return registeredTool; - } - /** - * tool() implementation. Parses arguments passed to overrides defined above. - */ - tool(name, ...rest) { - if (this._registeredTools[name]) { - throw new Error(`Tool ${name} is already registered`); - } - let description; - let inputSchema; - let outputSchema; - let annotations; - // Tool properties are passed as separate arguments, with omissions allowed. - // Support for this style is frozen as of protocol version 2025-03-26. Future additions - // to tool definition should *NOT* be added. - if (typeof rest[0] === 'string') { - description = rest.shift(); - } - // Handle the different overload combinations - if (rest.length > 1) { - // We have at least one more arg before the callback - const firstArg = rest[0]; - if (isZodRawShapeCompat(firstArg)) { - // We have a params schema as the first arg - inputSchema = rest.shift(); - // Check if the next arg is potentially annotations - if (rest.length > 1 && typeof rest[0] === 'object' && rest[0] !== null && !isZodRawShapeCompat(rest[0])) { - // Case: tool(name, paramsSchema, annotations, cb) - // Or: tool(name, description, paramsSchema, annotations, cb) - annotations = rest.shift(); - } - } - else if (typeof firstArg === 'object' && firstArg !== null) { - // Not a ZodRawShapeCompat, so must be annotations in this position - // Case: tool(name, annotations, cb) - // Or: tool(name, description, annotations, cb) - annotations = rest.shift(); - } - } - const callback = rest[0]; - return this._createRegisteredTool(name, undefined, description, inputSchema, outputSchema, annotations, { taskSupport: 'forbidden' }, undefined, callback); - } - /** - * Registers a tool with a config object and callback. - */ - registerTool(name, config, cb) { - if (this._registeredTools[name]) { - throw new Error(`Tool ${name} is already registered`); - } - const { title, description, inputSchema, outputSchema, annotations, _meta } = config; - return this._createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, { taskSupport: 'forbidden' }, _meta, cb); - } - prompt(name, ...rest) { - if (this._registeredPrompts[name]) { - throw new Error(`Prompt ${name} is already registered`); - } - let description; - if (typeof rest[0] === 'string') { - description = rest.shift(); - } - let argsSchema; - if (rest.length > 1) { - argsSchema = rest.shift(); - } - const cb = rest[0]; - const registeredPrompt = this._createRegisteredPrompt(name, undefined, description, argsSchema, cb); - this.setPromptRequestHandlers(); - this.sendPromptListChanged(); - return registeredPrompt; - } - /** - * Registers a prompt with a config object and callback. - */ - registerPrompt(name, config, cb) { - if (this._registeredPrompts[name]) { - throw new Error(`Prompt ${name} is already registered`); - } - const { title, description, argsSchema } = config; - const registeredPrompt = this._createRegisteredPrompt(name, title, description, argsSchema, cb); - this.setPromptRequestHandlers(); - this.sendPromptListChanged(); - return registeredPrompt; - } - /** - * Checks if the server is connected to a transport. - * @returns True if the server is connected - */ - isConnected() { - return this.server.transport !== undefined; - } - /** - * Sends a logging message to the client, if connected. - * Note: You only need to send the parameters object, not the entire JSON RPC message - * @see LoggingMessageNotification - * @param params - * @param sessionId optional for stateless and backward compatibility - */ - async sendLoggingMessage(params, sessionId) { - return this.server.sendLoggingMessage(params, sessionId); - } - /** - * Sends a resource list changed event to the client, if connected. - */ - sendResourceListChanged() { - if (this.isConnected()) { - this.server.sendResourceListChanged(); - } - } - /** - * Sends a tool list changed event to the client, if connected. - */ - sendToolListChanged() { - if (this.isConnected()) { - this.server.sendToolListChanged(); - } - } - /** - * Sends a prompt list changed event to the client, if connected. - */ - sendPromptListChanged() { - if (this.isConnected()) { - this.server.sendPromptListChanged(); - } - } -} -exports.McpServer = McpServer; -/** - * A resource template combines a URI pattern with optional functionality to enumerate - * all resources matching that pattern. - */ -class ResourceTemplate { - constructor(uriTemplate, _callbacks) { - this._callbacks = _callbacks; - this._uriTemplate = typeof uriTemplate === 'string' ? new uriTemplate_js_1.UriTemplate(uriTemplate) : uriTemplate; - } - /** - * Gets the URI template pattern. - */ - get uriTemplate() { - return this._uriTemplate; - } - /** - * Gets the list callback, if one was provided. - */ - get listCallback() { - return this._callbacks.list; - } - /** - * Gets the callback for completing a specific URI template variable, if one was provided. - */ - completeCallback(variable) { - return this._callbacks.complete?.[variable]; - } -} -exports.ResourceTemplate = ResourceTemplate; -const EMPTY_OBJECT_JSON_SCHEMA = { - type: 'object', - properties: {} -}; -/** - * Checks if a value looks like a Zod schema by checking for parse/safeParse methods. - */ -function isZodTypeLike(value) { - return (value !== null && - typeof value === 'object' && - 'parse' in value && - typeof value.parse === 'function' && - 'safeParse' in value && - typeof value.safeParse === 'function'); -} -/** - * Checks if an object is a Zod schema instance (v3 or v4). - * - * Zod schemas have internal markers: - * - v3: `_def` property - * - v4: `_zod` property - * - * This includes transformed schemas like z.preprocess(), z.transform(), z.pipe(). - */ -function isZodSchemaInstance(obj) { - return '_def' in obj || '_zod' in obj || isZodTypeLike(obj); -} -/** - * Checks if an object is a "raw shape" - a plain object where values are Zod schemas. - * - * Raw shapes are used as shorthand: `{ name: z.string() }` instead of `z.object({ name: z.string() })`. - * - * IMPORTANT: This must NOT match actual Zod schema instances (like z.preprocess, z.pipe), - * which have internal properties that could be mistaken for schema values. - */ -function isZodRawShapeCompat(obj) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - // If it's already a Zod schema instance, it's NOT a raw shape - if (isZodSchemaInstance(obj)) { - return false; - } - // Empty objects are valid raw shapes (tools with no parameters) - if (Object.keys(obj).length === 0) { - return true; - } - // A raw shape has at least one property that is a Zod schema - return Object.values(obj).some(isZodTypeLike); -} -/** - * Converts a provided Zod schema to a Zod object if it is a ZodRawShapeCompat, - * otherwise returns the schema as is. - */ -function getZodSchemaObject(schema) { - if (!schema) { - return undefined; - } - if (isZodRawShapeCompat(schema)) { - return (0, zod_compat_js_1.objectFromShape)(schema); - } - return schema; -} -function promptArgumentsFromSchema(schema) { - const shape = (0, zod_compat_js_1.getObjectShape)(schema); - if (!shape) - return []; - return Object.entries(shape).map(([name, field]) => { - // Get description - works for both v3 and v4 - const description = (0, zod_compat_js_1.getSchemaDescription)(field); - // Check if optional - works for both v3 and v4 - const isOptional = (0, zod_compat_js_1.isSchemaOptional)(field); - return { - name, - description, - required: !isOptional - }; - }); -} -function getMethodValue(schema) { - const shape = (0, zod_compat_js_1.getObjectShape)(schema); - const methodSchema = shape?.method; - if (!methodSchema) { - throw new Error('Schema is missing a method literal'); - } - // Extract literal value - works for both v3 and v4 - const value = (0, zod_compat_js_1.getLiteralValue)(methodSchema); - if (typeof value === 'string') { - return value; - } - throw new Error('Schema method literal must be a string'); -} -function createCompletionResult(suggestions) { - return { - completion: { - values: suggestions.slice(0, 100), - total: suggestions.length, - hasMore: suggestions.length > 100 - } - }; -} -const EMPTY_COMPLETION_RESULT = { - completion: { - values: [], - hasMore: false - } -}; -//# sourceMappingURL=mcp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js.map deleted file mode 100644 index d31072a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/server/mcp.ts"],"names":[],"mappings":";;;AAAA,yCAAmD;AACnD,mDAcyB;AACzB,2EAAiE;AACjE,0CAsCqB;AACrB,qDAA+D;AAC/D,6DAAkE;AAIlE,2EAA0E;AAC1E,uEAAiF;AAEjF,6BAAkC;AAElC;;;;GAIG;AACH,MAAa,SAAS;IAclB,YAAY,UAA0B,EAAE,OAAuB;QARvD,yBAAoB,GAA0C,EAAE,CAAC;QACjE,iCAA4B,GAEhC,EAAE,CAAC;QACC,qBAAgB,GAAuC,EAAE,CAAC;QAC1D,uBAAkB,GAAyC,EAAE,CAAC;QAuC9D,6BAAwB,GAAG,KAAK,CAAC;QAsRjC,kCAA6B,GAAG,KAAK,CAAC;QAmFtC,iCAA4B,GAAG,KAAK,CAAC;QAiFrC,+BAA0B,GAAG,KAAK,CAAC;QA7dvC,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,IAAI,YAAY;QACZ,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,UAAU,EAAE;QACR,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,KAAK;KACjB;CACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.d.ts deleted file mode 100644 index cb526d8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { RequestHandler } from 'express'; -/** - * Express middleware for DNS rebinding protection. - * Validates Host header hostname (port-agnostic) against an allowed list. - * - * This is particularly important for servers without authorization or HTTPS, - * such as localhost servers or development servers. DNS rebinding attacks can - * bypass same-origin policy by manipulating DNS to point a domain to a - * localhost address, allowing malicious websites to access your local server. - * - * @param allowedHostnames - List of allowed hostnames (without ports). - * For IPv6, provide the address with brackets (e.g., '[::1]'). - * @returns Express middleware function - * - * @example - * ```typescript - * const middleware = hostHeaderValidation(['localhost', '127.0.0.1', '[::1]']); - * app.use(middleware); - * ``` - */ -export declare function hostHeaderValidation(allowedHostnames: string[]): RequestHandler; -/** - * Convenience middleware for localhost DNS rebinding protection. - * Allows only localhost, 127.0.0.1, and [::1] (IPv6 localhost) hostnames. - * - * @example - * ```typescript - * app.use(localhostHostValidation()); - * ``` - */ -export declare function localhostHostValidation(): RequestHandler; -//# sourceMappingURL=hostHeaderValidation.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.d.ts.map deleted file mode 100644 index c550324..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hostHeaderValidation.d.ts","sourceRoot":"","sources":["../../../../src/server/middleware/hostHeaderValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,cAAc,EAAE,MAAM,SAAS,CAAC;AAE1E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,cAAc,CA4C/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,IAAI,cAAc,CAExD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.js deleted file mode 100644 index 6d8c0ae..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hostHeaderValidation = hostHeaderValidation; -exports.localhostHostValidation = localhostHostValidation; -/** - * Express middleware for DNS rebinding protection. - * Validates Host header hostname (port-agnostic) against an allowed list. - * - * This is particularly important for servers without authorization or HTTPS, - * such as localhost servers or development servers. DNS rebinding attacks can - * bypass same-origin policy by manipulating DNS to point a domain to a - * localhost address, allowing malicious websites to access your local server. - * - * @param allowedHostnames - List of allowed hostnames (without ports). - * For IPv6, provide the address with brackets (e.g., '[::1]'). - * @returns Express middleware function - * - * @example - * ```typescript - * const middleware = hostHeaderValidation(['localhost', '127.0.0.1', '[::1]']); - * app.use(middleware); - * ``` - */ -function hostHeaderValidation(allowedHostnames) { - return (req, res, next) => { - const hostHeader = req.headers.host; - if (!hostHeader) { - res.status(403).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Missing Host header' - }, - id: null - }); - return; - } - // Use URL API to parse hostname (handles IPv4, IPv6, and regular hostnames) - let hostname; - try { - hostname = new URL(`http://${hostHeader}`).hostname; - } - catch { - res.status(403).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: `Invalid Host header: ${hostHeader}` - }, - id: null - }); - return; - } - if (!allowedHostnames.includes(hostname)) { - res.status(403).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: `Invalid Host: ${hostname}` - }, - id: null - }); - return; - } - next(); - }; -} -/** - * Convenience middleware for localhost DNS rebinding protection. - * Allows only localhost, 127.0.0.1, and [::1] (IPv6 localhost) hostnames. - * - * @example - * ```typescript - * app.use(localhostHostValidation()); - * ``` - */ -function localhostHostValidation() { - return hostHeaderValidation(['localhost', '127.0.0.1', '[::1]']); -} -//# sourceMappingURL=hostHeaderValidation.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.js.map deleted file mode 100644 index c97b552..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hostHeaderValidation.js","sourceRoot":"","sources":["../../../../src/server/middleware/hostHeaderValidation.ts"],"names":[],"mappings":";;AAqBA,oDA4CC;AAWD,0DAEC;AA5ED;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,oBAAoB,CAAC,gBAA0B;IAC3D,OAAO,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;QACvD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACH,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,qBAAqB;iBACjC;gBACD,EAAE,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACX,CAAC;QAED,4EAA4E;QAC5E,IAAI,QAAgB,CAAC;QACrB,IAAI,CAAC;YACD,QAAQ,GAAG,IAAI,GAAG,CAAC,UAAU,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC;QACxD,CAAC;QAAC,MAAM,CAAC;YACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACH,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,wBAAwB,UAAU,EAAE;iBAChD;gBACD,EAAE,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACX,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACH,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,iBAAiB,QAAQ,EAAE;iBACvC;gBACD,EAAE,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACX,CAAC;QACD,IAAI,EAAE,CAAC;IACX,CAAC,CAAC;AACN,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,uBAAuB;IACnC,OAAO,oBAAoB,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.d.ts deleted file mode 100644 index 7fa42a5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { IncomingMessage, ServerResponse } from 'node:http'; -import { Transport } from '../shared/transport.js'; -import { JSONRPCMessage, MessageExtraInfo } from '../types.js'; -import { AuthInfo } from './auth/types.js'; -/** - * Configuration options for SSEServerTransport. - */ -export interface SSEServerTransportOptions { - /** - * List of allowed host header values for DNS rebinding protection. - * If not specified, host validation is disabled. - * @deprecated Use the `hostHeaderValidation` middleware from `@modelcontextprotocol/sdk/server/middleware/hostHeaderValidation.js` instead, - * or use `createMcpExpressApp` from `@modelcontextprotocol/sdk/server/express.js` which includes localhost protection by default. - */ - allowedHosts?: string[]; - /** - * List of allowed origin header values for DNS rebinding protection. - * If not specified, origin validation is disabled. - * @deprecated Use the `hostHeaderValidation` middleware from `@modelcontextprotocol/sdk/server/middleware/hostHeaderValidation.js` instead, - * or use `createMcpExpressApp` from `@modelcontextprotocol/sdk/server/express.js` which includes localhost protection by default. - */ - allowedOrigins?: string[]; - /** - * Enable DNS rebinding protection (requires allowedHosts and/or allowedOrigins to be configured). - * Default is false for backwards compatibility. - * @deprecated Use the `hostHeaderValidation` middleware from `@modelcontextprotocol/sdk/server/middleware/hostHeaderValidation.js` instead, - * or use `createMcpExpressApp` from `@modelcontextprotocol/sdk/server/express.js` which includes localhost protection by default. - */ - enableDnsRebindingProtection?: boolean; -} -/** - * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. - * - * This transport is only available in Node.js environments. - * @deprecated SSEServerTransport is deprecated. Use StreamableHTTPServerTransport instead. - */ -export declare class SSEServerTransport implements Transport { - private _endpoint; - private res; - private _sseResponse?; - private _sessionId; - private _options; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage, extra?: MessageExtraInfo) => void; - /** - * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. - */ - constructor(_endpoint: string, res: ServerResponse, options?: SSEServerTransportOptions); - /** - * Validates request headers for DNS rebinding protection. - * @returns Error message if validation fails, undefined if validation passes. - */ - private validateRequestHeaders; - /** - * Handles the initial SSE connection request. - * - * This should be called when a GET request is made to establish the SSE stream. - */ - start(): Promise; - /** - * Handles incoming POST messages. - * - * This should be called when a POST request is made to send a message to the server. - */ - handlePostMessage(req: IncomingMessage & { - auth?: AuthInfo; - }, res: ServerResponse, parsedBody?: unknown): Promise; - /** - * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. - */ - handleMessage(message: unknown, extra?: MessageExtraInfo): Promise; - close(): Promise; - send(message: JSONRPCMessage): Promise; - /** - * Returns the session ID for this transport. - * - * This can be used to route incoming POST requests. - */ - get sessionId(): string; -} -//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.d.ts.map deleted file mode 100644 index c94a521..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/server/sse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,gBAAgB,EAAe,MAAM,aAAa,CAAC;AAGlG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;;OAKG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAY5C,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,GAAG;IAZf,OAAO,CAAC,YAAY,CAAC,CAAiB;IACtC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAExE;;OAEG;gBAES,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,cAAc,EAC3B,OAAO,CAAC,EAAE,yBAAyB;IAMvC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAyB9B;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA8B5B;;;;OAIG;IACG,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA+C7H;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYxE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAQlD;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.js deleted file mode 100644 index 2829fd3..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.js +++ /dev/null @@ -1,165 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SSEServerTransport = void 0; -const node_crypto_1 = require("node:crypto"); -const types_js_1 = require("../types.js"); -const raw_body_1 = __importDefault(require("raw-body")); -const content_type_1 = __importDefault(require("content-type")); -const node_url_1 = require("node:url"); -const MAXIMUM_MESSAGE_SIZE = '4mb'; -/** - * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. - * - * This transport is only available in Node.js environments. - * @deprecated SSEServerTransport is deprecated. Use StreamableHTTPServerTransport instead. - */ -class SSEServerTransport { - /** - * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. - */ - constructor(_endpoint, res, options) { - this._endpoint = _endpoint; - this.res = res; - this._sessionId = (0, node_crypto_1.randomUUID)(); - this._options = options || { enableDnsRebindingProtection: false }; - } - /** - * Validates request headers for DNS rebinding protection. - * @returns Error message if validation fails, undefined if validation passes. - */ - validateRequestHeaders(req) { - // Skip validation if protection is not enabled - if (!this._options.enableDnsRebindingProtection) { - return undefined; - } - // Validate Host header if allowedHosts is configured - if (this._options.allowedHosts && this._options.allowedHosts.length > 0) { - const hostHeader = req.headers.host; - if (!hostHeader || !this._options.allowedHosts.includes(hostHeader)) { - return `Invalid Host header: ${hostHeader}`; - } - } - // Validate Origin header if allowedOrigins is configured - if (this._options.allowedOrigins && this._options.allowedOrigins.length > 0) { - const originHeader = req.headers.origin; - if (originHeader && !this._options.allowedOrigins.includes(originHeader)) { - return `Invalid Origin header: ${originHeader}`; - } - } - return undefined; - } - /** - * Handles the initial SSE connection request. - * - * This should be called when a GET request is made to establish the SSE stream. - */ - async start() { - if (this._sseResponse) { - throw new Error('SSEServerTransport already started! If using Server class, note that connect() calls start() automatically.'); - } - this.res.writeHead(200, { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache, no-transform', - Connection: 'keep-alive' - }); - // Send the endpoint event - // Use a dummy base URL because this._endpoint is relative. - // This allows using URL/URLSearchParams for robust parameter handling. - const dummyBase = 'http://localhost'; // Any valid base works - const endpointUrl = new node_url_1.URL(this._endpoint, dummyBase); - endpointUrl.searchParams.set('sessionId', this._sessionId); - // Reconstruct the relative URL string (pathname + search + hash) - const relativeUrlWithSession = endpointUrl.pathname + endpointUrl.search + endpointUrl.hash; - this.res.write(`event: endpoint\ndata: ${relativeUrlWithSession}\n\n`); - this._sseResponse = this.res; - this.res.on('close', () => { - this._sseResponse = undefined; - this.onclose?.(); - }); - } - /** - * Handles incoming POST messages. - * - * This should be called when a POST request is made to send a message to the server. - */ - async handlePostMessage(req, res, parsedBody) { - if (!this._sseResponse) { - const message = 'SSE connection not established'; - res.writeHead(500).end(message); - throw new Error(message); - } - // Validate request headers for DNS rebinding protection - const validationError = this.validateRequestHeaders(req); - if (validationError) { - res.writeHead(403).end(validationError); - this.onerror?.(new Error(validationError)); - return; - } - const authInfo = req.auth; - const requestInfo = { headers: req.headers }; - let body; - try { - const ct = content_type_1.default.parse(req.headers['content-type'] ?? ''); - if (ct.type !== 'application/json') { - throw new Error(`Unsupported content-type: ${ct.type}`); - } - body = - parsedBody ?? - (await (0, raw_body_1.default)(req, { - limit: MAXIMUM_MESSAGE_SIZE, - encoding: ct.parameters.charset ?? 'utf-8' - })); - } - catch (error) { - res.writeHead(400).end(String(error)); - this.onerror?.(error); - return; - } - try { - await this.handleMessage(typeof body === 'string' ? JSON.parse(body) : body, { requestInfo, authInfo }); - } - catch { - res.writeHead(400).end(`Invalid message: ${body}`); - return; - } - res.writeHead(202).end('Accepted'); - } - /** - * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. - */ - async handleMessage(message, extra) { - let parsedMessage; - try { - parsedMessage = types_js_1.JSONRPCMessageSchema.parse(message); - } - catch (error) { - this.onerror?.(error); - throw error; - } - this.onmessage?.(parsedMessage, extra); - } - async close() { - this._sseResponse?.end(); - this._sseResponse = undefined; - this.onclose?.(); - } - async send(message) { - if (!this._sseResponse) { - throw new Error('Not connected'); - } - this._sseResponse.write(`event: message\ndata: ${JSON.stringify(message)}\n\n`); - } - /** - * Returns the session ID for this transport. - * - * This can be used to route incoming POST requests. - */ - get sessionId() { - return this._sessionId; - } -} -exports.SSEServerTransport = SSEServerTransport; -//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.js.map deleted file mode 100644 index f80cb8d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../../src/server/sse.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAyC;AAGzC,0CAAkG;AAClG,wDAAkC;AAClC,gEAAuC;AAEvC,uCAA+B;AAE/B,MAAM,oBAAoB,GAAG,KAAK,CAAC;AA+BnC;;;;;GAKG;AACH,MAAa,kBAAkB;IAQ3B;;OAEG;IACH,YACY,SAAiB,EACjB,GAAmB,EAC3B,OAAmC;QAF3B,cAAS,GAAT,SAAS,CAAQ;QACjB,QAAG,GAAH,GAAG,CAAgB;QAG3B,IAAI,CAAC,UAAU,GAAG,IAAA,wBAAU,GAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,CAAC;IACvE,CAAC;IAED;;;OAGG;IACK,sBAAsB,CAAC,GAAoB;QAC/C,+CAA+C;QAC/C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE,CAAC;YAC9C,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,qDAAqD;QACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtE,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;YACpC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBAClE,OAAO,wBAAwB,UAAU,EAAE,CAAC;YAChD,CAAC;QACL,CAAC;QAED,yDAAyD;QACzD,IAAI,IAAI,CAAC,QAA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CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;QAC9B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpF,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ;AA7KD,gDA6KC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts deleted file mode 100644 index 83af572..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Readable, Writable } from 'node:stream'; -import { JSONRPCMessage } from '../types.js'; -import { Transport } from '../shared/transport.js'; -/** - * Server transport for stdio: this communicates with an MCP client by reading from the current process' stdin and writing to stdout. - * - * This transport is only available in Node.js environments. - */ -export declare class StdioServerTransport implements Transport { - private _stdin; - private _stdout; - private _readBuffer; - private _started; - constructor(_stdin?: Readable, _stdout?: Writable); - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - _ondata: (chunk: Buffer) => void; - _onerror: (error: Error) => void; - /** - * Starts listening for messages on stdin. - */ - start(): Promise; - private processReadBuffer; - close(): Promise; - send(message: JSONRPCMessage): Promise; -} -//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts.map deleted file mode 100644 index fdd2dfe..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/server/stdio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IAK9C,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IALnB,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAGb,MAAM,GAAE,QAAwB,EAChC,OAAO,GAAE,QAAyB;IAG9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAG9C,OAAO,UAAW,MAAM,UAGtB;IACF,QAAQ,UAAW,KAAK,UAEtB;IAEF;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAY5B,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAU/C"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js deleted file mode 100644 index 0edcbf3..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StdioServerTransport = void 0; -const node_process_1 = __importDefault(require("node:process")); -const stdio_js_1 = require("../shared/stdio.js"); -/** - * Server transport for stdio: this communicates with an MCP client by reading from the current process' stdin and writing to stdout. - * - * This transport is only available in Node.js environments. - */ -class StdioServerTransport { - constructor(_stdin = node_process_1.default.stdin, _stdout = node_process_1.default.stdout) { - this._stdin = _stdin; - this._stdout = _stdout; - this._readBuffer = new stdio_js_1.ReadBuffer(); - this._started = false; - // Arrow functions to bind `this` properly, while maintaining function identity. - this._ondata = (chunk) => { - this._readBuffer.append(chunk); - this.processReadBuffer(); - }; - this._onerror = (error) => { - this.onerror?.(error); - }; - } - /** - * Starts listening for messages on stdin. - */ - async start() { - if (this._started) { - throw new Error('StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.'); - } - this._started = true; - this._stdin.on('data', this._ondata); - this._stdin.on('error', this._onerror); - } - processReadBuffer() { - while (true) { - try { - const message = this._readBuffer.readMessage(); - if (message === null) { - break; - } - this.onmessage?.(message); - } - catch (error) { - this.onerror?.(error); - } - } - } - async close() { - // Remove our event listeners first - this._stdin.off('data', this._ondata); - this._stdin.off('error', this._onerror); - // Check if we were the only data listener - const remainingDataListeners = this._stdin.listenerCount('data'); - if (remainingDataListeners === 0) { - // Only pause stdin if we were the only listener - // This prevents interfering with other parts of the application that might be using stdin - this._stdin.pause(); - } - // Clear the buffer and notify closure - this._readBuffer.clear(); - this.onclose?.(); - } - send(message) { - return new Promise(resolve => { - const json = (0, stdio_js_1.serializeMessage)(message); - if (this._stdout.write(json)) { - resolve(); - } - else { - this._stdout.once('drain', resolve); - } - }); - } -} -exports.StdioServerTransport = StdioServerTransport; -//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js.map deleted file mode 100644 index f5d54d4..0000000 --- a/node_modules/@modelcontextprot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ableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.d.ts deleted file mode 100644 index 5d5564b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Node.js HTTP Streamable HTTP Server Transport - * - * This is a thin wrapper around `WebStandardStreamableHTTPServerTransport` that provides - * compatibility with Node.js HTTP server (IncomingMessage/ServerResponse). - * - * For web-standard environments (Cloudflare Workers, Deno, Bun), use `WebStandardStreamableHTTPServerTransport` directly. - */ -import { IncomingMessage, ServerResponse } from 'node:http'; -import { Transport } from '../shared/transport.js'; -import { AuthInfo } from './auth/types.js'; -import { MessageExtraInfo, JSONRPCMessage, RequestId } from '../types.js'; -import { WebStandardStreamableHTTPServerTransportOptions, EventStore, StreamId, EventId } from './webStandardStreamableHttp.js'; -export type { EventStore, StreamId, EventId }; -/** - * Configuration options for StreamableHTTPServerTransport - * - * This is an alias for WebStandardStreamableHTTPServerTransportOptions for backward compatibility. - */ -export type StreamableHTTPServerTransportOptions = WebStandardStreamableHTTPServerTransportOptions; -/** - * Server transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. - * It supports both SSE streaming and direct HTTP responses. - * - * This is a wrapper around `WebStandardStreamableHTTPServerTransport` that provides Node.js HTTP compatibility. - * It uses the `@hono/node-server` library to convert between Node.js HTTP and Web Standard APIs. - * - * Usage example: - * - * ```typescript - * // Stateful mode - server sets the session ID - * const statefulTransport = new StreamableHTTPServerTransport({ - * sessionIdGenerator: () => randomUUID(), - * }); - * - * // Stateless mode - explicitly set session ID to undefined - * const statelessTransport = new StreamableHTTPServerTransport({ - * sessionIdGenerator: undefined, - * }); - * - * // Using with pre-parsed request body - * app.post('/mcp', (req, res) => { - * transport.handleRequest(req, res, req.body); - * }); - * ``` - * - * In stateful mode: - * - Session ID is generated and included in response headers - * - Session ID is always included in initialization responses - * - Requests with invalid session IDs are rejected with 404 Not Found - * - Non-initialization requests without a session ID are rejected with 400 Bad Request - * - State is maintained in-memory (connections, message history) - * - * In stateless mode: - * - No Session ID is included in any responses - * - No session validation is performed - */ -export declare class StreamableHTTPServerTransport implements Transport { - private _webStandardTransport; - private _requestListener; - private _requestContext; - constructor(options?: StreamableHTTPServerTransportOptions); - /** - * Gets the session ID for this transport instance. - */ - get sessionId(): string | undefined; - /** - * Sets callback for when the transport is closed. - */ - set onclose(handler: (() => void) | undefined); - get onclose(): (() => void) | undefined; - /** - * Sets callback for transport errors. - */ - set onerror(handler: ((error: Error) => void) | undefined); - get onerror(): ((error: Error) => void) | undefined; - /** - * Sets callback for incoming messages. - */ - set onmessage(handler: ((message: JSONRPCMessage, extra?: MessageExtraInfo) => void) | undefined); - get onmessage(): ((message: JSONRPCMessage, extra?: MessageExtraInfo) => void) | undefined; - /** - * Starts the transport. This is required by the Transport interface but is a no-op - * for the Streamable HTTP transport as connections are managed per-request. - */ - start(): Promise; - /** - * Closes the transport and all active connections. - */ - close(): Promise; - /** - * Sends a JSON-RPC message through the transport. - */ - send(message: JSONRPCMessage, options?: { - relatedRequestId?: RequestId; - }): Promise; - /** - * Handles an incoming HTTP request, whether GET or POST. - * - * This method converts Node.js HTTP objects to Web Standard Request/Response - * and delegates to the underlying WebStandardStreamableHTTPServerTransport. - * - * @param req - Node.js IncomingMessage, optionally with auth property from middleware - * @param res - Node.js ServerResponse - * @param parsedBody - Optional pre-parsed body from body-parser middleware - */ - handleRequest(req: IncomingMessage & { - auth?: AuthInfo; - }, res: ServerResponse, parsedBody?: unknown): Promise; - /** - * Close an SSE stream for a specific request, triggering client reconnection. - * Use this to implement polling behavior during long-running operations - - * client will reconnect after the retry interval specified in the priming event. - */ - closeSSEStream(requestId: RequestId): void; - /** - * Close the standalone GET SSE stream, triggering client reconnection. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream(): void; -} -//# sourceMappingURL=streamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.d.ts.map deleted file mode 100644 index f9e54b4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../../src/server/streamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAEH,+CAA+C,EAC/C,UAAU,EACV,QAAQ,EACR,OAAO,EACV,MAAM,gCAAgC,CAAC;AAGxC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,oCAAoC,GAAG,+CAA+C,CAAC;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,6BAA8B,YAAW,SAAS;IAC3D,OAAO,CAAC,qBAAqB,CAA2C;IACxE,OAAO,CAAC,gBAAgB,CAAwC;IAEhE,OAAO,CAAC,eAAe,CAAkF;gBAE7F,OAAO,GAAE,oCAAyC;IAoB9D;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED;;OAEG;IACH,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,EAE5C;IAED,IAAI,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAEtC;IAED;;OAEG;IACH,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,EAExD;IAED,IAAI,OAAO,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAElD;IAED;;OAEG;IACH,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC,GAAG,SAAS,EAE/F;IAED,IAAI,SAAS,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC,GAAG,SAAS,CAEzF;IAED;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9F;;;;;;;;;OASG;IACG,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBzH;;;;OAIG;IACH,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAI1C;;;OAGG;IACH,wBAAwB,IAAI,IAAI;CAGnC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.js deleted file mode 100644 index a995355..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.js +++ /dev/null @@ -1,165 +0,0 @@ -"use strict"; -/** - * Node.js HTTP Streamable HTTP Server Transport - * - * This is a thin wrapper around `WebStandardStreamableHTTPServerTransport` that provides - * compatibility with Node.js HTTP server (IncomingMessage/ServerResponse). - * - * For web-standard environments (Cloudflare Workers, Deno, Bun), use `WebStandardStreamableHTTPServerTransport` directly. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StreamableHTTPServerTransport = void 0; -const node_server_1 = require("@hono/node-server"); -const webStandardStreamableHttp_js_1 = require("./webStandardStreamableHttp.js"); -/** - * Server transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. - * It supports both SSE streaming and direct HTTP responses. - * - * This is a wrapper around `WebStandardStreamableHTTPServerTransport` that provides Node.js HTTP compatibility. - * It uses the `@hono/node-server` library to convert between Node.js HTTP and Web Standard APIs. - * - * Usage example: - * - * ```typescript - * // Stateful mode - server sets the session ID - * const statefulTransport = new StreamableHTTPServerTransport({ - * sessionIdGenerator: () => randomUUID(), - * }); - * - * // Stateless mode - explicitly set session ID to undefined - * const statelessTransport = new StreamableHTTPServerTransport({ - * sessionIdGenerator: undefined, - * }); - * - * // Using with pre-parsed request body - * app.post('/mcp', (req, res) => { - * transport.handleRequest(req, res, req.body); - * }); - * ``` - * - * In stateful mode: - * - Session ID is generated and included in response headers - * - Session ID is always included in initialization responses - * - Requests with invalid session IDs are rejected with 404 Not Found - * - Non-initialization requests without a session ID are rejected with 400 Bad Request - * - State is maintained in-memory (connections, message history) - * - * In stateless mode: - * - No Session ID is included in any responses - * - No session validation is performed - */ -class StreamableHTTPServerTransport { - constructor(options = {}) { - // Store auth and parsedBody per request for passing through to handleRequest - this._requestContext = new WeakMap(); - this._webStandardTransport = new webStandardStreamableHttp_js_1.WebStandardStreamableHTTPServerTransport(options); - // Create a request listener that wraps the web standard transport - // getRequestListener converts Node.js HTTP to Web Standard and properly handles SSE streaming - // overrideGlobalObjects: false prevents Hono from overwriting global Response, which would - // break frameworks like Next.js whose response classes extend the native Response - this._requestListener = (0, node_server_1.getRequestListener)(async (webRequest) => { - // Get context if available (set during handleRequest) - const context = this._requestContext.get(webRequest); - return this._webStandardTransport.handleRequest(webRequest, { - authInfo: context?.authInfo, - parsedBody: context?.parsedBody - }); - }, { overrideGlobalObjects: false }); - } - /** - * Gets the session ID for this transport instance. - */ - get sessionId() { - return this._webStandardTransport.sessionId; - } - /** - * Sets callback for when the transport is closed. - */ - set onclose(handler) { - this._webStandardTransport.onclose = handler; - } - get onclose() { - return this._webStandardTransport.onclose; - } - /** - * Sets callback for transport errors. - */ - set onerror(handler) { - this._webStandardTransport.onerror = handler; - } - get onerror() { - return this._webStandardTransport.onerror; - } - /** - * Sets callback for incoming messages. - */ - set onmessage(handler) { - this._webStandardTransport.onmessage = handler; - } - get onmessage() { - return this._webStandardTransport.onmessage; - } - /** - * Starts the transport. This is required by the Transport interface but is a no-op - * for the Streamable HTTP transport as connections are managed per-request. - */ - async start() { - return this._webStandardTransport.start(); - } - /** - * Closes the transport and all active connections. - */ - async close() { - return this._webStandardTransport.close(); - } - /** - * Sends a JSON-RPC message through the transport. - */ - async send(message, options) { - return this._webStandardTransport.send(message, options); - } - /** - * Handles an incoming HTTP request, whether GET or POST. - * - * This method converts Node.js HTTP objects to Web Standard Request/Response - * and delegates to the underlying WebStandardStreamableHTTPServerTransport. - * - * @param req - Node.js IncomingMessage, optionally with auth property from middleware - * @param res - Node.js ServerResponse - * @param parsedBody - Optional pre-parsed body from body-parser middleware - */ - async handleRequest(req, res, parsedBody) { - // Store context for this request to pass through auth and parsedBody - // We need to intercept the request creation to attach this context - const authInfo = req.auth; - // Create a custom handler that includes our context - // overrideGlobalObjects: false prevents Hono from overwriting global Response, which would - // break frameworks like Next.js whose response classes extend the native Response - const handler = (0, node_server_1.getRequestListener)(async (webRequest) => { - return this._webStandardTransport.handleRequest(webRequest, { - authInfo, - parsedBody - }); - }, { overrideGlobalObjects: false }); - // Delegate to the request listener which handles all the Node.js <-> Web Standard conversion - // including proper SSE streaming support - await handler(req, res); - } - /** - * Close an SSE stream for a specific request, triggering client reconnection. - * Use this to implement polling behavior during long-running operations - - * client will reconnect after the retry interval specified in the priming event. - */ - closeSSEStream(requestId) { - this._webStandardTransport.closeSSEStream(requestId); - } - /** - * Close the standalone GET SSE stream, triggering client reconnection. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream() { - this._webStandardTransport.closeStandaloneSSEStream(); - } -} -exports.StreamableHTTPServerTransport = StreamableHTTPServerTransport; -//# sourceMappingURL=streamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.js.map deleted file mode 100644 index d30634f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttp.js","sourceRoot":"","sources":["../../../src/server/streamableHttp.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAGH,mDAAuD;AAIvD,iFAMwC;AAYxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAa,6BAA6B;IAMtC,YAAY,UAAgD,EAAE;QAH9D,6EAA6E;QACrE,oBAAe,GAAoE,IAAI,OAAO,EAAE,CAAC;QAGrG,IAAI,CAAC,qBAAqB,GAAG,IAAI,uEAAwC,CAAC,OAAO,CAAC,CAAC;QAEnF,kEAAkE;QAClE,8FAA8F;QAC9F,2FAA2F;QAC3F,kFAAkF;QAClF,IAAI,CAAC,gBAAgB,GAAG,IAAA,gCAAkB,EACtC,KAAK,EAAE,UAAmB,EAAE,EAAE;YAC1B,sDAAsD;YACtD,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACrD,OAAO,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,UAAU,EAAE;gBACxD,QAAQ,EAAE,OAAO,EAAE,QAAQ;gBAC3B,UAAU,EAAE,OAAO,EAAE,UAAU;aAClC,CAA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,GAAG,GAAG,CAAC,IAAI,CAAC;QAE1B,oDAAoD;QACpD,2FAA2F;QAC3F,kFAAkF;QAClF,MAAM,OAAO,GAAG,IAAA,gCAAkB,EAC9B,KAAK,EAAE,UAAmB,EAAE,EAAE;YAC1B,OAAO,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,UAAU,EAAE;gBACxD,QAAQ;gBACR,UAAU;aACb,CAAC,CAAC;QACP,CAAC,EACD,EAAE,qBAAqB,EAAE,KAAK,EAAE,CACnC,CAAC;QAEF,6FAA6F;QAC7F,yCAAyC;QACzC,MAAM,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,SAAoB;QAC/B,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED;;;OAGG;IACH,wBAAwB;QACpB,IAAI,CAAC,qBAAqB,CAAC,wBAAwB,EAAE,CAAC;IAC1D,CAAC;CACJ;AAzID,sEAyIC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts deleted file mode 100644 index 11bb0eb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts +++ /dev/null @@ -1,268 +0,0 @@ -/** - * Web Standards Streamable HTTP Server Transport - * - * This is the core transport implementation using Web Standard APIs (Request, Response, ReadableStream). - * It can run on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc. - * - * For Node.js Express/HTTP compatibility, use `StreamableHTTPServerTransport` which wraps this transport. - */ -import { Transport } from '../shared/transport.js'; -import { AuthInfo } from './auth/types.js'; -import { MessageExtraInfo, JSONRPCMessage, RequestId } from '../types.js'; -export type StreamId = string; -export type EventId = string; -/** - * Interface for resumability support via event storage - */ -export interface EventStore { - /** - * Stores an event for later retrieval - * @param streamId ID of the stream the event belongs to - * @param message The JSON-RPC message to store - * @returns The generated event ID for the stored event - */ - storeEvent(streamId: StreamId, message: JSONRPCMessage): Promise; - /** - * Get the stream ID associated with a given event ID. - * @param eventId The event ID to look up - * @returns The stream ID, or undefined if not found - * - * Optional: If not provided, the SDK will use the streamId returned by - * replayEventsAfter for stream mapping. - */ - getStreamIdForEventId?(eventId: EventId): Promise; - replayEventsAfter(lastEventId: EventId, { send }: { - send: (eventId: EventId, message: JSONRPCMessage) => Promise; - }): Promise; -} -/** - * Configuration options for WebStandardStreamableHTTPServerTransport - */ -export interface WebStandardStreamableHTTPServerTransportOptions { - /** - * Function that generates a session ID for the transport. - * The session ID SHOULD be globally unique and cryptographically secure (e.g., a securely generated UUID, a JWT, or a cryptographic hash) - * - * If not provided, session management is disabled (stateless mode). - */ - sessionIdGenerator?: () => string; - /** - * A callback for session initialization events - * This is called when the server initializes a new session. - * Useful in cases when you need to register multiple mcp sessions - * and need to keep track of them. - * @param sessionId The generated session ID - */ - onsessioninitialized?: (sessionId: string) => void | Promise; - /** - * A callback for session close events - * This is called when the server closes a session due to a DELETE request. - * Useful in cases when you need to clean up resources associated with the session. - * Note that this is different from the transport closing, if you are handling - * HTTP requests from multiple nodes you might want to close each - * WebStandardStreamableHTTPServerTransport after a request is completed while still keeping the - * session open/running. - * @param sessionId The session ID that was closed - */ - onsessionclosed?: (sessionId: string) => void | Promise; - /** - * If true, the server will return JSON responses instead of starting an SSE stream. - * This can be useful for simple request/response scenarios without streaming. - * Default is false (SSE streams are preferred). - */ - enableJsonResponse?: boolean; - /** - * Event store for resumability support - * If provided, resumability will be enabled, allowing clients to reconnect and resume messages - */ - eventStore?: EventStore; - /** - * List of allowed host header values for DNS rebinding protection. - * If not specified, host validation is disabled. - * @deprecated Use external middleware for host validation instead. - */ - allowedHosts?: string[]; - /** - * List of allowed origin header values for DNS rebinding protection. - * If not specified, origin validation is disabled. - * @deprecated Use external middleware for origin validation instead. - */ - allowedOrigins?: string[]; - /** - * Enable DNS rebinding protection (requires allowedHosts and/or allowedOrigins to be configured). - * Default is false for backwards compatibility. - * @deprecated Use external middleware for DNS rebinding protection instead. - */ - enableDnsRebindingProtection?: boolean; - /** - * Retry interval in milliseconds to suggest to clients in SSE retry field. - * When set, the server will send a retry field in SSE priming events to control - * client reconnection timing for polling behavior. - */ - retryInterval?: number; -} -/** - * Options for handling a request - */ -export interface HandleRequestOptions { - /** - * Pre-parsed request body. If provided, the transport will use this instead of parsing req.json(). - * Useful when using body-parser middleware that has already parsed the body. - */ - parsedBody?: unknown; - /** - * Authentication info from middleware. If provided, will be passed to message handlers. - */ - authInfo?: AuthInfo; -} -/** - * Server transport for Web Standards Streamable HTTP: this implements the MCP Streamable HTTP transport specification - * using Web Standard APIs (Request, Response, ReadableStream). - * - * This transport works on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc. - * - * Usage example: - * - * ```typescript - * // Stateful mode - server sets the session ID - * const statefulTransport = new WebStandardStreamableHTTPServerTransport({ - * sessionIdGenerator: () => crypto.randomUUID(), - * }); - * - * // Stateless mode - explicitly set session ID to undefined - * const statelessTransport = new WebStandardStreamableHTTPServerTransport({ - * sessionIdGenerator: undefined, - * }); - * - * // Hono.js usage - * app.all('/mcp', async (c) => { - * return transport.handleRequest(c.req.raw); - * }); - * - * // Cloudflare Workers usage - * export default { - * async fetch(request: Request): Promise { - * return transport.handleRequest(request); - * } - * }; - * ``` - * - * In stateful mode: - * - Session ID is generated and included in response headers - * - Session ID is always included in initialization responses - * - Requests with invalid session IDs are rejected with 404 Not Found - * - Non-initialization requests without a session ID are rejected with 400 Bad Request - * - State is maintained in-memory (connections, message history) - * - * In stateless mode: - * - No Session ID is included in any responses - * - No session validation is performed - */ -export declare class WebStandardStreamableHTTPServerTransport implements Transport { - private sessionIdGenerator; - private _started; - private _hasHandledRequest; - private _streamMapping; - private _requestToStreamMapping; - private _requestResponseMap; - private _initialized; - private _enableJsonResponse; - private _standaloneSseStreamId; - private _eventStore?; - private _onsessioninitialized?; - private _onsessionclosed?; - private _allowedHosts?; - private _allowedOrigins?; - private _enableDnsRebindingProtection; - private _retryInterval?; - sessionId?: string; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage, extra?: MessageExtraInfo) => void; - constructor(options?: WebStandardStreamableHTTPServerTransportOptions); - /** - * Starts the transport. This is required by the Transport interface but is a no-op - * for the Streamable HTTP transport as connections are managed per-request. - */ - start(): Promise; - /** - * Helper to create a JSON error response - */ - private createJsonErrorResponse; - /** - * Validates request headers for DNS rebinding protection. - * @returns Error response if validation fails, undefined if validation passes. - */ - private validateRequestHeaders; - /** - * Handles an incoming HTTP request, whether GET, POST, or DELETE - * Returns a Response object (Web Standard) - */ - handleRequest(req: Request, options?: HandleRequestOptions): Promise; - /** - * Writes a priming event to establish resumption capability. - * Only sends if eventStore is configured (opt-in for resumability) and - * the client's protocol version supports empty SSE data (>= 2025-11-25). - */ - private writePrimingEvent; - /** - * Handles GET requests for SSE stream - */ - private handleGetRequest; - /** - * Replays events that would have been sent after the specified event ID - * Only used when resumability is enabled - */ - private replayEvents; - /** - * Writes an event to an SSE stream via controller with proper formatting - */ - private writeSSEEvent; - /** - * Handles unsupported requests (PUT, PATCH, etc.) - */ - private handleUnsupportedRequest; - /** - * Handles POST requests containing JSON-RPC messages - */ - private handlePostRequest; - /** - * Handles DELETE requests to terminate sessions - */ - private handleDeleteRequest; - /** - * Validates session ID for non-initialization requests. - * Returns Response error if invalid, undefined otherwise - */ - private validateSession; - /** - * Validates the MCP-Protocol-Version header on incoming requests. - * - * For initialization: Version negotiation handles unknown versions gracefully - * (server responds with its supported version). - * - * For subsequent requests with MCP-Protocol-Version header: - * - Accept if in supported list - * - 400 if unsupported - * - * For HTTP requests without the MCP-Protocol-Version header: - * - Accept and default to the version negotiated at initialization - */ - private validateProtocolVersion; - close(): Promise; - /** - * Close an SSE stream for a specific request, triggering client reconnection. - * Use this to implement polling behavior during long-running operations - - * client will reconnect after the retry interval specified in the priming event. - */ - closeSSEStream(requestId: RequestId): void; - /** - * Close the standalone GET SSE stream, triggering client reconnection. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream(): void; - send(message: JSONRPCMessage, options?: { - relatedRequestId?: RequestId; - }): Promise; -} -//# sourceMappingURL=webStandardStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts.map deleted file mode 100644 index 92a0e9b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webStandardStreamableHttp.d.ts","sourceRoot":"","sources":["../../../src/server/webStandardStreamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACH,gBAAgB,EAMhB,cAAc,EAEd,SAAS,EAGZ,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1E;;;;;;;OAOG;IACH,qBAAqB,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IAExE,iBAAiB,CACb,WAAW,EAAE,OAAO,EACpB,EACI,IAAI,EACP,EAAE;QACC,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,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;OAIG;IACH,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAU1C;;;OAGG;IACH,wBAAwB,IAAI,IAAI;IAO1B,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAiGjG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js deleted file mode 100644 index 456b084..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js +++ /dev/null @@ -1,736 +0,0 @@ -"use strict"; -/** - * Web Standards Streamable HTTP Server Transport - * - * This is the core transport implementation using Web Standard APIs (Request, Response, ReadableStream). - * It can run on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc. - * - * For Node.js Express/HTTP compatibility, use `StreamableHTTPServerTransport` which wraps this transport. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WebStandardStreamableHTTPServerTransport = void 0; -const types_js_1 = require("../types.js"); -/** - * Server transport for Web Standards Streamable HTTP: this implements the MCP Streamable HTTP transport specification - * using Web Standard APIs (Request, Response, ReadableStream). - * - * This transport works on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc. - * - * Usage example: - * - * ```typescript - * // Stateful mode - server sets the session ID - * const statefulTransport = new WebStandardStreamableHTTPServerTransport({ - * sessionIdGenerator: () => crypto.randomUUID(), - * }); - * - * // Stateless mode - explicitly set session ID to undefined - * const statelessTransport = new WebStandardStreamableHTTPServerTransport({ - * sessionIdGenerator: undefined, - * }); - * - * // Hono.js usage - * app.all('/mcp', async (c) => { - * return transport.handleRequest(c.req.raw); - * }); - * - * // Cloudflare Workers usage - * export default { - * async fetch(request: Request): Promise { - * return transport.handleRequest(request); - * } - * }; - * ``` - * - * In stateful mode: - * - Session ID is generated and included in response headers - * - Session ID is always included in initialization responses - * - Requests with invalid session IDs are rejected with 404 Not Found - * - Non-initialization requests without a session ID are rejected with 400 Bad Request - * - State is maintained in-memory (connections, message history) - * - * In stateless mode: - * - No Session ID is included in any responses - * - No session validation is performed - */ -class WebStandardStreamableHTTPServerTransport { - constructor(options = {}) { - this._started = false; - this._hasHandledRequest = false; - this._streamMapping = new Map(); - this._requestToStreamMapping = new Map(); - this._requestResponseMap = new Map(); - this._initialized = false; - this._enableJsonResponse = false; - this._standaloneSseStreamId = '_GET_stream'; - this.sessionIdGenerator = options.sessionIdGenerator; - this._enableJsonResponse = options.enableJsonResponse ?? false; - this._eventStore = options.eventStore; - this._onsessioninitialized = options.onsessioninitialized; - this._onsessionclosed = options.onsessionclosed; - this._allowedHosts = options.allowedHosts; - this._allowedOrigins = options.allowedOrigins; - this._enableDnsRebindingProtection = options.enableDnsRebindingProtection ?? false; - this._retryInterval = options.retryInterval; - } - /** - * Starts the transport. This is required by the Transport interface but is a no-op - * for the Streamable HTTP transport as connections are managed per-request. - */ - async start() { - if (this._started) { - throw new Error('Transport already started'); - } - this._started = true; - } - /** - * Helper to create a JSON error response - */ - createJsonErrorResponse(status, code, message, options) { - const error = { code, message }; - if (options?.data !== undefined) { - error.data = options.data; - } - return new Response(JSON.stringify({ - jsonrpc: '2.0', - error, - id: null - }), { - status, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - /** - * Validates request headers for DNS rebinding protection. - * @returns Error response if validation fails, undefined if validation passes. - */ - validateRequestHeaders(req) { - // Skip validation if protection is not enabled - if (!this._enableDnsRebindingProtection) { - return undefined; - } - // Validate Host header if allowedHosts is configured - if (this._allowedHosts && this._allowedHosts.length > 0) { - const hostHeader = req.headers.get('host'); - if (!hostHeader || !this._allowedHosts.includes(hostHeader)) { - const error = `Invalid Host header: ${hostHeader}`; - this.onerror?.(new Error(error)); - return this.createJsonErrorResponse(403, -32000, error); - } - } - // Validate Origin header if allowedOrigins is configured - if (this._allowedOrigins && this._allowedOrigins.length > 0) { - const originHeader = req.headers.get('origin'); - if (originHeader && !this._allowedOrigins.includes(originHeader)) { - const error = `Invalid Origin header: ${originHeader}`; - this.onerror?.(new Error(error)); - return this.createJsonErrorResponse(403, -32000, error); - } - } - return undefined; - } - /** - * Handles an incoming HTTP request, whether GET, POST, or DELETE - * Returns a Response object (Web Standard) - */ - async handleRequest(req, options) { - // In stateless mode (no sessionIdGenerator), each request must use a fresh transport. - // Reusing a stateless transport causes message ID collisions between clients. - if (!this.sessionIdGenerator && this._hasHandledRequest) { - throw new Error('Stateless transport cannot be reused across requests. Create a new transport per request.'); - } - this._hasHandledRequest = true; - // Validate request headers for DNS rebinding protection - const validationError = this.validateRequestHeaders(req); - if (validationError) { - return validationError; - } - switch (req.method) { - case 'POST': - return this.handlePostRequest(req, options); - case 'GET': - return this.handleGetRequest(req); - case 'DELETE': - return this.handleDeleteRequest(req); - default: - return this.handleUnsupportedRequest(); - } - } - /** - * Writes a priming event to establish resumption capability. - * Only sends if eventStore is configured (opt-in for resumability) and - * the client's protocol version supports empty SSE data (>= 2025-11-25). - */ - async writePrimingEvent(controller, encoder, streamId, protocolVersion) { - if (!this._eventStore) { - return; - } - // Priming events have empty data which older clients cannot handle. - // Only send priming events to clients with protocol version >= 2025-11-25 - // which includes the fix for handling empty SSE data. - if (protocolVersion < '2025-11-25') { - return; - } - const primingEventId = await this._eventStore.storeEvent(streamId, {}); - let primingEvent = `id: ${primingEventId}\ndata: \n\n`; - if (this._retryInterval !== undefined) { - primingEvent = `id: ${primingEventId}\nretry: ${this._retryInterval}\ndata: \n\n`; - } - controller.enqueue(encoder.encode(primingEvent)); - } - /** - * Handles GET requests for SSE stream - */ - async handleGetRequest(req) { - // The client MUST include an Accept header, listing text/event-stream as a supported content type. - const acceptHeader = req.headers.get('accept'); - if (!acceptHeader?.includes('text/event-stream')) { - return this.createJsonErrorResponse(406, -32000, 'Not Acceptable: Client must accept text/event-stream'); - } - // If an Mcp-Session-Id is returned by the server during initialization, - // clients using the Streamable HTTP transport MUST include it - // in the Mcp-Session-Id header on all of their subsequent HTTP requests. - const sessionError = this.validateSession(req); - if (sessionError) { - return sessionError; - } - const protocolError = this.validateProtocolVersion(req); - if (protocolError) { - return protocolError; - } - // Handle resumability: check for Last-Event-ID header - if (this._eventStore) { - const lastEventId = req.headers.get('last-event-id'); - if (lastEventId) { - return this.replayEvents(lastEventId); - } - } - // Check if there's already an active standalone SSE stream for this session - if (this._streamMapping.get(this._standaloneSseStreamId) !== undefined) { - // Only one GET SSE stream is allowed per session - return this.createJsonErrorResponse(409, -32000, 'Conflict: Only one SSE stream is allowed per session'); - } - const encoder = new TextEncoder(); - let streamController; - // Create a ReadableStream with a controller we can use to push SSE events - const readable = new ReadableStream({ - start: controller => { - streamController = controller; - }, - cancel: () => { - // Stream was cancelled by client - this._streamMapping.delete(this._standaloneSseStreamId); - } - }); - const headers = { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache, no-transform', - Connection: 'keep-alive' - }; - // After initialization, always include the session ID if we have one - if (this.sessionId !== undefined) { - headers['mcp-session-id'] = this.sessionId; - } - // Store the stream mapping with the controller for pushing data - this._streamMapping.set(this._standaloneSseStreamId, { - controller: streamController, - encoder, - cleanup: () => { - this._streamMapping.delete(this._standaloneSseStreamId); - try { - streamController.close(); - } - catch { - // Controller might already be closed - } - } - }); - return new Response(readable, { headers }); - } - /** - * Replays events that would have been sent after the specified event ID - * Only used when resumability is enabled - */ - async replayEvents(lastEventId) { - if (!this._eventStore) { - return this.createJsonErrorResponse(400, -32000, 'Event store not configured'); - } - try { - // If getStreamIdForEventId is available, use it for conflict checking - let streamId; - if (this._eventStore.getStreamIdForEventId) { - streamId = await this._eventStore.getStreamIdForEventId(lastEventId); - if (!streamId) { - return this.createJsonErrorResponse(400, -32000, 'Invalid event ID format'); - } - // Check conflict with the SAME streamId we'll use for mapping - if (this._streamMapping.get(streamId) !== undefined) { - return this.createJsonErrorResponse(409, -32000, 'Conflict: Stream already has an active connection'); - } - } - const headers = { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache, no-transform', - Connection: 'keep-alive' - }; - if (this.sessionId !== undefined) { - headers['mcp-session-id'] = this.sessionId; - } - // Create a ReadableStream with controller for SSE - const encoder = new TextEncoder(); - let streamController; - const readable = new ReadableStream({ - start: controller => { - streamController = controller; - }, - cancel: () => { - // Stream was cancelled by client - // Cleanup will be handled by the mapping - } - }); - // Replay events - returns the streamId for backwards compatibility - const replayedStreamId = await this._eventStore.replayEventsAfter(lastEventId, { - send: async (eventId, message) => { - const success = this.writeSSEEvent(streamController, encoder, message, eventId); - if (!success) { - this.onerror?.(new Error('Failed replay events')); - try { - streamController.close(); - } - catch { - // Controller might already be closed - } - } - } - }); - this._streamMapping.set(replayedStreamId, { - controller: streamController, - encoder, - cleanup: () => { - this._streamMapping.delete(replayedStreamId); - try { - streamController.close(); - } - catch { - // Controller might already be closed - } - } - }); - return new Response(readable, { headers }); - } - catch (error) { - this.onerror?.(error); - return this.createJsonErrorResponse(500, -32000, 'Error replaying events'); - } - } - /** - * Writes an event to an SSE stream via controller with proper formatting - */ - writeSSEEvent(controller, encoder, message, eventId) { - try { - let eventData = `event: message\n`; - // Include event ID if provided - this is important for resumability - if (eventId) { - eventData += `id: ${eventId}\n`; - } - eventData += `data: ${JSON.stringify(message)}\n\n`; - controller.enqueue(encoder.encode(eventData)); - return true; - } - catch { - return false; - } - } - /** - * Handles unsupported requests (PUT, PATCH, etc.) - */ - handleUnsupportedRequest() { - return new Response(JSON.stringify({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Method not allowed.' - }, - id: null - }), { - status: 405, - headers: { - Allow: 'GET, POST, DELETE', - 'Content-Type': 'application/json' - } - }); - } - /** - * Handles POST requests containing JSON-RPC messages - */ - async handlePostRequest(req, options) { - try { - // Validate the Accept header - const acceptHeader = req.headers.get('accept'); - // The client MUST include an Accept header, listing both application/json and text/event-stream as supported content types. - if (!acceptHeader?.includes('application/json') || !acceptHeader.includes('text/event-stream')) { - return this.createJsonErrorResponse(406, -32000, 'Not Acceptable: Client must accept both application/json and text/event-stream'); - } - const ct = req.headers.get('content-type'); - if (!ct || !ct.includes('application/json')) { - return this.createJsonErrorResponse(415, -32000, 'Unsupported Media Type: Content-Type must be application/json'); - } - // Build request info from headers - const requestInfo = { - headers: Object.fromEntries(req.headers.entries()) - }; - let rawMessage; - if (options?.parsedBody !== undefined) { - rawMessage = options.parsedBody; - } - else { - try { - rawMessage = await req.json(); - } - catch { - return this.createJsonErrorResponse(400, -32700, 'Parse error: Invalid JSON'); - } - } - let messages; - // handle batch and single messages - try { - if (Array.isArray(rawMessage)) { - messages = rawMessage.map(msg => types_js_1.JSONRPCMessageSchema.parse(msg)); - } - else { - messages = [types_js_1.JSONRPCMessageSchema.parse(rawMessage)]; - } - } - catch { - return this.createJsonErrorResponse(400, -32700, 'Parse error: Invalid JSON-RPC message'); - } - // Check if this is an initialization request - // https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/lifecycle/ - const isInitializationRequest = messages.some(types_js_1.isInitializeRequest); - if (isInitializationRequest) { - // If it's a server with session management and the session ID is already set we should reject the request - // to avoid re-initialization. - if (this._initialized && this.sessionId !== undefined) { - return this.createJsonErrorResponse(400, -32600, 'Invalid Request: Server already initialized'); - } - if (messages.length > 1) { - return this.createJsonErrorResponse(400, -32600, 'Invalid Request: Only one initialization request is allowed'); - } - this.sessionId = this.sessionIdGenerator?.(); - this._initialized = true; - // If we have a session ID and an onsessioninitialized handler, call it immediately - // This is needed in cases where the server needs to keep track of multiple sessions - if (this.sessionId && this._onsessioninitialized) { - await Promise.resolve(this._onsessioninitialized(this.sessionId)); - } - } - if (!isInitializationRequest) { - // If an Mcp-Session-Id is returned by the server during initialization, - // clients using the Streamable HTTP transport MUST include it - // in the Mcp-Session-Id header on all of their subsequent HTTP requests. - const sessionError = this.validateSession(req); - if (sessionError) { - return sessionError; - } - // Mcp-Protocol-Version header is required for all requests after initialization. - const protocolError = this.validateProtocolVersion(req); - if (protocolError) { - return protocolError; - } - } - // check if it contains requests - const hasRequests = messages.some(types_js_1.isJSONRPCRequest); - if (!hasRequests) { - // if it only contains notifications or responses, return 202 - for (const message of messages) { - this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo }); - } - return new Response(null, { status: 202 }); - } - // The default behavior is to use SSE streaming - // but in some cases server will return JSON responses - const streamId = crypto.randomUUID(); - // Extract protocol version for priming event decision. - // For initialize requests, get from request params. - // For other requests, get from header (already validated). - const initRequest = messages.find(m => (0, types_js_1.isInitializeRequest)(m)); - const clientProtocolVersion = initRequest - ? initRequest.params.protocolVersion - : (req.headers.get('mcp-protocol-version') ?? types_js_1.DEFAULT_NEGOTIATED_PROTOCOL_VERSION); - if (this._enableJsonResponse) { - // For JSON response mode, return a Promise that resolves when all responses are ready - return new Promise(resolve => { - this._streamMapping.set(streamId, { - resolveJson: resolve, - cleanup: () => { - this._streamMapping.delete(streamId); - } - }); - for (const message of messages) { - if ((0, types_js_1.isJSONRPCRequest)(message)) { - this._requestToStreamMapping.set(message.id, streamId); - } - } - for (const message of messages) { - this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo }); - } - }); - } - // SSE streaming mode - use ReadableStream with controller for more reliable data pushing - const encoder = new TextEncoder(); - let streamController; - const readable = new ReadableStream({ - start: controller => { - streamController = controller; - }, - cancel: () => { - // Stream was cancelled by client - this._streamMapping.delete(streamId); - } - }); - const headers = { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache', - Connection: 'keep-alive' - }; - // After initialization, always include the session ID if we have one - if (this.sessionId !== undefined) { - headers['mcp-session-id'] = this.sessionId; - } - // Store the response for this request to send messages back through this connection - // We need to track by request ID to maintain the connection - for (const message of messages) { - if ((0, types_js_1.isJSONRPCRequest)(message)) { - this._streamMapping.set(streamId, { - controller: streamController, - encoder, - cleanup: () => { - this._streamMapping.delete(streamId); - try { - streamController.close(); - } - catch { - // Controller might already be closed - } - } - }); - this._requestToStreamMapping.set(message.id, streamId); - } - } - // Write priming event if event store is configured (after mapping is set up) - await this.writePrimingEvent(streamController, encoder, streamId, clientProtocolVersion); - // handle each message - for (const message of messages) { - // Build closeSSEStream callback for requests when eventStore is configured - // AND client supports resumability (protocol version >= 2025-11-25). - // Old clients can't resume if the stream is closed early because they - // didn't receive a priming event with an event ID. - let closeSSEStream; - let closeStandaloneSSEStream; - if ((0, types_js_1.isJSONRPCRequest)(message) && this._eventStore && clientProtocolVersion >= '2025-11-25') { - closeSSEStream = () => { - this.closeSSEStream(message.id); - }; - closeStandaloneSSEStream = () => { - this.closeStandaloneSSEStream(); - }; - } - this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo, closeSSEStream, closeStandaloneSSEStream }); - } - // The server SHOULD NOT close the SSE stream before sending all JSON-RPC responses - // This will be handled by the send() method when responses are ready - return new Response(readable, { status: 200, headers }); - } - catch (error) { - // return JSON-RPC formatted error - this.onerror?.(error); - return this.createJsonErrorResponse(400, -32700, 'Parse error', { data: String(error) }); - } - } - /** - * Handles DELETE requests to terminate sessions - */ - async handleDeleteRequest(req) { - const sessionError = this.validateSession(req); - if (sessionError) { - return sessionError; - } - const protocolError = this.validateProtocolVersion(req); - if (protocolError) { - return protocolError; - } - await Promise.resolve(this._onsessionclosed?.(this.sessionId)); - await this.close(); - return new Response(null, { status: 200 }); - } - /** - * Validates session ID for non-initialization requests. - * Returns Response error if invalid, undefined otherwise - */ - validateSession(req) { - if (this.sessionIdGenerator === undefined) { - // If the sessionIdGenerator ID is not set, the session management is disabled - // and we don't need to validate the session ID - return undefined; - } - if (!this._initialized) { - // If the server has not been initialized yet, reject all requests - return this.createJsonErrorResponse(400, -32000, 'Bad Request: Server not initialized'); - } - const sessionId = req.headers.get('mcp-session-id'); - if (!sessionId) { - // Non-initialization requests without a session ID should return 400 Bad Request - return this.createJsonErrorResponse(400, -32000, 'Bad Request: Mcp-Session-Id header is required'); - } - if (sessionId !== this.sessionId) { - // Reject requests with invalid session ID with 404 Not Found - return this.createJsonErrorResponse(404, -32001, 'Session not found'); - } - return undefined; - } - /** - * Validates the MCP-Protocol-Version header on incoming requests. - * - * For initialization: Version negotiation handles unknown versions gracefully - * (server responds with its supported version). - * - * For subsequent requests with MCP-Protocol-Version header: - * - Accept if in supported list - * - 400 if unsupported - * - * For HTTP requests without the MCP-Protocol-Version header: - * - Accept and default to the version negotiated at initialization - */ - validateProtocolVersion(req) { - const protocolVersion = req.headers.get('mcp-protocol-version'); - if (protocolVersion !== null && !types_js_1.SUPPORTED_PROTOCOL_VERSIONS.includes(protocolVersion)) { - return this.createJsonErrorResponse(400, -32000, `Bad Request: Unsupported protocol version: ${protocolVersion} (supported versions: ${types_js_1.SUPPORTED_PROTOCOL_VERSIONS.join(', ')})`); - } - return undefined; - } - async close() { - // Close all SSE connections - this._streamMapping.forEach(({ cleanup }) => { - cleanup(); - }); - this._streamMapping.clear(); - // Clear any pending responses - this._requestResponseMap.clear(); - this.onclose?.(); - } - /** - * Close an SSE stream for a specific request, triggering client reconnection. - * Use this to implement polling behavior during long-running operations - - * client will reconnect after the retry interval specified in the priming event. - */ - closeSSEStream(requestId) { - const streamId = this._requestToStreamMapping.get(requestId); - if (!streamId) - return; - const stream = this._streamMapping.get(streamId); - if (stream) { - stream.cleanup(); - } - } - /** - * Close the standalone GET SSE stream, triggering client reconnection. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream() { - const stream = this._streamMapping.get(this._standaloneSseStreamId); - if (stream) { - stream.cleanup(); - } - } - async send(message, options) { - let requestId = options?.relatedRequestId; - if ((0, types_js_1.isJSONRPCResultResponse)(message) || (0, types_js_1.isJSONRPCErrorResponse)(message)) { - // If the message is a response, use the request ID from the message - requestId = message.id; - } - // Check if this message should be sent on the standalone SSE stream (no request ID) - // Ignore notifications from tools (which have relatedRequestId set) - // Those will be sent via dedicated response SSE streams - if (requestId === undefined) { - // For standalone SSE streams, we can only send requests and notifications - if ((0, types_js_1.isJSONRPCResultResponse)(message) || (0, types_js_1.isJSONRPCErrorResponse)(message)) { - throw new Error('Cannot send a response on a standalone SSE stream unless resuming a previous client request'); - } - // Generate and store event ID if event store is provided - // Store even if stream is disconnected so events can be replayed on reconnect - let eventId; - if (this._eventStore) { - // Stores the event and gets the generated event ID - eventId = await this._eventStore.storeEvent(this._standaloneSseStreamId, message); - } - const standaloneSse = this._streamMapping.get(this._standaloneSseStreamId); - if (standaloneSse === undefined) { - // Stream is disconnected - event is stored for replay, nothing more to do - return; - } - // Send the message to the standalone SSE stream - if (standaloneSse.controller && standaloneSse.encoder) { - this.writeSSEEvent(standaloneSse.controller, standaloneSse.encoder, message, eventId); - } - return; - } - // Get the response for this request - const streamId = this._requestToStreamMapping.get(requestId); - if (!streamId) { - throw new Error(`No connection established for request ID: ${String(requestId)}`); - } - const stream = this._streamMapping.get(streamId); - if (!this._enableJsonResponse && stream?.controller && stream?.encoder) { - // For SSE responses, generate event ID if event store is provided - let eventId; - if (this._eventStore) { - eventId = await this._eventStore.storeEvent(streamId, message); - } - // Write the event to the response stream - this.writeSSEEvent(stream.controller, stream.encoder, message, eventId); - } - if ((0, types_js_1.isJSONRPCResultResponse)(message) || (0, types_js_1.isJSONRPCErrorResponse)(message)) { - this._requestResponseMap.set(requestId, message); - const relatedIds = Array.from(this._requestToStreamMapping.entries()) - .filter(([_, sid]) => sid === streamId) - .map(([id]) => id); - // Check if we have responses for all requests using this connection - const allResponsesReady = relatedIds.every(id => this._requestResponseMap.has(id)); - if (allResponsesReady) { - if (!stream) { - throw new Error(`No connection established for request ID: ${String(requestId)}`); - } - if (this._enableJsonResponse && stream.resolveJson) { - // All responses ready, send as JSON - const headers = { - 'Content-Type': 'application/json' - }; - if (this.sessionId !== undefined) { - headers['mcp-session-id'] = this.sessionId; - } - const responses = relatedIds.map(id => this._requestResponseMap.get(id)); - if (responses.length === 1) { - stream.resolveJson(new Response(JSON.stringify(responses[0]), { status: 200, headers })); - } - else { - stream.resolveJson(new Response(JSON.stringify(responses), { status: 200, headers })); - } - } - else { - // End the SSE stream - stream.cleanup(); - } - // Clean up - for (const id of relatedIds) { - this._requestResponseMap.delete(id); - this._requestToStreamMapping.delete(id); - } - } - } - } -} -exports.WebStandardStreamableHTTPServerTransport = WebStandardStreamableHTTPServerTransport; -//# sourceMappingURL=webStandardStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js.map deleted file mode 100644 index a0463d9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webStandardStreamableHttp.js","sourceRoot":"","sources":["../../../src/server/webStandardStreamableHttp.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAIH,0CAYqB;AA8IrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAa,wCAAwC;IAwBjD,YAAY,UAA2D,EAAE;QArBjE,aAAQ,GAAY,KAAK,CAAC;QAC1B,uBAAkB,GAAY,KAAK,CAAC;QACpC,mBAAc,GAA+B,IAAI,GAAG,EAAE,CAAC;QACvD,4BAAuB,GAA2B,IAAI,GAAG,EAAE,CAAC;QAC5D,wBAAmB,GAAmC,IAAI,GAAG,EAAE,CAAC;QAChE,iBAAY,GAAY,KAAK,CAAC;QAC9B,wBAAmB,GAAY,KAAK,CAAC;QACrC,2BAAsB,GAAW,aAAa,CAAC;QAenD,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,IAAI,KAAK,CAAC;QAC/D,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;QAC1D,IAAI,CA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ACJ,qBAAqB;oBACrB,MAAM,CAAC,OAAO,EAAE,CAAC;gBACrB,CAAC;gBACD,WAAW;gBACX,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;oBAC1B,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACpC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAC5C,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AA5xBD,4FA4xBC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts deleted file mode 100644 index c3a5b60..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type * as z3 from 'zod/v3'; -import type * as z4 from 'zod/v4/core'; -export type AnySchema = z3.ZodTypeAny | z4.$ZodType; -export type AnyObjectSchema = z3.AnyZodObject | z4.$ZodObject | AnySchema; -export type ZodRawShapeCompat = Record; -export interface ZodV3Internal { - _def?: { - typeName?: string; - value?: unknown; - values?: unknown[]; - shape?: Record | (() => Record); - description?: string; - }; - shape?: Record | (() => Record); - value?: unknown; -} -export interface ZodV4Internal { - _zod?: { - def?: { - type?: string; - value?: unknown; - values?: unknown[]; - shape?: Record | (() => Record); - }; - }; - value?: unknown; -} -export type SchemaOutput = S extends z3.ZodTypeAny ? z3.infer : S extends z4.$ZodType ? z4.output : never; -export type SchemaInput = S extends z3.ZodTypeAny ? z3.input : S extends z4.$ZodType ? z4.input : never; -/** - * Infers the output type from a ZodRawShapeCompat (raw shape object). - * Maps over each key in the shape and infers the output type from each schema. - */ -export type ShapeOutput = { - [K in keyof Shape]: SchemaOutput; -}; -export declare function isZ4Schema(s: AnySchema): s is z4.$ZodType; -export declare function objectFromShape(shape: ZodRawShapeCompat): AnyObjectSchema; -export declare function safeParse(schema: S, data: unknown): { - success: true; - data: SchemaOutput; -} | { - success: false; - error: unknown; -}; -export declare function safeParseAsync(schema: S, data: unknown): Promise<{ - success: true; - data: SchemaOutput; -} | { - success: false; - error: unknown; -}>; -export declare function getObjectShape(schema: AnyObjectSchema | undefined): Record | undefined; -/** - * Normalizes a schema to an object schema. Handles both: - * - Already-constructed object schemas (v3 or v4) - * - Raw shapes that need to be wrapped into object schemas - */ -export declare function normalizeObjectSchema(schema: AnySchema | ZodRawShapeCompat | undefined): AnyObjectSchema | undefined; -/** - * Safely extracts an error message from a parse result error. - * Zod errors can have different structures, so we handle various cases. - */ -export declare function getParseErrorMessage(error: unknown): string; -/** - * Gets the description from a schema, if available. - * Works with both Zod v3 and v4. - * - * Both versions expose a `.description` getter that returns the description - * from their respective internal storage (v3: _def, v4: globalRegistry). - */ -export declare function getSchemaDescription(schema: AnySchema): string | undefined; -/** - * Checks if a schema is optional. - * Works with both Zod v3 and v4. - */ -export declare function isSchemaOptional(schema: AnySchema): boolean; -/** - * Gets the literal value from a schema, if it's a literal schema. - * Works with both Zod v3 and v4. - * Returns undefined if the schema is not a literal or the value cannot be determined. - */ -export declare function getLiteralValue(schema: AnySchema): unknown; -//# sourceMappingURL=zod-compat.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts.map deleted file mode 100644 index a2ccd51..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-compat.d.ts","sourceRoot":"","sources":["../../../src/server/zod-compat.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAMvC,MAAM,MAAM,SAAS,GAAG,EAAE,CAAC,UAAU,GAAG,EAA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AAGD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,GAAG,SAAS,GAAG,eAAe,GAAG,SAAS,CAiDpH;AAGD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAoB3D;AAGD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE1E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAW3D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAwB1D"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js deleted file mode 100644 index 2e75c80..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js +++ /dev/null @@ -1,244 +0,0 @@ -"use strict"; -// zod-compat.ts -// ---------------------------------------------------- -// Unified types + helpers to accept Zod v3 and v4 (Mini) -// ---------------------------------------------------- -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isZ4Schema = isZ4Schema; -exports.objectFromShape = objectFromShape; -exports.safeParse = safeParse; -exports.safeParseAsync = safeParseAsync; -exports.getObjectShape = getObjectShape; -exports.normalizeObjectSchema = normalizeObjectSchema; -exports.getParseErrorMessage = getParseErrorMessage; -exports.getSchemaDescription = getSchemaDescription; -exports.isSchemaOptional = isSchemaOptional; -exports.getLiteralValue = getLiteralValue; -const z3rt = __importStar(require("zod/v3")); -const z4mini = __importStar(require("zod/v4-mini")); -// --- Runtime detection --- -function isZ4Schema(s) { - // Present on Zod 4 (Classic & Mini) schemas; absent on Zod 3 - const schema = s; - return !!schema._zod; -} -// --- Schema construction --- -function objectFromShape(shape) { - const values = Object.values(shape); - if (values.length === 0) - return z4mini.object({}); // default to v4 Mini - const allV4 = values.every(isZ4Schema); - const allV3 = values.every(s => !isZ4Schema(s)); - if (allV4) - return z4mini.object(shape); - if (allV3) - return z3rt.object(shape); - throw new Error('Mixed Zod versions detected in object shape.'); -} -// --- Unified parsing --- -function safeParse(schema, data) { - if (isZ4Schema(schema)) { - // Mini exposes top-level safeParse - const result = z4mini.safeParse(schema, data); - return result; - } - const v3Schema = schema; - const result = v3Schema.safeParse(data); - return result; -} -async function safeParseAsync(schema, data) { - if (isZ4Schema(schema)) { - // Mini exposes top-level safeParseAsync - const result = await z4mini.safeParseAsync(schema, data); - return result; - } - const v3Schema = schema; - const result = await v3Schema.safeParseAsync(data); - return result; -} -// --- Shape extraction --- -function getObjectShape(schema) { - if (!schema) - return undefined; - // Zod v3 exposes `.shape`; Zod v4 keeps the shape on `_zod.def.shape` - let rawShape; - if (isZ4Schema(schema)) { - const v4Schema = schema; - rawShape = v4Schema._zod?.def?.shape; - } - else { - const v3Schema = schema; - rawShape = v3Schema.shape; - } - if (!rawShape) - return undefined; - if (typeof rawShape === 'function') { - try { - return rawShape(); - } - catch { - return undefined; - } - } - return rawShape; -} -// --- Schema normalization --- -/** - * Normalizes a schema to an object schema. Handles both: - * - Already-constructed object schemas (v3 or v4) - * - Raw shapes that need to be wrapped into object schemas - */ -function normalizeObjectSchema(schema) { - if (!schema) - return undefined; - // First check if it's a raw shape (Record) - // Raw shapes don't have _def or _zod properties and aren't schemas themselves - if (typeof schema === 'object') { - // Check if it's actually a ZodRawShapeCompat (not a schema instance) - // by checking if it lacks schema-like internal properties - const asV3 = schema; - const asV4 = schema; - // If it's not a schema instance (no _def or _zod), it might be a raw shape - if (!asV3._def && !asV4._zod) { - // Check if all values are schemas (heuristic to confirm it's a raw shape) - const values = Object.values(schema); - if (values.length > 0 && - values.every(v => typeof v === 'object' && - v !== null && - (v._def !== undefined || - v._zod !== undefined || - typeof v.parse === 'function'))) { - return objectFromShape(schema); - } - } - } - // If we get here, it should be an AnySchema (not a raw shape) - // Check if it's already an object schema - if (isZ4Schema(schema)) { - // Check if it's a v4 object - const v4Schema = schema; - const def = v4Schema._zod?.def; - if (def && (def.type === 'object' || def.shape !== undefined)) { - return schema; - } - } - else { - // Check if it's a v3 object - const v3Schema = schema; - if (v3Schema.shape !== undefined) { - return schema; - } - } - return undefined; -} -// --- Error message extraction --- -/** - * Safely extracts an error message from a parse result error. - * Zod errors can have different structures, so we handle various cases. - */ -function getParseErrorMessage(error) { - if (error && typeof error === 'object') { - // Try common error structures - if ('message' in error && typeof error.message === 'string') { - return error.message; - } - if ('issues' in error && Array.isArray(error.issues) && error.issues.length > 0) { - const firstIssue = error.issues[0]; - if (firstIssue && typeof firstIssue === 'object' && 'message' in firstIssue) { - return String(firstIssue.message); - } - } - // Fallback: try to stringify the error - try { - return JSON.stringify(error); - } - catch { - return String(error); - } - } - return String(error); -} -// --- Schema metadata access --- -/** - * Gets the description from a schema, if available. - * Works with both Zod v3 and v4. - * - * Both versions expose a `.description` getter that returns the description - * from their respective internal storage (v3: _def, v4: globalRegistry). - */ -function getSchemaDescription(schema) { - return schema.description; -} -/** - * Checks if a schema is optional. - * Works with both Zod v3 and v4. - */ -function isSchemaOptional(schema) { - if (isZ4Schema(schema)) { - const v4Schema = schema; - return v4Schema._zod?.def?.type === 'optional'; - } - const v3Schema = schema; - // v3 has isOptional() method - if (typeof schema.isOptional === 'function') { - return schema.isOptional(); - } - return v3Schema._def?.typeName === 'ZodOptional'; -} -/** - * Gets the literal value from a schema, if it's a literal schema. - * Works with both Zod v3 and v4. - * Returns undefined if the schema is not a literal or the value cannot be determined. - */ -function getLiteralValue(schema) { - if (isZ4Schema(schema)) { - const v4Schema = schema; - const def = v4Schema._zod?.def; - if (def) { - // Try various ways to get the literal value - if (def.value !== undefined) - return def.value; - if (Array.isArray(def.values) && def.values.length > 0) { - return def.values[0]; - } - } - } - const v3Schema = schema; - const def = v3Schema._def; - if (def) { - if (def.value !== undefined) - return def.value; - if (Array.isArray(def.values) && def.values.length > 0) { - return def.values[0]; - } - } - // Fallback: check for direct value property (some Zod versions) - const directValue = schema.value; - if (directValue !== undefined) - return directValue; - return undefined; -} -//# sourceMappingURL=zod-compat.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js.map deleted file mode 100644 index d36391a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-compat.js","sourceRoot":"","sources":["../../../src/server/zod-compat.ts"],"names":[],"mappings":";AAAA,gBAAgB;AAChB,uDAAuD;AACvD,yDAAyD;AACzD,uDAAuD;;;;;;;;;;;;;;;;;;;;;;;;;AAqDvD,gCAIC;AAGD,0CAWC;AAGD,8BAYC;AAED,wCAYC;AAGD,wCAyBC;AAQD,sDAiDC;AAOD,oDAoBC;AAUD,oDAEC;AAMD,4CAWC;AAOD,0CAwBC;AA3QD,6CAA+B;AAC/B,oDAAsC;AA8CtC,4BAA4B;AAC5B,SAAgB,UAAU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ontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.d.ts deleted file mode 100644 index 3a04452..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AnySchema, AnyObjectSchema } from './zod-compat.js'; -type JsonSchema = Record; -type CommonOpts = { - strictUnions?: boolean; - pipeStrategy?: 'input' | 'output'; - target?: 'jsonSchema7' | 'draft-7' | 'jsonSchema2019-09' | 'draft-2020-12'; -}; -export declare function toJsonSchemaCompat(schema: AnyObjectSchema, opts?: CommonOpts): JsonSchema; -export declare function getMethodLiteral(schema: AnyObjectSchema): string; -export declare function parseWithCompat(schema: AnySchema, data: unknown): unknown; -export {}; -//# sourceMappingURL=zod-json-schema-compat.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.d.ts.map deleted file mode 100644 index 0b851bf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-json-schema-compat.d.ts","sourceRoot":"","sources":["../../../src/server/zod-json-schema-compat.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAE,eAAe,EAA0D,MAAM,iBAAiB,CAAC;AAGrH,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAG1C,KAAK,UAAU,GAAG;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,mBAAmB,GAAG,eAAe,CAAC;CAC9E,CAAC;AASF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAczF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAahE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAMzE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js deleted file mode 100644 index bc067da..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -// zod-json-schema-compat.ts -// ---------------------------------------------------- -// JSON Schema conversion for both Zod v3 and Zod v4 (Mini) -// v3 uses your vendored converter; v4 uses Mini's toJSONSchema -// ---------------------------------------------------- -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toJsonSchemaCompat = toJsonSchemaCompat; -exports.getMethodLiteral = getMethodLiteral; -exports.parseWithCompat = parseWithCompat; -const z4mini = __importStar(require("zod/v4-mini")); -const zod_compat_js_1 = require("./zod-compat.js"); -const zod_to_json_schema_1 = require("zod-to-json-schema"); -function mapMiniTarget(t) { - if (!t) - return 'draft-7'; - if (t === 'jsonSchema7' || t === 'draft-7') - return 'draft-7'; - if (t === 'jsonSchema2019-09' || t === 'draft-2020-12') - return 'draft-2020-12'; - return 'draft-7'; // fallback -} -function toJsonSchemaCompat(schema, opts) { - if ((0, zod_compat_js_1.isZ4Schema)(schema)) { - // v4 branch — use Mini's built-in toJSONSchema - return z4mini.toJSONSchema(schema, { - target: mapMiniTarget(opts?.target), - io: opts?.pipeStrategy ?? 'input' - }); - } - // v3 branch — use vendored converter - return (0, zod_to_json_schema_1.zodToJsonSchema)(schema, { - strictUnions: opts?.strictUnions ?? true, - pipeStrategy: opts?.pipeStrategy ?? 'input' - }); -} -function getMethodLiteral(schema) { - const shape = (0, zod_compat_js_1.getObjectShape)(schema); - const methodSchema = shape?.method; - if (!methodSchema) { - throw new Error('Schema is missing a method literal'); - } - const value = (0, zod_compat_js_1.getLiteralValue)(methodSchema); - if (typeof value !== 'string') { - throw new Error('Schema method literal must be a string'); - } - return value; -} -function parseWithCompat(schema, data) { - const result = (0, zod_compat_js_1.safeParse)(schema, data); - if (!result.success) { - throw result.error; - } - return result.data; -} -//# sourceMappingURL=zod-json-schema-compat.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js.map deleted file mode 100644 index 627929d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-json-schema-compat.js","sourceRoot":"","sources":["../../../src/server/zod-json-schema-compat.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,uDAAuD;AACvD,2DAA2D;AAC3D,+DAA+D;AAC/D,uDAAuD;;;;;;;;;;;;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C;QAC5B,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAgB,eAAe,CAAC,MAAiB,EAAE,IAAa;IAC5D,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,MAAM,CAAC,KAAK,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts deleted file mode 100644 index c966e30..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Utilities for handling OAuth resource URIs. - */ -/** - * Converts a server URL to a resource URL by removing the fragment. - * RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component". - * Keeps everything else unchanged (scheme, domain, port, path, query). - */ -export declare function resourceUrlFromServerUrl(url: URL | string): URL; -/** - * Checks if a requested resource URL matches a configured resource URL. - * A requested resource matches if it has the same scheme, domain, port, - * and its path starts with the configured resource's path. - * - * @param requestedResource The resource URL being requested - * @param configuredResource The resource URL that has been configured - * @returns true if the requested resource matches the configured resource, false otherwise - */ -export declare function checkResourceAllowed({ requestedResource, configuredResource }: { - requestedResource: URL | string; - configuredResource: URL | string; -}): boolean; -//# sourceMappingURL=auth-utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts.map deleted file mode 100644 index 30873de..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth-utils.d.ts","sourceRoot":"","sources":["../../../src/shared/auth-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,GAAG,CAI/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,iBAAiB,EACjB,kBAAkB,EACrB,EAAE;IACC,iBAAiB,EAAE,GAAG,GAAG,MAAM,CAAC;IAChC,kBAAkB,EAAE,GAAG,GAAG,MAAM,CAAC;CACpC,GAAG,OAAO,CAwBV"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js deleted file mode 100644 index f2fe617..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -/** - * Utilities for handling OAuth resource URIs. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.resourceUrlFromServerUrl = resourceUrlFromServerUrl; -exports.checkResourceAllowed = checkResourceAllowed; -/** - * Converts a server URL to a resource URL by removing the fragment. - * RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component". - * Keeps everything else unchanged (scheme, domain, port, path, query). - */ -function resourceUrlFromServerUrl(url) { - const resourceURL = typeof url === 'string' ? new URL(url) : new URL(url.href); - resourceURL.hash = ''; // Remove fragment - return resourceURL; -} -/** - * Checks if a requested resource URL matches a configured resource URL. - * A requested resource matches if it has the same scheme, domain, port, - * and its path starts with the configured resource's path. - * - * @param requestedResource The resource URL being requested - * @param configuredResource The resource URL that has been configured - * @returns true if the requested resource matches the configured resource, false otherwise - */ -function checkResourceAllowed({ requestedResource, configuredResource }) { - const requested = typeof requestedResource === 'string' ? new URL(requestedResource) : new URL(requestedResource.href); - const configured = typeof configuredResource === 'string' ? new URL(configuredResource) : new URL(configuredResource.href); - // Compare the origin (scheme, domain, and port) - if (requested.origin !== configured.origin) { - return false; - } - // Handle cases like requested=/foo and configured=/foo/ - if (requested.pathname.length < configured.pathname.length) { - return false; - } - // Check if the requested path starts with the configured path - // Ensure both paths end with / for proper comparison - // This ensures that if we have paths like "/api" and "/api/users", - // we properly detect that "/api/users" is a subpath of "/api" - // By adding a trailing slash if missing, we avoid false positives - // where paths like "/api123" would incorrectly match "/api" - const requestedPath = requested.pathname.endsWith('/') ? requested.pathname : requested.pathname + '/'; - const configuredPath = configured.pathname.endsWith('/') ? configured.pathname : configured.pathname + '/'; - return requestedPath.startsWith(configuredPath); -} -//# sourceMappingURL=auth-utils.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js.map deleted file mode 100644 index 4a71b25..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth-utils.js","sourceRoot":"","sources":["../../../src/shared/auth-utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAOH,4DAIC;AAWD,oDA8BC;AAlDD;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,GAAiB;IACtD,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/E,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,kBAAkB;IACzC,OAAO,WAAW,CAAC;AACvB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,EACjC,iBAAiB,EACjB,kBAAkB,EAIrB;IACG,MAAM,SAAS,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACvH,MAAM,UAAU,GAAG,OAAO,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAE3H,gDAAgD;IAChD,IAAI,SAAS,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,wDAAwD;IACxD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,8DAA8D;IAC9D,qDAAqD;IACrD,mEAAmE;IACnE,8DAA8D;IAC9D,kEAAkE;IAClE,4DAA4D;IAC5D,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,GAAG,GAAG,CAAC;IACvG,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC;IAE3G,OAAO,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACpD,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts deleted file mode 100644 index 4e47be1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -import * as z from 'zod/v4'; -/** - * Reusable URL validation that disallows javascript: scheme - */ -export declare const SafeUrlSchema: z.ZodURL; -/** - * RFC 9728 OAuth Protected Resource Metadata - */ -export declare const OAuthProtectedResourceMetadataSchema: z.ZodObject<{ - resource: z.ZodString; - authorization_servers: z.ZodOptional>; - jwks_uri: z.ZodOptional; - scopes_supported: z.ZodOptional>; - bearer_methods_supported: z.ZodOptional>; - resource_signing_alg_values_supported: z.ZodOptional>; - resource_name: z.ZodOptional; - resource_documentation: z.ZodOptional; - resource_policy_uri: z.ZodOptional; - resource_tos_uri: z.ZodOptional; - tls_client_certificate_bound_access_tokens: z.ZodOptional; - authorization_details_types_supported: z.ZodOptional>; - dpop_signing_alg_values_supported: z.ZodOptional>; - dpop_bound_access_tokens_required: z.ZodOptional; -}, z.core.$loose>; -/** - * RFC 8414 OAuth 2.0 Authorization Server Metadata - */ -export declare const OAuthMetadataSchema: z.ZodObject<{ - issuer: z.ZodString; - authorization_endpoint: z.ZodURL; - token_endpoint: z.ZodURL; - registration_endpoint: z.ZodOptional; - scopes_supported: z.ZodOptional>; - response_types_supported: z.ZodArray; - response_modes_supported: z.ZodOptional>; - grant_types_supported: z.ZodOptional>; - token_endpoint_auth_methods_supported: z.ZodOptional>; - token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - service_documentation: z.ZodOptional; - revocation_endpoint: z.ZodOptional; - revocation_endpoint_auth_methods_supported: z.ZodOptional>; - revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - introspection_endpoint: z.ZodOptional; - introspection_endpoint_auth_methods_supported: z.ZodOptional>; - introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - code_challenge_methods_supported: z.ZodOptional>; - client_id_metadata_document_supported: z.ZodOptional; -}, z.core.$loose>; -/** - * OpenID Connect Discovery 1.0 Provider Metadata - * see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata - */ -export declare const OpenIdProviderMetadataSchema: z.ZodObject<{ - issuer: z.ZodString; - authorization_endpoint: z.ZodURL; - token_endpoint: z.ZodURL; - userinfo_endpoint: z.ZodOptional; - jwks_uri: z.ZodURL; - registration_endpoint: z.ZodOptional; - scopes_supported: z.ZodOptional>; - response_types_supported: z.ZodArray; - response_modes_supported: z.ZodOptional>; - grant_types_supported: z.ZodOptional>; - acr_values_supported: z.ZodOptional>; - subject_types_supported: z.ZodArray; - id_token_signing_alg_values_supported: z.ZodArray; - id_token_encryption_alg_values_supported: z.ZodOptional>; - id_token_encryption_enc_values_supported: z.ZodOptional>; - userinfo_signing_alg_values_supported: z.ZodOptional>; - userinfo_encryption_alg_values_supported: z.ZodOptional>; - userinfo_encryption_enc_values_supported: z.ZodOptional>; - request_object_signing_alg_values_supported: z.ZodOptional>; - request_object_encryption_alg_values_supported: z.ZodOptional>; - request_object_encryption_enc_values_supported: z.ZodOptional>; - token_endpoint_auth_methods_supported: z.ZodOptional>; - token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - display_values_supported: z.ZodOptional>; - claim_types_supported: z.ZodOptional>; - claims_supported: z.ZodOptional>; - service_documentation: z.ZodOptional; - claims_locales_supported: z.ZodOptional>; - ui_locales_supported: z.ZodOptional>; - claims_parameter_supported: z.ZodOptional; - request_parameter_supported: z.ZodOptional; - request_uri_parameter_supported: z.ZodOptional; - require_request_uri_registration: z.ZodOptional; - op_policy_uri: z.ZodOptional; - op_tos_uri: z.ZodOptional; - client_id_metadata_document_supported: z.ZodOptional; -}, z.core.$loose>; -/** - * OpenID Connect Discovery metadata that may include OAuth 2.0 fields - * This schema represents the real-world scenario where OIDC providers - * return a mix of OpenID Connect and OAuth 2.0 metadata fields - */ -export declare const OpenIdProviderDiscoveryMetadataSchema: z.ZodObject<{ - code_challenge_methods_supported: z.ZodOptional>; - issuer: z.ZodString; - authorization_endpoint: z.ZodURL; - token_endpoint: z.ZodURL; - userinfo_endpoint: z.ZodOptional; - jwks_uri: z.ZodURL; - registration_endpoint: z.ZodOptional; - scopes_supported: z.ZodOptional>; - response_types_supported: z.ZodArray; - response_modes_supported: z.ZodOptional>; - grant_types_supported: z.ZodOptional>; - acr_values_supported: z.ZodOptional>; - subject_types_supported: z.ZodArray; - id_token_signing_alg_values_supported: z.ZodArray; - id_token_encryption_alg_values_supported: z.ZodOptional>; - id_token_encryption_enc_values_supported: z.ZodOptional>; - userinfo_signing_alg_values_supported: z.ZodOptional>; - userinfo_encryption_alg_values_supported: z.ZodOptional>; - userinfo_encryption_enc_values_supported: z.ZodOptional>; - request_object_signing_alg_values_supported: z.ZodOptional>; - request_object_encryption_alg_values_supported: z.ZodOptional>; - request_object_encryption_enc_values_supported: z.ZodOptional>; - token_endpoint_auth_methods_supported: z.ZodOptional>; - token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - display_values_supported: z.ZodOptional>; - claim_types_supported: z.ZodOptional>; - claims_supported: z.ZodOptional>; - service_documentation: z.ZodOptional; - claims_locales_supported: z.ZodOptional>; - ui_locales_supported: z.ZodOptional>; - claims_parameter_supported: z.ZodOptional; - request_parameter_supported: z.ZodOptional; - request_uri_parameter_supported: z.ZodOptional; - require_request_uri_registration: z.ZodOptional; - op_policy_uri: z.ZodOptional; - op_tos_uri: z.ZodOptional; - client_id_metadata_document_supported: z.ZodOptional; -}, z.core.$strip>; -/** - * OAuth 2.1 token response - */ -export declare const OAuthTokensSchema: z.ZodObject<{ - access_token: z.ZodString; - id_token: z.ZodOptional; - token_type: z.ZodString; - expires_in: z.ZodOptional>; - scope: z.ZodOptional; - refresh_token: z.ZodOptional; -}, z.core.$strip>; -/** - * OAuth 2.1 error response - */ -export declare const OAuthErrorResponseSchema: z.ZodObject<{ - error: z.ZodString; - error_description: z.ZodOptional; - error_uri: z.ZodOptional; -}, z.core.$strip>; -/** - * Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri - */ -export declare const OptionalSafeUrlSchema: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata - */ -export declare const OAuthClientMetadataSchema: z.ZodObject<{ - redirect_uris: z.ZodArray; - token_endpoint_auth_method: z.ZodOptional; - grant_types: z.ZodOptional>; - response_types: z.ZodOptional>; - client_name: z.ZodOptional; - client_uri: z.ZodOptional; - logo_uri: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; - scope: z.ZodOptional; - contacts: z.ZodOptional>; - tos_uri: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; - policy_uri: z.ZodOptional; - jwks_uri: z.ZodOptional; - jwks: z.ZodOptional; - software_id: z.ZodOptional; - software_version: z.ZodOptional; - software_statement: z.ZodOptional; -}, z.core.$strip>; -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration client information - */ -export declare const OAuthClientInformationSchema: z.ZodObject<{ - client_id: z.ZodString; - client_secret: z.ZodOptional; - client_id_issued_at: z.ZodOptional; - client_secret_expires_at: z.ZodOptional; -}, z.core.$strip>; -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata) - */ -export declare const OAuthClientInformationFullSchema: z.ZodObject<{ - redirect_uris: z.ZodArray; - token_endpoint_auth_method: z.ZodOptional; - grant_types: z.ZodOptional>; - response_types: z.ZodOptional>; - client_name: z.ZodOptional; - client_uri: z.ZodOptional; - logo_uri: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; - scope: z.ZodOptional; - contacts: z.ZodOptional>; - tos_uri: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; - policy_uri: z.ZodOptional; - jwks_uri: z.ZodOptional; - jwks: z.ZodOptional; - software_id: z.ZodOptional; - software_version: z.ZodOptional; - software_statement: z.ZodOptional; - client_id: z.ZodString; - client_secret: z.ZodOptional; - client_id_issued_at: z.ZodOptional; - client_secret_expires_at: z.ZodOptional; -}, z.core.$strip>; -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration error response - */ -export declare const OAuthClientRegistrationErrorSchema: z.ZodObject<{ - error: z.ZodString; - error_description: z.ZodOptional; -}, z.core.$strip>; -/** - * RFC 7009 OAuth 2.0 Token Revocation request - */ -export declare const OAuthTokenRevocationRequestSchema: z.ZodObject<{ - token: z.ZodString; - token_type_hint: z.ZodOptional; -}, z.core.$strip>; -export type OAuthMetadata = z.infer; -export type OpenIdProviderMetadata = z.infer; -export type OpenIdProviderDiscoveryMetadata = z.infer; -export type OAuthTokens = z.infer; -export type OAuthErrorResponse = z.infer; -export type OAuthClientMetadata = z.infer; -export type OAuthClientInformation = z.infer; -export type OAuthClientInformationFull = z.infer; -export type OAuthClientInformationMixed = OAuthClientInformation | OAuthClientInformationFull; -export type OAuthClientRegistrationError = z.infer; -export type OAuthTokenRevocationRequest = z.infer; -export type OAuthProtectedResourceMetadata = z.infer; -export type AuthorizationServerMetadata = OAuthMetadata | OpenIdProviderDiscoveryMetadata; -//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts.map deleted file mode 100644 index 031a88f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,aAAa,UAmBrB,CAAC;AAEN;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;iBAe/C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;iBAoB9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCvC,CAAC;AAEH;;;;GAIG;AACH,eAAO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F,MAAM,MAAM,2BAA2B,GAAG,sBAAsB,GAAG,0BAA0B,CAAC;AAC9F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAGlG,MAAM,MAAM,2BAA2B,GAAG,aAAa,GAAG,+BAA+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js deleted file mode 100644 index 97217c9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js +++ /dev/null @@ -1,224 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.OAuthTokenRevocationRequestSchema = exports.OAuthClientRegistrationErrorSchema = exports.OAuthClientInformationFullSchema = exports.OAuthClientInformationSchema = exports.OAuthClientMetadataSchema = exports.OptionalSafeUrlSchema = exports.OAuthErrorResponseSchema = exports.OAuthTokensSchema = exports.OpenIdProviderDiscoveryMetadataSchema = exports.OpenIdProviderMetadataSchema = exports.OAuthMetadataSchema = exports.OAuthProtectedResourceMetadataSchema = exports.SafeUrlSchema = void 0; -const z = __importStar(require("zod/v4")); -/** - * Reusable URL validation that disallows javascript: scheme - */ -exports.SafeUrlSchema = z - .url() - .superRefine((val, ctx) => { - if (!URL.canParse(val)) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - message: 'URL must be parseable', - fatal: true - }); - return z.NEVER; - } -}) - .refine(url => { - const u = new URL(url); - return u.protocol !== 'javascript:' && u.protocol !== 'data:' && u.protocol !== 'vbscript:'; -}, { message: 'URL cannot use javascript:, data:, or vbscript: scheme' }); -/** - * RFC 9728 OAuth Protected Resource Metadata - */ -exports.OAuthProtectedResourceMetadataSchema = z.looseObject({ - resource: z.string().url(), - authorization_servers: z.array(exports.SafeUrlSchema).optional(), - jwks_uri: z.string().url().optional(), - scopes_supported: z.array(z.string()).optional(), - bearer_methods_supported: z.array(z.string()).optional(), - resource_signing_alg_values_supported: z.array(z.string()).optional(), - resource_name: z.string().optional(), - resource_documentation: z.string().optional(), - resource_policy_uri: z.string().url().optional(), - resource_tos_uri: z.string().url().optional(), - tls_client_certificate_bound_access_tokens: z.boolean().optional(), - authorization_details_types_supported: z.array(z.string()).optional(), - dpop_signing_alg_values_supported: z.array(z.string()).optional(), - dpop_bound_access_tokens_required: z.boolean().optional() -}); -/** - * RFC 8414 OAuth 2.0 Authorization Server Metadata - */ -exports.OAuthMetadataSchema = z.looseObject({ - issuer: z.string(), - authorization_endpoint: exports.SafeUrlSchema, - token_endpoint: exports.SafeUrlSchema, - registration_endpoint: exports.SafeUrlSchema.optional(), - scopes_supported: z.array(z.string()).optional(), - response_types_supported: z.array(z.string()), - response_modes_supported: z.array(z.string()).optional(), - grant_types_supported: z.array(z.string()).optional(), - token_endpoint_auth_methods_supported: z.array(z.string()).optional(), - token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(), - service_documentation: exports.SafeUrlSchema.optional(), - revocation_endpoint: exports.SafeUrlSchema.optional(), - revocation_endpoint_auth_methods_supported: z.array(z.string()).optional(), - revocation_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(), - introspection_endpoint: z.string().optional(), - introspection_endpoint_auth_methods_supported: z.array(z.string()).optional(), - introspection_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(), - code_challenge_methods_supported: z.array(z.string()).optional(), - client_id_metadata_document_supported: z.boolean().optional() -}); -/** - * OpenID Connect Discovery 1.0 Provider Metadata - * see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata - */ -exports.OpenIdProviderMetadataSchema = z.looseObject({ - issuer: z.string(), - authorization_endpoint: exports.SafeUrlSchema, - token_endpoint: exports.SafeUrlSchema, - userinfo_endpoint: exports.SafeUrlSchema.optional(), - jwks_uri: exports.SafeUrlSchema, - registration_endpoint: exports.SafeUrlSchema.optional(), - scopes_supported: z.array(z.string()).optional(), - response_types_supported: z.array(z.string()), - response_modes_supported: z.array(z.string()).optional(), - grant_types_supported: z.array(z.string()).optional(), - acr_values_supported: z.array(z.string()).optional(), - subject_types_supported: z.array(z.string()), - id_token_signing_alg_values_supported: z.array(z.string()), - id_token_encryption_alg_values_supported: z.array(z.string()).optional(), - id_token_encryption_enc_values_supported: z.array(z.string()).optional(), - userinfo_signing_alg_values_supported: z.array(z.string()).optional(), - userinfo_encryption_alg_values_supported: z.array(z.string()).optional(), - userinfo_encryption_enc_values_supported: z.array(z.string()).optional(), - request_object_signing_alg_values_supported: z.array(z.string()).optional(), - request_object_encryption_alg_values_supported: z.array(z.string()).optional(), - request_object_encryption_enc_values_supported: z.array(z.string()).optional(), - token_endpoint_auth_methods_supported: z.array(z.string()).optional(), - token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(), - display_values_supported: z.array(z.string()).optional(), - claim_types_supported: z.array(z.string()).optional(), - claims_supported: z.array(z.string()).optional(), - service_documentation: z.string().optional(), - claims_locales_supported: z.array(z.string()).optional(), - ui_locales_supported: z.array(z.string()).optional(), - claims_parameter_supported: z.boolean().optional(), - request_parameter_supported: z.boolean().optional(), - request_uri_parameter_supported: z.boolean().optional(), - require_request_uri_registration: z.boolean().optional(), - op_policy_uri: exports.SafeUrlSchema.optional(), - op_tos_uri: exports.SafeUrlSchema.optional(), - client_id_metadata_document_supported: z.boolean().optional() -}); -/** - * OpenID Connect Discovery metadata that may include OAuth 2.0 fields - * This schema represents the real-world scenario where OIDC providers - * return a mix of OpenID Connect and OAuth 2.0 metadata fields - */ -exports.OpenIdProviderDiscoveryMetadataSchema = z.object({ - ...exports.OpenIdProviderMetadataSchema.shape, - ...exports.OAuthMetadataSchema.pick({ - code_challenge_methods_supported: true - }).shape -}); -/** - * OAuth 2.1 token response - */ -exports.OAuthTokensSchema = z - .object({ - access_token: z.string(), - id_token: z.string().optional(), // Optional for OAuth 2.1, but necessary in OpenID Connect - token_type: z.string(), - expires_in: z.coerce.number().optional(), - scope: z.string().optional(), - refresh_token: z.string().optional() -}) - .strip(); -/** - * OAuth 2.1 error response - */ -exports.OAuthErrorResponseSchema = z.object({ - error: z.string(), - error_description: z.string().optional(), - error_uri: z.string().optional() -}); -/** - * Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri - */ -exports.OptionalSafeUrlSchema = exports.SafeUrlSchema.optional().or(z.literal('').transform(() => undefined)); -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata - */ -exports.OAuthClientMetadataSchema = z - .object({ - redirect_uris: z.array(exports.SafeUrlSchema), - token_endpoint_auth_method: z.string().optional(), - grant_types: z.array(z.string()).optional(), - response_types: z.array(z.string()).optional(), - client_name: z.string().optional(), - client_uri: exports.SafeUrlSchema.optional(), - logo_uri: exports.OptionalSafeUrlSchema, - scope: z.string().optional(), - contacts: z.array(z.string()).optional(), - tos_uri: exports.OptionalSafeUrlSchema, - policy_uri: z.string().optional(), - jwks_uri: exports.SafeUrlSchema.optional(), - jwks: z.any().optional(), - software_id: z.string().optional(), - software_version: z.string().optional(), - software_statement: z.string().optional() -}) - .strip(); -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration client information - */ -exports.OAuthClientInformationSchema = z - .object({ - client_id: z.string(), - client_secret: z.string().optional(), - client_id_issued_at: z.number().optional(), - client_secret_expires_at: z.number().optional() -}) - .strip(); -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata) - */ -exports.OAuthClientInformationFullSchema = exports.OAuthClientMetadataSchema.merge(exports.OAuthClientInformationSchema); -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration error response - */ -exports.OAuthClientRegistrationErrorSchema = z - .object({ - error: z.string(), - error_description: z.string().optional() -}) - .strip(); -/** - * RFC 7009 OAuth 2.0 Token Revocation request - */ -exports.OAuthTokenRevocationRequestSchema = z - .object({ - token: z.string(), - token_type_hint: z.string().optional() -}) - .strip(); -//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js.map deleted file mode 100644 index 310255a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA4B;AAE5B;;GAEG;AACU,QAAA,aAAa,GAAG,CAAC;KACzB,GAAG,EAAE;KACL,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACtB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,GAAG,CAAC,QAAQ,CAAC;YACT,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,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,KAAK,EAAE,CAAC;AAEb;;GAEG;AACU,QAAA,iCAAiC,GAAG,CAAC;KAC7C,MAAM,CAAC;IACJ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACzC,CAAC;KACD,KAAK,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts deleted file mode 100644 index 9dff76d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { BaseMetadata } from '../types.js'; -/** - * Utilities for working with BaseMetadata objects. - */ -/** - * Gets the display name for an object with BaseMetadata. - * For tools, the precedence is: title → annotations.title → name - * For other objects: title → name - * This implements the spec requirement: "if no title is provided, name should be used for display purposes" - */ -export declare function getDisplayName(metadata: BaseMetadata | (BaseMetadata & { - annotations?: { - title?: string; - }; -})): string; -//# sourceMappingURL=metadataUtils.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts.map deleted file mode 100644 index 9d9929c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadataUtils.d.ts","sourceRoot":"","sources":["../../../src/shared/metadataUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AAEH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG;IAAE,WAAW,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,GAAG,MAAM,CAarH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js deleted file mode 100644 index 2e50da6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getDisplayName = getDisplayName; -/** - * Utilities for working with BaseMetadata objects. - */ -/** - * Gets the display name for an object with BaseMetadata. - * For tools, the precedence is: title → annotations.title → name - * For other objects: title → name - * This implements the spec requirement: "if no title is provided, name should be used for display purposes" - */ -function getDisplayName(metadata) { - // First check for title (not undefined and not empty string) - if (metadata.title !== undefined && metadata.title !== '') { - return metadata.title; - } - // Then check for annotations.title (only present in Tool objects) - if ('annotations' in metadata && metadata.annotations?.title) { - return metadata.annotations.title; - } - // Finally fall back to name - return metadata.name; -} -//# sourceMappingURL=metadataUtils.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js.map deleted file mode 100644 index a334dbd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadataUtils.js","sourceRoot":"","sources":["../../../src/shared/metadataUtils.ts"],"names":[],"mappings":";;AAYA,wCAaC;AAvBD;;GAEG;AAEH;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,QAA8E;IACzG,6DAA6D;IAC7D,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,QAAQ,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC;QACxD,OAAO,QAAQ,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,kEAAkE;IAClE,IAAI,aAAa,IAAI,QAAQ,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC;QAC3D,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC;IACtC,CAAC;IAED,4BAA4B;IAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts deleted file mode 100644 index 808bfed..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts +++ /dev/null @@ -1,443 +0,0 @@ -import { AnySchema, AnyObjectSchema, SchemaOutput } from '../server/zod-compat.js'; -import { ClientCapabilities, GetTaskRequest, GetTaskPayloadRequest, ListTasksResultSchema, CancelTaskResultSchema, JSONRPCRequest, Progress, RequestId, Result, ServerCapabilities, RequestMeta, RequestInfo, GetTaskResult, TaskCreationParams, RelatedTaskMetadata, Task, Request, Notification } from '../types.js'; -import { Transport, TransportSendOptions } from './transport.js'; -import { AuthInfo } from '../server/auth/types.js'; -import { TaskStore, TaskMessageQueue, CreateTaskOptions } from '../experimental/tasks/interfaces.js'; -import { ResponseMessage } from './responseMessage.js'; -/** - * Callback for progress notifications. - */ -export type ProgressCallback = (progress: Progress) => void; -/** - * Additional initialization options. - */ -export type ProtocolOptions = { - /** - * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities. - * - * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those. - * - * Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true. - */ - enforceStrictCapabilities?: boolean; - /** - * An array of notification method names that should be automatically debounced. - * Any notifications with a method in this list will be coalesced if they - * occur in the same tick of the event loop. - * e.g., ['notifications/tools/list_changed'] - */ - debouncedNotificationMethods?: string[]; - /** - * Optional task storage implementation. If provided, enables task-related request handlers - * and provides task storage capabilities to request handlers. - */ - taskStore?: TaskStore; - /** - * Optional task message queue implementation for managing server-initiated messages - * that will be delivered through the tasks/result response stream. - */ - taskMessageQueue?: TaskMessageQueue; - /** - * Default polling interval (in milliseconds) for task status checks when no pollInterval - * is provided by the server. Defaults to 5000ms if not specified. - */ - defaultTaskPollInterval?: number; - /** - * Maximum number of messages that can be queued per task for side-channel delivery. - * If undefined, the queue size is unbounded. - * When the limit is exceeded, the TaskMessageQueue implementation's enqueue() method - * will throw an error. It's the implementation's responsibility to handle overflow - * appropriately (e.g., by failing the task, dropping messages, etc.). - */ - maxTaskQueueSize?: number; -}; -/** - * The default request timeout, in miliseconds. - */ -export declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; -/** - * Options that can be given per request. - */ -export type RequestOptions = { - /** - * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked. - * - * For task-augmented requests: progress notifications continue after CreateTaskResult is returned and stop automatically when the task reaches a terminal status. - */ - onprogress?: ProgressCallback; - /** - * Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request(). - */ - signal?: AbortSignal; - /** - * A timeout (in milliseconds) for this request. If exceeded, an McpError with code `RequestTimeout` will be raised from request(). - * - * If not specified, `DEFAULT_REQUEST_TIMEOUT_MSEC` will be used as the timeout. - */ - timeout?: number; - /** - * If true, receiving a progress notification will reset the request timeout. - * This is useful for long-running operations that send periodic progress updates. - * Default: false - */ - resetTimeoutOnProgress?: boolean; - /** - * Maximum total time (in milliseconds) to wait for a response. - * If exceeded, an McpError with code `RequestTimeout` will be raised, regardless of progress notifications. - * If not specified, there is no maximum total timeout. - */ - maxTotalTimeout?: number; - /** - * If provided, augments the request with task creation parameters to enable call-now, fetch-later execution patterns. - */ - task?: TaskCreationParams; - /** - * If provided, associates this request with a related task. - */ - relatedTask?: RelatedTaskMetadata; -} & TransportSendOptions; -/** - * Options that can be given per notification. - */ -export type NotificationOptions = { - /** - * May be used to indicate to the transport which incoming request to associate this outgoing notification with. - */ - relatedRequestId?: RequestId; - /** - * If provided, associates this notification with a related task. - */ - relatedTask?: RelatedTaskMetadata; -}; -/** - * Options that can be given per request. - */ -export type TaskRequestOptions = Omit; -/** - * Request-scoped TaskStore interface. - */ -export interface RequestTaskStore { - /** - * Creates a new task with the given creation parameters. - * The implementation generates a unique taskId and createdAt timestamp. - * - * @param taskParams - The task creation parameters from the request - * @returns The created task object - */ - createTask(taskParams: CreateTaskOptions): Promise; - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @returns The task object - * @throws If the task does not exist - */ - getTask(taskId: string): Promise; - /** - * Stores the result of a task and sets its final status. - * - * @param taskId - The task identifier - * @param status - The final status: 'completed' for success, 'failed' for errors - * @param result - The result to store - */ - storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result): Promise; - /** - * Retrieves the stored result of a task. - * - * @param taskId - The task identifier - * @returns The stored result - */ - getTaskResult(taskId: string): Promise; - /** - * Updates a task's status (e.g., to 'cancelled', 'failed', 'completed'). - * - * @param taskId - The task identifier - * @param status - The new status - * @param statusMessage - Optional diagnostic message for failed tasks or other status information - */ - updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string): Promise; - /** - * Lists tasks, optionally starting from a pagination cursor. - * - * @param cursor - Optional cursor for pagination - * @returns An object containing the tasks array and an optional nextCursor - */ - listTasks(cursor?: string): Promise<{ - tasks: Task[]; - nextCursor?: string; - }>; -} -/** - * Extra data given to request handlers. - */ -export type RequestHandlerExtra = { - /** - * An abort signal used to communicate if the request was cancelled from the sender's side. - */ - signal: AbortSignal; - /** - * Information about a validated access token, provided to request handlers. - */ - authInfo?: AuthInfo; - /** - * The session ID from the transport, if available. - */ - sessionId?: string; - /** - * Metadata from the original request. - */ - _meta?: RequestMeta; - /** - * The JSON-RPC ID of the request being handled. - * This can be useful for tracking or logging purposes. - */ - requestId: RequestId; - taskId?: string; - taskStore?: RequestTaskStore; - taskRequestedTtl?: number | null; - /** - * The original HTTP request. - */ - requestInfo?: RequestInfo; - /** - * Sends a notification that relates to the current request being handled. - * - * This is used by certain transports to correctly associate related messages. - */ - sendNotification: (notification: SendNotificationT) => Promise; - /** - * Sends a request that relates to the current request being handled. - * - * This is used by certain transports to correctly associate related messages. - */ - sendRequest: (request: SendRequestT, resultSchema: U, options?: TaskRequestOptions) => Promise>; - /** - * Closes the SSE stream for this request, triggering client reconnection. - * Only available when using StreamableHTTPServerTransport with eventStore configured. - * Use this to implement polling behavior during long-running operations. - */ - closeSSEStream?: () => void; - /** - * Closes the standalone GET SSE stream, triggering client reconnection. - * Only available when using StreamableHTTPServerTransport with eventStore configured. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream?: () => void; -}; -/** - * Implements MCP protocol framing on top of a pluggable transport, including - * features like request/response linking, notifications, and progress. - */ -export declare abstract class Protocol { - private _options?; - private _transport?; - private _requestMessageId; - private _requestHandlers; - private _requestHandlerAbortControllers; - private _notificationHandlers; - private _responseHandlers; - private _progressHandlers; - private _timeoutInfo; - private _pendingDebouncedNotifications; - private _taskProgressTokens; - private _taskStore?; - private _taskMessageQueue?; - private _requestResolvers; - /** - * Callback for when the connection is closed for any reason. - * - * This is invoked when close() is called as well. - */ - onclose?: () => void; - /** - * Callback for when an error occurs. - * - * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. - */ - onerror?: (error: Error) => void; - /** - * A handler to invoke for any request types that do not have their own handler installed. - */ - fallbackRequestHandler?: (request: JSONRPCRequest, extra: RequestHandlerExtra) => Promise; - /** - * A handler to invoke for any notification types that do not have their own handler installed. - */ - fallbackNotificationHandler?: (notification: Notification) => Promise; - constructor(_options?: ProtocolOptions | undefined); - private _oncancel; - private _setupTimeout; - private _resetTimeout; - private _cleanupTimeout; - /** - * Attaches to the given transport, starts it, and starts listening for messages. - * - * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. - */ - connect(transport: Transport): Promise; - private _onclose; - private _onerror; - private _onnotification; - private _onrequest; - private _onprogress; - private _onresponse; - get transport(): Transport | undefined; - /** - * Closes the connection. - */ - close(): Promise; - /** - * A method to check if a capability is supported by the remote side, for the given method to be called. - * - * This should be implemented by subclasses. - */ - protected abstract assertCapabilityForMethod(method: SendRequestT['method']): void; - /** - * A method to check if a notification is supported by the local side, for the given method to be sent. - * - * This should be implemented by subclasses. - */ - protected abstract assertNotificationCapability(method: SendNotificationT['method']): void; - /** - * A method to check if a request handler is supported by the local side, for the given method to be handled. - * - * This should be implemented by subclasses. - */ - protected abstract assertRequestHandlerCapability(method: string): void; - /** - * A method to check if task creation is supported for the given request method. - * - * This should be implemented by subclasses. - */ - protected abstract assertTaskCapability(method: string): void; - /** - * A method to check if task handler is supported by the local side, for the given method to be handled. - * - * This should be implemented by subclasses. - */ - protected abstract assertTaskHandlerCapability(method: string): void; - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * @example - * ```typescript - * const stream = protocol.requestStream(request, resultSchema, options); - * for await (const message of stream) { - * switch (message.type) { - * case 'taskCreated': - * console.log('Task created:', message.task.taskId); - * break; - * case 'taskStatus': - * console.log('Task status:', message.task.status); - * break; - * case 'result': - * console.log('Final result:', message.result); - * break; - * case 'error': - * console.error('Error:', message.error); - * break; - * } - * } - * ``` - * - * @experimental Use `client.experimental.tasks.requestStream()` to access this method. - */ - protected requestStream(request: SendRequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>; - /** - * Sends a request and waits for a response. - * - * Do not use this method to emit notifications! Use notification() instead. - */ - request(request: SendRequestT, resultSchema: T, options?: RequestOptions): Promise>; - /** - * Gets the current status of a task. - * - * @experimental Use `client.experimental.tasks.getTask()` to access this method. - */ - protected getTask(params: GetTaskRequest['params'], options?: RequestOptions): Promise; - /** - * Retrieves the result of a completed task. - * - * @experimental Use `client.experimental.tasks.getTaskResult()` to access this method. - */ - protected getTaskResult(params: GetTaskPayloadRequest['params'], resultSchema: T, options?: RequestOptions): Promise>; - /** - * Lists tasks, optionally starting from a pagination cursor. - * - * @experimental Use `client.experimental.tasks.listTasks()` to access this method. - */ - protected listTasks(params?: { - cursor?: string; - }, options?: RequestOptions): Promise>; - /** - * Cancels a specific task. - * - * @experimental Use `client.experimental.tasks.cancelTask()` to access this method. - */ - protected cancelTask(params: { - taskId: string; - }, options?: RequestOptions): Promise>; - /** - * Emits a notification, which is a one-way message that does not expect a response. - */ - notification(notification: SendNotificationT, options?: NotificationOptions): Promise; - /** - * Registers a handler to invoke when this protocol object receives a request with the given method. - * - * Note that this will replace any previous request handler for the same method. - */ - setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => SendResultT | Promise): void; - /** - * Removes the request handler for the given method. - */ - removeRequestHandler(method: string): void; - /** - * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed. - */ - assertCanSetRequestHandler(method: string): void; - /** - * Registers a handler to invoke when this protocol object receives a notification with the given method. - * - * Note that this will replace any previous notification handler for the same method. - */ - setNotificationHandler(notificationSchema: T, handler: (notification: SchemaOutput) => void | Promise): void; - /** - * Removes the notification handler for the given method. - */ - removeNotificationHandler(method: string): void; - /** - * Cleans up the progress handler associated with a task. - * This should be called when a task reaches a terminal status. - */ - private _cleanupTaskProgressHandler; - /** - * Enqueues a task-related message for side-channel delivery via tasks/result. - * @param taskId The task ID to associate the message with - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @throws Error if taskStore is not configured or if enqueue fails (e.g., queue overflow) - * - * Note: If enqueue fails, it's the TaskMessageQueue implementation's responsibility to handle - * the error appropriately (e.g., by failing the task, logging, etc.). The Protocol layer - * simply propagates the error. - */ - private _enqueueTaskMessage; - /** - * Clears the message queue for a task and rejects any pending request resolvers. - * @param taskId The task ID whose queue should be cleared - * @param sessionId Optional session ID for binding the operation to a specific session - */ - private _clearTaskQueue; - /** - * Waits for a task update (new messages or status change) with abort signal support. - * Uses polling to check for updates at the task's configured poll interval. - * @param taskId The task ID to wait for - * @param signal Abort signal to cancel the wait - * @returns Promise that resolves when an update occurs or rejects if aborted - */ - private _waitForTaskUpdate; - private requestTaskStore; -} -export declare function mergeCapabilities(base: ServerCapabilities, additional: Partial): ServerCapabilities; -export declare function mergeCapabilities(base: ClientCapabilities, additional: Partial): ClientCapabilities; -//# sourceMappingURL=protocol.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts.map deleted file mode 100644 index e9e32c2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/shared/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAa,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAEH,kBAAkB,EAGlB,cAAc,EAGd,qBAAqB,EAGrB,qBAAqB,EAErB,sBAAsB,EAOtB,cAAc,EAId,QAAQ,EAIR,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,WAAW,EAEX,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EAEnB,IAAI,EAGJ,OAAO,EACP,YAAY,EAGf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAc,SAAS,EAAE,gBAAgB,EAAiB,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAEhI,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B;;;;;;OAMG;IACH,yBAAyB,CAAC,E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AG,OAAO,CAAC,WAAW,CAAC,GACxC,IAAI;IAUP;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI1C;;OAEG;IACH,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAMhD;;;;OAIG;IACH,sBAAsB,CAAC,CAAC,SAAS,eAAe,EAC5C,kBAAkB,EAAE,CAAC,EACrB,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACjE,IAAI;IAQP;;OAEG;IACH,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/C;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAQnC;;;;;;;;;;OAUG;YACW,mBAAmB;IAUjC;;;;OAIG;YACW,eAAe;IAqB7B;;;;;;OAMG;YACW,kBAAkB;IAiChC,OAAO,CAAC,gBAAgB;CAwF3B;AAMD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;AACzH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js deleted file mode 100644 index c8f26bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js +++ /dev/null @@ -1,1104 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Protocol = exports.DEFAULT_REQUEST_TIMEOUT_MSEC = void 0; -exports.mergeCapabilities = mergeCapabilities; -const zod_compat_js_1 = require("../server/zod-compat.js"); -const types_js_1 = require("../types.js"); -const interfaces_js_1 = require("../experimental/tasks/interfaces.js"); -const zod_json_schema_compat_js_1 = require("../server/zod-json-schema-compat.js"); -/** - * The default request timeout, in miliseconds. - */ -exports.DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; -/** - * Implements MCP protocol framing on top of a pluggable transport, including - * features like request/response linking, notifications, and progress. - */ -class Protocol { - constructor(_options) { - this._options = _options; - this._requestMessageId = 0; - this._requestHandlers = new Map(); - this._requestHandlerAbortControllers = new Map(); - this._notificationHandlers = new Map(); - this._responseHandlers = new Map(); - this._progressHandlers = new Map(); - this._timeoutInfo = new Map(); - this._pendingDebouncedNotifications = new Set(); - // Maps task IDs to progress tokens to keep handlers alive after CreateTaskResult - this._taskProgressTokens = new Map(); - this._requestResolvers = new Map(); - this.setNotificationHandler(types_js_1.CancelledNotificationSchema, notification => { - this._oncancel(notification); - }); - this.setNotificationHandler(types_js_1.ProgressNotificationSchema, notification => { - this._onprogress(notification); - }); - this.setRequestHandler(types_js_1.PingRequestSchema, - // Automatic pong by default. - _request => ({})); - // Install task handlers if TaskStore is provided - this._taskStore = _options?.taskStore; - this._taskMessageQueue = _options?.taskMessageQueue; - if (this._taskStore) { - this.setRequestHandler(types_js_1.GetTaskRequestSchema, async (request, extra) => { - const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId); - if (!task) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, 'Failed to retrieve task: Task not found'); - } - // Per spec: tasks/get responses SHALL NOT include related-task metadata - // as the taskId parameter is the source of truth - // @ts-expect-error SendResultT cannot contain GetTaskResult, but we include it in our derived types everywhere else - return { - ...task - }; - }); - this.setRequestHandler(types_js_1.GetTaskPayloadRequestSchema, async (request, extra) => { - const handleTaskResult = async () => { - const taskId = request.params.taskId; - // Deliver queued messages - if (this._taskMessageQueue) { - let queuedMessage; - while ((queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId))) { - // Handle response and error messages by routing them to the appropriate resolver - if (queuedMessage.type === 'response' || queuedMessage.type === 'error') { - const message = queuedMessage.message; - const requestId = message.id; - // Lookup resolver in _requestResolvers map - const resolver = this._requestResolvers.get(requestId); - if (resolver) { - // Remove resolver from map after invocation - this._requestResolvers.delete(requestId); - // Invoke resolver with response or error - if (queuedMessage.type === 'response') { - resolver(message); - } - else { - // Convert JSONRPCError to McpError - const errorMessage = message; - const error = new types_js_1.McpError(errorMessage.error.code, errorMessage.error.message, errorMessage.error.data); - resolver(error); - } - } - else { - // Handle missing resolver gracefully with error logging - const messageType = queuedMessage.type === 'response' ? 'Response' : 'Error'; - this._onerror(new Error(`${messageType} handler missing for request ${requestId}`)); - } - // Continue to next message - continue; - } - // Send the message on the response stream by passing the relatedRequestId - // This tells the transport to write the message to the tasks/result response stream - await this._transport?.send(queuedMessage.message, { relatedRequestId: extra.requestId }); - } - } - // Now check task status - const task = await this._taskStore.getTask(taskId, extra.sessionId); - if (!task) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Task not found: ${taskId}`); - } - // Block if task is not terminal (we've already delivered all queued messages above) - if (!(0, interfaces_js_1.isTerminal)(task.status)) { - // Wait for status change or new messages - await this._waitForTaskUpdate(taskId, extra.signal); - // After waking up, recursively call to deliver any new messages or result - return await handleTaskResult(); - } - // If task is terminal, return the result - if ((0, interfaces_js_1.isTerminal)(task.status)) { - const result = await this._taskStore.getTaskResult(taskId, extra.sessionId); - this._clearTaskQueue(taskId); - return { - ...result, - _meta: { - ...result._meta, - [types_js_1.RELATED_TASK_META_KEY]: { - taskId: taskId - } - } - }; - } - return await handleTaskResult(); - }; - return await handleTaskResult(); - }); - this.setRequestHandler(types_js_1.ListTasksRequestSchema, async (request, extra) => { - try { - const { tasks, nextCursor } = await this._taskStore.listTasks(request.params?.cursor, extra.sessionId); - // @ts-expect-error SendResultT cannot contain ListTasksResult, but we include it in our derived types everywhere else - return { - tasks, - nextCursor, - _meta: {} - }; - } - catch (error) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Failed to list tasks: ${error instanceof Error ? error.message : String(error)}`); - } - }); - this.setRequestHandler(types_js_1.CancelTaskRequestSchema, async (request, extra) => { - try { - // Get the current task to check if it's in a terminal state, in case the implementation is not atomic - const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId); - if (!task) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Task not found: ${request.params.taskId}`); - } - // Reject cancellation of terminal tasks - if ((0, interfaces_js_1.isTerminal)(task.status)) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`); - } - await this._taskStore.updateTaskStatus(request.params.taskId, 'cancelled', 'Client cancelled task execution.', extra.sessionId); - this._clearTaskQueue(request.params.taskId); - const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId); - if (!cancelledTask) { - // Task was deleted during cancellation (e.g., cleanup happened) - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`); - } - return { - _meta: {}, - ...cancelledTask - }; - } - catch (error) { - // Re-throw McpError as-is - if (error instanceof types_js_1.McpError) { - throw error; - } - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidRequest, `Failed to cancel task: ${error instanceof Error ? error.message : String(error)}`); - } - }); - } - } - async _oncancel(notification) { - if (!notification.params.requestId) { - return; - } - // Handle request cancellation - const controller = this._requestHandlerAbortControllers.get(notification.params.requestId); - controller?.abort(notification.params.reason); - } - _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) { - this._timeoutInfo.set(messageId, { - timeoutId: setTimeout(onTimeout, timeout), - startTime: Date.now(), - timeout, - maxTotalTimeout, - resetTimeoutOnProgress, - onTimeout - }); - } - _resetTimeout(messageId) { - const info = this._timeoutInfo.get(messageId); - if (!info) - return false; - const totalElapsed = Date.now() - info.startTime; - if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) { - this._timeoutInfo.delete(messageId); - throw types_js_1.McpError.fromError(types_js_1.ErrorCode.RequestTimeout, 'Maximum total timeout exceeded', { - maxTotalTimeout: info.maxTotalTimeout, - totalElapsed - }); - } - clearTimeout(info.timeoutId); - info.timeoutId = setTimeout(info.onTimeout, info.timeout); - return true; - } - _cleanupTimeout(messageId) { - const info = this._timeoutInfo.get(messageId); - if (info) { - clearTimeout(info.timeoutId); - this._timeoutInfo.delete(messageId); - } - } - /** - * Attaches to the given transport, starts it, and starts listening for messages. - * - * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. - */ - async connect(transport) { - if (this._transport) { - throw new Error('Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.'); - } - this._transport = transport; - const _onclose = this.transport?.onclose; - this._transport.onclose = () => { - _onclose?.(); - this._onclose(); - }; - const _onerror = this.transport?.onerror; - this._transport.onerror = (error) => { - _onerror?.(error); - this._onerror(error); - }; - const _onmessage = this._transport?.onmessage; - this._transport.onmessage = (message, extra) => { - _onmessage?.(message, extra); - if ((0, types_js_1.isJSONRPCResultResponse)(message) || (0, types_js_1.isJSONRPCErrorResponse)(message)) { - this._onresponse(message); - } - else if ((0, types_js_1.isJSONRPCRequest)(message)) { - this._onrequest(message, extra); - } - else if ((0, types_js_1.isJSONRPCNotification)(message)) { - this._onnotification(message); - } - else { - this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`)); - } - }; - await this._transport.start(); - } - _onclose() { - const responseHandlers = this._responseHandlers; - this._responseHandlers = new Map(); - this._progressHandlers.clear(); - this._taskProgressTokens.clear(); - this._pendingDebouncedNotifications.clear(); - // Abort all in-flight request handlers so they stop sending messages - for (const controller of this._requestHandlerAbortControllers.values()) { - controller.abort(); - } - this._requestHandlerAbortControllers.clear(); - const error = types_js_1.McpError.fromError(types_js_1.ErrorCode.ConnectionClosed, 'Connection closed'); - this._transport = undefined; - this.onclose?.(); - for (const handler of responseHandlers.values()) { - handler(error); - } - } - _onerror(error) { - this.onerror?.(error); - } - _onnotification(notification) { - const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler; - // Ignore notifications not being subscribed to. - if (handler === undefined) { - return; - } - // Starting with Promise.resolve() puts any synchronous errors into the monad as well. - Promise.resolve() - .then(() => handler(notification)) - .catch(error => this._onerror(new Error(`Uncaught error in notification handler: ${error}`))); - } - _onrequest(request, extra) { - const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler; - // Capture the current transport at request time to ensure responses go to the correct client - const capturedTransport = this._transport; - // Extract taskId from request metadata if present (needed early for method not found case) - const relatedTaskId = request.params?._meta?.[types_js_1.RELATED_TASK_META_KEY]?.taskId; - if (handler === undefined) { - const errorResponse = { - jsonrpc: '2.0', - id: request.id, - error: { - code: types_js_1.ErrorCode.MethodNotFound, - message: 'Method not found' - } - }; - // Queue or send the error response based on whether this is a task-related request - if (relatedTaskId && this._taskMessageQueue) { - this._enqueueTaskMessage(relatedTaskId, { - type: 'error', - message: errorResponse, - timestamp: Date.now() - }, capturedTransport?.sessionId).catch(error => this._onerror(new Error(`Failed to enqueue error response: ${error}`))); - } - else { - capturedTransport - ?.send(errorResponse) - .catch(error => this._onerror(new Error(`Failed to send an error response: ${error}`))); - } - return; - } - const abortController = new AbortController(); - this._requestHandlerAbortControllers.set(request.id, abortController); - const taskCreationParams = (0, types_js_1.isTaskAugmentedRequestParams)(request.params) ? request.params.task : undefined; - const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport?.sessionId) : undefined; - const fullExtra = { - signal: abortController.signal, - sessionId: capturedTransport?.sessionId, - _meta: request.params?._meta, - sendNotification: async (notification) => { - if (abortController.signal.aborted) - return; - // Include related-task metadata if this request is part of a task - const notificationOptions = { relatedRequestId: request.id }; - if (relatedTaskId) { - notificationOptions.relatedTask = { taskId: relatedTaskId }; - } - await this.notification(notification, notificationOptions); - }, - sendRequest: async (r, resultSchema, options) => { - if (abortController.signal.aborted) { - throw new types_js_1.McpError(types_js_1.ErrorCode.ConnectionClosed, 'Request was cancelled'); - } - // Include related-task metadata if this request is part of a task - const requestOptions = { ...options, relatedRequestId: request.id }; - if (relatedTaskId && !requestOptions.relatedTask) { - requestOptions.relatedTask = { taskId: relatedTaskId }; - } - // Set task status to input_required when sending a request within a task context - // Use the taskId from options (explicit) or fall back to relatedTaskId (inherited) - const effectiveTaskId = requestOptions.relatedTask?.taskId ?? relatedTaskId; - if (effectiveTaskId && taskStore) { - await taskStore.updateTaskStatus(effectiveTaskId, 'input_required'); - } - return await this.request(r, resultSchema, requestOptions); - }, - authInfo: extra?.authInfo, - requestId: request.id, - requestInfo: extra?.requestInfo, - taskId: relatedTaskId, - taskStore: taskStore, - taskRequestedTtl: taskCreationParams?.ttl, - closeSSEStream: extra?.closeSSEStream, - closeStandaloneSSEStream: extra?.closeStandaloneSSEStream - }; - // Starting with Promise.resolve() puts any synchronous errors into the monad as well. - Promise.resolve() - .then(() => { - // If this request asked for task creation, check capability first - if (taskCreationParams) { - // Check if the request method supports task creation - this.assertTaskHandlerCapability(request.method); - } - }) - .then(() => handler(request, fullExtra)) - .then(async (result) => { - if (abortController.signal.aborted) { - // Request was cancelled - return; - } - const response = { - result, - jsonrpc: '2.0', - id: request.id - }; - // Queue or send the response based on whether this is a task-related request - if (relatedTaskId && this._taskMessageQueue) { - await this._enqueueTaskMessage(relatedTaskId, { - type: 'response', - message: response, - timestamp: Date.now() - }, capturedTransport?.sessionId); - } - else { - await capturedTransport?.send(response); - } - }, async (error) => { - if (abortController.signal.aborted) { - // Request was cancelled - return; - } - const errorResponse = { - jsonrpc: '2.0', - id: request.id, - error: { - code: Number.isSafeInteger(error['code']) ? error['code'] : types_js_1.ErrorCode.InternalError, - message: error.message ?? 'Internal error', - ...(error['data'] !== undefined && { data: error['data'] }) - } - }; - // Queue or send the error response based on whether this is a task-related request - if (relatedTaskId && this._taskMessageQueue) { - await this._enqueueTaskMessage(relatedTaskId, { - type: 'error', - message: errorResponse, - timestamp: Date.now() - }, capturedTransport?.sessionId); - } - else { - await capturedTransport?.send(errorResponse); - } - }) - .catch(error => this._onerror(new Error(`Failed to send response: ${error}`))) - .finally(() => { - this._requestHandlerAbortControllers.delete(request.id); - }); - } - _onprogress(notification) { - const { progressToken, ...params } = notification.params; - const messageId = Number(progressToken); - const handler = this._progressHandlers.get(messageId); - if (!handler) { - this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`)); - return; - } - const responseHandler = this._responseHandlers.get(messageId); - const timeoutInfo = this._timeoutInfo.get(messageId); - if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) { - try { - this._resetTimeout(messageId); - } - catch (error) { - // Clean up if maxTotalTimeout was exceeded - this._responseHandlers.delete(messageId); - this._progressHandlers.delete(messageId); - this._cleanupTimeout(messageId); - responseHandler(error); - return; - } - } - handler(params); - } - _onresponse(response) { - const messageId = Number(response.id); - // Check if this is a response to a queued request - const resolver = this._requestResolvers.get(messageId); - if (resolver) { - this._requestResolvers.delete(messageId); - if ((0, types_js_1.isJSONRPCResultResponse)(response)) { - resolver(response); - } - else { - const error = new types_js_1.McpError(response.error.code, response.error.message, response.error.data); - resolver(error); - } - return; - } - const handler = this._responseHandlers.get(messageId); - if (handler === undefined) { - this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`)); - return; - } - this._responseHandlers.delete(messageId); - this._cleanupTimeout(messageId); - // Keep progress handler alive for CreateTaskResult responses - let isTaskResponse = false; - if ((0, types_js_1.isJSONRPCResultResponse)(response) && response.result && typeof response.result === 'object') { - const result = response.result; - if (result.task && typeof result.task === 'object') { - const task = result.task; - if (typeof task.taskId === 'string') { - isTaskResponse = true; - this._taskProgressTokens.set(task.taskId, messageId); - } - } - } - if (!isTaskResponse) { - this._progressHandlers.delete(messageId); - } - if ((0, types_js_1.isJSONRPCResultResponse)(response)) { - handler(response); - } - else { - const error = types_js_1.McpError.fromError(response.error.code, response.error.message, response.error.data); - handler(error); - } - } - get transport() { - return this._transport; - } - /** - * Closes the connection. - */ - async close() { - await this._transport?.close(); - } - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * @example - * ```typescript - * const stream = protocol.requestStream(request, resultSchema, options); - * for await (const message of stream) { - * switch (message.type) { - * case 'taskCreated': - * console.log('Task created:', message.task.taskId); - * break; - * case 'taskStatus': - * console.log('Task status:', message.task.status); - * break; - * case 'result': - * console.log('Final result:', message.result); - * break; - * case 'error': - * console.error('Error:', message.error); - * break; - * } - * } - * ``` - * - * @experimental Use `client.experimental.tasks.requestStream()` to access this method. - */ - async *requestStream(request, resultSchema, options) { - const { task } = options ?? {}; - // For non-task requests, just yield the result - if (!task) { - try { - const result = await this.request(request, resultSchema, options); - yield { type: 'result', result }; - } - catch (error) { - yield { - type: 'error', - error: error instanceof types_js_1.McpError ? error : new types_js_1.McpError(types_js_1.ErrorCode.InternalError, String(error)) - }; - } - return; - } - // For task-augmented requests, we need to poll for status - // First, make the request to create the task - let taskId; - try { - // Send the request and get the CreateTaskResult - const createResult = await this.request(request, types_js_1.CreateTaskResultSchema, options); - // Extract taskId from the result - if (createResult.task) { - taskId = createResult.task.taskId; - yield { type: 'taskCreated', task: createResult.task }; - } - else { - throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, 'Task creation did not return a task'); - } - // Poll for task completion - while (true) { - // Get current task status - const task = await this.getTask({ taskId }, options); - yield { type: 'taskStatus', task }; - // Check if task is terminal - if ((0, interfaces_js_1.isTerminal)(task.status)) { - if (task.status === 'completed') { - // Get the final result - const result = await this.getTaskResult({ taskId }, resultSchema, options); - yield { type: 'result', result }; - } - else if (task.status === 'failed') { - yield { - type: 'error', - error: new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Task ${taskId} failed`) - }; - } - else if (task.status === 'cancelled') { - yield { - type: 'error', - error: new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Task ${taskId} was cancelled`) - }; - } - return; - } - // When input_required, call tasks/result to deliver queued messages - // (elicitation, sampling) via SSE and block until terminal - if (task.status === 'input_required') { - const result = await this.getTaskResult({ taskId }, resultSchema, options); - yield { type: 'result', result }; - return; - } - // Wait before polling again - const pollInterval = task.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1000; - await new Promise(resolve => setTimeout(resolve, pollInterval)); - // Check if cancelled - options?.signal?.throwIfAborted(); - } - } - catch (error) { - yield { - type: 'error', - error: error instanceof types_js_1.McpError ? error : new types_js_1.McpError(types_js_1.ErrorCode.InternalError, String(error)) - }; - } - } - /** - * Sends a request and waits for a response. - * - * Do not use this method to emit notifications! Use notification() instead. - */ - request(request, resultSchema, options) { - const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {}; - // Send the request - return new Promise((resolve, reject) => { - const earlyReject = (error) => { - reject(error); - }; - if (!this._transport) { - earlyReject(new Error('Not connected')); - return; - } - if (this._options?.enforceStrictCapabilities === true) { - try { - this.assertCapabilityForMethod(request.method); - // If task creation is requested, also check task capabilities - if (task) { - this.assertTaskCapability(request.method); - } - } - catch (e) { - earlyReject(e); - return; - } - } - options?.signal?.throwIfAborted(); - const messageId = this._requestMessageId++; - const jsonrpcRequest = { - ...request, - jsonrpc: '2.0', - id: messageId - }; - if (options?.onprogress) { - this._progressHandlers.set(messageId, options.onprogress); - jsonrpcRequest.params = { - ...request.params, - _meta: { - ...(request.params?._meta || {}), - progressToken: messageId - } - }; - } - // Augment with task creation parameters if provided - if (task) { - jsonrpcRequest.params = { - ...jsonrpcRequest.params, - task: task - }; - } - // Augment with related task metadata if relatedTask is provided - if (relatedTask) { - jsonrpcRequest.params = { - ...jsonrpcRequest.params, - _meta: { - ...(jsonrpcRequest.params?._meta || {}), - [types_js_1.RELATED_TASK_META_KEY]: relatedTask - } - }; - } - const cancel = (reason) => { - this._responseHandlers.delete(messageId); - this._progressHandlers.delete(messageId); - this._cleanupTimeout(messageId); - this._transport - ?.send({ - jsonrpc: '2.0', - method: 'notifications/cancelled', - params: { - requestId: messageId, - reason: String(reason) - } - }, { relatedRequestId, resumptionToken, onresumptiontoken }) - .catch(error => this._onerror(new Error(`Failed to send cancellation: ${error}`))); - // Wrap the reason in an McpError if it isn't already - const error = reason instanceof types_js_1.McpError ? reason : new types_js_1.McpError(types_js_1.ErrorCode.RequestTimeout, String(reason)); - reject(error); - }; - this._responseHandlers.set(messageId, response => { - if (options?.signal?.aborted) { - return; - } - if (response instanceof Error) { - return reject(response); - } - try { - const parseResult = (0, zod_compat_js_1.safeParse)(resultSchema, response.result); - if (!parseResult.success) { - // Type guard: if success is false, error is guaranteed to exist - reject(parseResult.error); - } - else { - resolve(parseResult.data); - } - } - catch (error) { - reject(error); - } - }); - options?.signal?.addEventListener('abort', () => { - cancel(options?.signal?.reason); - }); - const timeout = options?.timeout ?? exports.DEFAULT_REQUEST_TIMEOUT_MSEC; - const timeoutHandler = () => cancel(types_js_1.McpError.fromError(types_js_1.ErrorCode.RequestTimeout, 'Request timed out', { timeout })); - this._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false); - // Queue request if related to a task - const relatedTaskId = relatedTask?.taskId; - if (relatedTaskId) { - // Store the response resolver for this request so responses can be routed back - const responseResolver = (response) => { - const handler = this._responseHandlers.get(messageId); - if (handler) { - handler(response); - } - else { - // Log error when resolver is missing, but don't fail - this._onerror(new Error(`Response handler missing for side-channeled request ${messageId}`)); - } - }; - this._requestResolvers.set(messageId, responseResolver); - this._enqueueTaskMessage(relatedTaskId, { - type: 'request', - message: jsonrpcRequest, - timestamp: Date.now() - }).catch(error => { - this._cleanupTimeout(messageId); - reject(error); - }); - // Don't send through transport - queued messages are delivered via tasks/result only - // This prevents duplicate delivery for bidirectional transports - } - else { - // No related task - send through transport normally - this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch(error => { - this._cleanupTimeout(messageId); - reject(error); - }); - } - }); - } - /** - * Gets the current status of a task. - * - * @experimental Use `client.experimental.tasks.getTask()` to access this method. - */ - async getTask(params, options) { - // @ts-expect-error SendRequestT cannot directly contain GetTaskRequest, but we ensure all type instantiations contain it anyways - return this.request({ method: 'tasks/get', params }, types_js_1.GetTaskResultSchema, options); - } - /** - * Retrieves the result of a completed task. - * - * @experimental Use `client.experimental.tasks.getTaskResult()` to access this method. - */ - async getTaskResult(params, resultSchema, options) { - // @ts-expect-error SendRequestT cannot directly contain GetTaskPayloadRequest, but we ensure all type instantiations contain it anyways - return this.request({ method: 'tasks/result', params }, resultSchema, options); - } - /** - * Lists tasks, optionally starting from a pagination cursor. - * - * @experimental Use `client.experimental.tasks.listTasks()` to access this method. - */ - async listTasks(params, options) { - // @ts-expect-error SendRequestT cannot directly contain ListTasksRequest, but we ensure all type instantiations contain it anyways - return this.request({ method: 'tasks/list', params }, types_js_1.ListTasksResultSchema, options); - } - /** - * Cancels a specific task. - * - * @experimental Use `client.experimental.tasks.cancelTask()` to access this method. - */ - async cancelTask(params, options) { - // @ts-expect-error SendRequestT cannot directly contain CancelTaskRequest, but we ensure all type instantiations contain it anyways - return this.request({ method: 'tasks/cancel', params }, types_js_1.CancelTaskResultSchema, options); - } - /** - * Emits a notification, which is a one-way message that does not expect a response. - */ - async notification(notification, options) { - if (!this._transport) { - throw new Error('Not connected'); - } - this.assertNotificationCapability(notification.method); - // Queue notification if related to a task - const relatedTaskId = options?.relatedTask?.taskId; - if (relatedTaskId) { - // Build the JSONRPC notification with metadata - const jsonrpcNotification = { - ...notification, - jsonrpc: '2.0', - params: { - ...notification.params, - _meta: { - ...(notification.params?._meta || {}), - [types_js_1.RELATED_TASK_META_KEY]: options.relatedTask - } - } - }; - await this._enqueueTaskMessage(relatedTaskId, { - type: 'notification', - message: jsonrpcNotification, - timestamp: Date.now() - }); - // Don't send through transport - queued messages are delivered via tasks/result only - // This prevents duplicate delivery for bidirectional transports - return; - } - const debouncedMethods = this._options?.debouncedNotificationMethods ?? []; - // A notification can only be debounced if it's in the list AND it's "simple" - // (i.e., has no parameters and no related request ID or related task that could be lost). - const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !options?.relatedRequestId && !options?.relatedTask; - if (canDebounce) { - // If a notification of this type is already scheduled, do nothing. - if (this._pendingDebouncedNotifications.has(notification.method)) { - return; - } - // Mark this notification type as pending. - this._pendingDebouncedNotifications.add(notification.method); - // Schedule the actual send to happen in the next microtask. - // This allows all synchronous calls in the current event loop tick to be coalesced. - Promise.resolve().then(() => { - // Un-mark the notification so the next one can be scheduled. - this._pendingDebouncedNotifications.delete(notification.method); - // SAFETY CHECK: If the connection was closed while this was pending, abort. - if (!this._transport) { - return; - } - let jsonrpcNotification = { - ...notification, - jsonrpc: '2.0' - }; - // Augment with related task metadata if relatedTask is provided - if (options?.relatedTask) { - jsonrpcNotification = { - ...jsonrpcNotification, - params: { - ...jsonrpcNotification.params, - _meta: { - ...(jsonrpcNotification.params?._meta || {}), - [types_js_1.RELATED_TASK_META_KEY]: options.relatedTask - } - } - }; - } - // Send the notification, but don't await it here to avoid blocking. - // Handle potential errors with a .catch(). - this._transport?.send(jsonrpcNotification, options).catch(error => this._onerror(error)); - }); - // Return immediately. - return; - } - let jsonrpcNotification = { - ...notification, - jsonrpc: '2.0' - }; - // Augment with related task metadata if relatedTask is provided - if (options?.relatedTask) { - jsonrpcNotification = { - ...jsonrpcNotification, - params: { - ...jsonrpcNotification.params, - _meta: { - ...(jsonrpcNotification.params?._meta || {}), - [types_js_1.RELATED_TASK_META_KEY]: options.relatedTask - } - } - }; - } - await this._transport.send(jsonrpcNotification, options); - } - /** - * Registers a handler to invoke when this protocol object receives a request with the given method. - * - * Note that this will replace any previous request handler for the same method. - */ - setRequestHandler(requestSchema, handler) { - const method = (0, zod_json_schema_compat_js_1.getMethodLiteral)(requestSchema); - this.assertRequestHandlerCapability(method); - this._requestHandlers.set(method, (request, extra) => { - const parsed = (0, zod_json_schema_compat_js_1.parseWithCompat)(requestSchema, request); - return Promise.resolve(handler(parsed, extra)); - }); - } - /** - * Removes the request handler for the given method. - */ - removeRequestHandler(method) { - this._requestHandlers.delete(method); - } - /** - * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed. - */ - assertCanSetRequestHandler(method) { - if (this._requestHandlers.has(method)) { - throw new Error(`A request handler for ${method} already exists, which would be overridden`); - } - } - /** - * Registers a handler to invoke when this protocol object receives a notification with the given method. - * - * Note that this will replace any previous notification handler for the same method. - */ - setNotificationHandler(notificationSchema, handler) { - const method = (0, zod_json_schema_compat_js_1.getMethodLiteral)(notificationSchema); - this._notificationHandlers.set(method, notification => { - const parsed = (0, zod_json_schema_compat_js_1.parseWithCompat)(notificationSchema, notification); - return Promise.resolve(handler(parsed)); - }); - } - /** - * Removes the notification handler for the given method. - */ - removeNotificationHandler(method) { - this._notificationHandlers.delete(method); - } - /** - * Cleans up the progress handler associated with a task. - * This should be called when a task reaches a terminal status. - */ - _cleanupTaskProgressHandler(taskId) { - const progressToken = this._taskProgressTokens.get(taskId); - if (progressToken !== undefined) { - this._progressHandlers.delete(progressToken); - this._taskProgressTokens.delete(taskId); - } - } - /** - * Enqueues a task-related message for side-channel delivery via tasks/result. - * @param taskId The task ID to associate the message with - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @throws Error if taskStore is not configured or if enqueue fails (e.g., queue overflow) - * - * Note: If enqueue fails, it's the TaskMessageQueue implementation's responsibility to handle - * the error appropriately (e.g., by failing the task, logging, etc.). The Protocol layer - * simply propagates the error. - */ - async _enqueueTaskMessage(taskId, message, sessionId) { - // Task message queues are only used when taskStore is configured - if (!this._taskStore || !this._taskMessageQueue) { - throw new Error('Cannot enqueue task message: taskStore and taskMessageQueue are not configured'); - } - const maxQueueSize = this._options?.maxTaskQueueSize; - await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize); - } - /** - * Clears the message queue for a task and rejects any pending request resolvers. - * @param taskId The task ID whose queue should be cleared - * @param sessionId Optional session ID for binding the operation to a specific session - */ - async _clearTaskQueue(taskId, sessionId) { - if (this._taskMessageQueue) { - // Reject any pending request resolvers - const messages = await this._taskMessageQueue.dequeueAll(taskId, sessionId); - for (const message of messages) { - if (message.type === 'request' && (0, types_js_1.isJSONRPCRequest)(message.message)) { - // Extract request ID from the message - const requestId = message.message.id; - const resolver = this._requestResolvers.get(requestId); - if (resolver) { - resolver(new types_js_1.McpError(types_js_1.ErrorCode.InternalError, 'Task cancelled or completed')); - this._requestResolvers.delete(requestId); - } - else { - // Log error when resolver is missing during cleanup for better observability - this._onerror(new Error(`Resolver missing for request ${requestId} during task ${taskId} cleanup`)); - } - } - } - } - } - /** - * Waits for a task update (new messages or status change) with abort signal support. - * Uses polling to check for updates at the task's configured poll interval. - * @param taskId The task ID to wait for - * @param signal Abort signal to cancel the wait - * @returns Promise that resolves when an update occurs or rejects if aborted - */ - async _waitForTaskUpdate(taskId, signal) { - // Get the task's poll interval, falling back to default - let interval = this._options?.defaultTaskPollInterval ?? 1000; - try { - const task = await this._taskStore?.getTask(taskId); - if (task?.pollInterval) { - interval = task.pollInterval; - } - } - catch { - // Use default interval if task lookup fails - } - return new Promise((resolve, reject) => { - if (signal.aborted) { - reject(new types_js_1.McpError(types_js_1.ErrorCode.InvalidRequest, 'Request cancelled')); - return; - } - // Wait for the poll interval, then resolve so caller can check for updates - const timeoutId = setTimeout(resolve, interval); - // Clean up timeout and reject if aborted - signal.addEventListener('abort', () => { - clearTimeout(timeoutId); - reject(new types_js_1.McpError(types_js_1.ErrorCode.InvalidRequest, 'Request cancelled')); - }, { once: true }); - }); - } - requestTaskStore(request, sessionId) { - const taskStore = this._taskStore; - if (!taskStore) { - throw new Error('No task store configured'); - } - return { - createTask: async (taskParams) => { - if (!request) { - throw new Error('No request provided'); - } - return await taskStore.createTask(taskParams, request.id, { - method: request.method, - params: request.params - }, sessionId); - }, - getTask: async (taskId) => { - const task = await taskStore.getTask(taskId, sessionId); - if (!task) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, 'Failed to retrieve task: Task not found'); - } - return task; - }, - storeTaskResult: async (taskId, status, result) => { - await taskStore.storeTaskResult(taskId, status, result, sessionId); - // Get updated task state and send notification - const task = await taskStore.getTask(taskId, sessionId); - if (task) { - const notification = types_js_1.TaskStatusNotificationSchema.parse({ - method: 'notifications/tasks/status', - params: task - }); - await this.notification(notification); - if ((0, interfaces_js_1.isTerminal)(task.status)) { - this._cleanupTaskProgressHandler(taskId); - // Don't clear queue here - it will be cleared after delivery via tasks/result - } - } - }, - getTaskResult: taskId => { - return taskStore.getTaskResult(taskId, sessionId); - }, - updateTaskStatus: async (taskId, status, statusMessage) => { - // Check if task exists - const task = await taskStore.getTask(taskId, sessionId); - if (!task) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`); - } - // Don't allow transitions from terminal states - if ((0, interfaces_js_1.isTerminal)(task.status)) { - throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Cannot update task "${taskId}" from terminal status "${task.status}" to "${status}". Terminal states (completed, failed, cancelled) cannot transition to other states.`); - } - await taskStore.updateTaskStatus(taskId, status, statusMessage, sessionId); - // Get updated task state and send notification - const updatedTask = await taskStore.getTask(taskId, sessionId); - if (updatedTask) { - const notification = types_js_1.TaskStatusNotificationSchema.parse({ - method: 'notifications/tasks/status', - params: updatedTask - }); - await this.notification(notification); - if ((0, interfaces_js_1.isTerminal)(updatedTask.status)) { - this._cleanupTaskProgressHandler(taskId); - // Don't clear queue here - it will be cleared after delivery via tasks/result - } - } - }, - listTasks: cursor => { - return taskStore.listTasks(cursor, sessionId); - } - }; - } -} -exports.Protocol = Protocol; -function isPlainObject(value) { - return value !== null && typeof value === 'object' && !Array.isArray(value); -} -function mergeCapabilities(base, additional) { - const result = { ...base }; - for (const key in additional) { - const k = key; - const addValue = additional[k]; - if (addValue === undefined) - continue; - const baseValue = result[k]; - if (isPlainObject(baseValue) && isPlainObject(addValue)) { - result[k] = { ...baseValue, ...addValue }; - } - else { - result[k] = addValue; - } - } - return result; -} -//# sourceMappingURL=protocol.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js.map deleted file mode 100644 index 811c90f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/shared/protocol.ts"],"names":[],"mappings":";;;AA0nDA,8CAcC;AAxoDD,2DAA8F;AAC9F,0CA6CqB;AAGrB,uEAAgI;AAChI,mFAAwF;AAoDxF;;GAEG;AACU,QAAA,4BAA4B,GAAG,KAAK,CAAC;AAkNlD;;;GAGG;AACH,MAAsB,QAAQ;IA8C1B,YAAoB,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;QA5CtC,sBAAiB,GAAG,CAAC,CAAC;QACtB,qBAAgB,GAGpB,IAAI,GAAG,EAAE,CAAC;QACN,oCAA+B,GAAoC,IAAI,GAAG,EAAE,CAAC;QAC7E,0BAAqB,GAAsE,IAAI,GAAG,EAAE,CAAC;QACrG,sBAAiB,GAAmE,IAAI,GAAG,EAAE,CAAC;QAC9F,sBAAiB,GAAkC,IAAI,GAAG,EAAE,CAAC;QAC7D,iBAAY,GAA6B,IAAI,GAAG,EAAE,CAAC;QACnD,mCAA8B,GAAG,IAAI,GAAG,EAAU,CAAC;QAE3D,iFAAiF;QACzE,wBAAmB,GAAwB,IAAI,GAAG,EAAE,CAAC;QAKrD,sBAAiB,GAAsE,IAAI,GAAG,EAAE,CAAC;QA2BrG,IAAI,CAAC,sBAAsB,CAAC,sCAA2B,EAAE,YAAY,CAAC,EAAE;YACpE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,sBAAsB,CAAC,qCAA0B,EAAE,YAAY,CAAC,EAAE;YACnE,IAAI,CAAC,WAAW,CAAC,YAA+C,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,CAClB,4BAAiB;QACj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CAAC,GAAG,EAAE,GAAI,SAAqC,EAAE,GAAI,QAAoC,EAAiB,CAAC;QACvH,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,CAAC,CAAC,GAAG,QAAuB,CAAC;QACxC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.d.ts deleted file mode 100644 index 84354bd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Result, Task, McpError } from '../types.js'; -/** - * Base message type - */ -export interface BaseResponseMessage { - type: string; -} -/** - * Task status update message - */ -export interface TaskStatusMessage extends BaseResponseMessage { - type: 'taskStatus'; - task: Task; -} -/** - * Task created message (first message for task-augmented requests) - */ -export interface TaskCreatedMessage extends BaseResponseMessage { - type: 'taskCreated'; - task: Task; -} -/** - * Final result message (terminal) - */ -export interface ResultMessage extends BaseResponseMessage { - type: 'result'; - result: T; -} -/** - * Error message (terminal) - */ -export interface ErrorMessage extends BaseResponseMessage { - type: 'error'; - error: McpError; -} -/** - * Union type representing all possible messages that can be yielded during request processing. - * Note: Progress notifications are handled through the existing onprogress callback mechanism. - * Side-channeled messages (server requests/notifications) are handled through registered handlers. - */ -export type ResponseMessage = TaskStatusMessage | TaskCreatedMessage | ResultMessage | ErrorMessage; -export type AsyncGeneratorValue = T extends AsyncGenerator ? U : never; -export declare function toArrayAsync>(it: T): Promise[]>; -export declare function takeResult>>(it: U): Promise; -//# sourceMappingURL=responseMessage.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.d.ts.map deleted file mode 100644 index 65d93bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responseMessage.d.ts","sourceRoot":"","sources":["../../../src/shared/responseMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC1D,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC3D,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,mBAAmB;IACxE,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,CAAC,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,mBAAmB;IACrD,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,QAAQ,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,IAAI,iBAAiB,GAAG,kBAAkB,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC;AAEzH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEnF,wBAAsB,YAAY,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,CAO9G;AAED,wBAAsB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAUlH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.js deleted file mode 100644 index 6c223fc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toArrayAsync = toArrayAsync; -exports.takeResult = takeResult; -async function toArrayAsync(it) { - const arr = []; - for await (const o of it) { - arr.push(o); - } - return arr; -} -async function takeResult(it) { - for await (const o of it) { - if (o.type === 'result') { - return o.result; - } - else if (o.type === 'error') { - throw o.error; - } - } - throw new Error('No result in stream.'); -} -//# sourceMappingURL=responseMessage.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.js.map deleted file mode 100644 index 18bd904..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responseMessage.js","sourceRoot":"","sources":["../../../src/shared/responseMessage.ts"],"names":[],"mappings":";;AAkDA,oCAOC;AAED,gCAUC;AAnBM,KAAK,UAAU,YAAY,CAAoC,EAAK;IACvE,MAAM,GAAG,GAA6B,EAAE,CAAC;IACzC,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACvB,GAAG,CAAC,IAAI,CAAC,CAA2B,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAEM,KAAK,UAAU,UAAU,CAAiE,EAAK;IAClG,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,OAAO,CAAC,CAAC,MAAM,CAAC;QACpB,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC5B,MAAM,CAAC,CAAC,KAAK,CAAC;QAClB,CAAC;IACL,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts deleted file mode 100644 index 0830a48..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JSONRPCMessage } from '../types.js'; -/** - * Buffers a continuous stdio stream into discrete JSON-RPC messages. - */ -export declare class ReadBuffer { - private _buffer?; - append(chunk: Buffer): void; - readMessage(): JSONRPCMessage | null; - clear(): void; -} -export declare function deserializeMessage(line: string): JSONRPCMessage; -export declare function serializeMessage(message: JSONRPCMessage): string; -//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts.map deleted file mode 100644 index 8f97f2a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI3B,WAAW,IAAI,cAAc,GAAG,IAAI;IAepC,KAAK,IAAI,IAAI;CAGhB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAEhE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js deleted file mode 100644 index 540ee56..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ReadBuffer = void 0; -exports.deserializeMessage = deserializeMessage; -exports.serializeMessage = serializeMessage; -const types_js_1 = require("../types.js"); -/** - * Buffers a continuous stdio stream into discrete JSON-RPC messages. - */ -class ReadBuffer { - append(chunk) { - this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk; - } - readMessage() { - if (!this._buffer) { - return null; - } - const index = this._buffer.indexOf('\n'); - if (index === -1) { - return null; - } - const line = this._buffer.toString('utf8', 0, index).replace(/\r$/, ''); - this._buffer = this._buffer.subarray(index + 1); - return deserializeMessage(line); - } - clear() { - this._buffer = undefined; - } -} -exports.ReadBuffer = ReadBuffer; -function deserializeMessage(line) { - return types_js_1.JSONRPCMessageSchema.parse(JSON.parse(line)); -} -function serializeMessage(message) { - return JSON.stringify(message) + '\n'; -} -//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js.map deleted file mode 100644 index 89fbc1a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":";;;AAgCA,gDA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@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.d.ts deleted file mode 100644 index 3cf94bf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Tool name validation utilities according to SEP: Specify Format for Tool Names - * - * Tool names SHOULD be between 1 and 128 characters in length (inclusive). - * Tool names are case-sensitive. - * Allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits - * (0-9), underscore (_), dash (-), and dot (.). - * Tool names SHOULD NOT contain spaces, commas, or other special characters. - */ -/** - * Validates a tool name according to the SEP specification - * @param name - The tool name to validate - * @returns An object containing validation result and any warnings - */ -export declare function validateToolName(name: string): { - isValid: boolean; - warnings: string[]; -}; -/** - * Issues warnings for non-conforming tool names - * @param name - The tool name that triggered the warnings - * @param warnings - Array of warning messages - */ -export declare function issueToolNameWarning(name: string, warnings: string[]): void; -/** - * Validates a tool name and issues warnings for non-conforming names - * @param name - The tool name to validate - * @returns true if the name is valid, false otherwise - */ -export declare function validateAndWarnToolName(name: string): boolean; -//# sourceMappingURL=toolNameValidation.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.d.ts.map deleted file mode 100644 index d81f015..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"toolNameValidation.d.ts","sourceRoot":"","sources":["../../../src/shared/toolNameValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CA0DA;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAY3E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAO7D"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.js deleted file mode 100644 index cd9d930..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -/** - * Tool name validation utilities according to SEP: Specify Format for Tool Names - * - * Tool names SHOULD be between 1 and 128 characters in length (inclusive). - * Tool names are case-sensitive. - * Allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits - * (0-9), underscore (_), dash (-), and dot (.). - * Tool names SHOULD NOT contain spaces, commas, or other special characters. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateToolName = validateToolName; -exports.issueToolNameWarning = issueToolNameWarning; -exports.validateAndWarnToolName = validateAndWarnToolName; -/** - * Regular expression for valid tool names according to SEP-986 specification - */ -const TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/; -/** - * Validates a tool name according to the SEP specification - * @param name - The tool name to validate - * @returns An object containing validation result and any warnings - */ -function validateToolName(name) { - const warnings = []; - // Check length - if (name.length === 0) { - return { - isValid: false, - warnings: ['Tool name cannot be empty'] - }; - } - if (name.length > 128) { - return { - isValid: false, - warnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`] - }; - } - // Check for specific problematic patterns (these are warnings, not validation failures) - if (name.includes(' ')) { - warnings.push('Tool name contains spaces, which may cause parsing issues'); - } - if (name.includes(',')) { - warnings.push('Tool name contains commas, which may cause parsing issues'); - } - // Check for potentially confusing patterns (leading/trailing dashes, dots, slashes) - if (name.startsWith('-') || name.endsWith('-')) { - warnings.push('Tool name starts or ends with a dash, which may cause parsing issues in some contexts'); - } - if (name.startsWith('.') || name.endsWith('.')) { - warnings.push('Tool name starts or ends with a dot, which may cause parsing issues in some contexts'); - } - // Check for invalid characters - if (!TOOL_NAME_REGEX.test(name)) { - const invalidChars = name - .split('') - .filter(char => !/[A-Za-z0-9._-]/.test(char)) - .filter((char, index, arr) => arr.indexOf(char) === index); // Remove duplicates - warnings.push(`Tool name contains invalid characters: ${invalidChars.map(c => `"${c}"`).join(', ')}`, 'Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)'); - return { - isValid: false, - warnings - }; - } - return { - isValid: true, - warnings - }; -} -/** - * Issues warnings for non-conforming tool names - * @param name - The tool name that triggered the warnings - * @param warnings - Array of warning messages - */ -function issueToolNameWarning(name, warnings) { - if (warnings.length > 0) { - console.warn(`Tool name validation warning for "${name}":`); - for (const warning of warnings) { - console.warn(` - ${warning}`); - } - console.warn('Tool registration will proceed, but this may cause compatibility issues.'); - console.warn('Consider updating the tool name to conform to the MCP tool naming standard.'); - console.warn('See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.'); - } -} -/** - * Validates a tool name and issues warnings for non-conforming names - * @param name - The tool name to validate - * @returns true if the name is valid, false otherwise - */ -function validateAndWarnToolName(name) { - const result = validateToolName(name); - // Always issue warnings for any validation issues (both invalid names and warnings) - issueToolNameWarning(name, result.warnings); - return result.isValid; -} -//# sourceMappingURL=toolNameValidation.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.js.map deleted file mode 100644 index ad136cc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"toolNameValidation.js","sourceRoot":"","sources":["../../../src/shared/toolNameValidation.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAYH,4CA6DC;AAO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IAE5C,OAAO,MAAM,CAAC,OAAO,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts deleted file mode 100644 index 1bd95ef..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { JSONRPCMessage, MessageExtraInfo, RequestId } from '../types.js'; -export type FetchLike = (url: string | URL, init?: RequestInit) => Promise; -/** - * Normalizes HeadersInit to a plain Record for manipulation. - * Handles Headers objects, arrays of tuples, and plain objects. - */ -export declare function normalizeHeaders(headers: HeadersInit | undefined): Record; -/** - * Creates a fetch function that includes base RequestInit options. - * This ensures requests inherit settings like credentials, mode, headers, etc. from the base init. - * - * @param baseFetch - The base fetch function to wrap (defaults to global fetch) - * @param baseInit - The base RequestInit to merge with each request - * @returns A wrapped fetch function that merges base options with call-specific options - */ -export declare function createFetchWithInit(baseFetch?: FetchLike, baseInit?: RequestInit): FetchLike; -/** - * Options for sending a JSON-RPC message. - */ -export type TransportSendOptions = { - /** - * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. - */ - relatedRequestId?: RequestId; - /** - * The resumption token used to continue long-running requests that were interrupted. - * - * This allows clients to reconnect and continue from where they left off, if supported by the transport. - */ - resumptionToken?: string; - /** - * A callback that is invoked when the resumption token changes, if supported by the transport. - * - * This allows clients to persist the latest token for potential reconnection. - */ - onresumptiontoken?: (token: string) => void; -}; -/** - * Describes the minimal contract for an MCP transport that a client or server can communicate over. - */ -export interface Transport { - /** - * Starts processing messages on the transport, including any connection steps that might need to be taken. - * - * This method should only be called after callbacks are installed, or else messages may be lost. - * - * NOTE: This method should not be called explicitly when using Client, Server, or Protocol classes, as they will implicitly call start(). - */ - start(): Promise; - /** - * Sends a JSON-RPC message (request or response). - * - * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. - */ - send(message: JSONRPCMessage, options?: TransportSendOptions): Promise; - /** - * Closes the connection. - */ - close(): Promise; - /** - * Callback for when the connection is closed for any reason. - * - * This should be invoked when close() is called as well. - */ - onclose?: () => void; - /** - * Callback for when an error occurs. - * - * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. - */ - onerror?: (error: Error) => void; - /** - * Callback for when a message (request or response) is received over the connection. - * - * Includes the requestInfo and authInfo if the transport is authenticated. - * - * The requestInfo can be used to get the original request information (headers, etc.) - */ - onmessage?: (message: T, extra?: MessageExtraInfo) => void; - /** - * The session ID generated for this connection. - */ - sessionId?: string; - /** - * Sets the protocol version used for the connection (called when the initialize response is received). - */ - setProtocolVersion?: (version: string) => void; -} -//# sourceMappingURL=transport.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts.map deleted file mode 100644 index 7a3d837..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1E,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAErF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYzF;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,GAAE,SAAiB,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,SAAS,CAenG;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAE7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C,CAAC;AACF;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7E;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,cAAc,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAErF;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js deleted file mode 100644 index 38cfcc7..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.normalizeHeaders = normalizeHeaders; -exports.createFetchWithInit = createFetchWithInit; -/** - * Normalizes HeadersInit to a plain Record for manipulation. - * Handles Headers objects, arrays of tuples, and plain objects. - */ -function normalizeHeaders(headers) { - if (!headers) - return {}; - if (headers instanceof Headers) { - return Object.fromEntries(headers.entries()); - } - if (Array.isArray(headers)) { - return Object.fromEntries(headers); - } - return { ...headers }; -} -/** - * Creates a fetch function that includes base RequestInit options. - * This ensures requests inherit settings like credentials, mode, headers, etc. from the base init. - * - * @param baseFetch - The base fetch function to wrap (defaults to global fetch) - * @param baseInit - The base RequestInit to merge with each request - * @returns A wrapped fetch function that merges base options with call-specific options - */ -function createFetchWithInit(baseFetch = fetch, baseInit) { - if (!baseInit) { - return baseFetch; - } - // Return a wrapped fetch that merges base RequestInit with call-specific init - return async (url, init) => { - const mergedInit = { - ...baseInit, - ...init, - // Headers need special handling - merge instead of replace - headers: init?.headers ? { ...normalizeHeaders(baseInit.headers), ...normalizeHeaders(init.headers) } : baseInit.headers - }; - return baseFetch(url, mergedInit); - }; -} -//# sourceMappingURL=transport.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js.map deleted file mode 100644 index 7ddf2f9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":";;AAQA,4CAYC;AAUD,kDAeC;AAzCD;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,OAAgC;IAC7D,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,IAAI,OAAO,YAAY,OAAO,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,EAAE,GAAI,OAAkC,EAAE,CAAC;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,YAAuB,KAAK,EAAE,QAAsB;IACpF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,8EAA8E;IAC9E,OAAO,KAAK,EAAE,GAAiB,EAAE,IAAkB,EAAqB,EAAE;QACtE,MAAM,UAAU,GAAgB;YAC5B,GAAG,QAAQ;YACX,GAAG,IAAI;YACP,2DAA2D;YAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO;SAC3H,CAAC;QACF,OAAO,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACtC,CAAC,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts deleted file mode 100644 index 175e329..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type Variables = Record; -export declare class UriTemplate { - /** - * Returns true if the given string contains any URI template expressions. - * A template expression is a sequence of characters enclosed in curly braces, - * like {foo} or {?bar}. - */ - static isTemplate(str: string): boolean; - private static validateLength; - private readonly template; - private readonly parts; - get variableNames(): string[]; - constructor(template: string); - toString(): string; - private parse; - private getOperator; - private getNames; - private encodeValue; - private expandPart; - expand(variables: Variables): string; - private escapeRegExp; - private partToRegExp; - match(uri: string): Variables | null; -} -//# sourceMappingURL=uriTemplate.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts.map deleted file mode 100644 index 052e918..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uriTemplate.d.ts","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAO1D,qBAAa,WAAW;IACpB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAMvC,OAAO,CAAC,MAAM,CAAC,cAAc;IAK7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyF;IAE/G,IAAI,aAAa,IAAI,MAAM,EAAE,CAE5B;gBAEW,QAAQ,EAAE,MAAM;IAM5B,QAAQ,IAAI,MAAM;IAIlB,OAAO,CAAC,KAAK;IA8Cb,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,UAAU;IAsDlB,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IA4BpC,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAkDpB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;CAuCvC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js deleted file mode 100644 index 8f8c74a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js +++ /dev/null @@ -1,243 +0,0 @@ -"use strict"; -// Claude-authored implementation of RFC 6570 URI Templates -Object.defineProperty(exports, "__esModule", { value: true }); -exports.UriTemplate = void 0; -const MAX_TEMPLATE_LENGTH = 1000000; // 1MB -const MAX_VARIABLE_LENGTH = 1000000; // 1MB -const MAX_TEMPLATE_EXPRESSIONS = 10000; -const MAX_REGEX_LENGTH = 1000000; // 1MB -class UriTemplate { - /** - * Returns true if the given string contains any URI template expressions. - * A template expression is a sequence of characters enclosed in curly braces, - * like {foo} or {?bar}. - */ - static isTemplate(str) { - // Look for any sequence of characters between curly braces - // that isn't just whitespace - return /\{[^}\s]+\}/.test(str); - } - static validateLength(str, max, context) { - if (str.length > max) { - throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`); - } - } - get variableNames() { - return this.parts.flatMap(part => (typeof part === 'string' ? [] : part.names)); - } - constructor(template) { - UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, 'Template'); - this.template = template; - this.parts = this.parse(template); - } - toString() { - return this.template; - } - parse(template) { - const parts = []; - let currentText = ''; - let i = 0; - let expressionCount = 0; - while (i < template.length) { - if (template[i] === '{') { - if (currentText) { - parts.push(currentText); - currentText = ''; - } - const end = template.indexOf('}', i); - if (end === -1) - throw new Error('Unclosed template expression'); - expressionCount++; - if (expressionCount > MAX_TEMPLATE_EXPRESSIONS) { - throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`); - } - const expr = template.slice(i + 1, end); - const operator = this.getOperator(expr); - const exploded = expr.includes('*'); - const names = this.getNames(expr); - const name = names[0]; - // Validate variable name length - for (const name of names) { - UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name'); - } - parts.push({ name, operator, names, exploded }); - i = end + 1; - } - else { - currentText += template[i]; - i++; - } - } - if (currentText) { - parts.push(currentText); - } - return parts; - } - getOperator(expr) { - const operators = ['+', '#', '.', '/', '?', '&']; - return operators.find(op => expr.startsWith(op)) || ''; - } - getNames(expr) { - const operator = this.getOperator(expr); - return expr - .slice(operator.length) - .split(',') - .map(name => name.replace('*', '').trim()) - .filter(name => name.length > 0); - } - encodeValue(value, operator) { - UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, 'Variable value'); - if (operator === '+' || operator === '#') { - return encodeURI(value); - } - return encodeURIComponent(value); - } - expandPart(part, variables) { - if (part.operator === '?' || part.operator === '&') { - const pairs = part.names - .map(name => { - const value = variables[name]; - if (value === undefined) - return ''; - const encoded = Array.isArray(value) - ? value.map(v => this.encodeValue(v, part.operator)).join(',') - : this.encodeValue(value.toString(), part.operator); - return `${name}=${encoded}`; - }) - .filter(pair => pair.length > 0); - if (pairs.length === 0) - return ''; - const separator = part.operator === '?' ? '?' : '&'; - return separator + pairs.join('&'); - } - if (part.names.length > 1) { - const values = part.names.map(name => variables[name]).filter(v => v !== undefined); - if (values.length === 0) - return ''; - return values.map(v => (Array.isArray(v) ? v[0] : v)).join(','); - } - const value = variables[part.name]; - if (value === undefined) - return ''; - const values = Array.isArray(value) ? value : [value]; - const encoded = values.map(v => this.encodeValue(v, part.operator)); - switch (part.operator) { - case '': - return encoded.join(','); - case '+': - return encoded.join(','); - case '#': - return '#' + encoded.join(','); - case '.': - return '.' + encoded.join('.'); - case '/': - return '/' + encoded.join('/'); - default: - return encoded.join(','); - } - } - expand(variables) { - let result = ''; - let hasQueryParam = false; - for (const part of this.parts) { - if (typeof part === 'string') { - result += part; - continue; - } - const expanded = this.expandPart(part, variables); - if (!expanded) - continue; - // Convert ? to & if we already have a query parameter - if ((part.operator === '?' || part.operator === '&') && hasQueryParam) { - result += expanded.replace('?', '&'); - } - else { - result += expanded; - } - if (part.operator === '?' || part.operator === '&') { - hasQueryParam = true; - } - } - return result; - } - escapeRegExp(str) { - return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - } - partToRegExp(part) { - const patterns = []; - // Validate variable name length for matching - for (const name of part.names) { - UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name'); - } - if (part.operator === '?' || part.operator === '&') { - for (let i = 0; i < part.names.length; i++) { - const name = part.names[i]; - const prefix = i === 0 ? '\\' + part.operator : '&'; - patterns.push({ - pattern: prefix + this.escapeRegExp(name) + '=([^&]+)', - name - }); - } - return patterns; - } - let pattern; - const name = part.name; - switch (part.operator) { - case '': - pattern = part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)'; - break; - case '+': - case '#': - pattern = '(.+)'; - break; - case '.': - pattern = '\\.([^/,]+)'; - break; - case '/': - pattern = '/' + (part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)'); - break; - default: - pattern = '([^/]+)'; - } - patterns.push({ pattern, name }); - return patterns; - } - match(uri) { - UriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, 'URI'); - let pattern = '^'; - const names = []; - for (const part of this.parts) { - if (typeof part === 'string') { - pattern += this.escapeRegExp(part); - } - else { - const patterns = this.partToRegExp(part); - for (const { pattern: partPattern, name } of patterns) { - pattern += partPattern; - names.push({ name, exploded: part.exploded }); - } - } - } - pattern += '$'; - UriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, 'Generated regex pattern'); - const regex = new RegExp(pattern); - const match = uri.match(regex); - if (!match) - return null; - const result = {}; - for (let i = 0; i < names.length; i++) { - const { name, exploded } = names[i]; - const value = match[i + 1]; - const cleanName = name.replace('*', ''); - if (exploded && value.includes(',')) { - result[cleanName] = value.split(','); - } - else { - result[cleanName] = value; - } - } - return result; - } -} -exports.UriTemplate = UriTemplate; -//# sourceMappingURL=uriTemplate.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js.map deleted file mode 100644 index 6181393..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uriTemplate.js","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":";AA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,CAAC,CAAC;YACpC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAExC,IAAI,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAClC,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACzC,CAAC;iBAAM,CAAC;gBACJ,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;YAC9B,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AArRD,kCAqRC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.d.ts deleted file mode 100644 index f94e3cf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.d.ts +++ /dev/null @@ -1,2299 +0,0 @@ -/** - * This file is automatically generated from the Model Context Protocol specification. - * - * Source: https://github.com/modelcontextprotocol/modelcontextprotocol - * Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts - * Last updated from commit: 35fa160caf287a9c48696e3ae452c0645c713669 - * - * DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates. - * To update this file, run: npm run fetch:spec-types - */ -/** - * Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent. - * - * @category JSON-RPC - */ -export type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResponse; -/** @internal */ -export declare const LATEST_PROTOCOL_VERSION = "DRAFT-2026-v1"; -/** @internal */ -export declare const JSONRPC_VERSION = "2.0"; -/** - * A progress token, used to associate progress notifications with the original request. - * - * @category Common Types - */ -export type ProgressToken = string | number; -/** - * An opaque token used to represent a cursor for pagination. - * - * @category Common Types - */ -export type Cursor = string; -/** - * Common params for any task-augmented request. - * - * @internal - */ -export interface TaskAugmentedRequestParams extends RequestParams { - /** - * If specified, the caller is requesting task-augmented execution for this request. - * The request will return a CreateTaskResult immediately, and the actual result can be - * retrieved later via tasks/result. - * - * Task augmentation is subject to capability negotiation - receivers MUST declare support - * for task augmentation of specific request types in their capabilities. - */ - task?: TaskMetadata; -} -/** - * Common params for any request. - * - * @internal - */ -export interface RequestParams { - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - /** - * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. - */ - progressToken?: ProgressToken; - [key: string]: unknown; - }; -} -/** @internal */ -export interface Request { - method: string; - params?: { - [key: string]: any; - }; -} -/** @internal */ -export interface NotificationParams { - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** @internal */ -export interface Notification { - method: string; - params?: { - [key: string]: any; - }; -} -/** - * @category Common Types - */ -export interface Result { - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; - [key: string]: unknown; -} -/** - * @category Common Types - */ -export interface Error { - /** - * The error type that occurred. - */ - code: number; - /** - * A short description of the error. The message SHOULD be limited to a concise single sentence. - */ - message: string; - /** - * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). - */ - data?: unknown; -} -/** - * A uniquely identifying ID for a request in JSON-RPC. - * - * @category Common Types - */ -export type RequestId = string | number; -/** - * A request that expects a response. - * - * @category JSON-RPC - */ -export interface JSONRPCRequest extends Request { - jsonrpc: typeof JSONRPC_VERSION; - id: RequestId; -} -/** - * A notification which does not expect a response. - * - * @category JSON-RPC - */ -export interface JSONRPCNotification extends Notification { - jsonrpc: typeof JSONRPC_VERSION; -} -/** - * A successful (non-error) response to a request. - * - * @category JSON-RPC - */ -export interface JSONRPCResultResponse { - jsonrpc: typeof JSONRPC_VERSION; - id: RequestId; - result: Result; -} -/** - * A response to a request that indicates an error occurred. - * - * @category JSON-RPC - */ -export interface JSONRPCErrorResponse { - jsonrpc: typeof JSONRPC_VERSION; - id?: RequestId; - error: Error; -} -/** - * A response to a request, containing either the result or error. - */ -export type JSONRPCResponse = JSONRPCResultResponse | JSONRPCErrorResponse; -export declare const PARSE_ERROR = -32700; -export declare const INVALID_REQUEST = -32600; -export declare const METHOD_NOT_FOUND = -32601; -export declare const INVALID_PARAMS = -32602; -export declare const INTERNAL_ERROR = -32603; -/** @internal */ -export declare const URL_ELICITATION_REQUIRED = -32042; -/** - * An error response that indicates that the server requires the client to provide additional information via an elicitation request. - * - * @internal - */ -export interface URLElicitationRequiredError extends Omit { - error: Error & { - code: typeof URL_ELICITATION_REQUIRED; - data: { - elicitations: ElicitRequestURLParams[]; - [key: string]: unknown; - }; - }; -} -/** - * A response that indicates success but carries no data. - * - * @category Common Types - */ -export type EmptyResult = Result; -/** - * Parameters for a `notifications/cancelled` notification. - * - * @category `notifications/cancelled` - */ -export interface CancelledNotificationParams extends NotificationParams { - /** - * The ID of the request to cancel. - * - * This MUST correspond to the ID of a request previously issued in the same direction. - * This MUST be provided for cancelling non-task requests. - * This MUST NOT be used for cancelling tasks (use the `tasks/cancel` request instead). - */ - requestId?: RequestId; - /** - * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. - */ - reason?: string; -} -/** - * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. - * - * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. - * - * This notification indicates that the result will be unused, so any associated processing SHOULD cease. - * - * A client MUST NOT attempt to cancel its `initialize` request. - * - * For task cancellation, use the `tasks/cancel` request instead of this notification. - * - * @category `notifications/cancelled` - */ -export interface CancelledNotification extends JSONRPCNotification { - method: "notifications/cancelled"; - params: CancelledNotificationParams; -} -/** - * Parameters for an `initialize` request. - * - * @category `initialize` - */ -export interface InitializeRequestParams extends RequestParams { - /** - * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. - */ - protocolVersion: string; - capabilities: ClientCapabilities; - clientInfo: Implementation; -} -/** - * This request is sent from the client to the server when it first connects, asking it to begin initialization. - * - * @category `initialize` - */ -export interface InitializeRequest extends JSONRPCRequest { - method: "initialize"; - params: InitializeRequestParams; -} -/** - * After receiving an initialize request from the client, the server sends this response. - * - * @category `initialize` - */ -export interface InitializeResult extends Result { - /** - * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. - */ - protocolVersion: string; - capabilities: ServerCapabilities; - serverInfo: Implementation; - /** - * Instructions describing how to use the server and its features. - * - * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. - */ - instructions?: string; -} -/** - * This notification is sent from the client to the server after initialization has finished. - * - * @category `notifications/initialized` - */ -export interface InitializedNotification extends JSONRPCNotification { - method: "notifications/initialized"; - params?: NotificationParams; -} -/** - * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. - * - * @category `initialize` - */ -export interface ClientCapabilities { - /** - * Experimental, non-standard capabilities that the client supports. - */ - experimental?: { - [key: string]: object; - }; - /** - * Present if the client supports listing roots. - */ - roots?: { - /** - * Whether the client supports notifications for changes to the roots list. - */ - listChanged?: boolean; - }; - /** - * Present if the client supports sampling from an LLM. - */ - sampling?: { - /** - * Whether the client supports context inclusion via includeContext parameter. - * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it). - */ - context?: object; - /** - * Whether the client supports tool use via tools and toolChoice parameters. - */ - tools?: object; - }; - /** - * Present if the client supports elicitation from the server. - */ - elicitation?: { - form?: object; - url?: object; - }; - /** - * Present if the client supports task-augmented requests. - */ - tasks?: { - /** - * Whether this client supports tasks/list. - */ - list?: object; - /** - * Whether this client supports tasks/cancel. - */ - cancel?: object; - /** - * Specifies which request types can be augmented with tasks. - */ - requests?: { - /** - * Task support for sampling-related requests. - */ - sampling?: { - /** - * Whether the client supports task-augmented sampling/createMessage requests. - */ - createMessage?: object; - }; - /** - * Task support for elicitation-related requests. - */ - elicitation?: { - /** - * Whether the client supports task-augmented elicitation/create requests. - */ - create?: object; - }; - }; - }; -} -/** - * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. - * - * @category `initialize` - */ -export interface ServerCapabilities { - /** - * Experimental, non-standard capabilities that the server supports. - */ - experimental?: { - [key: string]: object; - }; - /** - * Present if the server supports sending log messages to the client. - */ - logging?: object; - /** - * Present if the server supports argument autocompletion suggestions. - */ - completions?: object; - /** - * Present if the server offers any prompt templates. - */ - prompts?: { - /** - * Whether this server supports notifications for changes to the prompt list. - */ - listChanged?: boolean; - }; - /** - * Present if the server offers any resources to read. - */ - resources?: { - /** - * Whether this server supports subscribing to resource updates. - */ - subscribe?: boolean; - /** - * Whether this server supports notifications for changes to the resource list. - */ - listChanged?: boolean; - }; - /** - * Present if the server offers any tools to call. - */ - tools?: { - /** - * Whether this server supports notifications for changes to the tool list. - */ - listChanged?: boolean; - }; - /** - * Present if the server supports task-augmented requests. - */ - tasks?: { - /** - * Whether this server supports tasks/list. - */ - list?: object; - /** - * Whether this server supports tasks/cancel. - */ - cancel?: object; - /** - * Specifies which request types can be augmented with tasks. - */ - requests?: { - /** - * Task support for tool-related requests. - */ - tools?: { - /** - * Whether the server supports task-augmented tools/call requests. - */ - call?: object; - }; - }; - }; -} -/** - * An optionally-sized icon that can be displayed in a user interface. - * - * @category Common Types - */ -export interface Icon { - /** - * A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a - * `data:` URI with Base64-encoded image data. - * - * Consumers SHOULD takes steps to ensure URLs serving icons are from the - * same domain as the client/server or a trusted domain. - * - * Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain - * executable JavaScript. - * - * @format uri - */ - src: string; - /** - * Optional MIME type override if the source MIME type is missing or generic. - * For example: `"image/png"`, `"image/jpeg"`, or `"image/svg+xml"`. - */ - mimeType?: string; - /** - * Optional array of strings that specify sizes at which the icon can be used. - * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG. - * - * If not provided, the client should assume that the icon can be used at any size. - */ - sizes?: string[]; - /** - * Optional specifier for the theme this icon is designed for. `light` indicates - * the icon is designed to be used with a light background, and `dark` indicates - * the icon is designed to be used with a dark background. - * - * If not provided, the client should assume the icon can be used with any theme. - */ - theme?: "light" | "dark"; -} -/** - * Base interface to add `icons` property. - * - * @internal - */ -export interface Icons { - /** - * Optional set of sized icons that the client can display in a user interface. - * - * Clients that support rendering icons MUST support at least the following MIME types: - * - `image/png` - PNG images (safe, universal compatibility) - * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility) - * - * Clients that support rendering icons SHOULD also support: - * - `image/svg+xml` - SVG images (scalable but requires security precautions) - * - `image/webp` - WebP images (modern, efficient format) - */ - icons?: Icon[]; -} -/** - * Base interface for metadata with name (identifier) and title (display name) properties. - * - * @internal - */ -export interface BaseMetadata { - /** - * Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present). - */ - name: string; - /** - * Intended for UI and end-user contexts — optimized to be human-readable and easily understood, - * even by those unfamiliar with domain-specific terminology. - * - * If not provided, the name should be used for display (except for Tool, - * where `annotations.title` should be given precedence over using `name`, - * if present). - */ - title?: string; -} -/** - * Describes the MCP implementation. - * - * @category `initialize` - */ -export interface Implementation extends BaseMetadata, Icons { - version: string; - /** - * An optional human-readable description of what this implementation does. - * - * This can be used by clients or servers to provide context about their purpose - * and capabilities. For example, a server might describe the types of resources - * or tools it provides, while a client might describe its intended use case. - */ - description?: string; - /** - * An optional URL of the website for this implementation. - * - * @format uri - */ - websiteUrl?: string; -} -/** - * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. - * - * @category `ping` - */ -export interface PingRequest extends JSONRPCRequest { - method: "ping"; - params?: RequestParams; -} -/** - * Parameters for a `notifications/progress` notification. - * - * @category `notifications/progress` - */ -export interface ProgressNotificationParams extends NotificationParams { - /** - * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. - */ - progressToken: ProgressToken; - /** - * The progress thus far. This should increase every time progress is made, even if the total is unknown. - * - * @TJS-type number - */ - progress: number; - /** - * Total number of items to process (or total progress required), if known. - * - * @TJS-type number - */ - total?: number; - /** - * An optional message describing the current progress. - */ - message?: string; -} -/** - * An out-of-band notification used to inform the receiver of a progress update for a long-running request. - * - * @category `notifications/progress` - */ -export interface ProgressNotification extends JSONRPCNotification { - method: "notifications/progress"; - params: ProgressNotificationParams; -} -/** - * Common parameters for paginated requests. - * - * @internal - */ -export interface PaginatedRequestParams extends RequestParams { - /** - * An opaque token representing the current pagination position. - * If provided, the server should return results starting after this cursor. - */ - cursor?: Cursor; -} -/** @internal */ -export interface PaginatedRequest extends JSONRPCRequest { - params?: PaginatedRequestParams; -} -/** @internal */ -export interface PaginatedResult extends Result { - /** - * An opaque token representing the pagination position after the last returned result. - * If present, there may be more results available. - */ - nextCursor?: Cursor; -} -/** - * Sent from the client to request a list of resources the server has. - * - * @category `resources/list` - */ -export interface ListResourcesRequest extends PaginatedRequest { - method: "resources/list"; -} -/** - * The server's response to a resources/list request from the client. - * - * @category `resources/list` - */ -export interface ListResourcesResult extends PaginatedResult { - resources: Resource[]; -} -/** - * Sent from the client to request a list of resource templates the server has. - * - * @category `resources/templates/list` - */ -export interface ListResourceTemplatesRequest extends PaginatedRequest { - method: "resources/templates/list"; -} -/** - * The server's response to a resources/templates/list request from the client. - * - * @category `resources/templates/list` - */ -export interface ListResourceTemplatesResult extends PaginatedResult { - resourceTemplates: ResourceTemplate[]; -} -/** - * Common parameters when working with resources. - * - * @internal - */ -export interface ResourceRequestParams extends RequestParams { - /** - * The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it. - * - * @format uri - */ - uri: string; -} -/** - * Parameters for a `resources/read` request. - * - * @category `resources/read` - */ -export interface ReadResourceRequestParams extends ResourceRequestParams { -} -/** - * Sent from the client to the server, to read a specific resource URI. - * - * @category `resources/read` - */ -export interface ReadResourceRequest extends JSONRPCRequest { - method: "resources/read"; - params: ReadResourceRequestParams; -} -/** - * The server's response to a resources/read request from the client. - * - * @category `resources/read` - */ -export interface ReadResourceResult extends Result { - contents: (TextResourceContents | BlobResourceContents)[]; -} -/** - * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. - * - * @category `notifications/resources/list_changed` - */ -export interface ResourceListChangedNotification extends JSONRPCNotification { - method: "notifications/resources/list_changed"; - params?: NotificationParams; -} -/** - * Parameters for a `resources/subscribe` request. - * - * @category `resources/subscribe` - */ -export interface SubscribeRequestParams extends ResourceRequestParams { -} -/** - * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. - * - * @category `resources/subscribe` - */ -export interface SubscribeRequest extends JSONRPCRequest { - method: "resources/subscribe"; - params: SubscribeRequestParams; -} -/** - * Parameters for a `resources/unsubscribe` request. - * - * @category `resources/unsubscribe` - */ -export interface UnsubscribeRequestParams extends ResourceRequestParams { -} -/** - * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. - * - * @category `resources/unsubscribe` - */ -export interface UnsubscribeRequest extends JSONRPCRequest { - method: "resources/unsubscribe"; - params: UnsubscribeRequestParams; -} -/** - * Parameters for a `notifications/resources/updated` notification. - * - * @category `notifications/resources/updated` - */ -export interface ResourceUpdatedNotificationParams extends NotificationParams { - /** - * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. - * - * @format uri - */ - uri: string; -} -/** - * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. - * - * @category `notifications/resources/updated` - */ -export interface ResourceUpdatedNotification extends JSONRPCNotification { - method: "notifications/resources/updated"; - params: ResourceUpdatedNotificationParams; -} -/** - * A known resource that the server is capable of reading. - * - * @category `resources/list` - */ -export interface Resource extends BaseMetadata, Icons { - /** - * The URI of this resource. - * - * @format uri - */ - uri: string; - /** - * A description of what this resource represents. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description?: string; - /** - * The MIME type of this resource, if known. - */ - mimeType?: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known. - * - * This can be used by Hosts to display file sizes and estimate context window usage. - */ - size?: number; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * A template description for resources available on the server. - * - * @category `resources/templates/list` - */ -export interface ResourceTemplate extends BaseMetadata, Icons { - /** - * A URI template (according to RFC 6570) that can be used to construct resource URIs. - * - * @format uri-template - */ - uriTemplate: string; - /** - * A description of what this template is for. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description?: string; - /** - * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. - */ - mimeType?: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * The contents of a specific resource or sub-resource. - * - * @internal - */ -export interface ResourceContents { - /** - * The URI of this resource. - * - * @format uri - */ - uri: string; - /** - * The MIME type of this resource, if known. - */ - mimeType?: string; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * @category Content - */ -export interface TextResourceContents extends ResourceContents { - /** - * The text of the item. This must only be set if the item can actually be represented as text (not binary data). - */ - text: string; -} -/** - * @category Content - */ -export interface BlobResourceContents extends ResourceContents { - /** - * A base64-encoded string representing the binary data of the item. - * - * @format byte - */ - blob: string; -} -/** - * Sent from the client to request a list of prompts and prompt templates the server has. - * - * @category `prompts/list` - */ -export interface ListPromptsRequest extends PaginatedRequest { - method: "prompts/list"; -} -/** - * The server's response to a prompts/list request from the client. - * - * @category `prompts/list` - */ -export interface ListPromptsResult extends PaginatedResult { - prompts: Prompt[]; -} -/** - * Parameters for a `prompts/get` request. - * - * @category `prompts/get` - */ -export interface GetPromptRequestParams extends RequestParams { - /** - * The name of the prompt or prompt template. - */ - name: string; - /** - * Arguments to use for templating the prompt. - */ - arguments?: { - [key: string]: string; - }; -} -/** - * Used by the client to get a prompt provided by the server. - * - * @category `prompts/get` - */ -export interface GetPromptRequest extends JSONRPCRequest { - method: "prompts/get"; - params: GetPromptRequestParams; -} -/** - * The server's response to a prompts/get request from the client. - * - * @category `prompts/get` - */ -export interface GetPromptResult extends Result { - /** - * An optional description for the prompt. - */ - description?: string; - messages: PromptMessage[]; -} -/** - * A prompt or prompt template that the server offers. - * - * @category `prompts/list` - */ -export interface Prompt extends BaseMetadata, Icons { - /** - * An optional description of what this prompt provides - */ - description?: string; - /** - * A list of arguments to use for templating the prompt. - */ - arguments?: PromptArgument[]; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * Describes an argument that a prompt can accept. - * - * @category `prompts/list` - */ -export interface PromptArgument extends BaseMetadata { - /** - * A human-readable description of the argument. - */ - description?: string; - /** - * Whether this argument must be provided. - */ - required?: boolean; -} -/** - * The sender or recipient of messages and data in a conversation. - * - * @category Common Types - */ -export type Role = "user" | "assistant"; -/** - * Describes a message returned as part of a prompt. - * - * This is similar to `SamplingMessage`, but also supports the embedding of - * resources from the MCP server. - * - * @category `prompts/get` - */ -export interface PromptMessage { - role: Role; - content: ContentBlock; -} -/** - * A resource that the server is capable of reading, included in a prompt or tool call result. - * - * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. - * - * @category Content - */ -export interface ResourceLink extends Resource { - type: "resource_link"; -} -/** - * The contents of a resource, embedded into a prompt or tool call result. - * - * It is up to the client how best to render embedded resources for the benefit - * of the LLM and/or the user. - * - * @category Content - */ -export interface EmbeddedResource { - type: "resource"; - resource: TextResourceContents | BlobResourceContents; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. - * - * @category `notifications/prompts/list_changed` - */ -export interface PromptListChangedNotification extends JSONRPCNotification { - method: "notifications/prompts/list_changed"; - params?: NotificationParams; -} -/** - * Sent from the client to request a list of tools the server has. - * - * @category `tools/list` - */ -export interface ListToolsRequest extends PaginatedRequest { - method: "tools/list"; -} -/** - * The server's response to a tools/list request from the client. - * - * @category `tools/list` - */ -export interface ListToolsResult extends PaginatedResult { - tools: Tool[]; -} -/** - * The server's response to a tool call. - * - * @category `tools/call` - */ -export interface CallToolResult extends Result { - /** - * A list of content objects that represent the unstructured result of the tool call. - */ - content: ContentBlock[]; - /** - * An optional JSON object that represents the structured result of the tool call. - */ - structuredContent?: { - [key: string]: unknown; - }; - /** - * Whether the tool call ended in an error. - * - * If not set, this is assumed to be false (the call was successful). - * - * Any errors that originate from the tool SHOULD be reported inside the result - * object, with `isError` set to true, _not_ as an MCP protocol-level error - * response. Otherwise, the LLM would not be able to see that an error occurred - * and self-correct. - * - * However, any errors in _finding_ the tool, an error indicating that the - * server does not support tool calls, or any other exceptional conditions, - * should be reported as an MCP error response. - */ - isError?: boolean; -} -/** - * Parameters for a `tools/call` request. - * - * @category `tools/call` - */ -export interface CallToolRequestParams extends TaskAugmentedRequestParams { - /** - * The name of the tool. - */ - name: string; - /** - * Arguments to use for the tool call. - */ - arguments?: { - [key: string]: unknown; - }; -} -/** - * Used by the client to invoke a tool provided by the server. - * - * @category `tools/call` - */ -export interface CallToolRequest extends JSONRPCRequest { - method: "tools/call"; - params: CallToolRequestParams; -} -/** - * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. - * - * @category `notifications/tools/list_changed` - */ -export interface ToolListChangedNotification extends JSONRPCNotification { - method: "notifications/tools/list_changed"; - params?: NotificationParams; -} -/** - * Additional properties describing a Tool to clients. - * - * NOTE: all properties in ToolAnnotations are **hints**. - * They are not guaranteed to provide a faithful description of - * tool behavior (including descriptive properties like `title`). - * - * Clients should never make tool use decisions based on ToolAnnotations - * received from untrusted servers. - * - * @category `tools/list` - */ -export interface ToolAnnotations { - /** - * A human-readable title for the tool. - */ - title?: string; - /** - * If true, the tool does not modify its environment. - * - * Default: false - */ - readOnlyHint?: boolean; - /** - * If true, the tool may perform destructive updates to its environment. - * If false, the tool performs only additive updates. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: true - */ - destructiveHint?: boolean; - /** - * If true, calling the tool repeatedly with the same arguments - * will have no additional effect on its environment. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: false - */ - idempotentHint?: boolean; - /** - * If true, this tool may interact with an "open world" of external - * entities. If false, the tool's domain of interaction is closed. - * For example, the world of a web search tool is open, whereas that - * of a memory tool is not. - * - * Default: true - */ - openWorldHint?: boolean; -} -/** - * Execution-related properties for a tool. - * - * @category `tools/list` - */ -export interface ToolExecution { - /** - * Indicates whether this tool supports task-augmented execution. - * This allows clients to handle long-running operations through polling - * the task system. - * - * - "forbidden": Tool does not support task-augmented execution (default when absent) - * - "optional": Tool may support task-augmented execution - * - "required": Tool requires task-augmented execution - * - * Default: "forbidden" - */ - taskSupport?: "forbidden" | "optional" | "required"; -} -/** - * Definition for a tool the client can call. - * - * @category `tools/list` - */ -export interface Tool extends BaseMetadata, Icons { - /** - * A human-readable description of the tool. - * - * This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model. - */ - description?: string; - /** - * A JSON Schema object defining the expected parameters for the tool. - */ - inputSchema: { - $schema?: string; - type: "object"; - properties?: { - [key: string]: object; - }; - required?: string[]; - }; - /** - * Execution-related properties for this tool. - */ - execution?: ToolExecution; - /** - * An optional JSON Schema object defining the structure of the tool's output returned in - * the structuredContent field of a CallToolResult. - * - * Defaults to JSON Schema 2020-12 when no explicit $schema is provided. - * Currently restricted to type: "object" at the root level. - */ - outputSchema?: { - $schema?: string; - type: "object"; - properties?: { - [key: string]: object; - }; - required?: string[]; - }; - /** - * Optional additional tool information. - * - * Display name precedence order is: title, annotations.title, then name. - */ - annotations?: ToolAnnotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * The status of a task. - * - * @category `tasks` - */ -export type TaskStatus = "working" | "input_required" | "completed" | "failed" | "cancelled"; -/** - * Metadata for augmenting a request with task execution. - * Include this in the `task` field of the request parameters. - * - * @category `tasks` - */ -export interface TaskMetadata { - /** - * Requested duration in milliseconds to retain task from creation. - */ - ttl?: number; -} -/** - * Metadata for associating messages with a task. - * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`. - * - * @category `tasks` - */ -export interface RelatedTaskMetadata { - /** - * The task identifier this message is associated with. - */ - taskId: string; -} -/** - * Data associated with a task. - * - * @category `tasks` - */ -export interface Task { - /** - * The task identifier. - */ - taskId: string; - /** - * Current task state. - */ - status: TaskStatus; - /** - * Optional human-readable message describing the current task state. - * This can provide context for any status, including: - * - Reasons for "cancelled" status - * - Summaries for "completed" status - * - Diagnostic information for "failed" status (e.g., error details, what went wrong) - */ - statusMessage?: string; - /** - * ISO 8601 timestamp when the task was created. - */ - createdAt: string; - /** - * ISO 8601 timestamp when the task was last updated. - */ - lastUpdatedAt: string; - /** - * Actual retention duration from creation in milliseconds, null for unlimited. - */ - ttl: number | null; - /** - * Suggested polling interval in milliseconds. - */ - pollInterval?: number; -} -/** - * A response to a task-augmented request. - * - * @category `tasks` - */ -export interface CreateTaskResult extends Result { - task: Task; -} -/** - * A request to retrieve the state of a task. - * - * @category `tasks/get` - */ -export interface GetTaskRequest extends JSONRPCRequest { - method: "tasks/get"; - params: { - /** - * The task identifier to query. - */ - taskId: string; - }; -} -/** - * The response to a tasks/get request. - * - * @category `tasks/get` - */ -export type GetTaskResult = Result & Task; -/** - * A request to retrieve the result of a completed task. - * - * @category `tasks/result` - */ -export interface GetTaskPayloadRequest extends JSONRPCRequest { - method: "tasks/result"; - params: { - /** - * The task identifier to retrieve results for. - */ - taskId: string; - }; -} -/** - * The response to a tasks/result request. - * The structure matches the result type of the original request. - * For example, a tools/call task would return the CallToolResult structure. - * - * @category `tasks/result` - */ -export interface GetTaskPayloadResult extends Result { - [key: string]: unknown; -} -/** - * A request to cancel a task. - * - * @category `tasks/cancel` - */ -export interface CancelTaskRequest extends JSONRPCRequest { - method: "tasks/cancel"; - params: { - /** - * The task identifier to cancel. - */ - taskId: string; - }; -} -/** - * The response to a tasks/cancel request. - * - * @category `tasks/cancel` - */ -export type CancelTaskResult = Result & Task; -/** - * A request to retrieve a list of tasks. - * - * @category `tasks/list` - */ -export interface ListTasksRequest extends PaginatedRequest { - method: "tasks/list"; -} -/** - * The response to a tasks/list request. - * - * @category `tasks/list` - */ -export interface ListTasksResult extends PaginatedResult { - tasks: Task[]; -} -/** - * Parameters for a `notifications/tasks/status` notification. - * - * @category `notifications/tasks/status` - */ -export type TaskStatusNotificationParams = NotificationParams & Task; -/** - * An optional notification from the receiver to the requestor, informing them that a task's status has changed. Receivers are not required to send these notifications. - * - * @category `notifications/tasks/status` - */ -export interface TaskStatusNotification extends JSONRPCNotification { - method: "notifications/tasks/status"; - params: TaskStatusNotificationParams; -} -/** - * Parameters for a `logging/setLevel` request. - * - * @category `logging/setLevel` - */ -export interface SetLevelRequestParams extends RequestParams { - /** - * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message. - */ - level: LoggingLevel; -} -/** - * A request from the client to the server, to enable or adjust logging. - * - * @category `logging/setLevel` - */ -export interface SetLevelRequest extends JSONRPCRequest { - method: "logging/setLevel"; - params: SetLevelRequestParams; -} -/** - * Parameters for a `notifications/message` notification. - * - * @category `notifications/message` - */ -export interface LoggingMessageNotificationParams extends NotificationParams { - /** - * The severity of this log message. - */ - level: LoggingLevel; - /** - * An optional name of the logger issuing this message. - */ - logger?: string; - /** - * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. - */ - data: unknown; -} -/** - * JSONRPCNotification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. - * - * @category `notifications/message` - */ -export interface LoggingMessageNotification extends JSONRPCNotification { - method: "notifications/message"; - params: LoggingMessageNotificationParams; -} -/** - * The severity of a log message. - * - * These map to syslog message severities, as specified in RFC-5424: - * https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1 - * - * @category Common Types - */ -export type LoggingLevel = "debug" | "info" | "notice" | "warning" | "error" | "critical" | "alert" | "emergency"; -/** - * Parameters for a `sampling/createMessage` request. - * - * @category `sampling/createMessage` - */ -export interface CreateMessageRequestParams extends TaskAugmentedRequestParams { - messages: SamplingMessage[]; - /** - * The server's preferences for which model to select. The client MAY ignore these preferences. - */ - modelPreferences?: ModelPreferences; - /** - * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. - */ - systemPrompt?: string; - /** - * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. - * The client MAY ignore this request. - * - * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client - * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases. - */ - includeContext?: "none" | "thisServer" | "allServers"; - /** - * @TJS-type number - */ - temperature?: number; - /** - * The requested maximum number of tokens to sample (to prevent runaway completions). - * - * The client MAY choose to sample fewer tokens than the requested maximum. - */ - maxTokens: number; - stopSequences?: string[]; - /** - * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. - */ - metadata?: object; - /** - * Tools that the model may use during generation. - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. - */ - tools?: Tool[]; - /** - * Controls how the model uses tools. - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. - * Default is `{ mode: "auto" }`. - */ - toolChoice?: ToolChoice; -} -/** - * Controls tool selection behavior for sampling requests. - * - * @category `sampling/createMessage` - */ -export interface ToolChoice { - /** - * Controls the tool use ability of the model: - * - "auto": Model decides whether to use tools (default) - * - "required": Model MUST use at least one tool before completing - * - "none": Model MUST NOT use any tools - */ - mode?: "auto" | "required" | "none"; -} -/** - * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. - * - * @category `sampling/createMessage` - */ -export interface CreateMessageRequest extends JSONRPCRequest { - method: "sampling/createMessage"; - params: CreateMessageRequestParams; -} -/** - * The client's response to a sampling/createMessage request from the server. - * The client should inform the user before returning the sampled message, to allow them - * to inspect the response (human in the loop) and decide whether to allow the server to see it. - * - * @category `sampling/createMessage` - */ -export interface CreateMessageResult extends Result, SamplingMessage { - /** - * The name of the model that generated the message. - */ - model: string; - /** - * The reason why sampling stopped, if known. - * - * Standard values: - * - "endTurn": Natural end of the assistant's turn - * - "stopSequence": A stop sequence was encountered - * - "maxTokens": Maximum token limit was reached - * - "toolUse": The model wants to use one or more tools - * - * This field is an open string to allow for provider-specific stop reasons. - */ - stopReason?: "endTurn" | "stopSequence" | "maxTokens" | "toolUse" | string; -} -/** - * Describes a message issued to or received from an LLM API. - * - * @category `sampling/createMessage` - */ -export interface SamplingMessage { - role: Role; - content: SamplingMessageContentBlock | SamplingMessageContentBlock[]; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -export type SamplingMessageContentBlock = TextContent | ImageContent | AudioContent | ToolUseContent | ToolResultContent; -/** - * Optional annotations for the client. The client can use annotations to inform how objects are used or displayed - * - * @category Common Types - */ -export interface Annotations { - /** - * Describes who the intended audience of this object or data is. - * - * It can include multiple entries to indicate content useful for multiple audiences (e.g., `["user", "assistant"]`). - */ - audience?: Role[]; - /** - * Describes how important this data is for operating the server. - * - * A value of 1 means "most important," and indicates that the data is - * effectively required, while 0 means "least important," and indicates that - * the data is entirely optional. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - priority?: number; - /** - * The moment the resource was last modified, as an ISO 8601 formatted string. - * - * Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z"). - * - * Examples: last activity timestamp in an open file, timestamp when the resource - * was attached, etc. - */ - lastModified?: string; -} -/** - * @category Content - */ -export type ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource; -/** - * Text provided to or from an LLM. - * - * @category Content - */ -export interface TextContent { - type: "text"; - /** - * The text content of the message. - */ - text: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * An image provided to or from an LLM. - * - * @category Content - */ -export interface ImageContent { - type: "image"; - /** - * The base64-encoded image data. - * - * @format byte - */ - data: string; - /** - * The MIME type of the image. Different providers may support different image types. - */ - mimeType: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * Audio provided to or from an LLM. - * - * @category Content - */ -export interface AudioContent { - type: "audio"; - /** - * The base64-encoded audio data. - * - * @format byte - */ - data: string; - /** - * The MIME type of the audio. Different providers may support different audio types. - */ - mimeType: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * A request from the assistant to call a tool. - * - * @category `sampling/createMessage` - */ -export interface ToolUseContent { - type: "tool_use"; - /** - * A unique identifier for this tool use. - * - * This ID is used to match tool results to their corresponding tool uses. - */ - id: string; - /** - * The name of the tool to call. - */ - name: string; - /** - * The arguments to pass to the tool, conforming to the tool's input schema. - */ - input: { - [key: string]: unknown; - }; - /** - * Optional metadata about the tool use. Clients SHOULD preserve this field when - * including tool uses in subsequent sampling requests to enable caching optimizations. - * - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * The result of a tool use, provided by the user back to the assistant. - * - * @category `sampling/createMessage` - */ -export interface ToolResultContent { - type: "tool_result"; - /** - * The ID of the tool use this result corresponds to. - * - * This MUST match the ID from a previous ToolUseContent. - */ - toolUseId: string; - /** - * The unstructured result content of the tool use. - * - * This has the same format as CallToolResult.content and can include text, images, - * audio, resource links, and embedded resources. - */ - content: ContentBlock[]; - /** - * An optional structured result object. - * - * If the tool defined an outputSchema, this SHOULD conform to that schema. - */ - structuredContent?: { - [key: string]: unknown; - }; - /** - * Whether the tool use resulted in an error. - * - * If true, the content typically describes the error that occurred. - * Default: false - */ - isError?: boolean; - /** - * Optional metadata about the tool result. Clients SHOULD preserve this field when - * including tool results in subsequent sampling requests to enable caching optimizations. - * - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * The server's preferences for model selection, requested of the client during sampling. - * - * Because LLMs can vary along multiple dimensions, choosing the "best" model is - * rarely straightforward. Different models excel in different areas—some are - * faster but less capable, others are more capable but more expensive, and so - * on. This interface allows servers to express their priorities across multiple - * dimensions to help clients make an appropriate selection for their use case. - * - * These preferences are always advisory. The client MAY ignore them. It is also - * up to the client to decide how to interpret these preferences and how to - * balance them against other considerations. - * - * @category `sampling/createMessage` - */ -export interface ModelPreferences { - /** - * Optional hints to use for model selection. - * - * If multiple hints are specified, the client MUST evaluate them in order - * (such that the first match is taken). - * - * The client SHOULD prioritize these hints over the numeric priorities, but - * MAY still use the priorities to select from ambiguous matches. - */ - hints?: ModelHint[]; - /** - * How much to prioritize cost when selecting a model. A value of 0 means cost - * is not important, while a value of 1 means cost is the most important - * factor. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - costPriority?: number; - /** - * How much to prioritize sampling speed (latency) when selecting a model. A - * value of 0 means speed is not important, while a value of 1 means speed is - * the most important factor. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - speedPriority?: number; - /** - * How much to prioritize intelligence and capabilities when selecting a - * model. A value of 0 means intelligence is not important, while a value of 1 - * means intelligence is the most important factor. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - intelligencePriority?: number; -} -/** - * Hints to use for model selection. - * - * Keys not declared here are currently left unspecified by the spec and are up - * to the client to interpret. - * - * @category `sampling/createMessage` - */ -export interface ModelHint { - /** - * A hint for a model name. - * - * The client SHOULD treat this as a substring of a model name; for example: - * - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022` - * - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc. - * - `claude` should match any Claude model - * - * The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example: - * - `gemini-1.5-flash` could match `claude-3-haiku-20240307` - */ - name?: string; -} -/** - * Parameters for a `completion/complete` request. - * - * @category `completion/complete` - */ -export interface CompleteRequestParams extends RequestParams { - ref: PromptReference | ResourceTemplateReference; - /** - * The argument's information - */ - argument: { - /** - * The name of the argument - */ - name: string; - /** - * The value of the argument to use for completion matching. - */ - value: string; - }; - /** - * Additional, optional context for completions - */ - context?: { - /** - * Previously-resolved variables in a URI template or prompt. - */ - arguments?: { - [key: string]: string; - }; - }; -} -/** - * A request from the client to the server, to ask for completion options. - * - * @category `completion/complete` - */ -export interface CompleteRequest extends JSONRPCRequest { - method: "completion/complete"; - params: CompleteRequestParams; -} -/** - * The server's response to a completion/complete request - * - * @category `completion/complete` - */ -export interface CompleteResult extends Result { - completion: { - /** - * An array of completion values. Must not exceed 100 items. - */ - values: string[]; - /** - * The total number of completion options available. This can exceed the number of values actually sent in the response. - */ - total?: number; - /** - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. - */ - hasMore?: boolean; - }; -} -/** - * A reference to a resource or resource template definition. - * - * @category `completion/complete` - */ -export interface ResourceTemplateReference { - type: "ref/resource"; - /** - * The URI or URI template of the resource. - * - * @format uri-template - */ - uri: string; -} -/** - * Identifies a prompt. - * - * @category `completion/complete` - */ -export interface PromptReference extends BaseMetadata { - type: "ref/prompt"; -} -/** - * Sent from the server to request a list of root URIs from the client. Roots allow - * servers to ask for specific directories or files to operate on. A common example - * for roots is providing a set of repositories or directories a server should operate - * on. - * - * This request is typically used when the server needs to understand the file system - * structure or access specific locations that the client has permission to read from. - * - * @category `roots/list` - */ -export interface ListRootsRequest extends JSONRPCRequest { - method: "roots/list"; - params?: RequestParams; -} -/** - * The client's response to a roots/list request from the server. - * This result contains an array of Root objects, each representing a root directory - * or file that the server can operate on. - * - * @category `roots/list` - */ -export interface ListRootsResult extends Result { - roots: Root[]; -} -/** - * Represents a root directory or file that the server can operate on. - * - * @category `roots/list` - */ -export interface Root { - /** - * The URI identifying the root. This *must* start with file:// for now. - * This restriction may be relaxed in future versions of the protocol to allow - * other URI schemes. - * - * @format uri - */ - uri: string; - /** - * An optional name for the root. This can be used to provide a human-readable - * identifier for the root, which may be useful for display purposes or for - * referencing the root in other parts of the application. - */ - name?: string; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * A notification from the client to the server, informing it that the list of roots has changed. - * This notification should be sent whenever the client adds, removes, or modifies any root. - * The server should then request an updated list of roots using the ListRootsRequest. - * - * @category `notifications/roots/list_changed` - */ -export interface RootsListChangedNotification extends JSONRPCNotification { - method: "notifications/roots/list_changed"; - params?: NotificationParams; -} -/** - * The parameters for a request to elicit non-sensitive information from the user via a form in the client. - * - * @category `elicitation/create` - */ -export interface ElicitRequestFormParams extends TaskAugmentedRequestParams { - /** - * The elicitation mode. - */ - mode?: "form"; - /** - * The message to present to the user describing what information is being requested. - */ - message: string; - /** - * A restricted subset of JSON Schema. - * Only top-level properties are allowed, without nesting. - */ - requestedSchema: { - $schema?: string; - type: "object"; - properties: { - [key: string]: PrimitiveSchemaDefinition; - }; - required?: string[]; - }; -} -/** - * The parameters for a request to elicit information from the user via a URL in the client. - * - * @category `elicitation/create` - */ -export interface ElicitRequestURLParams extends TaskAugmentedRequestParams { - /** - * The elicitation mode. - */ - mode: "url"; - /** - * The message to present to the user explaining why the interaction is needed. - */ - message: string; - /** - * The ID of the elicitation, which must be unique within the context of the server. - * The client MUST treat this ID as an opaque value. - */ - elicitationId: string; - /** - * The URL that the user should navigate to. - * - * @format uri - */ - url: string; -} -/** - * The parameters for a request to elicit additional information from the user via the client. - * - * @category `elicitation/create` - */ -export type ElicitRequestParams = ElicitRequestFormParams | ElicitRequestURLParams; -/** - * A request from the server to elicit additional information from the user via the client. - * - * @category `elicitation/create` - */ -export interface ElicitRequest extends JSONRPCRequest { - method: "elicitation/create"; - params: ElicitRequestParams; -} -/** - * Restricted schema definitions that only allow primitive types - * without nested objects or arrays. - * - * @category `elicitation/create` - */ -export type PrimitiveSchemaDefinition = StringSchema | NumberSchema | BooleanSchema | EnumSchema; -/** - * @category `elicitation/create` - */ -export interface StringSchema { - type: "string"; - title?: string; - description?: string; - minLength?: number; - maxLength?: number; - format?: "email" | "uri" | "date" | "date-time"; - default?: string; -} -/** - * @category `elicitation/create` - */ -export interface NumberSchema { - type: "number" | "integer"; - title?: string; - description?: string; - minimum?: number; - maximum?: number; - default?: number; -} -/** - * @category `elicitation/create` - */ -export interface BooleanSchema { - type: "boolean"; - title?: string; - description?: string; - default?: boolean; -} -/** - * Schema for single-selection enumeration without display titles for options. - * - * @category `elicitation/create` - */ -export interface UntitledSingleSelectEnumSchema { - type: "string"; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Array of enum values to choose from. - */ - enum: string[]; - /** - * Optional default value. - */ - default?: string; -} -/** - * Schema for single-selection enumeration with display titles for each option. - * - * @category `elicitation/create` - */ -export interface TitledSingleSelectEnumSchema { - type: "string"; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Array of enum options with values and display labels. - */ - oneOf: Array<{ - /** - * The enum value. - */ - const: string; - /** - * Display label for this option. - */ - title: string; - }>; - /** - * Optional default value. - */ - default?: string; -} -/** - * @category `elicitation/create` - */ -export type SingleSelectEnumSchema = UntitledSingleSelectEnumSchema | TitledSingleSelectEnumSchema; -/** - * Schema for multiple-selection enumeration without display titles for options. - * - * @category `elicitation/create` - */ -export interface UntitledMultiSelectEnumSchema { - type: "array"; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Minimum number of items to select. - */ - minItems?: number; - /** - * Maximum number of items to select. - */ - maxItems?: number; - /** - * Schema for the array items. - */ - items: { - type: "string"; - /** - * Array of enum values to choose from. - */ - enum: string[]; - }; - /** - * Optional default value. - */ - default?: string[]; -} -/** - * Schema for multiple-selection enumeration with display titles for each option. - * - * @category `elicitation/create` - */ -export interface TitledMultiSelectEnumSchema { - type: "array"; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Minimum number of items to select. - */ - minItems?: number; - /** - * Maximum number of items to select. - */ - maxItems?: number; - /** - * Schema for array items with enum options and display labels. - */ - items: { - /** - * Array of enum options with values and display labels. - */ - anyOf: Array<{ - /** - * The constant enum value. - */ - const: string; - /** - * Display title for this option. - */ - title: string; - }>; - }; - /** - * Optional default value. - */ - default?: string[]; -} -/** - * @category `elicitation/create` - */ -export type MultiSelectEnumSchema = UntitledMultiSelectEnumSchema | TitledMultiSelectEnumSchema; -/** - * Use TitledSingleSelectEnumSchema instead. - * This interface will be removed in a future version. - * - * @category `elicitation/create` - */ -export interface LegacyTitledEnumSchema { - type: "string"; - title?: string; - description?: string; - enum: string[]; - /** - * (Legacy) Display names for enum values. - * Non-standard according to JSON schema 2020-12. - */ - enumNames?: string[]; - default?: string; -} -/** - * @category `elicitation/create` - */ -export type EnumSchema = SingleSelectEnumSchema | MultiSelectEnumSchema | LegacyTitledEnumSchema; -/** - * The client's response to an elicitation request. - * - * @category `elicitation/create` - */ -export interface ElicitResult extends Result { - /** - * The user action in response to the elicitation. - * - "accept": User submitted the form/confirmed the action - * - "decline": User explicitly decline the action - * - "cancel": User dismissed without making an explicit choice - */ - action: "accept" | "decline" | "cancel"; - /** - * The submitted form data, only present when action is "accept" and mode was "form". - * Contains values matching the requested schema. - * Omitted for out-of-band mode responses. - */ - content?: { - [key: string]: string | number | boolean | string[]; - }; -} -/** - * An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request. - * - * @category `notifications/elicitation/complete` - */ -export interface ElicitationCompleteNotification extends JSONRPCNotification { - method: "notifications/elicitation/complete"; - params: { - /** - * The ID of the elicitation that completed. - */ - elicitationId: string; - }; -} -/** @internal */ -export type ClientRequest = PingRequest | InitializeRequest | CompleteRequest | SetLevelRequest | GetPromptRequest | ListPromptsRequest | ListResourcesRequest | ListResourceTemplatesRequest | ReadResourceRequest | SubscribeRequest | UnsubscribeRequest | CallToolRequest | ListToolsRequest | GetTaskRequest | GetTaskPayloadRequest | ListTasksRequest | CancelTaskRequest; -/** @internal */ -export type ClientNotification = CancelledNotification | ProgressNotification | InitializedNotification | RootsListChangedNotification | TaskStatusNotification; -/** @internal */ -export type ClientResult = EmptyResult | CreateMessageResult | ListRootsResult | ElicitResult | GetTaskResult | GetTaskPayloadResult | ListTasksResult | CancelTaskResult; -/** @internal */ -export type ServerRequest = PingRequest | CreateMessageRequest | ListRootsRequest | ElicitRequest | GetTaskRequest | GetTaskPayloadRequest | ListTasksRequest | CancelTaskRequest; -/** @internal */ -export type ServerNotification = CancelledNotification | ProgressNotification | LoggingMessageNotification | ResourceUpdatedNotification | ResourceListChangedNotification | ToolListChangedNotification | PromptListChangedNotification | ElicitationCompleteNotification | TaskStatusNotification; -/** @internal */ -export type ServerResult = EmptyResult | InitializeResult | CompleteResult | GetPromptResult | ListPromptsResult | ListResourceTemplatesResult | ListResourcesResult | ReadResourceResult | CallToolResult | ListToolsResult | GetTaskResult | GetTaskPayloadResult | ListTasksResult | CancelTaskResult; -//# sourceMappingURL=spec.types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.d.ts.map deleted file mode 100644 index 7e4fb0e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"spec.types.d.ts","sourceRoot":"","sources":["../../src/spec.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GACtB,cAAc,GACd,mBAAmB,GACnB,eAAe,CAAC;AAEpB,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AACvD,gBAAgB;AAChB,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B;;;;GAIG;AACH,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AACD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE;QACN;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAED,gBAAgB;AAChB,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,G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Ae,GACf,aAAa,GACb,oBAAoB,GACpB,eAAe,GACf,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js deleted file mode 100644 index 6924e51..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -/** - * This file is automatically generated from the Model Context Protocol specification. - * - * Source: https://github.com/modelcontextprotocol/modelcontextprotocol - * Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts - * Last updated from commit: 35fa160caf287a9c48696e3ae452c0645c713669 - * - * DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates. - * To update this file, run: npm run fetch:spec-types - */ /* JSON-RPC types */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.URL_ELICITATION_REQUIRED = exports.INTERNAL_ERROR = exports.INVALID_PARAMS = exports.METHOD_NOT_FOUND = exports.INVALID_REQUEST = exports.PARSE_ERROR = exports.JSONRPC_VERSION = exports.LATEST_PROTOCOL_VERSION = void 0; -/** @internal */ -exports.LATEST_PROTOCOL_VERSION = "DRAFT-2026-v1"; -/** @internal */ -exports.JSONRPC_VERSION = "2.0"; -// Standard JSON-RPC error codes -exports.PARSE_ERROR = -32700; -exports.INVALID_REQUEST = -32600; -exports.METHOD_NOT_FOUND = -32601; -exports.INVALID_PARAMS = -32602; -exports.INTERNAL_ERROR = -32603; -// Implementation-specific JSON-RPC error codes [-32000, -32099] -/** @internal */ -exports.URL_ELICITATION_REQUIRED = -32042; -//# sourceMappingURL=spec.types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js.map deleted file mode 100644 index b04ea1a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"spec.types.js","sourceRoot":"","sources":["../../src/spec.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG,CAAA,oBAAoB;;;AAYvB,gBAAgB;AACH,QAAA,uBAAuB,GAAG,eAAe,CAAC;AACvD,gBAAgB;AACH,QAAA,eAAe,GAAG,KAAK,CAAC;AA4JrC,gCAAgC;AACnB,QAAA,WAAW,GAAG,CAAC,KAAK,CAAC;AACrB,QAAA,eAAe,GAAG,CAAC,KAAK,CAAC;AACzB,QAAA,gBAAgB,GAAG,CAAC,KAAK,CAAC;AAC1B,QAAA,cAAc,GAAG,CAAC,KAAK,CAAC;AACxB,QAAA,cAAc,GAAG,CAAC,KAAK,CAAC;AAErC,gEAAgE;AAChE,gBAAgB;AACH,QAAA,wBAAwB,GAAG,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts deleted file mode 100644 index 55f087e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts +++ /dev/null @@ -1,8133 +0,0 @@ -import * as z from 'zod/v4'; -import { AuthInfo } from './server/auth/types.js'; -export declare const LATEST_PROTOCOL_VERSION = "2025-11-25"; -export declare const DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26"; -export declare const SUPPORTED_PROTOCOL_VERSIONS: string[]; -export declare const RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task"; -export declare const JSONRPC_VERSION = "2.0"; -/** - * Utility types - */ -type ExpandRecursively = T extends object ? (T extends infer O ? { - [K in keyof O]: ExpandRecursively; -} : never) : T; -/** - * A progress token, used to associate progress notifications with the original request. - */ -export declare const ProgressTokenSchema: z.ZodUnion; -/** - * An opaque token used to represent a cursor for pagination. - */ -export declare const CursorSchema: z.ZodString; -/** - * Task creation parameters, used to ask that the server create a task to represent a request. - */ -export declare const TaskCreationParamsSchema: z.ZodObject<{ - /** - * Time in milliseconds to keep task results available after completion. - * If null, the task has unlimited lifetime until manually cleaned up. - */ - ttl: z.ZodOptional>; - /** - * Time in milliseconds to wait between task status requests. - */ - pollInterval: z.ZodOptional; -}, z.core.$loose>; -export declare const TaskMetadataSchema: z.ZodObject<{ - ttl: z.ZodOptional; -}, z.core.$strip>; -/** - * Metadata for associating messages with a task. - * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`. - */ -export declare const RelatedTaskMetadataSchema: z.ZodObject<{ - taskId: z.ZodString; -}, z.core.$strip>; -declare const RequestMetaSchema: z.ZodObject<{ - /** - * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. - */ - progressToken: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; -}, z.core.$loose>; -/** - * Common params for any request. - */ -declare const BaseRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strip>; -/** - * Common params for any task-augmented request. - */ -export declare const TaskAugmentedRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * Checks if a value is a valid TaskAugmentedRequestParams. - * @param value - The value to check. - * - * @returns True if the value is a valid TaskAugmentedRequestParams, false otherwise. - */ -export declare const isTaskAugmentedRequestParams: (value: unknown) => value is TaskAugmentedRequestParams; -export declare const RequestSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$strip>; -declare const NotificationsParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strip>; -export declare const NotificationSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$strip>; -export declare const ResultSchema: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$loose>; -/** - * A uniquely identifying ID for a request in JSON-RPC. - */ -export declare const RequestIdSchema: z.ZodUnion; -/** - * A request that expects a response. - */ -export declare const JSONRPCRequestSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodUnion; -}, z.core.$strict>; -export declare const isJSONRPCRequest: (value: unknown) => value is JSONRPCRequest; -/** - * A notification which does not expect a response. - */ -export declare const JSONRPCNotificationSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - jsonrpc: z.ZodLiteral<"2.0">; -}, z.core.$strict>; -export declare const isJSONRPCNotification: (value: unknown) => value is JSONRPCNotification; -/** - * A successful (non-error) response to a request. - */ -export declare const JSONRPCResultResponseSchema: z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodUnion; - result: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>; -}, z.core.$strict>; -/** - * Checks if a value is a valid JSONRPCResultResponse. - * @param value - The value to check. - * - * @returns True if the value is a valid JSONRPCResultResponse, false otherwise. - */ -export declare const isJSONRPCResultResponse: (value: unknown) => value is JSONRPCResultResponse; -/** - * @deprecated Use {@link isJSONRPCResultResponse} instead. - * - * Please note that {@link JSONRPCResponse} is a union of {@link JSONRPCResultResponse} and {@link JSONRPCErrorResponse} as per the updated JSON-RPC specification. (was previously just {@link JSONRPCResultResponse}) - */ -export declare const isJSONRPCResponse: (value: unknown) => value is JSONRPCResultResponse; -/** - * Error codes defined by the JSON-RPC specification. - */ -export declare enum ErrorCode { - ConnectionClosed = -32000, - RequestTimeout = -32001, - ParseError = -32700, - InvalidRequest = -32600, - MethodNotFound = -32601, - InvalidParams = -32602, - InternalError = -32603, - UrlElicitationRequired = -32042 -} -/** - * A response to a request that indicates an error occurred. - */ -export declare const JSONRPCErrorResponseSchema: z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodOptional>; - error: z.ZodObject<{ - code: z.ZodNumber; - message: z.ZodString; - data: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strict>; -/** - * @deprecated Use {@link JSONRPCErrorResponseSchema} instead. - */ -export declare const JSONRPCErrorSchema: z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodOptional>; - error: z.ZodObject<{ - code: z.ZodNumber; - message: z.ZodString; - data: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strict>; -/** - * Checks if a value is a valid JSONRPCErrorResponse. - * @param value - The value to check. - * - * @returns True if the value is a valid JSONRPCErrorResponse, false otherwise. - */ -export declare const isJSONRPCErrorResponse: (value: unknown) => value is JSONRPCErrorResponse; -/** - * @deprecated Use {@link isJSONRPCErrorResponse} instead. - */ -export declare const isJSONRPCError: (value: unknown) => value is JSONRPCErrorResponse; -export declare const JSONRPCMessageSchema: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodUnion; -}, z.core.$strict>, z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - jsonrpc: z.ZodLiteral<"2.0">; -}, z.core.$strict>, z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodUnion; - result: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>; -}, z.core.$strict>, z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodOptional>; - error: z.ZodObject<{ - code: z.ZodNumber; - message: z.ZodString; - data: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strict>]>; -export declare const JSONRPCResponseSchema: z.ZodUnion; - id: z.ZodUnion; - result: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>; -}, z.core.$strict>, z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodOptional>; - error: z.ZodObject<{ - code: z.ZodNumber; - message: z.ZodString; - data: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strict>]>; -/** - * A response that indicates success but carries no data. - */ -export declare const EmptyResultSchema: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strict>; -export declare const CancelledNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - requestId: z.ZodOptional>; - reason: z.ZodOptional; -}, z.core.$strip>; -/** - * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. - * - * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. - * - * This notification indicates that the result will be unused, so any associated processing SHOULD cease. - * - * A client MUST NOT attempt to cancel its `initialize` request. - */ -export declare const CancelledNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/cancelled">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - requestId: z.ZodOptional>; - reason: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Icon schema for use in tools, prompts, resources, and implementations. - */ -export declare const IconSchema: z.ZodObject<{ - src: z.ZodString; - mimeType: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; -}, z.core.$strip>; -/** - * Base schema to add `icons` property. - * - */ -export declare const IconsSchema: z.ZodObject<{ - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; -}, z.core.$strip>; -/** - * Base metadata interface for common properties across resources, tools, prompts, and implementations. - */ -export declare const BaseMetadataSchema: z.ZodObject<{ - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Describes the name and version of an MCP implementation. - */ -export declare const ImplementationSchema: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Task capabilities for clients, indicating which request types support task creation. - */ -export declare const ClientTasksCapabilitySchema: z.ZodObject<{ - /** - * Present if the client supports listing tasks. - */ - list: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$loose>; -/** - * Task capabilities for servers, indicating which request types support task creation. - */ -export declare const ServerTasksCapabilitySchema: z.ZodObject<{ - /** - * Present if the server supports listing tasks. - */ - list: z.ZodOptional>; - /** - * Present if the server supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$loose>; -/** - * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. - */ -export declare const ClientCapabilitiesSchema: z.ZodObject<{ - experimental: z.ZodOptional>>; - sampling: z.ZodOptional>; - tools: z.ZodOptional>; - }, z.core.$strip>>; - elicitation: z.ZodOptional, z.ZodIntersection; - }, z.core.$strip>, z.ZodRecord>>; - url: z.ZodOptional>; - }, z.core.$strip>, z.ZodOptional>>>>; - roots: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$strip>; -export declare const InitializeRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - sampling: z.ZodOptional>; - tools: z.ZodOptional>; - }, z.core.$strip>>; - elicitation: z.ZodOptional, z.ZodIntersection; - }, z.core.$strip>, z.ZodRecord>>; - url: z.ZodOptional>; - }, z.core.$strip>, z.ZodOptional>>>>; - roots: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - clientInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * This request is sent from the client to the server when it first connects, asking it to begin initialization. - */ -export declare const InitializeRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"initialize">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - sampling: z.ZodOptional>; - tools: z.ZodOptional>; - }, z.core.$strip>>; - elicitation: z.ZodOptional, z.ZodIntersection; - }, z.core.$strip>, z.ZodRecord>>; - url: z.ZodOptional>; - }, z.core.$strip>, z.ZodOptional>>>>; - roots: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - clientInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const isInitializeRequest: (value: unknown) => value is InitializeRequest; -/** - * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. - */ -export declare const ServerCapabilitiesSchema: z.ZodObject<{ - experimental: z.ZodOptional>>; - logging: z.ZodOptional>; - completions: z.ZodOptional>; - prompts: z.ZodOptional; - }, z.core.$strip>>; - resources: z.ZodOptional; - listChanged: z.ZodOptional; - }, z.core.$strip>>; - tools: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the server supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$strip>; -/** - * After receiving an initialize request from the client, the server sends this response. - */ -export declare const InitializeResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - logging: z.ZodOptional>; - completions: z.ZodOptional>; - prompts: z.ZodOptional; - }, z.core.$strip>>; - resources: z.ZodOptional; - listChanged: z.ZodOptional; - }, z.core.$strip>>; - tools: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the server supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - serverInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; - instructions: z.ZodOptional; -}, z.core.$loose>; -/** - * This notification is sent from the client to the server after initialization has finished. - */ -export declare const InitializedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/initialized">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const isInitializedNotification: (value: unknown) => value is InitializedNotification; -/** - * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. - */ -export declare const PingRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"ping">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const ProgressSchema: z.ZodObject<{ - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; -}, z.core.$strip>; -export declare const ProgressNotificationParamsSchema: z.ZodObject<{ - progressToken: z.ZodUnion; - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strip>; -/** - * An out-of-band notification used to inform the receiver of a progress update for a long-running request. - * - * @category notifications/progress - */ -export declare const ProgressNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/progress">; - params: z.ZodObject<{ - progressToken: z.ZodUnion; - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const PaginatedRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; -}, z.core.$strip>; -export declare const PaginatedRequestSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const PaginatedResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; -}, z.core.$loose>; -/** - * The status of a task. - * */ -export declare const TaskStatusSchema: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; -}>; -/** - * A pollable state object associated with a request. - */ -export declare const TaskSchema: z.ZodObject<{ - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>; -/** - * Result returned when a task is created, containing the task data wrapped in a task field. - */ -export declare const CreateTaskResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodObject<{ - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$loose>; -/** - * Parameters for task status notification. - */ -export declare const TaskStatusNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>; -/** - * A notification sent when a task's status changes. - */ -export declare const TaskStatusNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/tasks/status">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * A request to get the state of a specific task. - */ -export declare const GetTaskRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"tasks/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The response to a tasks/get request. - */ -export declare const GetTaskResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>; -/** - * A request to get the result of a specific task. - */ -export declare const GetTaskPayloadRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"tasks/result">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The response to a tasks/result request. - * The structure matches the result type of the original request. - * For example, a tools/call task would return the CallToolResult structure. - * - */ -export declare const GetTaskPayloadResultSchema: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$loose>; -/** - * A request to list tasks. - */ -export declare const ListTasksRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tasks/list">; -}, z.core.$strip>; -/** - * The response to a tasks/list request. - */ -export declare const ListTasksResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tasks: z.ZodArray; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * A request to cancel a specific task. - */ -export declare const CancelTaskRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"tasks/cancel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The response to a tasks/cancel request. - */ -export declare const CancelTaskResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>; -/** - * The contents of a specific resource or sub-resource. - */ -export declare const ResourceContentsSchema: z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; -}, z.core.$strip>; -export declare const TextResourceContentsSchema: z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - text: z.ZodString; -}, z.core.$strip>; -export declare const BlobResourceContentsSchema: z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; -}, z.core.$strip>; -/** - * The sender or recipient of messages and data in a conversation. - */ -export declare const RoleSchema: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; -}>; -/** - * Optional annotations providing clients additional context about a resource. - */ -export declare const AnnotationsSchema: z.ZodObject<{ - audience: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; -}, z.core.$strip>; -/** - * A known resource that the server is capable of reading. - */ -export declare const ResourceSchema: z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * A template description for resources available on the server. - */ -export declare const ResourceTemplateSchema: z.ZodObject<{ - uriTemplate: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Sent from the client to request a list of resources the server has. - */ -export declare const ListResourcesRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"resources/list">; -}, z.core.$strip>; -/** - * The server's response to a resources/list request from the client. - */ -export declare const ListResourcesResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - resources: z.ZodArray; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * Sent from the client to request a list of resource templates the server has. - */ -export declare const ListResourceTemplatesRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"resources/templates/list">; -}, z.core.$strip>; -/** - * The server's response to a resources/templates/list request from the client. - */ -export declare const ListResourceTemplatesResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - resourceTemplates: z.ZodArray; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -export declare const ResourceRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Parameters for a `resources/read` request. - */ -export declare const ReadResourceRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Sent from the client to the server, to read a specific resource URI. - */ -export declare const ReadResourceRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"resources/read">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The server's response to a resources/read request from the client. - */ -export declare const ReadResourceResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - contents: z.ZodArray; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>>; -}, z.core.$loose>; -/** - * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. - */ -export declare const ResourceListChangedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/resources/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const SubscribeRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. - */ -export declare const SubscribeRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"resources/subscribe">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const UnsubscribeRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. - */ -export declare const UnsubscribeRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"resources/unsubscribe">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Parameters for a `notifications/resources/updated` notification. - */ -export declare const ResourceUpdatedNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. - */ -export declare const ResourceUpdatedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/resources/updated">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Describes an argument that a prompt can accept. - */ -export declare const PromptArgumentSchema: z.ZodObject<{ - name: z.ZodString; - description: z.ZodOptional; - required: z.ZodOptional; -}, z.core.$strip>; -/** - * A prompt or prompt template that the server offers. - */ -export declare const PromptSchema: z.ZodObject<{ - description: z.ZodOptional; - arguments: z.ZodOptional; - required: z.ZodOptional; - }, z.core.$strip>>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Sent from the client to request a list of prompts and prompt templates the server has. - */ -export declare const ListPromptsRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"prompts/list">; -}, z.core.$strip>; -/** - * The server's response to a prompts/list request from the client. - */ -export declare const ListPromptsResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - prompts: z.ZodArray; - arguments: z.ZodOptional; - required: z.ZodOptional; - }, z.core.$strip>>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * Parameters for a `prompts/get` request. - */ -export declare const GetPromptRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - name: z.ZodString; - arguments: z.ZodOptional>; -}, z.core.$strip>; -/** - * Used by the client to get a prompt provided by the server. - */ -export declare const GetPromptRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"prompts/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - name: z.ZodString; - arguments: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Text provided to or from an LLM. - */ -export declare const TextContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * An image provided to or from an LLM. - */ -export declare const ImageContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * An Audio provided to or from an LLM. - */ -export declare const AudioContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * A tool call request from an assistant (LLM). - * Represents the assistant's request to use a tool. - */ -export declare const ToolUseContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * The contents of a resource, embedded into a prompt or tool call result. - */ -export declare const EmbeddedResourceSchema: z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * A resource that the server is capable of reading, included in a prompt or tool call result. - * - * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. - */ -export declare const ResourceLinkSchema: z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; -}, z.core.$strip>; -/** - * A content block that can be used in prompts and tool results. - */ -export declare const ContentBlockSchema: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>]>; -/** - * Describes a message returned as part of a prompt. - */ -export declare const PromptMessageSchema: z.ZodObject<{ - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; -}, z.core.$strip>; -/** - * The server's response to a prompts/get request from the client. - */ -export declare const GetPromptResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - description: z.ZodOptional; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. - */ -export declare const PromptListChangedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/prompts/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * Additional properties describing a Tool to clients. - * - * NOTE: all properties in ToolAnnotations are **hints**. - * They are not guaranteed to provide a faithful description of - * tool behavior (including descriptive properties like `title`). - * - * Clients should never make tool use decisions based on ToolAnnotations - * received from untrusted servers. - */ -export declare const ToolAnnotationsSchema: z.ZodObject<{ - title: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; -}, z.core.$strip>; -/** - * Execution-related properties for a tool. - */ -export declare const ToolExecutionSchema: z.ZodObject<{ - taskSupport: z.ZodOptional>; -}, z.core.$strip>; -/** - * Definition for a tool the client can call. - */ -export declare const ToolSchema: z.ZodObject<{ - description: z.ZodOptional; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Sent from the client to request a list of tools the server has. - */ -export declare const ListToolsRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tools/list">; -}, z.core.$strip>; -/** - * The server's response to a tools/list request from the client. - */ -export declare const ListToolsResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tools: z.ZodArray; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * The server's response to a tool call. - */ -export declare const CallToolResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; -}, z.core.$loose>; -/** - * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. - */ -export declare const CompatibilityCallToolResultSchema: z.ZodUnion<[z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - toolResult: z.ZodUnknown; -}, z.core.$loose>]>; -/** - * Parameters for a `tools/call` request. - */ -export declare const CallToolRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - name: z.ZodString; - arguments: z.ZodOptional>; -}, z.core.$strip>; -/** - * Used by the client to invoke a tool provided by the server. - */ -export declare const CallToolRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"tools/call">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - name: z.ZodString; - arguments: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. - */ -export declare const ToolListChangedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/tools/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * Callback type for list changed notifications. - */ -export type ListChangedCallback = (error: Error | null, items: T[] | null) => void; -/** - * Base schema for list changed subscription options (without callback). - * Used internally for Zod validation of autoRefresh and debounceMs. - */ -export declare const ListChangedOptionsBaseSchema: z.ZodObject<{ - autoRefresh: z.ZodDefault; - debounceMs: z.ZodDefault; -}, z.core.$strip>; -/** - * Options for subscribing to list changed notifications. - * - * @typeParam T - The type of items in the list (Tool, Prompt, or Resource) - */ -export type ListChangedOptions = { - /** - * If true, the list will be refreshed automatically when a list changed notification is received. - * @default true - */ - autoRefresh?: boolean; - /** - * Debounce time in milliseconds. Set to 0 to disable. - * @default 300 - */ - debounceMs?: number; - /** - * Callback invoked when the list changes. - * - * If autoRefresh is true, items contains the updated list. - * If autoRefresh is false, items is null (caller should refresh manually). - */ - onChanged: ListChangedCallback; -}; -/** - * Configuration for list changed notification handlers. - * - * Use this to configure handlers for tools, prompts, and resources list changes - * when creating a client. - * - * Note: Handlers are only activated if the server advertises the corresponding - * `listChanged` capability (e.g., `tools.listChanged: true`). If the server - * doesn't advertise this capability, the handler will not be set up. - */ -export type ListChangedHandlers = { - /** - * Handler for tool list changes. - */ - tools?: ListChangedOptions; - /** - * Handler for prompt list changes. - */ - prompts?: ListChangedOptions; - /** - * Handler for resource list changes. - */ - resources?: ListChangedOptions; -}; -/** - * The severity of a log message. - */ -export declare const LoggingLevelSchema: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; -}>; -/** - * Parameters for a `logging/setLevel` request. - */ -export declare const SetLevelRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; -}, z.core.$strip>; -/** - * A request from the client to the server, to enable or adjust logging. - */ -export declare const SetLevelRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"logging/setLevel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Parameters for a `notifications/message` notification. - */ -export declare const LoggingMessageNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - logger: z.ZodOptional; - data: z.ZodUnknown; -}, z.core.$strip>; -/** - * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. - */ -export declare const LoggingMessageNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/message">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - logger: z.ZodOptional; - data: z.ZodUnknown; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Hints to use for model selection. - */ -export declare const ModelHintSchema: z.ZodObject<{ - name: z.ZodOptional; -}, z.core.$strip>; -/** - * The server's preferences for model selection, requested of the client during sampling. - */ -export declare const ModelPreferencesSchema: z.ZodObject<{ - hints: z.ZodOptional; - }, z.core.$strip>>>; - costPriority: z.ZodOptional; - speedPriority: z.ZodOptional; - intelligencePriority: z.ZodOptional; -}, z.core.$strip>; -/** - * Controls tool usage behavior in sampling requests. - */ -export declare const ToolChoiceSchema: z.ZodObject<{ - mode: z.ZodOptional>; -}, z.core.$strip>; -/** - * The result of a tool execution, provided by the user (server). - * Represents the outcome of invoking a tool requested via ToolUseContent. - */ -export declare const ToolResultContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * Basic content types for sampling responses (without tool use). - * Used for backwards-compatible CreateMessageResult when tools are not used. - */ -export declare const SamplingContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>]>; -/** - * Content block types allowed in sampling messages. - * This includes text, image, audio, tool use requests, and tool results. - */ -export declare const SamplingMessageContentBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; -}, z.core.$strip>]>; -/** - * Describes a message issued to or received from an LLM API. - */ -export declare const SamplingMessageSchema: z.ZodObject<{ - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * Parameters for a `sampling/createMessage` request. - */ -export declare const CreateMessageRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; - _meta: z.ZodOptional>; - }, z.core.$strip>>; - modelPreferences: z.ZodOptional; - }, z.core.$strip>>>; - costPriority: z.ZodOptional; - speedPriority: z.ZodOptional; - intelligencePriority: z.ZodOptional; - }, z.core.$strip>>; - systemPrompt: z.ZodOptional; - includeContext: z.ZodOptional>; - temperature: z.ZodOptional; - maxTokens: z.ZodNumber; - stopSequences: z.ZodOptional>; - metadata: z.ZodOptional>; - tools: z.ZodOptional; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>>; - toolChoice: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. - */ -export declare const CreateMessageRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"sampling/createMessage">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; - _meta: z.ZodOptional>; - }, z.core.$strip>>; - modelPreferences: z.ZodOptional; - }, z.core.$strip>>>; - costPriority: z.ZodOptional; - speedPriority: z.ZodOptional; - intelligencePriority: z.ZodOptional; - }, z.core.$strip>>; - systemPrompt: z.ZodOptional; - includeContext: z.ZodOptional>; - temperature: z.ZodOptional; - maxTokens: z.ZodNumber; - stopSequences: z.ZodOptional>; - metadata: z.ZodOptional>; - tools: z.ZodOptional; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>>; - toolChoice: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The client's response to a sampling/create_message request from the server. - * This is the backwards-compatible version that returns single content (no arrays). - * Used when the request does not include tools. - */ -export declare const CreateMessageResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - model: z.ZodString; - stopReason: z.ZodOptional, z.ZodString]>>; - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodDiscriminatedUnion<[z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; -}, z.core.$loose>; -/** - * The client's response to a sampling/create_message request when tools were provided. - * This version supports array content for tool use flows. - */ -export declare const CreateMessageResultWithToolsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - model: z.ZodString; - stopReason: z.ZodOptional, z.ZodString]>>; - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; -}, z.core.$loose>; -/** - * Primitive schema definition for boolean fields. - */ -export declare const BooleanSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Primitive schema definition for string fields. - */ -export declare const StringSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Primitive schema definition for number fields. - */ -export declare const NumberSchemaSchema: z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Schema for single-selection enumeration without display titles for options. - */ -export declare const UntitledSingleSelectEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Schema for single-selection enumeration with display titles for each option. - */ -export declare const TitledSingleSelectEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Use TitledSingleSelectEnumSchema instead. - * This interface will be removed in a future version. - */ -export declare const LegacyTitledEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>; -export declare const SingleSelectEnumSchemaSchema: z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; -}, z.core.$strip>]>; -/** - * Schema for multiple-selection enumeration without display titles for options. - */ -export declare const UntitledMultiSelectEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>; -/** - * Schema for multiple-selection enumeration with display titles for each option. - */ -export declare const TitledMultiSelectEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>; -/** - * Combined schema for multiple-selection enumeration - */ -export declare const MultiSelectEnumSchemaSchema: z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>]>; -/** - * Primitive schema definition for enum fields. - */ -export declare const EnumSchemaSchema: z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; -}, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>]>]>; -/** - * Union of all primitive schema definitions. - */ -export declare const PrimitiveSchemaDefinitionSchema: z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; -}, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; -}, z.core.$strip>]>; -/** - * Parameters for an `elicitation/create` request for form-based elicitation. - */ -export declare const ElicitRequestFormParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodOptional>; - message: z.ZodString; - requestedSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodRecord; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; - }, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>]>>; - required: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Parameters for an `elicitation/create` request for URL-based elicitation. - */ -export declare const ElicitRequestURLParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodLiteral<"url">; - message: z.ZodString; - elicitationId: z.ZodString; - url: z.ZodString; -}, z.core.$strip>; -/** - * The parameters for a request to elicit additional information from the user via the client. - */ -export declare const ElicitRequestParamsSchema: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodOptional>; - message: z.ZodString; - requestedSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodRecord; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; - }, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>]>>; - required: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodLiteral<"url">; - message: z.ZodString; - elicitationId: z.ZodString; - url: z.ZodString; -}, z.core.$strip>]>; -/** - * A request from the server to elicit user input via the client. - * The client should present the message and form fields to the user (form mode) - * or navigate to a URL (URL mode). - */ -export declare const ElicitRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"elicitation/create">; - params: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodOptional>; - message: z.ZodString; - requestedSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodRecord; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; - }, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>]>>; - required: z.ZodOptional>; - }, z.core.$strip>; - }, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodLiteral<"url">; - message: z.ZodString; - elicitationId: z.ZodString; - url: z.ZodString; - }, z.core.$strip>]>; -}, z.core.$strip>; -/** - * Parameters for a `notifications/elicitation/complete` notification. - * - * @category notifications/elicitation/complete - */ -export declare const ElicitationCompleteNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - elicitationId: z.ZodString; -}, z.core.$strip>; -/** - * A notification from the server to the client, informing it of a completion of an out-of-band elicitation request. - * - * @category notifications/elicitation/complete - */ -export declare const ElicitationCompleteNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/elicitation/complete">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - elicitationId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The client's response to an elicitation/create request from the server. - */ -export declare const ElicitResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - action: z.ZodEnum<{ - cancel: "cancel"; - accept: "accept"; - decline: "decline"; - }>; - content: z.ZodPipe, z.ZodOptional]>>>>; -}, z.core.$loose>; -/** - * A reference to a resource or resource template definition. - */ -export declare const ResourceTemplateReferenceSchema: z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; -}, z.core.$strip>; -/** - * @deprecated Use ResourceTemplateReferenceSchema instead - */ -export declare const ResourceReferenceSchema: z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Identifies a prompt. - */ -export declare const PromptReferenceSchema: z.ZodObject<{ - type: z.ZodLiteral<"ref/prompt">; - name: z.ZodString; -}, z.core.$strip>; -/** - * Parameters for a `completion/complete` request. - */ -export declare const CompleteRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - ref: z.ZodUnion; - name: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; - }, z.core.$strip>]>; - argument: z.ZodObject<{ - name: z.ZodString; - value: z.ZodString; - }, z.core.$strip>; - context: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * A request from the client to the server, to ask for completion options. - */ -export declare const CompleteRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"completion/complete">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - ref: z.ZodUnion; - name: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; - }, z.core.$strip>]>; - argument: z.ZodObject<{ - name: z.ZodString; - value: z.ZodString; - }, z.core.$strip>; - context: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; -}, z.core.$strip>; -export declare function assertCompleteRequestPrompt(request: CompleteRequest): asserts request is CompleteRequestPrompt; -export declare function assertCompleteRequestResourceTemplate(request: CompleteRequest): asserts request is CompleteRequestResourceTemplate; -/** - * The server's response to a completion/complete request - */ -export declare const CompleteResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - completion: z.ZodObject<{ - /** - * An array of completion values. Must not exceed 100 items. - */ - values: z.ZodArray; - /** - * The total number of completion options available. This can exceed the number of values actually sent in the response. - */ - total: z.ZodOptional; - /** - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. - */ - hasMore: z.ZodOptional; - }, z.core.$loose>; -}, z.core.$loose>; -/** - * Represents a root directory or file that the server can operate on. - */ -export declare const RootSchema: z.ZodObject<{ - uri: z.ZodString; - name: z.ZodOptional; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * Sent from the server to request a list of root URIs from the client. - */ -export declare const ListRootsRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"roots/list">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * The client's response to a roots/list request from the server. - */ -export declare const ListRootsResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - roots: z.ZodArray; - _meta: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * A notification from the client to the server, informing it that the list of roots has changed. - */ -export declare const RootsListChangedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/roots/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const ClientRequestSchema: z.ZodUnion; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"initialize">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - sampling: z.ZodOptional>; - tools: z.ZodOptional>; - }, z.core.$strip>>; - elicitation: z.ZodOptional, z.ZodIntersection; - }, z.core.$strip>, z.ZodRecord>>; - url: z.ZodOptional>; - }, z.core.$strip>, z.ZodOptional>>>>; - roots: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - clientInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"completion/complete">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - ref: z.ZodUnion; - name: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; - }, z.core.$strip>]>; - argument: z.ZodObject<{ - name: z.ZodString; - value: z.ZodString; - }, z.core.$strip>; - context: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"logging/setLevel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"prompts/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - name: z.ZodString; - arguments: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"prompts/list">; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"resources/list">; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"resources/templates/list">; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"resources/read">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"resources/subscribe">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"resources/unsubscribe">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tools/call">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - name: z.ZodString; - arguments: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tools/list">; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/result">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tasks/list">; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/cancel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>]>; -export declare const ClientNotificationSchema: z.ZodUnion; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - requestId: z.ZodOptional>; - reason: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/progress">; - params: z.ZodObject<{ - progressToken: z.ZodUnion; - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/initialized">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/roots/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/tasks/status">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>]>; -export declare const ClientResultSchema: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strict>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - model: z.ZodString; - stopReason: z.ZodOptional, z.ZodString]>>; - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodDiscriminatedUnion<[z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - model: z.ZodString; - stopReason: z.ZodOptional, z.ZodString]>>; - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - action: z.ZodEnum<{ - cancel: "cancel"; - accept: "accept"; - decline: "decline"; - }>; - content: z.ZodPipe, z.ZodOptional]>>>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - roots: z.ZodArray; - _meta: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tasks: z.ZodArray; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodObject<{ - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$loose>]>; -export declare const ServerRequestSchema: z.ZodUnion; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"sampling/createMessage">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; - _meta: z.ZodOptional>; - }, z.core.$strip>>; - modelPreferences: z.ZodOptional; - }, z.core.$strip>>>; - costPriority: z.ZodOptional; - speedPriority: z.ZodOptional; - intelligencePriority: z.ZodOptional; - }, z.core.$strip>>; - systemPrompt: z.ZodOptional; - includeContext: z.ZodOptional>; - temperature: z.ZodOptional; - maxTokens: z.ZodNumber; - stopSequences: z.ZodOptional>; - metadata: z.ZodOptional>; - tools: z.ZodOptional; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>>; - toolChoice: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"elicitation/create">; - params: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodOptional>; - message: z.ZodString; - requestedSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodRecord; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; - }, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>]>>; - required: z.ZodOptional>; - }, z.core.$strip>; - }, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodLiteral<"url">; - message: z.ZodString; - elicitationId: z.ZodString; - url: z.ZodString; - }, z.core.$strip>]>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"roots/list">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/result">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tasks/list">; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/cancel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>]>; -export declare const ServerNotificationSchema: z.ZodUnion; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - requestId: z.ZodOptional>; - reason: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/progress">; - params: z.ZodObject<{ - progressToken: z.ZodUnion; - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/message">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - logger: z.ZodOptional; - data: z.ZodUnknown; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/resources/updated">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/resources/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/tools/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/prompts/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/tasks/status">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/elicitation/complete">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - elicitationId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>]>; -export declare const ServerResultSchema: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strict>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - logging: z.ZodOptional>; - completions: z.ZodOptional>; - prompts: z.ZodOptional; - }, z.core.$strip>>; - resources: z.ZodOptional; - listChanged: z.ZodOptional; - }, z.core.$strip>>; - tools: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the server supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - serverInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; - instructions: z.ZodOptional; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - completion: z.ZodObject<{ - /** - * An array of completion values. Must not exceed 100 items. - */ - values: z.ZodArray; - /** - * The total number of completion options available. This can exceed the number of values actually sent in the response. - */ - total: z.ZodOptional; - /** - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. - */ - hasMore: z.ZodOptional; - }, z.core.$loose>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - description: z.ZodOptional; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - prompts: z.ZodArray; - arguments: z.ZodOptional; - required: z.ZodOptional; - }, z.core.$strip>>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - resources: z.ZodArray; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - resourceTemplates: z.ZodArray; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - contents: z.ZodArray; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tools: z.ZodArray; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tasks: z.ZodArray; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodObject<{ - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$loose>]>; -export declare class McpError extends Error { - readonly code: number; - readonly data?: unknown; - constructor(code: number, message: string, data?: unknown); - /** - * Factory method to create the appropriate error type based on the error code and data - */ - static fromError(code: number, message: string, data?: unknown): McpError; -} -/** - * Specialized error type when a tool requires a URL mode elicitation. - * This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against. - */ -export declare class UrlElicitationRequiredError extends McpError { - constructor(elicitations: ElicitRequestURLParams[], message?: string); - get elicitations(): ElicitRequestURLParams[]; -} -type Primitive = string | number | boolean | bigint | null | undefined; -type Flatten = T extends Primitive ? T : T extends Array ? Array> : T extends Set ? Set> : T extends Map ? Map, Flatten> : T extends object ? { - [K in keyof T]: Flatten; -} : T; -type Infer = Flatten>; -/** - * Headers that are compatible with both Node.js and the browser. - */ -export type IsomorphicHeaders = Record; -/** - * Information about the incoming request. - */ -export interface RequestInfo { - /** - * The headers of the request. - */ - headers: IsomorphicHeaders; -} -/** - * Extra information about a message. - */ -export interface MessageExtraInfo { - /** - * The request information. - */ - requestInfo?: RequestInfo; - /** - * The authentication information. - */ - authInfo?: AuthInfo; - /** - * Callback to close the SSE stream for this request, triggering client reconnection. - * Only available when using StreamableHTTPServerTransport with eventStore configured. - */ - closeSSEStream?: () => void; - /** - * Callback to close the standalone GET SSE stream, triggering client reconnection. - * Only available when using StreamableHTTPServerTransport with eventStore configured. - */ - closeStandaloneSSEStream?: () => void; -} -export type ProgressToken = Infer; -export type Cursor = Infer; -export type Request = Infer; -export type TaskAugmentedRequestParams = Infer; -export type RequestMeta = Infer; -export type Notification = Infer; -export type Result = Infer; -export type RequestId = Infer; -export type JSONRPCRequest = Infer; -export type JSONRPCNotification = Infer; -export type JSONRPCResponse = Infer; -export type JSONRPCErrorResponse = Infer; -/** - * @deprecated Use {@link JSONRPCErrorResponse} instead. - * - * Please note that spec types have renamed {@link JSONRPCError} to {@link JSONRPCErrorResponse} as per the updated JSON-RPC specification. (was previously just {@link JSONRPCError}) and future versions will remove {@link JSONRPCError}. - */ -export type JSONRPCError = JSONRPCErrorResponse; -export type JSONRPCResultResponse = Infer; -export type JSONRPCMessage = Infer; -export type RequestParams = Infer; -export type NotificationParams = Infer; -export type EmptyResult = Infer; -export type CancelledNotificationParams = Infer; -export type CancelledNotification = Infer; -export type Icon = Infer; -export type Icons = Infer; -export type BaseMetadata = Infer; -export type Annotations = Infer; -export type Role = Infer; -export type Implementation = Infer; -export type ClientCapabilities = Infer; -export type InitializeRequestParams = Infer; -export type InitializeRequest = Infer; -export type ServerCapabilities = Infer; -export type InitializeResult = Infer; -export type InitializedNotification = Infer; -export type PingRequest = Infer; -export type Progress = Infer; -export type ProgressNotificationParams = Infer; -export type ProgressNotification = Infer; -export type Task = Infer; -export type TaskStatus = Infer; -export type TaskCreationParams = Infer; -export type TaskMetadata = Infer; -export type RelatedTaskMetadata = Infer; -export type CreateTaskResult = Infer; -export type TaskStatusNotificationParams = Infer; -export type TaskStatusNotification = Infer; -export type GetTaskRequest = Infer; -export type GetTaskResult = Infer; -export type GetTaskPayloadRequest = Infer; -export type ListTasksRequest = Infer; -export type ListTasksResult = Infer; -export type CancelTaskRequest = Infer; -export type CancelTaskResult = Infer; -export type GetTaskPayloadResult = Infer; -export type PaginatedRequestParams = Infer; -export type PaginatedRequest = Infer; -export type PaginatedResult = Infer; -export type ResourceContents = Infer; -export type TextResourceContents = Infer; -export type BlobResourceContents = Infer; -export type Resource = Infer; -export type ResourceTemplate = Infer; -export type ListResourcesRequest = Infer; -export type ListResourcesResult = Infer; -export type ListResourceTemplatesRequest = Infer; -export type ListResourceTemplatesResult = Infer; -export type ResourceRequestParams = Infer; -export type ReadResourceRequestParams = Infer; -export type ReadResourceRequest = Infer; -export type ReadResourceResult = Infer; -export type ResourceListChangedNotification = Infer; -export type SubscribeRequestParams = Infer; -export type SubscribeRequest = Infer; -export type UnsubscribeRequestParams = Infer; -export type UnsubscribeRequest = Infer; -export type ResourceUpdatedNotificationParams = Infer; -export type ResourceUpdatedNotification = Infer; -export type PromptArgument = Infer; -export type Prompt = Infer; -export type ListPromptsRequest = Infer; -export type ListPromptsResult = Infer; -export type GetPromptRequestParams = Infer; -export type GetPromptRequest = Infer; -export type TextContent = Infer; -export type ImageContent = Infer; -export type AudioContent = Infer; -export type ToolUseContent = Infer; -export type ToolResultContent = Infer; -export type EmbeddedResource = Infer; -export type ResourceLink = Infer; -export type ContentBlock = Infer; -export type PromptMessage = Infer; -export type GetPromptResult = Infer; -export type PromptListChangedNotification = Infer; -export type ToolAnnotations = Infer; -export type ToolExecution = Infer; -export type Tool = Infer; -export type ListToolsRequest = Infer; -export type ListToolsResult = Infer; -export type CallToolRequestParams = Infer; -export type CallToolResult = Infer; -export type CompatibilityCallToolResult = Infer; -export type CallToolRequest = Infer; -export type ToolListChangedNotification = Infer; -export type LoggingLevel = Infer; -export type SetLevelRequestParams = Infer; -export type SetLevelRequest = Infer; -export type LoggingMessageNotificationParams = Infer; -export type LoggingMessageNotification = Infer; -export type ToolChoice = Infer; -export type ModelHint = Infer; -export type ModelPreferences = Infer; -export type SamplingContent = Infer; -export type SamplingMessageContentBlock = Infer; -export type SamplingMessage = Infer; -export type CreateMessageRequestParams = Infer; -export type CreateMessageRequest = Infer; -export type CreateMessageResult = Infer; -export type CreateMessageResultWithTools = Infer; -/** - * CreateMessageRequestParams without tools - for backwards-compatible overload. - * Excludes tools/toolChoice to indicate they should not be provided. - */ -export type CreateMessageRequestParamsBase = Omit; -/** - * CreateMessageRequestParams with required tools - for tool-enabled overload. - */ -export interface CreateMessageRequestParamsWithTools extends CreateMessageRequestParams { - tools: Tool[]; -} -export type BooleanSchema = Infer; -export type StringSchema = Infer; -export type NumberSchema = Infer; -export type EnumSchema = Infer; -export type UntitledSingleSelectEnumSchema = Infer; -export type TitledSingleSelectEnumSchema = Infer; -export type LegacyTitledEnumSchema = Infer; -export type UntitledMultiSelectEnumSchema = Infer; -export type TitledMultiSelectEnumSchema = Infer; -export type SingleSelectEnumSchema = Infer; -export type MultiSelectEnumSchema = Infer; -export type PrimitiveSchemaDefinition = Infer; -export type ElicitRequestParams = Infer; -export type ElicitRequestFormParams = Infer; -export type ElicitRequestURLParams = Infer; -export type ElicitRequest = Infer; -export type ElicitationCompleteNotificationParams = Infer; -export type ElicitationCompleteNotification = Infer; -export type ElicitResult = Infer; -export type ResourceTemplateReference = Infer; -/** - * @deprecated Use ResourceTemplateReference instead - */ -export type ResourceReference = ResourceTemplateReference; -export type PromptReference = Infer; -export type CompleteRequestParams = Infer; -export type CompleteRequest = Infer; -export type CompleteRequestResourceTemplate = ExpandRecursively; -export type CompleteRequestPrompt = ExpandRecursively; -export type CompleteResult = Infer; -export type Root = Infer; -export type ListRootsRequest = Infer; -export type ListRootsResult = Infer; -export type RootsListChangedNotification = Infer; -export type ClientRequest = Infer; -export type ClientNotification = Infer; -export type ClientResult = Infer; -export type ServerRequest = Infer; -export type ServerNotification = Infer; -export type ServerResult = Infer; -export {}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts.map deleted file mode 100644 index 4745081..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -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,CAAC,eAAe,GAAG;IAAE,MAAM,EAAE,qBAAqB,GAAG;QAAE,GAAG,EAAE,eAAe,CAAA;KAAE,CAAA;CAAE,CAAC,CAAC;AACtI,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAGhE,MAAM,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC5C,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAClE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAG5F,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG5D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js deleted file mode 100644 index 1f4553e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js +++ /dev/null @@ -1,2092 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProgressNotificationParamsSchema = exports.ProgressSchema = exports.PingRequestSchema = exports.isInitializedNotification = exports.InitializedNotificationSchema = exports.InitializeResultSchema = exports.ServerCapabilitiesSchema = exports.isInitializeRequest = exports.InitializeRequestSchema = exports.InitializeRequestParamsSchema = exports.ClientCapabilitiesSchema = exports.ServerTasksCapabilitySchema = exports.ClientTasksCapabilitySchema = exports.ImplementationSchema = exports.BaseMetadataSchema = exports.IconsSchema = exports.IconSchema = exports.CancelledNotificationSchema = exports.CancelledNotificationParamsSchema = exports.EmptyResultSchema = exports.JSONRPCResponseSchema = exports.JSONRPCMessageSchema = exports.isJSONRPCError = exports.isJSONRPCErrorResponse = exports.JSONRPCErrorSchema = exports.JSONRPCErrorResponseSchema = exports.ErrorCode = exports.isJSONRPCResponse = exports.isJSONRPCResultResponse = exports.JSONRPCResultResponseSchema = exports.isJSONRPCNotification = exports.JSONRPCNotificationSchema = exports.isJSONRPCRequest = exports.JSONRPCRequestSchema = exports.RequestIdSchema = exports.ResultSchema = exports.NotificationSchema = exports.RequestSchema = exports.isTaskAugmentedRequestParams = exports.TaskAugmentedRequestParamsSchema = exports.RelatedTaskMetadataSchema = exports.TaskMetadataSchema = exports.TaskCreationParamsSchema = exports.CursorSchema = exports.ProgressTokenSchema = exports.JSONRPC_VERSION = exports.RELATED_TASK_META_KEY = exports.SUPPORTED_PROTOCOL_VERSIONS = exports.DEFAULT_NEGOTIATED_PROTOCOL_VERSION = exports.LATEST_PROTOCOL_VERSION = void 0; -exports.EmbeddedResourceSchema = exports.ToolUseContentSchema = exports.AudioContentSchema = exports.ImageContentSchema = exports.TextContentSchema = exports.GetPromptRequestSchema = exports.GetPromptRequestParamsSchema = exports.ListPromptsResultSchema = exports.ListPromptsRequestSchema = exports.PromptSchema = exports.PromptArgumentSchema = exports.ResourceUpdatedNotificationSchema = exports.ResourceUpdatedNotificationParamsSchema = exports.UnsubscribeRequestSchema = exports.UnsubscribeRequestParamsSchema = exports.SubscribeRequestSchema = exports.SubscribeRequestParamsSchema = exports.ResourceListChangedNotificationSchema = exports.ReadResourceResultSchema = exports.ReadResourceRequestSchema = exports.ReadResourceRequestParamsSchema = exports.ResourceRequestParamsSchema = exports.ListResourceTemplatesResultSchema = exports.ListResourceTemplatesRequestSchema = exports.ListResourcesResultSchema = exports.ListResourcesRequestSchema = exports.ResourceTemplateSchema = exports.ResourceSchema = exports.AnnotationsSchema = exports.RoleSchema = exports.BlobResourceContentsSchema = exports.TextResourceContentsSchema = exports.ResourceContentsSchema = exports.CancelTaskResultSchema = exports.CancelTaskRequestSchema = exports.ListTasksResultSchema = exports.ListTasksRequestSchema = exports.GetTaskPayloadResultSchema = exports.GetTaskPayloadRequestSchema = exports.GetTaskResultSchema = exports.GetTaskRequestSchema = exports.TaskStatusNotificationSchema = exports.TaskStatusNotificationParamsSchema = exports.CreateTaskResultSchema = exports.TaskSchema = exports.TaskStatusSchema = exports.PaginatedResultSchema = exports.PaginatedRequestSchema = exports.PaginatedRequestParamsSchema = exports.ProgressNotificationSchema = void 0; -exports.ElicitationCompleteNotificationSchema = exports.ElicitationCompleteNotificationParamsSchema = exports.ElicitRequestSchema = exports.ElicitRequestParamsSchema = exports.ElicitRequestURLParamsSchema = exports.ElicitRequestFormParamsSchema = exports.PrimitiveSchemaDefinitionSchema = exports.EnumSchemaSchema = exports.MultiSelectEnumSchemaSchema = exports.TitledMultiSelectEnumSchemaSchema = exports.UntitledMultiSelectEnumSchemaSchema = exports.SingleSelectEnumSchemaSchema = exports.LegacyTitledEnumSchemaSchema = exports.TitledSingleSelectEnumSchemaSchema = exports.UntitledSingleSelectEnumSchemaSchema = exports.NumberSchemaSchema = exports.StringSchemaSchema = exports.BooleanSchemaSchema = exports.CreateMessageResultWithToolsSchema = exports.CreateMessageResultSchema = exports.CreateMessageRequestSchema = exports.CreateMessageRequestParamsSchema = exports.SamplingMessageSchema = exports.SamplingMessageContentBlockSchema = exports.SamplingContentSchema = exports.ToolResultContentSchema = exports.ToolChoiceSchema = exports.ModelPreferencesSchema = exports.ModelHintSchema = exports.LoggingMessageNotificationSchema = exports.LoggingMessageNotificationParamsSchema = exports.SetLevelRequestSchema = exports.SetLevelRequestParamsSchema = exports.LoggingLevelSchema = exports.ListChangedOptionsBaseSchema = exports.ToolListChangedNotificationSchema = exports.CallToolRequestSchema = exports.CallToolRequestParamsSchema = exports.CompatibilityCallToolResultSchema = exports.CallToolResultSchema = exports.ListToolsResultSchema = exports.ListToolsRequestSchema = exports.ToolSchema = exports.ToolExecutionSchema = exports.ToolAnnotationsSchema = exports.PromptListChangedNotificationSchema = exports.GetPromptResultSchema = exports.PromptMessageSchema = exports.ContentBlockSchema = exports.ResourceLinkSchema = void 0; -exports.UrlElicitationRequiredError = exports.McpError = exports.ServerResultSchema = exports.ServerNotificationSchema = exports.ServerRequestSchema = exports.ClientResultSchema = exports.ClientNotificationSchema = exports.ClientRequestSchema = exports.RootsListChangedNotificationSchema = exports.ListRootsResultSchema = exports.ListRootsRequestSchema = exports.RootSchema = exports.CompleteResultSchema = exports.CompleteRequestSchema = exports.CompleteRequestParamsSchema = exports.PromptReferenceSchema = exports.ResourceReferenceSchema = exports.ResourceTemplateReferenceSchema = exports.ElicitResultSchema = void 0; -exports.assertCompleteRequestPrompt = assertCompleteRequestPrompt; -exports.assertCompleteRequestResourceTemplate = assertCompleteRequestResourceTemplate; -const z = __importStar(require("zod/v4")); -exports.LATEST_PROTOCOL_VERSION = '2025-11-25'; -exports.DEFAULT_NEGOTIATED_PROTOCOL_VERSION = '2025-03-26'; -exports.SUPPORTED_PROTOCOL_VERSIONS = [exports.LATEST_PROTOCOL_VERSION, '2025-06-18', '2025-03-26', '2024-11-05', '2024-10-07']; -exports.RELATED_TASK_META_KEY = 'io.modelcontextprotocol/related-task'; -/* JSON-RPC types */ -exports.JSONRPC_VERSION = '2.0'; -/** - * Assert 'object' type schema. - * - * @internal - */ -const AssertObjectSchema = z.custom((v) => v !== null && (typeof v === 'object' || typeof v === 'function')); -/** - * A progress token, used to associate progress notifications with the original request. - */ -exports.ProgressTokenSchema = z.union([z.string(), z.number().int()]); -/** - * An opaque token used to represent a cursor for pagination. - */ -exports.CursorSchema = z.string(); -/** - * Task creation parameters, used to ask that the server create a task to represent a request. - */ -exports.TaskCreationParamsSchema = z.looseObject({ - /** - * Time in milliseconds to keep task results available after completion. - * If null, the task has unlimited lifetime until manually cleaned up. - */ - ttl: z.union([z.number(), z.null()]).optional(), - /** - * Time in milliseconds to wait between task status requests. - */ - pollInterval: z.number().optional() -}); -exports.TaskMetadataSchema = z.object({ - ttl: z.number().optional() -}); -/** - * Metadata for associating messages with a task. - * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`. - */ -exports.RelatedTaskMetadataSchema = z.object({ - taskId: z.string() -}); -const RequestMetaSchema = z.looseObject({ - /** - * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. - */ - progressToken: exports.ProgressTokenSchema.optional(), - /** - * If specified, this request is related to the provided task. - */ - [exports.RELATED_TASK_META_KEY]: exports.RelatedTaskMetadataSchema.optional() -}); -/** - * Common params for any request. - */ -const BaseRequestParamsSchema = z.object({ - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta: RequestMetaSchema.optional() -}); -/** - * Common params for any task-augmented request. - */ -exports.TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * If specified, the caller is requesting task-augmented execution for this request. - * The request will return a CreateTaskResult immediately, and the actual result can be - * retrieved later via tasks/result. - * - * Task augmentation is subject to capability negotiation - receivers MUST declare support - * for task augmentation of specific request types in their capabilities. - */ - task: exports.TaskMetadataSchema.optional() -}); -/** - * Checks if a value is a valid TaskAugmentedRequestParams. - * @param value - The value to check. - * - * @returns True if the value is a valid TaskAugmentedRequestParams, false otherwise. - */ -const isTaskAugmentedRequestParams = (value) => exports.TaskAugmentedRequestParamsSchema.safeParse(value).success; -exports.isTaskAugmentedRequestParams = isTaskAugmentedRequestParams; -exports.RequestSchema = z.object({ - method: z.string(), - params: BaseRequestParamsSchema.loose().optional() -}); -const NotificationsParamsSchema = z.object({ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: RequestMetaSchema.optional() -}); -exports.NotificationSchema = z.object({ - method: z.string(), - params: NotificationsParamsSchema.loose().optional() -}); -exports.ResultSchema = z.looseObject({ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: RequestMetaSchema.optional() -}); -/** - * A uniquely identifying ID for a request in JSON-RPC. - */ -exports.RequestIdSchema = z.union([z.string(), z.number().int()]); -/** - * A request that expects a response. - */ -exports.JSONRPCRequestSchema = z - .object({ - jsonrpc: z.literal(exports.JSONRPC_VERSION), - id: exports.RequestIdSchema, - ...exports.RequestSchema.shape -}) - .strict(); -const isJSONRPCRequest = (value) => exports.JSONRPCRequestSchema.safeParse(value).success; -exports.isJSONRPCRequest = isJSONRPCRequest; -/** - * A notification which does not expect a response. - */ -exports.JSONRPCNotificationSchema = z - .object({ - jsonrpc: z.literal(exports.JSONRPC_VERSION), - ...exports.NotificationSchema.shape -}) - .strict(); -const isJSONRPCNotification = (value) => exports.JSONRPCNotificationSchema.safeParse(value).success; -exports.isJSONRPCNotification = isJSONRPCNotification; -/** - * A successful (non-error) response to a request. - */ -exports.JSONRPCResultResponseSchema = z - .object({ - jsonrpc: z.literal(exports.JSONRPC_VERSION), - id: exports.RequestIdSchema, - result: exports.ResultSchema -}) - .strict(); -/** - * Checks if a value is a valid JSONRPCResultResponse. - * @param value - The value to check. - * - * @returns True if the value is a valid JSONRPCResultResponse, false otherwise. - */ -const isJSONRPCResultResponse = (value) => exports.JSONRPCResultResponseSchema.safeParse(value).success; -exports.isJSONRPCResultResponse = isJSONRPCResultResponse; -/** - * @deprecated Use {@link isJSONRPCResultResponse} instead. - * - * Please note that {@link JSONRPCResponse} is a union of {@link JSONRPCResultResponse} and {@link JSONRPCErrorResponse} as per the updated JSON-RPC specification. (was previously just {@link JSONRPCResultResponse}) - */ -exports.isJSONRPCResponse = exports.isJSONRPCResultResponse; -/** - * Error codes defined by the JSON-RPC specification. - */ -var ErrorCode; -(function (ErrorCode) { - // SDK error codes - ErrorCode[ErrorCode["ConnectionClosed"] = -32000] = "ConnectionClosed"; - ErrorCode[ErrorCode["RequestTimeout"] = -32001] = "RequestTimeout"; - // Standard JSON-RPC error codes - ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError"; - ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest"; - ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound"; - ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams"; - ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError"; - // MCP-specific error codes - ErrorCode[ErrorCode["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired"; -})(ErrorCode || (exports.ErrorCode = ErrorCode = {})); -/** - * A response to a request that indicates an error occurred. - */ -exports.JSONRPCErrorResponseSchema = z - .object({ - jsonrpc: z.literal(exports.JSONRPC_VERSION), - id: exports.RequestIdSchema.optional(), - error: z.object({ - /** - * The error type that occurred. - */ - code: z.number().int(), - /** - * A short description of the error. The message SHOULD be limited to a concise single sentence. - */ - message: z.string(), - /** - * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). - */ - data: z.unknown().optional() - }) -}) - .strict(); -/** - * @deprecated Use {@link JSONRPCErrorResponseSchema} instead. - */ -exports.JSONRPCErrorSchema = exports.JSONRPCErrorResponseSchema; -/** - * Checks if a value is a valid JSONRPCErrorResponse. - * @param value - The value to check. - * - * @returns True if the value is a valid JSONRPCErrorResponse, false otherwise. - */ -const isJSONRPCErrorResponse = (value) => exports.JSONRPCErrorResponseSchema.safeParse(value).success; -exports.isJSONRPCErrorResponse = isJSONRPCErrorResponse; -/** - * @deprecated Use {@link isJSONRPCErrorResponse} instead. - */ -exports.isJSONRPCError = exports.isJSONRPCErrorResponse; -exports.JSONRPCMessageSchema = z.union([ - exports.JSONRPCRequestSchema, - exports.JSONRPCNotificationSchema, - exports.JSONRPCResultResponseSchema, - exports.JSONRPCErrorResponseSchema -]); -exports.JSONRPCResponseSchema = z.union([exports.JSONRPCResultResponseSchema, exports.JSONRPCErrorResponseSchema]); -/* Empty result */ -/** - * A response that indicates success but carries no data. - */ -exports.EmptyResultSchema = exports.ResultSchema.strict(); -exports.CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({ - /** - * The ID of the request to cancel. - * - * This MUST correspond to the ID of a request previously issued in the same direction. - */ - requestId: exports.RequestIdSchema.optional(), - /** - * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. - */ - reason: z.string().optional() -}); -/* Cancellation */ -/** - * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. - * - * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. - * - * This notification indicates that the result will be unused, so any associated processing SHOULD cease. - * - * A client MUST NOT attempt to cancel its `initialize` request. - */ -exports.CancelledNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/cancelled'), - params: exports.CancelledNotificationParamsSchema -}); -/* Base Metadata */ -/** - * Icon schema for use in tools, prompts, resources, and implementations. - */ -exports.IconSchema = z.object({ - /** - * URL or data URI for the icon. - */ - src: z.string(), - /** - * Optional MIME type for the icon. - */ - mimeType: z.string().optional(), - /** - * Optional array of strings that specify sizes at which the icon can be used. - * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG. - * - * If not provided, the client should assume that the icon can be used at any size. - */ - sizes: z.array(z.string()).optional(), - /** - * Optional specifier for the theme this icon is designed for. `light` indicates - * the icon is designed to be used with a light background, and `dark` indicates - * the icon is designed to be used with a dark background. - * - * If not provided, the client should assume the icon can be used with any theme. - */ - theme: z.enum(['light', 'dark']).optional() -}); -/** - * Base schema to add `icons` property. - * - */ -exports.IconsSchema = z.object({ - /** - * Optional set of sized icons that the client can display in a user interface. - * - * Clients that support rendering icons MUST support at least the following MIME types: - * - `image/png` - PNG images (safe, universal compatibility) - * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility) - * - * Clients that support rendering icons SHOULD also support: - * - `image/svg+xml` - SVG images (scalable but requires security precautions) - * - `image/webp` - WebP images (modern, efficient format) - */ - icons: z.array(exports.IconSchema).optional() -}); -/** - * Base metadata interface for common properties across resources, tools, prompts, and implementations. - */ -exports.BaseMetadataSchema = z.object({ - /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */ - name: z.string(), - /** - * Intended for UI and end-user contexts — optimized to be human-readable and easily understood, - * even by those unfamiliar with domain-specific terminology. - * - * If not provided, the name should be used for display (except for Tool, - * where `annotations.title` should be given precedence over using `name`, - * if present). - */ - title: z.string().optional() -}); -/* Initialization */ -/** - * Describes the name and version of an MCP implementation. - */ -exports.ImplementationSchema = exports.BaseMetadataSchema.extend({ - ...exports.BaseMetadataSchema.shape, - ...exports.IconsSchema.shape, - version: z.string(), - /** - * An optional URL of the website for this implementation. - */ - websiteUrl: z.string().optional(), - /** - * An optional human-readable description of what this implementation does. - * - * This can be used by clients or servers to provide context about their purpose - * and capabilities. For example, a server might describe the types of resources - * or tools it provides, while a client might describe its intended use case. - */ - description: z.string().optional() -}); -const FormElicitationCapabilitySchema = z.intersection(z.object({ - applyDefaults: z.boolean().optional() -}), z.record(z.string(), z.unknown())); -const ElicitationCapabilitySchema = z.preprocess(value => { - if (value && typeof value === 'object' && !Array.isArray(value)) { - if (Object.keys(value).length === 0) { - return { form: {} }; - } - } - return value; -}, z.intersection(z.object({ - form: FormElicitationCapabilitySchema.optional(), - url: AssertObjectSchema.optional() -}), z.record(z.string(), z.unknown()).optional())); -/** - * Task capabilities for clients, indicating which request types support task creation. - */ -exports.ClientTasksCapabilitySchema = z.looseObject({ - /** - * Present if the client supports listing tasks. - */ - list: AssertObjectSchema.optional(), - /** - * Present if the client supports cancelling tasks. - */ - cancel: AssertObjectSchema.optional(), - /** - * Capabilities for task creation on specific request types. - */ - requests: z - .looseObject({ - /** - * Task support for sampling requests. - */ - sampling: z - .looseObject({ - createMessage: AssertObjectSchema.optional() - }) - .optional(), - /** - * Task support for elicitation requests. - */ - elicitation: z - .looseObject({ - create: AssertObjectSchema.optional() - }) - .optional() - }) - .optional() -}); -/** - * Task capabilities for servers, indicating which request types support task creation. - */ -exports.ServerTasksCapabilitySchema = z.looseObject({ - /** - * Present if the server supports listing tasks. - */ - list: AssertObjectSchema.optional(), - /** - * Present if the server supports cancelling tasks. - */ - cancel: AssertObjectSchema.optional(), - /** - * Capabilities for task creation on specific request types. - */ - requests: z - .looseObject({ - /** - * Task support for tool requests. - */ - tools: z - .looseObject({ - call: AssertObjectSchema.optional() - }) - .optional() - }) - .optional() -}); -/** - * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. - */ -exports.ClientCapabilitiesSchema = z.object({ - /** - * Experimental, non-standard capabilities that the client supports. - */ - experimental: z.record(z.string(), AssertObjectSchema).optional(), - /** - * Present if the client supports sampling from an LLM. - */ - sampling: z - .object({ - /** - * Present if the client supports context inclusion via includeContext parameter. - * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it). - */ - context: AssertObjectSchema.optional(), - /** - * Present if the client supports tool use via tools and toolChoice parameters. - */ - tools: AssertObjectSchema.optional() - }) - .optional(), - /** - * Present if the client supports eliciting user input. - */ - elicitation: ElicitationCapabilitySchema.optional(), - /** - * Present if the client supports listing roots. - */ - roots: z - .object({ - /** - * Whether the client supports issuing notifications for changes to the roots list. - */ - listChanged: z.boolean().optional() - }) - .optional(), - /** - * Present if the client supports task creation. - */ - tasks: exports.ClientTasksCapabilitySchema.optional() -}); -exports.InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. - */ - protocolVersion: z.string(), - capabilities: exports.ClientCapabilitiesSchema, - clientInfo: exports.ImplementationSchema -}); -/** - * This request is sent from the client to the server when it first connects, asking it to begin initialization. - */ -exports.InitializeRequestSchema = exports.RequestSchema.extend({ - method: z.literal('initialize'), - params: exports.InitializeRequestParamsSchema -}); -const isInitializeRequest = (value) => exports.InitializeRequestSchema.safeParse(value).success; -exports.isInitializeRequest = isInitializeRequest; -/** - * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. - */ -exports.ServerCapabilitiesSchema = z.object({ - /** - * Experimental, non-standard capabilities that the server supports. - */ - experimental: z.record(z.string(), AssertObjectSchema).optional(), - /** - * Present if the server supports sending log messages to the client. - */ - logging: AssertObjectSchema.optional(), - /** - * Present if the server supports sending completions to the client. - */ - completions: AssertObjectSchema.optional(), - /** - * Present if the server offers any prompt templates. - */ - prompts: z - .object({ - /** - * Whether this server supports issuing notifications for changes to the prompt list. - */ - listChanged: z.boolean().optional() - }) - .optional(), - /** - * Present if the server offers any resources to read. - */ - resources: z - .object({ - /** - * Whether this server supports clients subscribing to resource updates. - */ - subscribe: z.boolean().optional(), - /** - * Whether this server supports issuing notifications for changes to the resource list. - */ - listChanged: z.boolean().optional() - }) - .optional(), - /** - * Present if the server offers any tools to call. - */ - tools: z - .object({ - /** - * Whether this server supports issuing notifications for changes to the tool list. - */ - listChanged: z.boolean().optional() - }) - .optional(), - /** - * Present if the server supports task creation. - */ - tasks: exports.ServerTasksCapabilitySchema.optional() -}); -/** - * After receiving an initialize request from the client, the server sends this response. - */ -exports.InitializeResultSchema = exports.ResultSchema.extend({ - /** - * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. - */ - protocolVersion: z.string(), - capabilities: exports.ServerCapabilitiesSchema, - serverInfo: exports.ImplementationSchema, - /** - * Instructions describing how to use the server and its features. - * - * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. - */ - instructions: z.string().optional() -}); -/** - * This notification is sent from the client to the server after initialization has finished. - */ -exports.InitializedNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/initialized'), - params: NotificationsParamsSchema.optional() -}); -const isInitializedNotification = (value) => exports.InitializedNotificationSchema.safeParse(value).success; -exports.isInitializedNotification = isInitializedNotification; -/* Ping */ -/** - * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. - */ -exports.PingRequestSchema = exports.RequestSchema.extend({ - method: z.literal('ping'), - params: BaseRequestParamsSchema.optional() -}); -/* Progress notifications */ -exports.ProgressSchema = z.object({ - /** - * The progress thus far. This should increase every time progress is made, even if the total is unknown. - */ - progress: z.number(), - /** - * Total number of items to process (or total progress required), if known. - */ - total: z.optional(z.number()), - /** - * An optional message describing the current progress. - */ - message: z.optional(z.string()) -}); -exports.ProgressNotificationParamsSchema = z.object({ - ...NotificationsParamsSchema.shape, - ...exports.ProgressSchema.shape, - /** - * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. - */ - progressToken: exports.ProgressTokenSchema -}); -/** - * An out-of-band notification used to inform the receiver of a progress update for a long-running request. - * - * @category notifications/progress - */ -exports.ProgressNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/progress'), - params: exports.ProgressNotificationParamsSchema -}); -exports.PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * An opaque token representing the current pagination position. - * If provided, the server should return results starting after this cursor. - */ - cursor: exports.CursorSchema.optional() -}); -/* Pagination */ -exports.PaginatedRequestSchema = exports.RequestSchema.extend({ - params: exports.PaginatedRequestParamsSchema.optional() -}); -exports.PaginatedResultSchema = exports.ResultSchema.extend({ - /** - * An opaque token representing the pagination position after the last returned result. - * If present, there may be more results available. - */ - nextCursor: exports.CursorSchema.optional() -}); -/** - * The status of a task. - * */ -exports.TaskStatusSchema = z.enum(['working', 'input_required', 'completed', 'failed', 'cancelled']); -/* Tasks */ -/** - * A pollable state object associated with a request. - */ -exports.TaskSchema = z.object({ - taskId: z.string(), - status: exports.TaskStatusSchema, - /** - * Time in milliseconds to keep task results available after completion. - * If null, the task has unlimited lifetime until manually cleaned up. - */ - ttl: z.union([z.number(), z.null()]), - /** - * ISO 8601 timestamp when the task was created. - */ - createdAt: z.string(), - /** - * ISO 8601 timestamp when the task was last updated. - */ - lastUpdatedAt: z.string(), - pollInterval: z.optional(z.number()), - /** - * Optional diagnostic message for failed tasks or other status information. - */ - statusMessage: z.optional(z.string()) -}); -/** - * Result returned when a task is created, containing the task data wrapped in a task field. - */ -exports.CreateTaskResultSchema = exports.ResultSchema.extend({ - task: exports.TaskSchema -}); -/** - * Parameters for task status notification. - */ -exports.TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(exports.TaskSchema); -/** - * A notification sent when a task's status changes. - */ -exports.TaskStatusNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/tasks/status'), - params: exports.TaskStatusNotificationParamsSchema -}); -/** - * A request to get the state of a specific task. - */ -exports.GetTaskRequestSchema = exports.RequestSchema.extend({ - method: z.literal('tasks/get'), - params: BaseRequestParamsSchema.extend({ - taskId: z.string() - }) -}); -/** - * The response to a tasks/get request. - */ -exports.GetTaskResultSchema = exports.ResultSchema.merge(exports.TaskSchema); -/** - * A request to get the result of a specific task. - */ -exports.GetTaskPayloadRequestSchema = exports.RequestSchema.extend({ - method: z.literal('tasks/result'), - params: BaseRequestParamsSchema.extend({ - taskId: z.string() - }) -}); -/** - * The response to a tasks/result request. - * The structure matches the result type of the original request. - * For example, a tools/call task would return the CallToolResult structure. - * - */ -exports.GetTaskPayloadResultSchema = exports.ResultSchema.loose(); -/** - * A request to list tasks. - */ -exports.ListTasksRequestSchema = exports.PaginatedRequestSchema.extend({ - method: z.literal('tasks/list') -}); -/** - * The response to a tasks/list request. - */ -exports.ListTasksResultSchema = exports.PaginatedResultSchema.extend({ - tasks: z.array(exports.TaskSchema) -}); -/** - * A request to cancel a specific task. - */ -exports.CancelTaskRequestSchema = exports.RequestSchema.extend({ - method: z.literal('tasks/cancel'), - params: BaseRequestParamsSchema.extend({ - taskId: z.string() - }) -}); -/** - * The response to a tasks/cancel request. - */ -exports.CancelTaskResultSchema = exports.ResultSchema.merge(exports.TaskSchema); -/* Resources */ -/** - * The contents of a specific resource or sub-resource. - */ -exports.ResourceContentsSchema = z.object({ - /** - * The URI of this resource. - */ - uri: z.string(), - /** - * The MIME type of this resource, if known. - */ - mimeType: z.optional(z.string()), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -exports.TextResourceContentsSchema = exports.ResourceContentsSchema.extend({ - /** - * The text of the item. This must only be set if the item can actually be represented as text (not binary data). - */ - text: z.string() -}); -/** - * A Zod schema for validating Base64 strings that is more performant and - * robust for very large inputs than the default regex-based check. It avoids - * stack overflows by using the native `atob` function for validation. - */ -const Base64Schema = z.string().refine(val => { - try { - // atob throws a DOMException if the string contains characters - // that are not part of the Base64 character set. - atob(val); - return true; - } - catch { - return false; - } -}, { message: 'Invalid Base64 string' }); -exports.BlobResourceContentsSchema = exports.ResourceContentsSchema.extend({ - /** - * A base64-encoded string representing the binary data of the item. - */ - blob: Base64Schema -}); -/** - * The sender or recipient of messages and data in a conversation. - */ -exports.RoleSchema = z.enum(['user', 'assistant']); -/** - * Optional annotations providing clients additional context about a resource. - */ -exports.AnnotationsSchema = z.object({ - /** - * Intended audience(s) for the resource. - */ - audience: z.array(exports.RoleSchema).optional(), - /** - * Importance hint for the resource, from 0 (least) to 1 (most). - */ - priority: z.number().min(0).max(1).optional(), - /** - * ISO 8601 timestamp for the most recent modification. - */ - lastModified: z.iso.datetime({ offset: true }).optional() -}); -/** - * A known resource that the server is capable of reading. - */ -exports.ResourceSchema = z.object({ - ...exports.BaseMetadataSchema.shape, - ...exports.IconsSchema.shape, - /** - * The URI of this resource. - */ - uri: z.string(), - /** - * A description of what this resource represents. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description: z.optional(z.string()), - /** - * The MIME type of this resource, if known. - */ - mimeType: z.optional(z.string()), - /** - * Optional annotations for the client. - */ - annotations: exports.AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.optional(z.looseObject({})) -}); -/** - * A template description for resources available on the server. - */ -exports.ResourceTemplateSchema = z.object({ - ...exports.BaseMetadataSchema.shape, - ...exports.IconsSchema.shape, - /** - * A URI template (according to RFC 6570) that can be used to construct resource URIs. - */ - uriTemplate: z.string(), - /** - * A description of what this template is for. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description: z.optional(z.string()), - /** - * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. - */ - mimeType: z.optional(z.string()), - /** - * Optional annotations for the client. - */ - annotations: exports.AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.optional(z.looseObject({})) -}); -/** - * Sent from the client to request a list of resources the server has. - */ -exports.ListResourcesRequestSchema = exports.PaginatedRequestSchema.extend({ - method: z.literal('resources/list') -}); -/** - * The server's response to a resources/list request from the client. - */ -exports.ListResourcesResultSchema = exports.PaginatedResultSchema.extend({ - resources: z.array(exports.ResourceSchema) -}); -/** - * Sent from the client to request a list of resource templates the server has. - */ -exports.ListResourceTemplatesRequestSchema = exports.PaginatedRequestSchema.extend({ - method: z.literal('resources/templates/list') -}); -/** - * The server's response to a resources/templates/list request from the client. - */ -exports.ListResourceTemplatesResultSchema = exports.PaginatedResultSchema.extend({ - resourceTemplates: z.array(exports.ResourceTemplateSchema) -}); -exports.ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. - * - * @format uri - */ - uri: z.string() -}); -/** - * Parameters for a `resources/read` request. - */ -exports.ReadResourceRequestParamsSchema = exports.ResourceRequestParamsSchema; -/** - * Sent from the client to the server, to read a specific resource URI. - */ -exports.ReadResourceRequestSchema = exports.RequestSchema.extend({ - method: z.literal('resources/read'), - params: exports.ReadResourceRequestParamsSchema -}); -/** - * The server's response to a resources/read request from the client. - */ -exports.ReadResourceResultSchema = exports.ResultSchema.extend({ - contents: z.array(z.union([exports.TextResourceContentsSchema, exports.BlobResourceContentsSchema])) -}); -/** - * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. - */ -exports.ResourceListChangedNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/resources/list_changed'), - params: NotificationsParamsSchema.optional() -}); -exports.SubscribeRequestParamsSchema = exports.ResourceRequestParamsSchema; -/** - * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. - */ -exports.SubscribeRequestSchema = exports.RequestSchema.extend({ - method: z.literal('resources/subscribe'), - params: exports.SubscribeRequestParamsSchema -}); -exports.UnsubscribeRequestParamsSchema = exports.ResourceRequestParamsSchema; -/** - * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. - */ -exports.UnsubscribeRequestSchema = exports.RequestSchema.extend({ - method: z.literal('resources/unsubscribe'), - params: exports.UnsubscribeRequestParamsSchema -}); -/** - * Parameters for a `notifications/resources/updated` notification. - */ -exports.ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({ - /** - * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. - */ - uri: z.string() -}); -/** - * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. - */ -exports.ResourceUpdatedNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/resources/updated'), - params: exports.ResourceUpdatedNotificationParamsSchema -}); -/* Prompts */ -/** - * Describes an argument that a prompt can accept. - */ -exports.PromptArgumentSchema = z.object({ - /** - * The name of the argument. - */ - name: z.string(), - /** - * A human-readable description of the argument. - */ - description: z.optional(z.string()), - /** - * Whether this argument must be provided. - */ - required: z.optional(z.boolean()) -}); -/** - * A prompt or prompt template that the server offers. - */ -exports.PromptSchema = z.object({ - ...exports.BaseMetadataSchema.shape, - ...exports.IconsSchema.shape, - /** - * An optional description of what this prompt provides - */ - description: z.optional(z.string()), - /** - * A list of arguments to use for templating the prompt. - */ - arguments: z.optional(z.array(exports.PromptArgumentSchema)), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.optional(z.looseObject({})) -}); -/** - * Sent from the client to request a list of prompts and prompt templates the server has. - */ -exports.ListPromptsRequestSchema = exports.PaginatedRequestSchema.extend({ - method: z.literal('prompts/list') -}); -/** - * The server's response to a prompts/list request from the client. - */ -exports.ListPromptsResultSchema = exports.PaginatedResultSchema.extend({ - prompts: z.array(exports.PromptSchema) -}); -/** - * Parameters for a `prompts/get` request. - */ -exports.GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * The name of the prompt or prompt template. - */ - name: z.string(), - /** - * Arguments to use for templating the prompt. - */ - arguments: z.record(z.string(), z.string()).optional() -}); -/** - * Used by the client to get a prompt provided by the server. - */ -exports.GetPromptRequestSchema = exports.RequestSchema.extend({ - method: z.literal('prompts/get'), - params: exports.GetPromptRequestParamsSchema -}); -/** - * Text provided to or from an LLM. - */ -exports.TextContentSchema = z.object({ - type: z.literal('text'), - /** - * The text content of the message. - */ - text: z.string(), - /** - * Optional annotations for the client. - */ - annotations: exports.AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * An image provided to or from an LLM. - */ -exports.ImageContentSchema = z.object({ - type: z.literal('image'), - /** - * The base64-encoded image data. - */ - data: Base64Schema, - /** - * The MIME type of the image. Different providers may support different image types. - */ - mimeType: z.string(), - /** - * Optional annotations for the client. - */ - annotations: exports.AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * An Audio provided to or from an LLM. - */ -exports.AudioContentSchema = z.object({ - type: z.literal('audio'), - /** - * The base64-encoded audio data. - */ - data: Base64Schema, - /** - * The MIME type of the audio. Different providers may support different audio types. - */ - mimeType: z.string(), - /** - * Optional annotations for the client. - */ - annotations: exports.AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * A tool call request from an assistant (LLM). - * Represents the assistant's request to use a tool. - */ -exports.ToolUseContentSchema = z.object({ - type: z.literal('tool_use'), - /** - * The name of the tool to invoke. - * Must match a tool name from the request's tools array. - */ - name: z.string(), - /** - * Unique identifier for this tool call. - * Used to correlate with ToolResultContent in subsequent messages. - */ - id: z.string(), - /** - * Arguments to pass to the tool. - * Must conform to the tool's inputSchema. - */ - input: z.record(z.string(), z.unknown()), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * The contents of a resource, embedded into a prompt or tool call result. - */ -exports.EmbeddedResourceSchema = z.object({ - type: z.literal('resource'), - resource: z.union([exports.TextResourceContentsSchema, exports.BlobResourceContentsSchema]), - /** - * Optional annotations for the client. - */ - annotations: exports.AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * A resource that the server is capable of reading, included in a prompt or tool call result. - * - * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. - */ -exports.ResourceLinkSchema = exports.ResourceSchema.extend({ - type: z.literal('resource_link') -}); -/** - * A content block that can be used in prompts and tool results. - */ -exports.ContentBlockSchema = z.union([ - exports.TextContentSchema, - exports.ImageContentSchema, - exports.AudioContentSchema, - exports.ResourceLinkSchema, - exports.EmbeddedResourceSchema -]); -/** - * Describes a message returned as part of a prompt. - */ -exports.PromptMessageSchema = z.object({ - role: exports.RoleSchema, - content: exports.ContentBlockSchema -}); -/** - * The server's response to a prompts/get request from the client. - */ -exports.GetPromptResultSchema = exports.ResultSchema.extend({ - /** - * An optional description for the prompt. - */ - description: z.string().optional(), - messages: z.array(exports.PromptMessageSchema) -}); -/** - * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. - */ -exports.PromptListChangedNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/prompts/list_changed'), - params: NotificationsParamsSchema.optional() -}); -/* Tools */ -/** - * Additional properties describing a Tool to clients. - * - * NOTE: all properties in ToolAnnotations are **hints**. - * They are not guaranteed to provide a faithful description of - * tool behavior (including descriptive properties like `title`). - * - * Clients should never make tool use decisions based on ToolAnnotations - * received from untrusted servers. - */ -exports.ToolAnnotationsSchema = z.object({ - /** - * A human-readable title for the tool. - */ - title: z.string().optional(), - /** - * If true, the tool does not modify its environment. - * - * Default: false - */ - readOnlyHint: z.boolean().optional(), - /** - * If true, the tool may perform destructive updates to its environment. - * If false, the tool performs only additive updates. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: true - */ - destructiveHint: z.boolean().optional(), - /** - * If true, calling the tool repeatedly with the same arguments - * will have no additional effect on the its environment. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: false - */ - idempotentHint: z.boolean().optional(), - /** - * If true, this tool may interact with an "open world" of external - * entities. If false, the tool's domain of interaction is closed. - * For example, the world of a web search tool is open, whereas that - * of a memory tool is not. - * - * Default: true - */ - openWorldHint: z.boolean().optional() -}); -/** - * Execution-related properties for a tool. - */ -exports.ToolExecutionSchema = z.object({ - /** - * Indicates the tool's preference for task-augmented execution. - * - "required": Clients MUST invoke the tool as a task - * - "optional": Clients MAY invoke the tool as a task or normal request - * - "forbidden": Clients MUST NOT attempt to invoke the tool as a task - * - * If not present, defaults to "forbidden". - */ - taskSupport: z.enum(['required', 'optional', 'forbidden']).optional() -}); -/** - * Definition for a tool the client can call. - */ -exports.ToolSchema = z.object({ - ...exports.BaseMetadataSchema.shape, - ...exports.IconsSchema.shape, - /** - * A human-readable description of the tool. - */ - description: z.string().optional(), - /** - * A JSON Schema 2020-12 object defining the expected parameters for the tool. - * Must have type: 'object' at the root level per MCP spec. - */ - inputSchema: z - .object({ - type: z.literal('object'), - properties: z.record(z.string(), AssertObjectSchema).optional(), - required: z.array(z.string()).optional() - }) - .catchall(z.unknown()), - /** - * An optional JSON Schema 2020-12 object defining the structure of the tool's output - * returned in the structuredContent field of a CallToolResult. - * Must have type: 'object' at the root level per MCP spec. - */ - outputSchema: z - .object({ - type: z.literal('object'), - properties: z.record(z.string(), AssertObjectSchema).optional(), - required: z.array(z.string()).optional() - }) - .catchall(z.unknown()) - .optional(), - /** - * Optional additional tool information. - */ - annotations: exports.ToolAnnotationsSchema.optional(), - /** - * Execution-related properties for this tool. - */ - execution: exports.ToolExecutionSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * Sent from the client to request a list of tools the server has. - */ -exports.ListToolsRequestSchema = exports.PaginatedRequestSchema.extend({ - method: z.literal('tools/list') -}); -/** - * The server's response to a tools/list request from the client. - */ -exports.ListToolsResultSchema = exports.PaginatedResultSchema.extend({ - tools: z.array(exports.ToolSchema) -}); -/** - * The server's response to a tool call. - */ -exports.CallToolResultSchema = exports.ResultSchema.extend({ - /** - * A list of content objects that represent the result of the tool call. - * - * If the Tool does not define an outputSchema, this field MUST be present in the result. - * For backwards compatibility, this field is always present, but it may be empty. - */ - content: z.array(exports.ContentBlockSchema).default([]), - /** - * An object containing structured tool output. - * - * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. - */ - structuredContent: z.record(z.string(), z.unknown()).optional(), - /** - * Whether the tool call ended in an error. - * - * If not set, this is assumed to be false (the call was successful). - * - * Any errors that originate from the tool SHOULD be reported inside the result - * object, with `isError` set to true, _not_ as an MCP protocol-level error - * response. Otherwise, the LLM would not be able to see that an error occurred - * and self-correct. - * - * However, any errors in _finding_ the tool, an error indicating that the - * server does not support tool calls, or any other exceptional conditions, - * should be reported as an MCP error response. - */ - isError: z.boolean().optional() -}); -/** - * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. - */ -exports.CompatibilityCallToolResultSchema = exports.CallToolResultSchema.or(exports.ResultSchema.extend({ - toolResult: z.unknown() -})); -/** - * Parameters for a `tools/call` request. - */ -exports.CallToolRequestParamsSchema = exports.TaskAugmentedRequestParamsSchema.extend({ - /** - * The name of the tool to call. - */ - name: z.string(), - /** - * Arguments to pass to the tool. - */ - arguments: z.record(z.string(), z.unknown()).optional() -}); -/** - * Used by the client to invoke a tool provided by the server. - */ -exports.CallToolRequestSchema = exports.RequestSchema.extend({ - method: z.literal('tools/call'), - params: exports.CallToolRequestParamsSchema -}); -/** - * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. - */ -exports.ToolListChangedNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/tools/list_changed'), - params: NotificationsParamsSchema.optional() -}); -/** - * Base schema for list changed subscription options (without callback). - * Used internally for Zod validation of autoRefresh and debounceMs. - */ -exports.ListChangedOptionsBaseSchema = z.object({ - /** - * If true, the list will be refreshed automatically when a list changed notification is received. - * The callback will be called with the updated list. - * - * If false, the callback will be called with null items, allowing manual refresh. - * - * @default true - */ - autoRefresh: z.boolean().default(true), - /** - * Debounce time in milliseconds for list changed notification processing. - * - * Multiple notifications received within this timeframe will only trigger one refresh. - * Set to 0 to disable debouncing. - * - * @default 300 - */ - debounceMs: z.number().int().nonnegative().default(300) -}); -/* Logging */ -/** - * The severity of a log message. - */ -exports.LoggingLevelSchema = z.enum(['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency']); -/** - * Parameters for a `logging/setLevel` request. - */ -exports.SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. - */ - level: exports.LoggingLevelSchema -}); -/** - * A request from the client to the server, to enable or adjust logging. - */ -exports.SetLevelRequestSchema = exports.RequestSchema.extend({ - method: z.literal('logging/setLevel'), - params: exports.SetLevelRequestParamsSchema -}); -/** - * Parameters for a `notifications/message` notification. - */ -exports.LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({ - /** - * The severity of this log message. - */ - level: exports.LoggingLevelSchema, - /** - * An optional name of the logger issuing this message. - */ - logger: z.string().optional(), - /** - * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. - */ - data: z.unknown() -}); -/** - * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. - */ -exports.LoggingMessageNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/message'), - params: exports.LoggingMessageNotificationParamsSchema -}); -/* Sampling */ -/** - * Hints to use for model selection. - */ -exports.ModelHintSchema = z.object({ - /** - * A hint for a model name. - */ - name: z.string().optional() -}); -/** - * The server's preferences for model selection, requested of the client during sampling. - */ -exports.ModelPreferencesSchema = z.object({ - /** - * Optional hints to use for model selection. - */ - hints: z.array(exports.ModelHintSchema).optional(), - /** - * How much to prioritize cost when selecting a model. - */ - costPriority: z.number().min(0).max(1).optional(), - /** - * How much to prioritize sampling speed (latency) when selecting a model. - */ - speedPriority: z.number().min(0).max(1).optional(), - /** - * How much to prioritize intelligence and capabilities when selecting a model. - */ - intelligencePriority: z.number().min(0).max(1).optional() -}); -/** - * Controls tool usage behavior in sampling requests. - */ -exports.ToolChoiceSchema = z.object({ - /** - * Controls when tools are used: - * - "auto": Model decides whether to use tools (default) - * - "required": Model MUST use at least one tool before completing - * - "none": Model MUST NOT use any tools - */ - mode: z.enum(['auto', 'required', 'none']).optional() -}); -/** - * The result of a tool execution, provided by the user (server). - * Represents the outcome of invoking a tool requested via ToolUseContent. - */ -exports.ToolResultContentSchema = z.object({ - type: z.literal('tool_result'), - toolUseId: z.string().describe('The unique identifier for the corresponding tool call.'), - content: z.array(exports.ContentBlockSchema).default([]), - structuredContent: z.object({}).loose().optional(), - isError: z.boolean().optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * Basic content types for sampling responses (without tool use). - * Used for backwards-compatible CreateMessageResult when tools are not used. - */ -exports.SamplingContentSchema = z.discriminatedUnion('type', [exports.TextContentSchema, exports.ImageContentSchema, exports.AudioContentSchema]); -/** - * Content block types allowed in sampling messages. - * This includes text, image, audio, tool use requests, and tool results. - */ -exports.SamplingMessageContentBlockSchema = z.discriminatedUnion('type', [ - exports.TextContentSchema, - exports.ImageContentSchema, - exports.AudioContentSchema, - exports.ToolUseContentSchema, - exports.ToolResultContentSchema -]); -/** - * Describes a message issued to or received from an LLM API. - */ -exports.SamplingMessageSchema = z.object({ - role: exports.RoleSchema, - content: z.union([exports.SamplingMessageContentBlockSchema, z.array(exports.SamplingMessageContentBlockSchema)]), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * Parameters for a `sampling/createMessage` request. - */ -exports.CreateMessageRequestParamsSchema = exports.TaskAugmentedRequestParamsSchema.extend({ - messages: z.array(exports.SamplingMessageSchema), - /** - * The server's preferences for which model to select. The client MAY modify or omit this request. - */ - modelPreferences: exports.ModelPreferencesSchema.optional(), - /** - * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. - */ - systemPrompt: z.string().optional(), - /** - * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. - * The client MAY ignore this request. - * - * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client - * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases. - */ - includeContext: z.enum(['none', 'thisServer', 'allServers']).optional(), - temperature: z.number().optional(), - /** - * The requested maximum number of tokens to sample (to prevent runaway completions). - * - * The client MAY choose to sample fewer tokens than the requested maximum. - */ - maxTokens: z.number().int(), - stopSequences: z.array(z.string()).optional(), - /** - * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. - */ - metadata: AssertObjectSchema.optional(), - /** - * Tools that the model may use during generation. - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. - */ - tools: z.array(exports.ToolSchema).optional(), - /** - * Controls how the model uses tools. - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. - * Default is `{ mode: "auto" }`. - */ - toolChoice: exports.ToolChoiceSchema.optional() -}); -/** - * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. - */ -exports.CreateMessageRequestSchema = exports.RequestSchema.extend({ - method: z.literal('sampling/createMessage'), - params: exports.CreateMessageRequestParamsSchema -}); -/** - * The client's response to a sampling/create_message request from the server. - * This is the backwards-compatible version that returns single content (no arrays). - * Used when the request does not include tools. - */ -exports.CreateMessageResultSchema = exports.ResultSchema.extend({ - /** - * The name of the model that generated the message. - */ - model: z.string(), - /** - * The reason why sampling stopped, if known. - * - * Standard values: - * - "endTurn": Natural end of the assistant's turn - * - "stopSequence": A stop sequence was encountered - * - "maxTokens": Maximum token limit was reached - * - * This field is an open string to allow for provider-specific stop reasons. - */ - stopReason: z.optional(z.enum(['endTurn', 'stopSequence', 'maxTokens']).or(z.string())), - role: exports.RoleSchema, - /** - * Response content. Single content block (text, image, or audio). - */ - content: exports.SamplingContentSchema -}); -/** - * The client's response to a sampling/create_message request when tools were provided. - * This version supports array content for tool use flows. - */ -exports.CreateMessageResultWithToolsSchema = exports.ResultSchema.extend({ - /** - * The name of the model that generated the message. - */ - model: z.string(), - /** - * The reason why sampling stopped, if known. - * - * Standard values: - * - "endTurn": Natural end of the assistant's turn - * - "stopSequence": A stop sequence was encountered - * - "maxTokens": Maximum token limit was reached - * - "toolUse": The model wants to use one or more tools - * - * This field is an open string to allow for provider-specific stop reasons. - */ - stopReason: z.optional(z.enum(['endTurn', 'stopSequence', 'maxTokens', 'toolUse']).or(z.string())), - role: exports.RoleSchema, - /** - * Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse". - */ - content: z.union([exports.SamplingMessageContentBlockSchema, z.array(exports.SamplingMessageContentBlockSchema)]) -}); -/* Elicitation */ -/** - * Primitive schema definition for boolean fields. - */ -exports.BooleanSchemaSchema = z.object({ - type: z.literal('boolean'), - title: z.string().optional(), - description: z.string().optional(), - default: z.boolean().optional() -}); -/** - * Primitive schema definition for string fields. - */ -exports.StringSchemaSchema = z.object({ - type: z.literal('string'), - title: z.string().optional(), - description: z.string().optional(), - minLength: z.number().optional(), - maxLength: z.number().optional(), - format: z.enum(['email', 'uri', 'date', 'date-time']).optional(), - default: z.string().optional() -}); -/** - * Primitive schema definition for number fields. - */ -exports.NumberSchemaSchema = z.object({ - type: z.enum(['number', 'integer']), - title: z.string().optional(), - description: z.string().optional(), - minimum: z.number().optional(), - maximum: z.number().optional(), - default: z.number().optional() -}); -/** - * Schema for single-selection enumeration without display titles for options. - */ -exports.UntitledSingleSelectEnumSchemaSchema = z.object({ - type: z.literal('string'), - title: z.string().optional(), - description: z.string().optional(), - enum: z.array(z.string()), - default: z.string().optional() -}); -/** - * Schema for single-selection enumeration with display titles for each option. - */ -exports.TitledSingleSelectEnumSchemaSchema = z.object({ - type: z.literal('string'), - title: z.string().optional(), - description: z.string().optional(), - oneOf: z.array(z.object({ - const: z.string(), - title: z.string() - })), - default: z.string().optional() -}); -/** - * Use TitledSingleSelectEnumSchema instead. - * This interface will be removed in a future version. - */ -exports.LegacyTitledEnumSchemaSchema = z.object({ - type: z.literal('string'), - title: z.string().optional(), - description: z.string().optional(), - enum: z.array(z.string()), - enumNames: z.array(z.string()).optional(), - default: z.string().optional() -}); -// Combined single selection enumeration -exports.SingleSelectEnumSchemaSchema = z.union([exports.UntitledSingleSelectEnumSchemaSchema, exports.TitledSingleSelectEnumSchemaSchema]); -/** - * Schema for multiple-selection enumeration without display titles for options. - */ -exports.UntitledMultiSelectEnumSchemaSchema = z.object({ - type: z.literal('array'), - title: z.string().optional(), - description: z.string().optional(), - minItems: z.number().optional(), - maxItems: z.number().optional(), - items: z.object({ - type: z.literal('string'), - enum: z.array(z.string()) - }), - default: z.array(z.string()).optional() -}); -/** - * Schema for multiple-selection enumeration with display titles for each option. - */ -exports.TitledMultiSelectEnumSchemaSchema = z.object({ - type: z.literal('array'), - title: z.string().optional(), - description: z.string().optional(), - minItems: z.number().optional(), - maxItems: z.number().optional(), - items: z.object({ - anyOf: z.array(z.object({ - const: z.string(), - title: z.string() - })) - }), - default: z.array(z.string()).optional() -}); -/** - * Combined schema for multiple-selection enumeration - */ -exports.MultiSelectEnumSchemaSchema = z.union([exports.UntitledMultiSelectEnumSchemaSchema, exports.TitledMultiSelectEnumSchemaSchema]); -/** - * Primitive schema definition for enum fields. - */ -exports.EnumSchemaSchema = z.union([exports.LegacyTitledEnumSchemaSchema, exports.SingleSelectEnumSchemaSchema, exports.MultiSelectEnumSchemaSchema]); -/** - * Union of all primitive schema definitions. - */ -exports.PrimitiveSchemaDefinitionSchema = z.union([exports.EnumSchemaSchema, exports.BooleanSchemaSchema, exports.StringSchemaSchema, exports.NumberSchemaSchema]); -/** - * Parameters for an `elicitation/create` request for form-based elicitation. - */ -exports.ElicitRequestFormParamsSchema = exports.TaskAugmentedRequestParamsSchema.extend({ - /** - * The elicitation mode. - * - * Optional for backward compatibility. Clients MUST treat missing mode as "form". - */ - mode: z.literal('form').optional(), - /** - * The message to present to the user describing what information is being requested. - */ - message: z.string(), - /** - * A restricted subset of JSON Schema. - * Only top-level properties are allowed, without nesting. - */ - requestedSchema: z.object({ - type: z.literal('object'), - properties: z.record(z.string(), exports.PrimitiveSchemaDefinitionSchema), - required: z.array(z.string()).optional() - }) -}); -/** - * Parameters for an `elicitation/create` request for URL-based elicitation. - */ -exports.ElicitRequestURLParamsSchema = exports.TaskAugmentedRequestParamsSchema.extend({ - /** - * The elicitation mode. - */ - mode: z.literal('url'), - /** - * The message to present to the user explaining why the interaction is needed. - */ - message: z.string(), - /** - * The ID of the elicitation, which must be unique within the context of the server. - * The client MUST treat this ID as an opaque value. - */ - elicitationId: z.string(), - /** - * The URL that the user should navigate to. - */ - url: z.string().url() -}); -/** - * The parameters for a request to elicit additional information from the user via the client. - */ -exports.ElicitRequestParamsSchema = z.union([exports.ElicitRequestFormParamsSchema, exports.ElicitRequestURLParamsSchema]); -/** - * A request from the server to elicit user input via the client. - * The client should present the message and form fields to the user (form mode) - * or navigate to a URL (URL mode). - */ -exports.ElicitRequestSchema = exports.RequestSchema.extend({ - method: z.literal('elicitation/create'), - params: exports.ElicitRequestParamsSchema -}); -/** - * Parameters for a `notifications/elicitation/complete` notification. - * - * @category notifications/elicitation/complete - */ -exports.ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({ - /** - * The ID of the elicitation that completed. - */ - elicitationId: z.string() -}); -/** - * A notification from the server to the client, informing it of a completion of an out-of-band elicitation request. - * - * @category notifications/elicitation/complete - */ -exports.ElicitationCompleteNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/elicitation/complete'), - params: exports.ElicitationCompleteNotificationParamsSchema -}); -/** - * The client's response to an elicitation/create request from the server. - */ -exports.ElicitResultSchema = exports.ResultSchema.extend({ - /** - * The user action in response to the elicitation. - * - "accept": User submitted the form/confirmed the action - * - "decline": User explicitly decline the action - * - "cancel": User dismissed without making an explicit choice - */ - action: z.enum(['accept', 'decline', 'cancel']), - /** - * The submitted form data, only present when action is "accept". - * Contains values matching the requested schema. - * Per MCP spec, content is "typically omitted" for decline/cancel actions. - * We normalize null to undefined for leniency while maintaining type compatibility. - */ - content: z.preprocess(val => (val === null ? undefined : val), z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])).optional()) -}); -/* Autocomplete */ -/** - * A reference to a resource or resource template definition. - */ -exports.ResourceTemplateReferenceSchema = z.object({ - type: z.literal('ref/resource'), - /** - * The URI or URI template of the resource. - */ - uri: z.string() -}); -/** - * @deprecated Use ResourceTemplateReferenceSchema instead - */ -exports.ResourceReferenceSchema = exports.ResourceTemplateReferenceSchema; -/** - * Identifies a prompt. - */ -exports.PromptReferenceSchema = z.object({ - type: z.literal('ref/prompt'), - /** - * The name of the prompt or prompt template - */ - name: z.string() -}); -/** - * Parameters for a `completion/complete` request. - */ -exports.CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({ - ref: z.union([exports.PromptReferenceSchema, exports.ResourceTemplateReferenceSchema]), - /** - * The argument's information - */ - argument: z.object({ - /** - * The name of the argument - */ - name: z.string(), - /** - * The value of the argument to use for completion matching. - */ - value: z.string() - }), - context: z - .object({ - /** - * Previously-resolved variables in a URI template or prompt. - */ - arguments: z.record(z.string(), z.string()).optional() - }) - .optional() -}); -/** - * A request from the client to the server, to ask for completion options. - */ -exports.CompleteRequestSchema = exports.RequestSchema.extend({ - method: z.literal('completion/complete'), - params: exports.CompleteRequestParamsSchema -}); -function assertCompleteRequestPrompt(request) { - if (request.params.ref.type !== 'ref/prompt') { - throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`); - } - void request; -} -function assertCompleteRequestResourceTemplate(request) { - if (request.params.ref.type !== 'ref/resource') { - throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`); - } - void request; -} -/** - * The server's response to a completion/complete request - */ -exports.CompleteResultSchema = exports.ResultSchema.extend({ - completion: z.looseObject({ - /** - * An array of completion values. Must not exceed 100 items. - */ - values: z.array(z.string()).max(100), - /** - * The total number of completion options available. This can exceed the number of values actually sent in the response. - */ - total: z.optional(z.number().int()), - /** - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. - */ - hasMore: z.optional(z.boolean()) - }) -}); -/* Roots */ -/** - * Represents a root directory or file that the server can operate on. - */ -exports.RootSchema = z.object({ - /** - * The URI identifying the root. This *must* start with file:// for now. - */ - uri: z.string().startsWith('file://'), - /** - * An optional name for the root. - */ - name: z.string().optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * Sent from the server to request a list of root URIs from the client. - */ -exports.ListRootsRequestSchema = exports.RequestSchema.extend({ - method: z.literal('roots/list'), - params: BaseRequestParamsSchema.optional() -}); -/** - * The client's response to a roots/list request from the server. - */ -exports.ListRootsResultSchema = exports.ResultSchema.extend({ - roots: z.array(exports.RootSchema) -}); -/** - * A notification from the client to the server, informing it that the list of roots has changed. - */ -exports.RootsListChangedNotificationSchema = exports.NotificationSchema.extend({ - method: z.literal('notifications/roots/list_changed'), - params: NotificationsParamsSchema.optional() -}); -/* Client messages */ -exports.ClientRequestSchema = z.union([ - exports.PingRequestSchema, - exports.InitializeRequestSchema, - exports.CompleteRequestSchema, - exports.SetLevelRequestSchema, - exports.GetPromptRequestSchema, - exports.ListPromptsRequestSchema, - exports.ListResourcesRequestSchema, - exports.ListResourceTemplatesRequestSchema, - exports.ReadResourceRequestSchema, - exports.SubscribeRequestSchema, - exports.UnsubscribeRequestSchema, - exports.CallToolRequestSchema, - exports.ListToolsRequestSchema, - exports.GetTaskRequestSchema, - exports.GetTaskPayloadRequestSchema, - exports.ListTasksRequestSchema, - exports.CancelTaskRequestSchema -]); -exports.ClientNotificationSchema = z.union([ - exports.CancelledNotificationSchema, - exports.ProgressNotificationSchema, - exports.InitializedNotificationSchema, - exports.RootsListChangedNotificationSchema, - exports.TaskStatusNotificationSchema -]); -exports.ClientResultSchema = z.union([ - exports.EmptyResultSchema, - exports.CreateMessageResultSchema, - exports.CreateMessageResultWithToolsSchema, - exports.ElicitResultSchema, - exports.ListRootsResultSchema, - exports.GetTaskResultSchema, - exports.ListTasksResultSchema, - exports.CreateTaskResultSchema -]); -/* Server messages */ -exports.ServerRequestSchema = z.union([ - exports.PingRequestSchema, - exports.CreateMessageRequestSchema, - exports.ElicitRequestSchema, - exports.ListRootsRequestSchema, - exports.GetTaskRequestSchema, - exports.GetTaskPayloadRequestSchema, - exports.ListTasksRequestSchema, - exports.CancelTaskRequestSchema -]); -exports.ServerNotificationSchema = z.union([ - exports.CancelledNotificationSchema, - exports.ProgressNotificationSchema, - exports.LoggingMessageNotificationSchema, - exports.ResourceUpdatedNotificationSchema, - exports.ResourceListChangedNotificationSchema, - exports.ToolListChangedNotificationSchema, - exports.PromptListChangedNotificationSchema, - exports.TaskStatusNotificationSchema, - exports.ElicitationCompleteNotificationSchema -]); -exports.ServerResultSchema = z.union([ - exports.EmptyResultSchema, - exports.InitializeResultSchema, - exports.CompleteResultSchema, - exports.GetPromptResultSchema, - exports.ListPromptsResultSchema, - exports.ListResourcesResultSchema, - exports.ListResourceTemplatesResultSchema, - exports.ReadResourceResultSchema, - exports.CallToolResultSchema, - exports.ListToolsResultSchema, - exports.GetTaskResultSchema, - exports.ListTasksResultSchema, - exports.CreateTaskResultSchema -]); -class McpError extends Error { - constructor(code, message, data) { - super(`MCP error ${code}: ${message}`); - this.code = code; - this.data = data; - this.name = 'McpError'; - } - /** - * Factory method to create the appropriate error type based on the error code and data - */ - static fromError(code, message, data) { - // Check for specific error types - if (code === ErrorCode.UrlElicitationRequired && data) { - const errorData = data; - if (errorData.elicitations) { - return new UrlElicitationRequiredError(errorData.elicitations, message); - } - } - // Default to generic McpError - return new McpError(code, message, data); - } -} -exports.McpError = McpError; -/** - * Specialized error type when a tool requires a URL mode elicitation. - * This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against. - */ -class UrlElicitationRequiredError extends McpError { - constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? 's' : ''} required`) { - super(ErrorCode.UrlElicitationRequired, message, { - elicitations: elicitations - }); - } - get elicitations() { - return this.data?.elicitations ?? []; - } -} -exports.UrlElicitationRequiredError = UrlElicitationRequiredError; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js.map deleted file mode 100644 index b0fe269..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAslEA,kEAKC;AAED,sFAKC;AAlmED,0CAA4B;AAGf,QAAA,uBAAuB,GAAG,YAAY,CAAC;AACvC,QAAA,mCAAmC,GAAG,YAAY,CAAC;AACnD,QAAA,2BAA2B,GAAG,CAAC,+BAAuB,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAEhH,QAAA,qBAAqB,GAAG,sCAAsC,CAAC;AAE5E,oBAAoB;AACP,QAAA,eAAe,GAAG,KAAK,CAAC;AAMrC;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAS,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC;AAClI;;GAEG;AACU,QAAA,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAE3E;;GAEG;AACU,QAAA,YAA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C,CAAC;YACvD,IAAI,SAAS,CAAC,YAAY,EAAE,CAAC;gBACzB,OAAO,IAAI,2BAA2B,CAAC,SAAS,CAAC,YAAwC,EAAE,OAAO,CAAC,CAAC;YACxG,CAAC;QACL,CAAC;QAED,8BAA8B;QAC9B,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;CACJ;AAzBD,4BAyBC;AAED;;;GAGG;AACH,MAAa,2BAA4B,SAAQ,QAAQ;IACrD,YAAY,YAAsC,EAAE,UAAkB,kBAAkB,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW;QACjI,KAAK,CAAC,SAAS,CAAC,sBAAsB,EAAE,OAAO,EAAE;YAC7C,YAAY,EAAE,YAAY;SAC7B,CAAC,CAAC;IACP,CAAC;IAED,IAAI,YAAY;QACZ,OAAQ,IAAI,CAAC,IAAmD,EAAE,YAAY,IAAI,EAAE,CAAC;IACzF,CAAC;CACJ;AAVD,kEAUC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.d.ts deleted file mode 100644 index 952ee68..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * AJV-based JSON Schema validator provider - */ -import Ajv from 'ajv'; -import type { JsonSchemaType, JsonSchemaValidator, jsonSchemaValidator } from './types.js'; -/** - * @example - * ```typescript - * // Use with default AJV instance (recommended) - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // Use with custom AJV instance - * import { Ajv } from 'ajv'; - * const ajv = new Ajv({ strict: true, allErrors: true }); - * const validator = new AjvJsonSchemaValidator(ajv); - * ``` - */ -export declare class AjvJsonSchemaValidator implements jsonSchemaValidator { - private _ajv; - /** - * Create an AJV validator - * - * @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created. - * - * @example - * ```typescript - * // Use default configuration (recommended for most cases) - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // Or provide custom AJV instance for advanced configuration - * import { Ajv } from 'ajv'; - * import addFormats from 'ajv-formats'; - * - * const ajv = new Ajv({ validateFormats: true }); - * addFormats(ajv); - * const validator = new AjvJsonSchemaValidator(ajv); - * ``` - */ - constructor(ajv?: Ajv); - /** - * Create a validator for the given JSON Schema - * - * The validator is compiled once and can be reused multiple times. - * If the schema has an $id, it will be cached by AJV automatically. - * - * @param schema - Standard JSON Schema object - * @returns A validator function that validates input data - */ - getValidator(schema: JsonSchemaType): JsonSchemaValidator; -} -//# sourceMappingURL=ajv-provider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.d.ts.map deleted file mode 100644 index 6704c4d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv-provider.d.ts","sourceRoot":"","sources":["../../../src/validation/ajv-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAA6B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAgBtH;;;;;;;;;;;;GAYG;AACH,qBAAa,sBAAuB,YAAW,mBAAmB;IAC9D,OAAO,CAAC,IAAI,CAAM;IAElB;;;;;;;;;;;;;;;;;;;OAmBG;gBACS,GAAG,CAAC,EAAE,GAAG;IAIrB;;;;;;;;OAQG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC;CAyBlE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js deleted file mode 100644 index a46f8c6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -/** - * AJV-based JSON Schema validator provider - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AjvJsonSchemaValidator = void 0; -const ajv_1 = __importDefault(require("ajv")); -const ajv_formats_1 = __importDefault(require("ajv-formats")); -function createDefaultAjvInstance() { - const ajv = new ajv_1.default({ - strict: false, - validateFormats: true, - validateSchema: false, - allErrors: true - }); - const addFormats = ajv_formats_1.default; - addFormats(ajv); - return ajv; -} -/** - * @example - * ```typescript - * // Use with default AJV instance (recommended) - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // Use with custom AJV instance - * import { Ajv } from 'ajv'; - * const ajv = new Ajv({ strict: true, allErrors: true }); - * const validator = new AjvJsonSchemaValidator(ajv); - * ``` - */ -class AjvJsonSchemaValidator { - /** - * Create an AJV validator - * - * @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created. - * - * @example - * ```typescript - * // Use default configuration (recommended for most cases) - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // Or provide custom AJV instance for advanced configuration - * import { Ajv } from 'ajv'; - * import addFormats from 'ajv-formats'; - * - * const ajv = new Ajv({ validateFormats: true }); - * addFormats(ajv); - * const validator = new AjvJsonSchemaValidator(ajv); - * ``` - */ - constructor(ajv) { - this._ajv = ajv ?? createDefaultAjvInstance(); - } - /** - * Create a validator for the given JSON Schema - * - * The validator is compiled once and can be reused multiple times. - * If the schema has an $id, it will be cached by AJV automatically. - * - * @param schema - Standard JSON Schema object - * @returns A validator function that validates input data - */ - getValidator(schema) { - // Check if schema has $id and is already compiled/cached - const ajvValidator = '$id' in schema && typeof schema.$id === 'string' - ? (this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema)) - : this._ajv.compile(schema); - return (input) => { - const valid = ajvValidator(input); - if (valid) { - return { - valid: true, - data: input, - errorMessage: undefined - }; - } - else { - return { - valid: false, - data: undefined, - errorMessage: this._ajv.errorsText(ajvValidator.errors) - }; - } - }; - } -} -exports.AjvJsonSchemaValidator = AjvJsonSchemaValidator; -//# sourceMappingURL=ajv-provider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js.map deleted file mode 100644 index 2405e7b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv-provider.js","sourceRoot":"","sources":["../../../src/validation/ajv-provider.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;AAEH,8CAAsB;AACtB,8DAAsC;AAGtC,SAAS,wBAAwB;IAC7B,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC;QAChB,MAAM,EAAE,KAAK;QACb,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,qBAAoD,CAAC;IACxE,UAAU,CAAC,GAAG,CAAC,CAAC;IAEhB,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAa,sBAAsB;IAG/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,GAAS;QACjB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,wBAAwB,EAAE,CAAC;IAClD,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAI,MAAsB;QAClC,yDAAyD;QACzD,MAAM,YAAY,GACd,KAAK,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YAC7C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAChE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEpC,OAAO,CAAC,KAAc,EAAgC,EAAE;YACpD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;YAElC,IAAI,KAAK,EAAE,CAAC;gBACR,OAAO;oBACH,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,KAAU;oBAChB,YAAY,EAAE,SAAS;iBAC1B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC;iBAC1D,CAAC;YACN,CAAC;QACL,CAAC,CAAC;IACN,CAAC;CACJ;AA7DD,wDA6DC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.d.ts deleted file mode 100644 index 89c244a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Cloudflare Worker-compatible JSON Schema validator provider - * - * This provider uses @cfworker/json-schema for validation without code generation, - * making it compatible with edge runtimes like Cloudflare Workers that restrict - * eval and new Function. - */ -import type { JsonSchemaType, JsonSchemaValidator, jsonSchemaValidator } from './types.js'; -/** - * JSON Schema draft version supported by @cfworker/json-schema - */ -export type CfWorkerSchemaDraft = '4' | '7' | '2019-09' | '2020-12'; -/** - * - * @example - * ```typescript - * // Use with default configuration (2020-12, shortcircuit) - * const validator = new CfWorkerJsonSchemaValidator(); - * - * // Use with custom configuration - * const validator = new CfWorkerJsonSchemaValidator({ - * draft: '2020-12', - * shortcircuit: false // Report all errors - * }); - * ``` - */ -export declare class CfWorkerJsonSchemaValidator implements jsonSchemaValidator { - private shortcircuit; - private draft; - /** - * Create a validator - * - * @param options - Configuration options - * @param options.shortcircuit - If true, stop validation after first error (default: true) - * @param options.draft - JSON Schema draft version to use (default: '2020-12') - */ - constructor(options?: { - shortcircuit?: boolean; - draft?: CfWorkerSchemaDraft; - }); - /** - * Create a validator for the given JSON Schema - * - * Unlike AJV, this validator is not cached internally - * - * @param schema - Standard JSON Schema object - * @returns A validator function that validates input data - */ - getValidator(schema: JsonSchemaType): JsonSchemaValidator; -} -//# sourceMappingURL=cfworker-provider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.d.ts.map deleted file mode 100644 index ce404d9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cfworker-provider.d.ts","sourceRoot":"","sources":["../../../src/validation/cfworker-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAA6B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;IACnE,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,KAAK,CAAsB;IAEnC;;;;;;OAMG;gBACS,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,mBAAmB,CAAA;KAAE;IAK7E;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC;CAsBlE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js deleted file mode 100644 index 91235b7..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -/** - * Cloudflare Worker-compatible JSON Schema validator provider - * - * This provider uses @cfworker/json-schema for validation without code generation, - * making it compatible with edge runtimes like Cloudflare Workers that restrict - * eval and new Function. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CfWorkerJsonSchemaValidator = void 0; -const json_schema_1 = require("@cfworker/json-schema"); -/** - * - * @example - * ```typescript - * // Use with default configuration (2020-12, shortcircuit) - * const validator = new CfWorkerJsonSchemaValidator(); - * - * // Use with custom configuration - * const validator = new CfWorkerJsonSchemaValidator({ - * draft: '2020-12', - * shortcircuit: false // Report all errors - * }); - * ``` - */ -class CfWorkerJsonSchemaValidator { - /** - * Create a validator - * - * @param options - Configuration options - * @param options.shortcircuit - If true, stop validation after first error (default: true) - * @param options.draft - JSON Schema draft version to use (default: '2020-12') - */ - constructor(options) { - this.shortcircuit = options?.shortcircuit ?? true; - this.draft = options?.draft ?? '2020-12'; - } - /** - * Create a validator for the given JSON Schema - * - * Unlike AJV, this validator is not cached internally - * - * @param schema - Standard JSON Schema object - * @returns A validator function that validates input data - */ - getValidator(schema) { - // Cast to the cfworker Schema type - our JsonSchemaType is structurally compatible - const validator = new json_schema_1.Validator(schema, this.draft, this.shortcircuit); - return (input) => { - const result = validator.validate(input); - if (result.valid) { - return { - valid: true, - data: input, - errorMessage: undefined - }; - } - else { - return { - valid: false, - data: undefined, - errorMessage: result.errors.map(err => `${err.instanceLocation}: ${err.error}`).join('; ') - }; - } - }; - } -} -exports.CfWorkerJsonSchemaValidator = CfWorkerJsonSchemaValidator; -//# sourceMappingURL=cfworker-provider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js.map deleted file mode 100644 index 88492c6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cfworker-provider.js","sourceRoot":"","sources":["../../../src/validation/cfworker-provider.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,uDAAkD;AAQlD;;;;;;;;;;;;;GAaG;AACH,MAAa,2BAA2B;IAIpC;;;;;;OAMG;IACH,YAAY,OAAiE;QACzE,IAAI,CAAC,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,IAAI,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,SAAS,CAAC;IAC7C,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAI,MAAsB;QAClC,mFAAmF;QACnF,MAAM,SAAS,GAAG,IAAI,uBAAS,CAAC,MAAoD,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAErH,OAAO,CAAC,KAAc,EAAgC,EAAE;YACpD,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEzC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO;oBACH,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,KAAU;oBAChB,YAAY,EAAE,SAAS;iBAC1B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,gBAAgB,KAAK,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC7F,CAAC;YACN,CAAC;QACL,CAAC,CAAC;IACN,CAAC;CACJ;AA9CD,kEA8CC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts deleted file mode 100644 index 99e9939..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * JSON Schema validation - * - * This module provides configurable JSON Schema validation for the MCP SDK. - * Choose a validator based on your runtime environment: - * - * - AjvJsonSchemaValidator: Best for Node.js (default, fastest) - * Import from: @modelcontextprotocol/sdk/validation/ajv - * Requires peer dependencies: ajv, ajv-formats - * - * - CfWorkerJsonSchemaValidator: Best for edge runtimes - * Import from: @modelcontextprotocol/sdk/validation/cfworker - * Requires peer dependency: @cfworker/json-schema - * - * @example - * ```typescript - * // For Node.js with AJV - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // For Cloudflare Workers - * import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/cfworker'; - * const validator = new CfWorkerJsonSchemaValidator(); - * ``` - * - * @module validation - */ -export type { JsonSchemaType, JsonSchemaValidator, JsonSchemaValidatorResult, jsonSchemaValidator } from './types.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts.map deleted file mode 100644 index a8845b9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js deleted file mode 100644 index c8be925..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * JSON Schema validation - * - * This module provides configurable JSON Schema validation for the MCP SDK. - * Choose a validator based on your runtime environment: - * - * - AjvJsonSchemaValidator: Best for Node.js (default, fastest) - * Import from: @modelcontextprotocol/sdk/validation/ajv - * Requires peer dependencies: ajv, ajv-formats - * - * - CfWorkerJsonSchemaValidator: Best for edge runtimes - * Import from: @modelcontextprotocol/sdk/validation/cfworker - * Requires peer dependency: @cfworker/json-schema - * - * @example - * ```typescript - * // For Node.js with AJV - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // For Cloudflare Workers - * import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/cfworker'; - * const validator = new CfWorkerJsonSchemaValidator(); - * ``` - * - * @module validation - */ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js.map deleted file mode 100644 index 1d5874d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts deleted file mode 100644 index 9fa9222..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { JSONSchema } from 'json-schema-typed'; -/** - * JSON Schema type definition (JSON Schema Draft 2020-12) - * - * This uses the object form of JSON Schema (excluding boolean schemas). - * While `true` and `false` are valid JSON Schemas, this SDK uses the - * object form for practical type safety. - * - * Re-exported from json-schema-typed for convenience. - * @see https://json-schema.org/draft/2020-12/json-schema-core.html - */ -export type JsonSchemaType = JSONSchema.Interface; -/** - * Result of a JSON Schema validation operation - */ -export type JsonSchemaValidatorResult = { - valid: true; - data: T; - errorMessage: undefined; -} | { - valid: false; - data: undefined; - errorMessage: string; -}; -/** - * A validator function that validates data against a JSON Schema - */ -export type JsonSchemaValidator = (input: unknown) => JsonSchemaValidatorResult; -/** - * Provider interface for creating validators from JSON Schemas - * - * This is the main extension point for custom validator implementations. - * Implementations should: - * - Support JSON Schema Draft 2020-12 (or be compatible with it) - * - Return validator functions that can be called multiple times - * - Handle schema compilation/caching internally - * - Provide clear error messages on validation failure - * - * @example - * ```typescript - * class MyValidatorProvider implements jsonSchemaValidator { - * getValidator(schema: JsonSchemaType): JsonSchemaValidator { - * // Compile/cache validator from schema - * return (input: unknown) => { - * // Validate input against schema - * if (valid) { - * return { valid: true, data: input as T, errorMessage: undefined }; - * } else { - * return { valid: false, data: undefined, errorMessage: 'Error details' }; - * } - * }; - * } - * } - * ``` - */ -export interface jsonSchemaValidator { - /** - * Create a validator for the given JSON Schema - * - * @param schema - Standard JSON Schema object - * @returns A validator function that can be called multiple times - */ - getValidator(schema: JsonSchemaType): JsonSchemaValidator; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts.map deleted file mode 100644 index 52aa0ef..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/validation/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IACjC;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC;IAAC,YAAY,EAAE,SAAS,CAAA;CAAE,GACjD;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;;OAKG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;CACnE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js deleted file mode 100644 index 11e638d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js.map deleted file mode 100644 index 51361cf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/validation/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts deleted file mode 100644 index 363697d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts +++ /dev/null @@ -1,190 +0,0 @@ -/** - * OAuth provider extensions for specialized authentication flows. - * - * This module provides ready-to-use OAuthClientProvider implementations - * for common machine-to-machine authentication scenarios. - */ -import { OAuthClientInformation, OAuthClientMetadata, OAuthTokens } from '../shared/auth.js'; -import { AddClientAuthentication, OAuthClientProvider } from './auth.js'; -/** - * Helper to produce a private_key_jwt client authentication function. - * - * Usage: - * const addClientAuth = createPrivateKeyJwtAuth({ issuer, subject, privateKey, alg, audience? }); - * // pass addClientAuth as provider.addClientAuthentication implementation - */ -export declare function createPrivateKeyJwtAuth(options: { - issuer: string; - subject: string; - privateKey: string | Uint8Array | Record; - alg: string; - audience?: string | URL; - lifetimeSeconds?: number; - claims?: Record; -}): AddClientAuthentication; -/** - * Options for creating a ClientCredentialsProvider. - */ -export interface ClientCredentialsProviderOptions { - /** - * The client_id for this OAuth client. - */ - clientId: string; - /** - * The client_secret for client_secret_basic authentication. - */ - clientSecret: string; - /** - * Optional client name for metadata. - */ - clientName?: string; - /** - * Space-separated scopes values requested by the client. - */ - scope?: string; -} -/** - * OAuth provider for client_credentials grant with client_secret_basic authentication. - * - * This provider is designed for machine-to-machine authentication where - * the client authenticates using a client_id and client_secret. - * - * @example - * const provider = new ClientCredentialsProvider({ - * clientId: 'my-client', - * clientSecret: 'my-secret' - * }); - * - * const transport = new StreamableHTTPClientTransport(serverUrl, { - * authProvider: provider - * }); - */ -export declare class ClientCredentialsProvider implements OAuthClientProvider { - private _tokens?; - private _clientInfo; - private _clientMetadata; - constructor(options: ClientCredentialsProviderOptions); - get redirectUrl(): undefined; - get clientMetadata(): OAuthClientMetadata; - clientInformation(): OAuthClientInformation; - saveClientInformation(info: OAuthClientInformation): void; - tokens(): OAuthTokens | undefined; - saveTokens(tokens: OAuthTokens): void; - redirectToAuthorization(): void; - saveCodeVerifier(): void; - codeVerifier(): string; - prepareTokenRequest(scope?: string): URLSearchParams; -} -/** - * Options for creating a PrivateKeyJwtProvider. - */ -export interface PrivateKeyJwtProviderOptions { - /** - * The client_id for this OAuth client. - */ - clientId: string; - /** - * The private key for signing JWT assertions. - * Can be a PEM string, Uint8Array, or JWK object. - */ - privateKey: string | Uint8Array | Record; - /** - * The algorithm to use for signing (e.g., 'RS256', 'ES256'). - */ - algorithm: string; - /** - * Optional client name for metadata. - */ - clientName?: string; - /** - * Optional JWT lifetime in seconds (default: 300). - */ - jwtLifetimeSeconds?: number; - /** - * Space-separated scopes values requested by the client. - */ - scope?: string; -} -/** - * OAuth provider for client_credentials grant with private_key_jwt authentication. - * - * This provider is designed for machine-to-machine authentication where - * the client authenticates using a signed JWT assertion (RFC 7523 Section 2.2). - * - * @example - * const provider = new PrivateKeyJwtProvider({ - * clientId: 'my-client', - * privateKey: pemEncodedPrivateKey, - * algorithm: 'RS256' - * }); - * - * const transport = new StreamableHTTPClientTransport(serverUrl, { - * authProvider: provider - * }); - */ -export declare class PrivateKeyJwtProvider implements OAuthClientProvider { - private _tokens?; - private _clientInfo; - private _clientMetadata; - addClientAuthentication: AddClientAuthentication; - constructor(options: PrivateKeyJwtProviderOptions); - get redirectUrl(): undefined; - get clientMetadata(): OAuthClientMetadata; - clientInformation(): OAuthClientInformation; - saveClientInformation(info: OAuthClientInformation): void; - tokens(): OAuthTokens | undefined; - saveTokens(tokens: OAuthTokens): void; - redirectToAuthorization(): void; - saveCodeVerifier(): void; - codeVerifier(): string; - prepareTokenRequest(scope?: string): URLSearchParams; -} -/** - * Options for creating a StaticPrivateKeyJwtProvider. - */ -export interface StaticPrivateKeyJwtProviderOptions { - /** - * The client_id for this OAuth client. - */ - clientId: string; - /** - * A pre-built JWT client assertion to use for authentication. - * - * This token should already contain the appropriate claims - * (iss, sub, aud, exp, etc.) and be signed by the client's key. - */ - jwtBearerAssertion: string; - /** - * Optional client name for metadata. - */ - clientName?: string; - /** - * Space-separated scopes values requested by the client. - */ - scope?: string; -} -/** - * OAuth provider for client_credentials grant with a static private_key_jwt assertion. - * - * This provider mirrors {@link PrivateKeyJwtProvider} but instead of constructing and - * signing a JWT on each request, it accepts a pre-built JWT assertion string and - * uses it directly for authentication. - */ -export declare class StaticPrivateKeyJwtProvider implements OAuthClientProvider { - private _tokens?; - private _clientInfo; - private _clientMetadata; - addClientAuthentication: AddClientAuthentication; - constructor(options: StaticPrivateKeyJwtProviderOptions); - get redirectUrl(): undefined; - get clientMetadata(): OAuthClientMetadata; - clientInformation(): OAuthClientInformation; - saveClientInformation(info: OAuthClientInformation): void; - tokens(): OAuthTokens | undefined; - saveTokens(tokens: OAuthTokens): void; - redirectToAuthorization(): void; - saveCodeVerifier(): void; - codeVerifier(): string; - prepareTokenRequest(scope?: string): URLSearchParams; -} -//# sourceMappingURL=auth-extensions.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts.map deleted file mode 100644 index 7945c0c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth-extensions.d.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AAW,kCAAkC;IAC/C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;IACnE,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,eAAe,CAAsB;IAC7C,uBAAuB,EAAE,uBAAuB,CAAC;gBAErC,OAAO,EAAE,kCAAkC;IAmBvD,IAAI,WAAW,IAAI,SAAS,CAE3B;IAED,IAAI,cAAc,IAAI,mBAAmB,CAExC;IAED,iBAAiB,IAAI,sBAAsB;IAI3C,qBAAqB,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI;IAIzD,MAAM,IAAI,WAAW,GAAG,SAAS;IAIjC,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAIrC,uBAAuB,IAAI,IAAI;IAI/B,gBAAgB,IAAI,IAAI;IAIxB,YAAY,IAAI,MAAM;IAItB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe;CAKvD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js deleted file mode 100644 index ae0dfe6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js +++ /dev/null @@ -1,269 +0,0 @@ -/** - * OAuth provider extensions for specialized authentication flows. - * - * This module provides ready-to-use OAuthClientProvider implementations - * for common machine-to-machine authentication scenarios. - */ -/** - * Helper to produce a private_key_jwt client authentication function. - * - * Usage: - * const addClientAuth = createPrivateKeyJwtAuth({ issuer, subject, privateKey, alg, audience? }); - * // pass addClientAuth as provider.addClientAuthentication implementation - */ -export function createPrivateKeyJwtAuth(options) { - return async (_headers, params, url, metadata) => { - // Lazy import to avoid heavy dependency unless used - if (typeof globalThis.crypto === 'undefined') { - throw new TypeError('crypto is not available, please ensure you add have Web Crypto API support for older Node.js versions (see https://github.com/modelcontextprotocol/typescript-sdk#nodejs-web-crypto-globalthiscrypto-compatibility)'); - } - const jose = await import('jose'); - const audience = String(options.audience ?? metadata?.issuer ?? url); - const lifetimeSeconds = options.lifetimeSeconds ?? 300; - const now = Math.floor(Date.now() / 1000); - const jti = `${Date.now()}-${Math.random().toString(36).slice(2)}`; - const baseClaims = { - iss: options.issuer, - sub: options.subject, - aud: audience, - exp: now + lifetimeSeconds, - iat: now, - jti - }; - const claims = options.claims ? { ...baseClaims, ...options.claims } : baseClaims; - // Import key for the requested algorithm - const alg = options.alg; - let key; - if (typeof options.privateKey === 'string') { - if (alg.startsWith('RS') || alg.startsWith('ES') || alg.startsWith('PS')) { - key = await jose.importPKCS8(options.privateKey, alg); - } - else if (alg.startsWith('HS')) { - key = new TextEncoder().encode(options.privateKey); - } - else { - throw new Error(`Unsupported algorithm ${alg}`); - } - } - else if (options.privateKey instanceof Uint8Array) { - if (alg.startsWith('HS')) { - key = options.privateKey; - } - else { - // Assume PKCS#8 DER in Uint8Array for asymmetric algorithms - key = await jose.importPKCS8(new TextDecoder().decode(options.privateKey), alg); - } - } - else { - // Treat as JWK - key = await jose.importJWK(options.privateKey, alg); - } - // Sign JWT - const assertion = await new jose.SignJWT(claims) - .setProtectedHeader({ alg, typ: 'JWT' }) - .setIssuer(options.issuer) - .setSubject(options.subject) - .setAudience(audience) - .setIssuedAt(now) - .setExpirationTime(now + lifetimeSeconds) - .setJti(jti) - .sign(key); - params.set('client_assertion', assertion); - params.set('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'); - }; -} -/** - * OAuth provider for client_credentials grant with client_secret_basic authentication. - * - * This provider is designed for machine-to-machine authentication where - * the client authenticates using a client_id and client_secret. - * - * @example - * const provider = new ClientCredentialsProvider({ - * clientId: 'my-client', - * clientSecret: 'my-secret' - * }); - * - * const transport = new StreamableHTTPClientTransport(serverUrl, { - * authProvider: provider - * }); - */ -export class ClientCredentialsProvider { - constructor(options) { - this._clientInfo = { - client_id: options.clientId, - client_secret: options.clientSecret - }; - this._clientMetadata = { - client_name: options.clientName ?? 'client-credentials-client', - redirect_uris: [], - grant_types: ['client_credentials'], - token_endpoint_auth_method: 'client_secret_basic', - scope: options.scope - }; - } - get redirectUrl() { - return undefined; - } - get clientMetadata() { - return this._clientMetadata; - } - clientInformation() { - return this._clientInfo; - } - saveClientInformation(info) { - this._clientInfo = info; - } - tokens() { - return this._tokens; - } - saveTokens(tokens) { - this._tokens = tokens; - } - redirectToAuthorization() { - throw new Error('redirectToAuthorization is not used for client_credentials flow'); - } - saveCodeVerifier() { - // Not used for client_credentials - } - codeVerifier() { - throw new Error('codeVerifier is not used for client_credentials flow'); - } - prepareTokenRequest(scope) { - const params = new URLSearchParams({ grant_type: 'client_credentials' }); - if (scope) - params.set('scope', scope); - return params; - } -} -/** - * OAuth provider for client_credentials grant with private_key_jwt authentication. - * - * This provider is designed for machine-to-machine authentication where - * the client authenticates using a signed JWT assertion (RFC 7523 Section 2.2). - * - * @example - * const provider = new PrivateKeyJwtProvider({ - * clientId: 'my-client', - * privateKey: pemEncodedPrivateKey, - * algorithm: 'RS256' - * }); - * - * const transport = new StreamableHTTPClientTransport(serverUrl, { - * authProvider: provider - * }); - */ -export class PrivateKeyJwtProvider { - constructor(options) { - this._clientInfo = { - client_id: options.clientId - }; - this._clientMetadata = { - client_name: options.clientName ?? 'private-key-jwt-client', - redirect_uris: [], - grant_types: ['client_credentials'], - token_endpoint_auth_method: 'private_key_jwt', - scope: options.scope - }; - this.addClientAuthentication = createPrivateKeyJwtAuth({ - issuer: options.clientId, - subject: options.clientId, - privateKey: options.privateKey, - alg: options.algorithm, - lifetimeSeconds: options.jwtLifetimeSeconds - }); - } - get redirectUrl() { - return undefined; - } - get clientMetadata() { - return this._clientMetadata; - } - clientInformation() { - return this._clientInfo; - } - saveClientInformation(info) { - this._clientInfo = info; - } - tokens() { - return this._tokens; - } - saveTokens(tokens) { - this._tokens = tokens; - } - redirectToAuthorization() { - throw new Error('redirectToAuthorization is not used for client_credentials flow'); - } - saveCodeVerifier() { - // Not used for client_credentials - } - codeVerifier() { - throw new Error('codeVerifier is not used for client_credentials flow'); - } - prepareTokenRequest(scope) { - const params = new URLSearchParams({ grant_type: 'client_credentials' }); - if (scope) - params.set('scope', scope); - return params; - } -} -/** - * OAuth provider for client_credentials grant with a static private_key_jwt assertion. - * - * This provider mirrors {@link PrivateKeyJwtProvider} but instead of constructing and - * signing a JWT on each request, it accepts a pre-built JWT assertion string and - * uses it directly for authentication. - */ -export class StaticPrivateKeyJwtProvider { - constructor(options) { - this._clientInfo = { - client_id: options.clientId - }; - this._clientMetadata = { - client_name: options.clientName ?? 'static-private-key-jwt-client', - redirect_uris: [], - grant_types: ['client_credentials'], - token_endpoint_auth_method: 'private_key_jwt', - scope: options.scope - }; - const assertion = options.jwtBearerAssertion; - this.addClientAuthentication = async (_headers, params) => { - params.set('client_assertion', assertion); - params.set('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'); - }; - } - get redirectUrl() { - return undefined; - } - get clientMetadata() { - return this._clientMetadata; - } - clientInformation() { - return this._clientInfo; - } - saveClientInformation(info) { - this._clientInfo = info; - } - tokens() { - return this._tokens; - } - saveTokens(tokens) { - this._tokens = tokens; - } - redirectToAuthorization() { - throw new Error('redirectToAuthorization is not used for client_credentials flow'); - } - saveCodeVerifier() { - // Not used for client_credentials - } - codeVerifier() { - throw new Error('codeVerifier is not used for client_credentials flow'); - } - prepareTokenRequest(scope) { - const params = new URLSearchParams({ grant_type: 'client_credentials' }); - if (scope) - params.set('scope', scope); - return params; - } -} -//# sourceMappingURL=auth-extensions.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js.map deleted file mode 100644 index c31b138..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth-extensions.js","sourceRoot":"","sources":["../../../src/client/auth-extensions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAQvC;IACG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;QAC7C,oDAAoD;QACpD,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YAC3C,MAAM,IAAI,SAAS,CACf,qNAAqN,CACxN,CAAC;QACN,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;QAElC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,EAAE,MAAM,IAAI,GAAG,CAAC,CAAC;QACrE,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,GAAG,CAAC;QAEvD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnE,MAAM,UAAU,GAAG;YACf,GAAG,EAAE,OAAO,CAAC,MAAM;YACnB,GAAG,EAAE,OAAO,CAAC,OAAO;YACpB,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,GAAG,GAAG,eAAe;YAC1B,GAAG,EAAE,GAAG;YACR,GAAG;SACN,CAAC;QACF,MAAM,MAAM,GAAG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AO,CAAC,kBAAkB,CAAC;QAC7C,IAAI,CAAC,uBAAuB,GAAG,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;YACtD,MAAM,CAAC,GAAG,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;YAC1C,MAAM,CAAC,GAAG,CAAC,uBAAuB,EAAE,wDAAwD,CAAC,CAAC;QAClG,CAAC,CAAC;IACN,CAAC;IAED,IAAI,WAAW;QACX,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,qBAAqB,CAAC,IAA4B;QAC9C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,UAAU,CAAC,MAAmB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,uBAAuB;QACnB,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACvF,CAAC;IAED,gBAAgB;QACZ,kCAAkC;IACtC,CAAC;IAED,YAAY;QACR,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC5E,CAAC;IAED,mBAAmB,CAAC,KAAc;QAC9B,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC,CAAC;QACzE,IAAI,KAAK;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts deleted file mode 100644 index c1405d6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts +++ /dev/null @@ -1,368 +0,0 @@ -import { OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens, OAuthMetadata, OAuthClientInformationFull, OAuthProtectedResourceMetadata, AuthorizationServerMetadata } from '../shared/auth.js'; -import { OAuthError } from '../server/auth/errors.js'; -import { FetchLike } from '../shared/transport.js'; -/** - * Function type for adding client authentication to token requests. - */ -export type AddClientAuthentication = (headers: Headers, params: URLSearchParams, url: string | URL, metadata?: AuthorizationServerMetadata) => void | Promise; -/** - * Implements an end-to-end OAuth client to be used with one MCP server. - * - * This client relies upon a concept of an authorized "session," the exact - * meaning of which is application-defined. Tokens, authorization codes, and - * code verifiers should not cross different sessions. - */ -export interface OAuthClientProvider { - /** - * The URL to redirect the user agent to after authorization. - * Return undefined for non-interactive flows that don't require user interaction - * (e.g., client_credentials, jwt-bearer). - */ - get redirectUrl(): string | URL | undefined; - /** - * External URL the server should use to fetch client metadata document - */ - clientMetadataUrl?: string; - /** - * Metadata about this OAuth client. - */ - get clientMetadata(): OAuthClientMetadata; - /** - * Returns a OAuth2 state parameter. - */ - state?(): string | Promise; - /** - * Loads information about this OAuth client, as registered already with the - * server, or returns `undefined` if the client is not registered with the - * server. - */ - clientInformation(): OAuthClientInformationMixed | undefined | Promise; - /** - * If implemented, this permits the OAuth client to dynamically register with - * the server. Client information saved this way should later be read via - * `clientInformation()`. - * - * This method is not required to be implemented if client information is - * statically known (e.g., pre-registered). - */ - saveClientInformation?(clientInformation: OAuthClientInformationMixed): void | Promise; - /** - * Loads any existing OAuth tokens for the current session, or returns - * `undefined` if there are no saved tokens. - */ - tokens(): OAuthTokens | undefined | Promise; - /** - * Stores new OAuth tokens for the current session, after a successful - * authorization. - */ - saveTokens(tokens: OAuthTokens): void | Promise; - /** - * Invoked to redirect the user agent to the given URL to begin the authorization flow. - */ - redirectToAuthorization(authorizationUrl: URL): void | Promise; - /** - * Saves a PKCE code verifier for the current session, before redirecting to - * the authorization flow. - */ - saveCodeVerifier(codeVerifier: string): void | Promise; - /** - * Loads the PKCE code verifier for the current session, necessary to validate - * the authorization result. - */ - codeVerifier(): string | Promise; - /** - * Adds custom client authentication to OAuth token requests. - * - * This optional method allows implementations to customize how client credentials - * are included in token exchange and refresh requests. When provided, this method - * is called instead of the default authentication logic, giving full control over - * the authentication mechanism. - * - * Common use cases include: - * - Supporting authentication methods beyond the standard OAuth 2.0 methods - * - Adding custom headers for proprietary authentication schemes - * - Implementing client assertion-based authentication (e.g., JWT bearer tokens) - * - * @param headers - The request headers (can be modified to add authentication) - * @param params - The request body parameters (can be modified to add credentials) - * @param url - The token endpoint URL being called - * @param metadata - Optional OAuth metadata for the server, which may include supported authentication methods - */ - addClientAuthentication?: AddClientAuthentication; - /** - * If defined, overrides the selection and validation of the - * RFC 8707 Resource Indicator. If left undefined, default - * validation behavior will be used. - * - * Implementations must verify the returned resource matches the MCP server. - */ - validateResourceURL?(serverUrl: string | URL, resource?: string): Promise; - /** - * If implemented, provides a way for the client to invalidate (e.g. delete) the specified - * credentials, in the case where the server has indicated that they are no longer valid. - * This avoids requiring the user to intervene manually. - */ - invalidateCredentials?(scope: 'all' | 'client' | 'tokens' | 'verifier'): void | Promise; - /** - * Prepares grant-specific parameters for a token request. - * - * This optional method allows providers to customize the token request based on - * the grant type they support. When implemented, it returns the grant type and - * any grant-specific parameters needed for the token exchange. - * - * If not implemented, the default behavior depends on the flow: - * - For authorization code flow: uses code, code_verifier, and redirect_uri - * - For client_credentials: detected via grant_types in clientMetadata - * - * @param scope - Optional scope to request - * @returns Grant type and parameters, or undefined to use default behavior - * - * @example - * // For client_credentials grant: - * prepareTokenRequest(scope) { - * return { - * grantType: 'client_credentials', - * params: scope ? { scope } : {} - * }; - * } - * - * @example - * // For authorization_code grant (default behavior): - * async prepareTokenRequest() { - * return { - * grantType: 'authorization_code', - * params: { - * code: this.authorizationCode, - * code_verifier: await this.codeVerifier(), - * redirect_uri: String(this.redirectUrl) - * } - * }; - * } - */ - prepareTokenRequest?(scope?: string): URLSearchParams | Promise | undefined; -} -export type AuthResult = 'AUTHORIZED' | 'REDIRECT'; -export declare class UnauthorizedError extends Error { - constructor(message?: string); -} -type ClientAuthMethod = 'client_secret_basic' | 'client_secret_post' | 'none'; -/** - * Determines the best client authentication method to use based on server support and client configuration. - * - * Priority order (highest to lowest): - * 1. client_secret_basic (if client secret is available) - * 2. client_secret_post (if client secret is available) - * 3. none (for public clients) - * - * @param clientInformation - OAuth client information containing credentials - * @param supportedMethods - Authentication methods supported by the authorization server - * @returns The selected authentication method - */ -export declare function selectClientAuthMethod(clientInformation: OAuthClientInformationMixed, supportedMethods: string[]): ClientAuthMethod; -/** - * Parses an OAuth error response from a string or Response object. - * - * If the input is a standard OAuth2.0 error response, it will be parsed according to the spec - * and an instance of the appropriate OAuthError subclass will be returned. - * If parsing fails, it falls back to a generic ServerError that includes - * the response status (if available) and original content. - * - * @param input - A Response object or string containing the error response - * @returns A Promise that resolves to an OAuthError instance - */ -export declare function parseErrorResponse(input: Response | string): Promise; -/** - * Orchestrates the full auth flow with a server. - * - * This can be used as a single entry point for all authorization functionality, - * instead of linking together the other lower-level functions in this module. - */ -export declare function auth(provider: OAuthClientProvider, options: { - serverUrl: string | URL; - authorizationCode?: string; - scope?: string; - resourceMetadataUrl?: URL; - fetchFn?: FetchLike; -}): Promise; -/** - * SEP-991: URL-based Client IDs - * Validate that the client_id is a valid URL with https scheme - */ -export declare function isHttpsUrl(value?: string): boolean; -export declare function selectResourceURL(serverUrl: string | URL, provider: OAuthClientProvider, resourceMetadata?: OAuthProtectedResourceMetadata): Promise; -/** - * Extract resource_metadata, scope, and error from WWW-Authenticate header. - */ -export declare function extractWWWAuthenticateParams(res: Response): { - resourceMetadataUrl?: URL; - scope?: string; - error?: string; -}; -/** - * Extract resource_metadata from response header. - * @deprecated Use `extractWWWAuthenticateParams` instead. - */ -export declare function extractResourceMetadataUrl(res: Response): URL | undefined; -/** - * Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata. - * - * If the server returns a 404 for the well-known endpoint, this function will - * return `undefined`. Any other errors will be thrown as exceptions. - */ -export declare function discoverOAuthProtectedResourceMetadata(serverUrl: string | URL, opts?: { - protocolVersion?: string; - resourceMetadataUrl?: string | URL; -}, fetchFn?: FetchLike): Promise; -/** - * Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata. - * - * If the server returns a 404 for the well-known endpoint, this function will - * return `undefined`. Any other errors will be thrown as exceptions. - * - * @deprecated This function is deprecated in favor of `discoverAuthorizationServerMetadata`. - */ -export declare function discoverOAuthMetadata(issuer: string | URL, { authorizationServerUrl, protocolVersion }?: { - authorizationServerUrl?: string | URL; - protocolVersion?: string; -}, fetchFn?: FetchLike): Promise; -/** - * Builds a list of discovery URLs to try for authorization server metadata. - * URLs are returned in priority order: - * 1. OAuth metadata at the given URL - * 2. OIDC metadata endpoints at the given URL - */ -export declare function buildDiscoveryUrls(authorizationServerUrl: string | URL): { - url: URL; - type: 'oauth' | 'oidc'; -}[]; -/** - * Discovers authorization server metadata with support for RFC 8414 OAuth 2.0 Authorization Server Metadata - * and OpenID Connect Discovery 1.0 specifications. - * - * This function implements a fallback strategy for authorization server discovery: - * 1. Attempts RFC 8414 OAuth metadata discovery first - * 2. If OAuth discovery fails, falls back to OpenID Connect Discovery - * - * @param authorizationServerUrl - The authorization server URL obtained from the MCP Server's - * protected resource metadata, or the MCP server's URL if the - * metadata was not found. - * @param options - Configuration options - * @param options.fetchFn - Optional fetch function for making HTTP requests, defaults to global fetch - * @param options.protocolVersion - MCP protocol version to use, defaults to LATEST_PROTOCOL_VERSION - * @returns Promise resolving to authorization server metadata, or undefined if discovery fails - */ -export declare function discoverAuthorizationServerMetadata(authorizationServerUrl: string | URL, { fetchFn, protocolVersion }?: { - fetchFn?: FetchLike; - protocolVersion?: string; -}): Promise; -/** - * Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL. - */ -export declare function startAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, redirectUrl, scope, state, resource }: { - metadata?: AuthorizationServerMetadata; - clientInformation: OAuthClientInformationMixed; - redirectUrl: string | URL; - scope?: string; - state?: string; - resource?: URL; -}): Promise<{ - authorizationUrl: URL; - codeVerifier: string; -}>; -/** - * Prepares token request parameters for an authorization code exchange. - * - * This is the default implementation used by fetchToken when the provider - * doesn't implement prepareTokenRequest. - * - * @param authorizationCode - The authorization code received from the authorization endpoint - * @param codeVerifier - The PKCE code verifier - * @param redirectUri - The redirect URI used in the authorization request - * @returns URLSearchParams for the authorization_code grant - */ -export declare function prepareAuthorizationCodeRequest(authorizationCode: string, codeVerifier: string, redirectUri: string | URL): URLSearchParams; -/** - * Exchanges an authorization code for an access token with the given server. - * - * Supports multiple client authentication methods as specified in OAuth 2.1: - * - Automatically selects the best authentication method based on server support - * - Falls back to appropriate defaults when server metadata is unavailable - * - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration object containing client info, auth code, etc. - * @returns Promise resolving to OAuth tokens - * @throws {Error} When token exchange fails or authentication is invalid - */ -export declare function exchangeAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, resource, addClientAuthentication, fetchFn }: { - metadata?: AuthorizationServerMetadata; - clientInformation: OAuthClientInformationMixed; - authorizationCode: string; - codeVerifier: string; - redirectUri: string | URL; - resource?: URL; - addClientAuthentication?: OAuthClientProvider['addClientAuthentication']; - fetchFn?: FetchLike; -}): Promise; -/** - * Exchange a refresh token for an updated access token. - * - * Supports multiple client authentication methods as specified in OAuth 2.1: - * - Automatically selects the best authentication method based on server support - * - Preserves the original refresh token if a new one is not returned - * - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration object containing client info, refresh token, etc. - * @returns Promise resolving to OAuth tokens (preserves original refresh_token if not replaced) - * @throws {Error} When token refresh fails or authentication is invalid - */ -export declare function refreshAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, fetchFn }: { - metadata?: AuthorizationServerMetadata; - clientInformation: OAuthClientInformationMixed; - refreshToken: string; - resource?: URL; - addClientAuthentication?: OAuthClientProvider['addClientAuthentication']; - fetchFn?: FetchLike; -}): Promise; -/** - * Unified token fetching that works with any grant type via provider.prepareTokenRequest(). - * - * This function provides a single entry point for obtaining tokens regardless of the - * OAuth grant type. The provider's prepareTokenRequest() method determines which grant - * to use and supplies the grant-specific parameters. - * - * @param provider - OAuth client provider that implements prepareTokenRequest() - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration for the token request - * @returns Promise resolving to OAuth tokens - * @throws {Error} When provider doesn't implement prepareTokenRequest or token fetch fails - * - * @example - * // Provider for client_credentials: - * class MyProvider implements OAuthClientProvider { - * prepareTokenRequest(scope) { - * const params = new URLSearchParams({ grant_type: 'client_credentials' }); - * if (scope) params.set('scope', scope); - * return params; - * } - * // ... other methods - * } - * - * const tokens = await fetchToken(provider, authServerUrl, { metadata }); - */ -export declare function fetchToken(provider: OAuthClientProvider, authorizationServerUrl: string | URL, { metadata, resource, authorizationCode, fetchFn }?: { - metadata?: AuthorizationServerMetadata; - resource?: URL; - /** Authorization code for the default authorization_code grant flow */ - authorizationCode?: string; - fetchFn?: FetchLike; -}): Promise; -/** - * Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591. - */ -export declare function registerClient(authorizationServerUrl: string | URL, { metadata, clientMetadata, fetchFn }: { - metadata?: AuthorizationServerMetadata; - clientMetadata: OAuthClientMetadata; - fetchFn?: FetchLike; -}): Promise; -export {}; -//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts.map deleted file mode 100644 index 012c440..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/client/auth.ts"],"names":[],"mappings":"AAEA,OAAO,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B,CAAC;IACvC,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,CAAC;CAClB,GACP,OAAO,CAAC,WAAW,CAAC,CA+BtB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAChC,sBAAsB,EAAE,MAAM,GAAG,GAAG,EACpC,EACI,QAAQ,EACR,cAAc,EACd,OAAO,EACV,EAAE;IACC,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IACvC,cAAc,EAAE,mBAAmB,CAAC;IACpC,OAAO,CAAC,EAAE,SAAS,CAAC;CACvB,GACF,OAAO,CAAC,0BAA0B,CAAC,CA0BrC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js deleted file mode 100644 index de86ff9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +++ /dev/null @@ -1,824 +0,0 @@ -import pkceChallenge from 'pkce-challenge'; -import { LATEST_PROTOCOL_VERSION } from '../types.js'; -import { OAuthErrorResponseSchema, OpenIdProviderDiscoveryMetadataSchema } from '../shared/auth.js'; -import { OAuthClientInformationFullSchema, OAuthMetadataSchema, OAuthProtectedResourceMetadataSchema, OAuthTokensSchema } from '../shared/auth.js'; -import { checkResourceAllowed, resourceUrlFromServerUrl } from '../shared/auth-utils.js'; -import { InvalidClientError, InvalidClientMetadataError, InvalidGrantError, OAUTH_ERRORS, OAuthError, ServerError, UnauthorizedClientError } from '../server/auth/errors.js'; -export class UnauthorizedError extends Error { - constructor(message) { - super(message ?? 'Unauthorized'); - } -} -function isClientAuthMethod(method) { - return ['client_secret_basic', 'client_secret_post', 'none'].includes(method); -} -const AUTHORIZATION_CODE_RESPONSE_TYPE = 'code'; -const AUTHORIZATION_CODE_CHALLENGE_METHOD = 'S256'; -/** - * Determines the best client authentication method to use based on server support and client configuration. - * - * Priority order (highest to lowest): - * 1. client_secret_basic (if client secret is available) - * 2. client_secret_post (if client secret is available) - * 3. none (for public clients) - * - * @param clientInformation - OAuth client information containing credentials - * @param supportedMethods - Authentication methods supported by the authorization server - * @returns The selected authentication method - */ -export function selectClientAuthMethod(clientInformation, supportedMethods) { - const hasClientSecret = clientInformation.client_secret !== undefined; - // If server doesn't specify supported methods, use RFC 6749 defaults - if (supportedMethods.length === 0) { - return hasClientSecret ? 'client_secret_post' : 'none'; - } - // Prefer the method returned by the server during client registration if valid and supported - if ('token_endpoint_auth_method' in clientInformation && - clientInformation.token_endpoint_auth_method && - isClientAuthMethod(clientInformation.token_endpoint_auth_method) && - supportedMethods.includes(clientInformation.token_endpoint_auth_method)) { - return clientInformation.token_endpoint_auth_method; - } - // Try methods in priority order (most secure first) - if (hasClientSecret && supportedMethods.includes('client_secret_basic')) { - return 'client_secret_basic'; - } - if (hasClientSecret && supportedMethods.includes('client_secret_post')) { - return 'client_secret_post'; - } - if (supportedMethods.includes('none')) { - return 'none'; - } - // Fallback: use what we have - return hasClientSecret ? 'client_secret_post' : 'none'; -} -/** - * Applies client authentication to the request based on the specified method. - * - * Implements OAuth 2.1 client authentication methods: - * - client_secret_basic: HTTP Basic authentication (RFC 6749 Section 2.3.1) - * - client_secret_post: Credentials in request body (RFC 6749 Section 2.3.1) - * - none: Public client authentication (RFC 6749 Section 2.1) - * - * @param method - The authentication method to use - * @param clientInformation - OAuth client information containing credentials - * @param headers - HTTP headers object to modify - * @param params - URL search parameters to modify - * @throws {Error} When required credentials are missing - */ -function applyClientAuthentication(method, clientInformation, headers, params) { - const { client_id, client_secret } = clientInformation; - switch (method) { - case 'client_secret_basic': - applyBasicAuth(client_id, client_secret, headers); - return; - case 'client_secret_post': - applyPostAuth(client_id, client_secret, params); - return; - case 'none': - applyPublicAuth(client_id, params); - return; - default: - throw new Error(`Unsupported client authentication method: ${method}`); - } -} -/** - * Applies HTTP Basic authentication (RFC 6749 Section 2.3.1) - */ -function applyBasicAuth(clientId, clientSecret, headers) { - if (!clientSecret) { - throw new Error('client_secret_basic authentication requires a client_secret'); - } - const credentials = btoa(`${clientId}:${clientSecret}`); - headers.set('Authorization', `Basic ${credentials}`); -} -/** - * Applies POST body authentication (RFC 6749 Section 2.3.1) - */ -function applyPostAuth(clientId, clientSecret, params) { - params.set('client_id', clientId); - if (clientSecret) { - params.set('client_secret', clientSecret); - } -} -/** - * Applies public client authentication (RFC 6749 Section 2.1) - */ -function applyPublicAuth(clientId, params) { - params.set('client_id', clientId); -} -/** - * Parses an OAuth error response from a string or Response object. - * - * If the input is a standard OAuth2.0 error response, it will be parsed according to the spec - * and an instance of the appropriate OAuthError subclass will be returned. - * If parsing fails, it falls back to a generic ServerError that includes - * the response status (if available) and original content. - * - * @param input - A Response object or string containing the error response - * @returns A Promise that resolves to an OAuthError instance - */ -export async function parseErrorResponse(input) { - const statusCode = input instanceof Response ? input.status : undefined; - const body = input instanceof Response ? await input.text() : input; - try { - const result = OAuthErrorResponseSchema.parse(JSON.parse(body)); - const { error, error_description, error_uri } = result; - const errorClass = OAUTH_ERRORS[error] || ServerError; - return new errorClass(error_description || '', error_uri); - } - catch (error) { - // Not a valid OAuth error response, but try to inform the user of the raw data anyway - const errorMessage = `${statusCode ? `HTTP ${statusCode}: ` : ''}Invalid OAuth error response: ${error}. Raw body: ${body}`; - return new ServerError(errorMessage); - } -} -/** - * Orchestrates the full auth flow with a server. - * - * This can be used as a single entry point for all authorization functionality, - * instead of linking together the other lower-level functions in this module. - */ -export async function auth(provider, options) { - try { - return await authInternal(provider, options); - } - catch (error) { - // Handle recoverable error types by invalidating credentials and retrying - if (error instanceof InvalidClientError || error instanceof UnauthorizedClientError) { - await provider.invalidateCredentials?.('all'); - return await authInternal(provider, options); - } - else if (error instanceof InvalidGrantError) { - await provider.invalidateCredentials?.('tokens'); - return await authInternal(provider, options); - } - // Throw otherwise - throw error; - } -} -async function authInternal(provider, { serverUrl, authorizationCode, scope, resourceMetadataUrl, fetchFn }) { - let resourceMetadata; - let authorizationServerUrl; - try { - resourceMetadata = await discoverOAuthProtectedResourceMetadata(serverUrl, { resourceMetadataUrl }, fetchFn); - if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) { - authorizationServerUrl = resourceMetadata.authorization_servers[0]; - } - } - catch { - // Ignore errors and fall back to /.well-known/oauth-authorization-server - } - /** - * If we don't get a valid authorization server metadata from protected resource metadata, - * fallback to the legacy MCP spec's implementation (version 2025-03-26): MCP server base URL acts as the Authorization server. - */ - if (!authorizationServerUrl) { - authorizationServerUrl = new URL('/', serverUrl); - } - const resource = await selectResourceURL(serverUrl, provider, resourceMetadata); - const metadata = await discoverAuthorizationServerMetadata(authorizationServerUrl, { - fetchFn - }); - // Handle client registration if needed - let clientInformation = await Promise.resolve(provider.clientInformation()); - if (!clientInformation) { - if (authorizationCode !== undefined) { - throw new Error('Existing OAuth client information is required when exchanging an authorization code'); - } - const supportsUrlBasedClientId = metadata?.client_id_metadata_document_supported === true; - const clientMetadataUrl = provider.clientMetadataUrl; - if (clientMetadataUrl && !isHttpsUrl(clientMetadataUrl)) { - throw new InvalidClientMetadataError(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${clientMetadataUrl}`); - } - const shouldUseUrlBasedClientId = supportsUrlBasedClientId && clientMetadataUrl; - if (shouldUseUrlBasedClientId) { - // SEP-991: URL-based Client IDs - clientInformation = { - client_id: clientMetadataUrl - }; - await provider.saveClientInformation?.(clientInformation); - } - else { - // Fallback to dynamic registration - if (!provider.saveClientInformation) { - throw new Error('OAuth client information must be saveable for dynamic registration'); - } - const fullInformation = await registerClient(authorizationServerUrl, { - metadata, - clientMetadata: provider.clientMetadata, - fetchFn - }); - await provider.saveClientInformation(fullInformation); - clientInformation = fullInformation; - } - } - // Non-interactive flows (e.g., client_credentials, jwt-bearer) don't need a redirect URL - const nonInteractiveFlow = !provider.redirectUrl; - // Exchange authorization code for tokens, or fetch tokens directly for non-interactive flows - if (authorizationCode !== undefined || nonInteractiveFlow) { - const tokens = await fetchToken(provider, authorizationServerUrl, { - metadata, - resource, - authorizationCode, - fetchFn - }); - await provider.saveTokens(tokens); - return 'AUTHORIZED'; - } - const tokens = await provider.tokens(); - // Handle token refresh or new authorization - if (tokens?.refresh_token) { - try { - // Attempt to refresh the token - const newTokens = await refreshAuthorization(authorizationServerUrl, { - metadata, - clientInformation, - refreshToken: tokens.refresh_token, - resource, - addClientAuthentication: provider.addClientAuthentication, - fetchFn - }); - await provider.saveTokens(newTokens); - return 'AUTHORIZED'; - } - catch (error) { - // If this is a ServerError, or an unknown type, log it out and try to continue. Otherwise, escalate so we can fix things and retry. - if (!(error instanceof OAuthError) || error instanceof ServerError) { - // Could not refresh OAuth tokens - } - else { - // Refresh failed for another reason, re-throw - throw error; - } - } - } - const state = provider.state ? await provider.state() : undefined; - // Start new authorization flow - const { authorizationUrl, codeVerifier } = await startAuthorization(authorizationServerUrl, { - metadata, - clientInformation, - state, - redirectUrl: provider.redirectUrl, - scope: scope || resourceMetadata?.scopes_supported?.join(' ') || provider.clientMetadata.scope, - resource - }); - await provider.saveCodeVerifier(codeVerifier); - await provider.redirectToAuthorization(authorizationUrl); - return 'REDIRECT'; -} -/** - * SEP-991: URL-based Client IDs - * Validate that the client_id is a valid URL with https scheme - */ -export function isHttpsUrl(value) { - if (!value) - return false; - try { - const url = new URL(value); - return url.protocol === 'https:' && url.pathname !== '/'; - } - catch { - return false; - } -} -export async function selectResourceURL(serverUrl, provider, resourceMetadata) { - const defaultResource = resourceUrlFromServerUrl(serverUrl); - // If provider has custom validation, delegate to it - if (provider.validateResourceURL) { - return await provider.validateResourceURL(defaultResource, resourceMetadata?.resource); - } - // Only include resource parameter when Protected Resource Metadata is present - if (!resourceMetadata) { - return undefined; - } - // Validate that the metadata's resource is compatible with our request - if (!checkResourceAllowed({ requestedResource: defaultResource, configuredResource: resourceMetadata.resource })) { - throw new Error(`Protected resource ${resourceMetadata.resource} does not match expected ${defaultResource} (or origin)`); - } - // Prefer the resource from metadata since it's what the server is telling us to request - return new URL(resourceMetadata.resource); -} -/** - * Extract resource_metadata, scope, and error from WWW-Authenticate header. - */ -export function extractWWWAuthenticateParams(res) { - const authenticateHeader = res.headers.get('WWW-Authenticate'); - if (!authenticateHeader) { - return {}; - } - const [type, scheme] = authenticateHeader.split(' '); - if (type.toLowerCase() !== 'bearer' || !scheme) { - return {}; - } - const resourceMetadataMatch = extractFieldFromWwwAuth(res, 'resource_metadata') || undefined; - let resourceMetadataUrl; - if (resourceMetadataMatch) { - try { - resourceMetadataUrl = new URL(resourceMetadataMatch); - } - catch { - // Ignore invalid URL - } - } - const scope = extractFieldFromWwwAuth(res, 'scope') || undefined; - const error = extractFieldFromWwwAuth(res, 'error') || undefined; - return { - resourceMetadataUrl, - scope, - error - }; -} -/** - * Extracts a specific field's value from the WWW-Authenticate header string. - * - * @param response The HTTP response object containing the headers. - * @param fieldName The name of the field to extract (e.g., "realm", "nonce"). - * @returns The field value - */ -function extractFieldFromWwwAuth(response, fieldName) { - const wwwAuthHeader = response.headers.get('WWW-Authenticate'); - if (!wwwAuthHeader) { - return null; - } - const pattern = new RegExp(`${fieldName}=(?:"([^"]+)"|([^\\s,]+))`); - const match = wwwAuthHeader.match(pattern); - if (match) { - // Pattern matches: field_name="value" or field_name=value (unquoted) - return match[1] || match[2]; - } - return null; -} -/** - * Extract resource_metadata from response header. - * @deprecated Use `extractWWWAuthenticateParams` instead. - */ -export function extractResourceMetadataUrl(res) { - const authenticateHeader = res.headers.get('WWW-Authenticate'); - if (!authenticateHeader) { - return undefined; - } - const [type, scheme] = authenticateHeader.split(' '); - if (type.toLowerCase() !== 'bearer' || !scheme) { - return undefined; - } - const regex = /resource_metadata="([^"]*)"/; - const match = regex.exec(authenticateHeader); - if (!match) { - return undefined; - } - try { - return new URL(match[1]); - } - catch { - return undefined; - } -} -/** - * Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata. - * - * If the server returns a 404 for the well-known endpoint, this function will - * return `undefined`. Any other errors will be thrown as exceptions. - */ -export async function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn = fetch) { - const response = await discoverMetadataWithFallback(serverUrl, 'oauth-protected-resource', fetchFn, { - protocolVersion: opts?.protocolVersion, - metadataUrl: opts?.resourceMetadataUrl - }); - if (!response || response.status === 404) { - await response?.body?.cancel(); - throw new Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`); - } - if (!response.ok) { - await response.body?.cancel(); - throw new Error(`HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`); - } - return OAuthProtectedResourceMetadataSchema.parse(await response.json()); -} -/** - * Helper function to handle fetch with CORS retry logic - */ -async function fetchWithCorsRetry(url, headers, fetchFn = fetch) { - try { - return await fetchFn(url, { headers }); - } - catch (error) { - if (error instanceof TypeError) { - if (headers) { - // CORS errors come back as TypeError, retry without headers - return fetchWithCorsRetry(url, undefined, fetchFn); - } - else { - // We're getting CORS errors on retry too, return undefined - return undefined; - } - } - throw error; - } -} -/** - * Constructs the well-known path for auth-related metadata discovery - */ -function buildWellKnownPath(wellKnownPrefix, pathname = '', options = {}) { - // Strip trailing slash from pathname to avoid double slashes - if (pathname.endsWith('/')) { - pathname = pathname.slice(0, -1); - } - return options.prependPathname ? `${pathname}/.well-known/${wellKnownPrefix}` : `/.well-known/${wellKnownPrefix}${pathname}`; -} -/** - * Tries to discover OAuth metadata at a specific URL - */ -async function tryMetadataDiscovery(url, protocolVersion, fetchFn = fetch) { - const headers = { - 'MCP-Protocol-Version': protocolVersion - }; - return await fetchWithCorsRetry(url, headers, fetchFn); -} -/** - * Determines if fallback to root discovery should be attempted - */ -function shouldAttemptFallback(response, pathname) { - return !response || (response.status >= 400 && response.status < 500 && pathname !== '/'); -} -/** - * Generic function for discovering OAuth metadata with fallback support - */ -async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) { - const issuer = new URL(serverUrl); - const protocolVersion = opts?.protocolVersion ?? LATEST_PROTOCOL_VERSION; - let url; - if (opts?.metadataUrl) { - url = new URL(opts.metadataUrl); - } - else { - // Try path-aware discovery first - const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname); - url = new URL(wellKnownPath, opts?.metadataServerUrl ?? issuer); - url.search = issuer.search; - } - let response = await tryMetadataDiscovery(url, protocolVersion, fetchFn); - // If path-aware discovery fails with 404 and we're not already at root, try fallback to root discovery - if (!opts?.metadataUrl && shouldAttemptFallback(response, issuer.pathname)) { - const rootUrl = new URL(`/.well-known/${wellKnownType}`, issuer); - response = await tryMetadataDiscovery(rootUrl, protocolVersion, fetchFn); - } - return response; -} -/** - * Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata. - * - * If the server returns a 404 for the well-known endpoint, this function will - * return `undefined`. Any other errors will be thrown as exceptions. - * - * @deprecated This function is deprecated in favor of `discoverAuthorizationServerMetadata`. - */ -export async function discoverOAuthMetadata(issuer, { authorizationServerUrl, protocolVersion } = {}, fetchFn = fetch) { - if (typeof issuer === 'string') { - issuer = new URL(issuer); - } - if (!authorizationServerUrl) { - authorizationServerUrl = issuer; - } - if (typeof authorizationServerUrl === 'string') { - authorizationServerUrl = new URL(authorizationServerUrl); - } - protocolVersion ?? (protocolVersion = LATEST_PROTOCOL_VERSION); - const response = await discoverMetadataWithFallback(authorizationServerUrl, 'oauth-authorization-server', fetchFn, { - protocolVersion, - metadataServerUrl: authorizationServerUrl - }); - if (!response || response.status === 404) { - await response?.body?.cancel(); - return undefined; - } - if (!response.ok) { - await response.body?.cancel(); - throw new Error(`HTTP ${response.status} trying to load well-known OAuth metadata`); - } - return OAuthMetadataSchema.parse(await response.json()); -} -/** - * Builds a list of discovery URLs to try for authorization server metadata. - * URLs are returned in priority order: - * 1. OAuth metadata at the given URL - * 2. OIDC metadata endpoints at the given URL - */ -export function buildDiscoveryUrls(authorizationServerUrl) { - const url = typeof authorizationServerUrl === 'string' ? new URL(authorizationServerUrl) : authorizationServerUrl; - const hasPath = url.pathname !== '/'; - const urlsToTry = []; - if (!hasPath) { - // Root path: https://example.com/.well-known/oauth-authorization-server - urlsToTry.push({ - url: new URL('/.well-known/oauth-authorization-server', url.origin), - type: 'oauth' - }); - // OIDC: https://example.com/.well-known/openid-configuration - urlsToTry.push({ - url: new URL(`/.well-known/openid-configuration`, url.origin), - type: 'oidc' - }); - return urlsToTry; - } - // Strip trailing slash from pathname to avoid double slashes - let pathname = url.pathname; - if (pathname.endsWith('/')) { - pathname = pathname.slice(0, -1); - } - // 1. OAuth metadata at the given URL - // Insert well-known before the path: https://example.com/.well-known/oauth-authorization-server/tenant1 - urlsToTry.push({ - url: new URL(`/.well-known/oauth-authorization-server${pathname}`, url.origin), - type: 'oauth' - }); - // 2. OIDC metadata endpoints - // RFC 8414 style: Insert /.well-known/openid-configuration before the path - urlsToTry.push({ - url: new URL(`/.well-known/openid-configuration${pathname}`, url.origin), - type: 'oidc' - }); - // OIDC Discovery 1.0 style: Append /.well-known/openid-configuration after the path - urlsToTry.push({ - url: new URL(`${pathname}/.well-known/openid-configuration`, url.origin), - type: 'oidc' - }); - return urlsToTry; -} -/** - * Discovers authorization server metadata with support for RFC 8414 OAuth 2.0 Authorization Server Metadata - * and OpenID Connect Discovery 1.0 specifications. - * - * This function implements a fallback strategy for authorization server discovery: - * 1. Attempts RFC 8414 OAuth metadata discovery first - * 2. If OAuth discovery fails, falls back to OpenID Connect Discovery - * - * @param authorizationServerUrl - The authorization server URL obtained from the MCP Server's - * protected resource metadata, or the MCP server's URL if the - * metadata was not found. - * @param options - Configuration options - * @param options.fetchFn - Optional fetch function for making HTTP requests, defaults to global fetch - * @param options.protocolVersion - MCP protocol version to use, defaults to LATEST_PROTOCOL_VERSION - * @returns Promise resolving to authorization server metadata, or undefined if discovery fails - */ -export async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION } = {}) { - const headers = { - 'MCP-Protocol-Version': protocolVersion, - Accept: 'application/json' - }; - // Get the list of URLs to try - const urlsToTry = buildDiscoveryUrls(authorizationServerUrl); - // Try each URL in order - for (const { url: endpointUrl, type } of urlsToTry) { - const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn); - if (!response) { - /** - * CORS error occurred - don't throw as the endpoint may not allow CORS, - * continue trying other possible endpoints - */ - continue; - } - if (!response.ok) { - await response.body?.cancel(); - // Continue looking for any 4xx response code. - if (response.status >= 400 && response.status < 500) { - continue; // Try next URL - } - throw new Error(`HTTP ${response.status} trying to load ${type === 'oauth' ? 'OAuth' : 'OpenID provider'} metadata from ${endpointUrl}`); - } - // Parse and validate based on type - if (type === 'oauth') { - return OAuthMetadataSchema.parse(await response.json()); - } - else { - return OpenIdProviderDiscoveryMetadataSchema.parse(await response.json()); - } - } - return undefined; -} -/** - * Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL. - */ -export async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, resource }) { - let authorizationUrl; - if (metadata) { - authorizationUrl = new URL(metadata.authorization_endpoint); - if (!metadata.response_types_supported.includes(AUTHORIZATION_CODE_RESPONSE_TYPE)) { - throw new Error(`Incompatible auth server: does not support response type ${AUTHORIZATION_CODE_RESPONSE_TYPE}`); - } - if (metadata.code_challenge_methods_supported && - !metadata.code_challenge_methods_supported.includes(AUTHORIZATION_CODE_CHALLENGE_METHOD)) { - throw new Error(`Incompatible auth server: does not support code challenge method ${AUTHORIZATION_CODE_CHALLENGE_METHOD}`); - } - } - else { - authorizationUrl = new URL('/authorize', authorizationServerUrl); - } - // Generate PKCE challenge - const challenge = await pkceChallenge(); - const codeVerifier = challenge.code_verifier; - const codeChallenge = challenge.code_challenge; - authorizationUrl.searchParams.set('response_type', AUTHORIZATION_CODE_RESPONSE_TYPE); - authorizationUrl.searchParams.set('client_id', clientInformation.client_id); - authorizationUrl.searchParams.set('code_challenge', codeChallenge); - authorizationUrl.searchParams.set('code_challenge_method', AUTHORIZATION_CODE_CHALLENGE_METHOD); - authorizationUrl.searchParams.set('redirect_uri', String(redirectUrl)); - if (state) { - authorizationUrl.searchParams.set('state', state); - } - if (scope) { - authorizationUrl.searchParams.set('scope', scope); - } - if (scope?.includes('offline_access')) { - // if the request includes the OIDC-only "offline_access" scope, - // we need to set the prompt to "consent" to ensure the user is prompted to grant offline access - // https://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess - authorizationUrl.searchParams.append('prompt', 'consent'); - } - if (resource) { - authorizationUrl.searchParams.set('resource', resource.href); - } - return { authorizationUrl, codeVerifier }; -} -/** - * Prepares token request parameters for an authorization code exchange. - * - * This is the default implementation used by fetchToken when the provider - * doesn't implement prepareTokenRequest. - * - * @param authorizationCode - The authorization code received from the authorization endpoint - * @param codeVerifier - The PKCE code verifier - * @param redirectUri - The redirect URI used in the authorization request - * @returns URLSearchParams for the authorization_code grant - */ -export function prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri) { - return new URLSearchParams({ - grant_type: 'authorization_code', - code: authorizationCode, - code_verifier: codeVerifier, - redirect_uri: String(redirectUri) - }); -} -/** - * Internal helper to execute a token request with the given parameters. - * Used by exchangeAuthorization, refreshAuthorization, and fetchToken. - */ -async function executeTokenRequest(authorizationServerUrl, { metadata, tokenRequestParams, clientInformation, addClientAuthentication, resource, fetchFn }) { - const tokenUrl = metadata?.token_endpoint ? new URL(metadata.token_endpoint) : new URL('/token', authorizationServerUrl); - const headers = new Headers({ - 'Content-Type': 'application/x-www-form-urlencoded', - Accept: 'application/json' - }); - if (resource) { - tokenRequestParams.set('resource', resource.href); - } - if (addClientAuthentication) { - await addClientAuthentication(headers, tokenRequestParams, tokenUrl, metadata); - } - else if (clientInformation) { - const supportedMethods = metadata?.token_endpoint_auth_methods_supported ?? []; - const authMethod = selectClientAuthMethod(clientInformation, supportedMethods); - applyClientAuthentication(authMethod, clientInformation, headers, tokenRequestParams); - } - const response = await (fetchFn ?? fetch)(tokenUrl, { - method: 'POST', - headers, - body: tokenRequestParams - }); - if (!response.ok) { - throw await parseErrorResponse(response); - } - return OAuthTokensSchema.parse(await response.json()); -} -/** - * Exchanges an authorization code for an access token with the given server. - * - * Supports multiple client authentication methods as specified in OAuth 2.1: - * - Automatically selects the best authentication method based on server support - * - Falls back to appropriate defaults when server metadata is unavailable - * - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration object containing client info, auth code, etc. - * @returns Promise resolving to OAuth tokens - * @throws {Error} When token exchange fails or authentication is invalid - */ -export async function exchangeAuthorization(authorizationServerUrl, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, resource, addClientAuthentication, fetchFn }) { - const tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri); - return executeTokenRequest(authorizationServerUrl, { - metadata, - tokenRequestParams, - clientInformation, - addClientAuthentication, - resource, - fetchFn - }); -} -/** - * Exchange a refresh token for an updated access token. - * - * Supports multiple client authentication methods as specified in OAuth 2.1: - * - Automatically selects the best authentication method based on server support - * - Preserves the original refresh token if a new one is not returned - * - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration object containing client info, refresh token, etc. - * @returns Promise resolving to OAuth tokens (preserves original refresh_token if not replaced) - * @throws {Error} When token refresh fails or authentication is invalid - */ -export async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, fetchFn }) { - const tokenRequestParams = new URLSearchParams({ - grant_type: 'refresh_token', - refresh_token: refreshToken - }); - const tokens = await executeTokenRequest(authorizationServerUrl, { - metadata, - tokenRequestParams, - clientInformation, - addClientAuthentication, - resource, - fetchFn - }); - // Preserve original refresh token if server didn't return a new one - return { refresh_token: refreshToken, ...tokens }; -} -/** - * Unified token fetching that works with any grant type via provider.prepareTokenRequest(). - * - * This function provides a single entry point for obtaining tokens regardless of the - * OAuth grant type. The provider's prepareTokenRequest() method determines which grant - * to use and supplies the grant-specific parameters. - * - * @param provider - OAuth client provider that implements prepareTokenRequest() - * @param authorizationServerUrl - The authorization server's base URL - * @param options - Configuration for the token request - * @returns Promise resolving to OAuth tokens - * @throws {Error} When provider doesn't implement prepareTokenRequest or token fetch fails - * - * @example - * // Provider for client_credentials: - * class MyProvider implements OAuthClientProvider { - * prepareTokenRequest(scope) { - * const params = new URLSearchParams({ grant_type: 'client_credentials' }); - * if (scope) params.set('scope', scope); - * return params; - * } - * // ... other methods - * } - * - * const tokens = await fetchToken(provider, authServerUrl, { metadata }); - */ -export async function fetchToken(provider, authorizationServerUrl, { metadata, resource, authorizationCode, fetchFn } = {}) { - const scope = provider.clientMetadata.scope; - // Use provider's prepareTokenRequest if available, otherwise fall back to authorization_code - let tokenRequestParams; - if (provider.prepareTokenRequest) { - tokenRequestParams = await provider.prepareTokenRequest(scope); - } - // Default to authorization_code grant if no custom prepareTokenRequest - if (!tokenRequestParams) { - if (!authorizationCode) { - throw new Error('Either provider.prepareTokenRequest() or authorizationCode is required'); - } - if (!provider.redirectUrl) { - throw new Error('redirectUrl is required for authorization_code flow'); - } - const codeVerifier = await provider.codeVerifier(); - tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, provider.redirectUrl); - } - const clientInformation = await provider.clientInformation(); - return executeTokenRequest(authorizationServerUrl, { - metadata, - tokenRequestParams, - clientInformation: clientInformation ?? undefined, - addClientAuthentication: provider.addClientAuthentication, - resource, - fetchFn - }); -} -/** - * Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591. - */ -export async function registerClient(authorizationServerUrl, { metadata, clientMetadata, fetchFn }) { - let registrationUrl; - if (metadata) { - if (!metadata.registration_endpoint) { - throw new Error('Incompatible auth server: does not support dynamic client registration'); - } - registrationUrl = new URL(metadata.registration_endpoint); - } - else { - registrationUrl = new URL('/register', authorizationServerUrl); - } - const response = await (fetchFn ?? fetch)(registrationUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(clientMetadata) - }); - if (!response.ok) { - throw await parseErrorResponse(response); - } - return OAuthClientInformationFullSchema.parse(await response.json()); -} -//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map deleted file mode 100644 index 6d43f39..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/client/auth.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAQH,wBAAwB,EAExB,qCAAqC,EACxC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,gCAAgC,EAChC,mBAAmB,EACnB,oCAAoC,EACpC,iBAAiB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EACH,kBAAkB,EAClB,0BAA0B,EAC1B,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,uBAAuB,EAC1B,MAAM,0BAA0B,CAAC;AAsKlC,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACxC,YAAY,OAAgB;QACxB,KAAK,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC;IACrC,CAAC;CACJ;AAID,SAAS,kBAAkB,CAAC,MAAc;IACtC,OAAO,CAAC,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,gCAAgC,GAAG,MAAM,CAAC;AAChD,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,sBAAsB,CAAC,iBAA8C,EAAE,gBAA0B;IAC7G,MAAM,eAAe,GAAG,iBAAiB,CAAC,aAAa,KAAK,SAAS,CAAC;IAEtE,qEAAqE;IACrE,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE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AC;YAClC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC9F,CAAC;QAED,eAAe,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC9D,CAAC;SAAM,CAAC;QACJ,eAAe,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC,eAAe,EAAE;QACvD,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACL,cAAc,EAAE,kBAAkB;SACrC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;KACvC,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,gCAAgC,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACzE,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts deleted file mode 100644 index efc0186..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts +++ /dev/null @@ -1,588 +0,0 @@ -import { Protocol, type ProtocolOptions, type RequestOptions } from '../shared/protocol.js'; -import type { Transport } from '../shared/transport.js'; -import { type CallToolRequest, CallToolResultSchema, type ClientCapabilities, type ClientNotification, type ClientRequest, type ClientResult, type CompatibilityCallToolResultSchema, type CompleteRequest, type GetPromptRequest, type Implementation, type ListPromptsRequest, type ListResourcesRequest, type ListResourceTemplatesRequest, type ListToolsRequest, type LoggingLevel, type ReadResourceRequest, type ServerCapabilities, type SubscribeRequest, type UnsubscribeRequest, type ListChangedHandlers, type Request, type Notification, type Result } from '../types.js'; -import type { jsonSchemaValidator } from '../validation/types.js'; -import { AnyObjectSchema, SchemaOutput } from '../server/zod-compat.js'; -import type { RequestHandlerExtra } from '../shared/protocol.js'; -import { ExperimentalClientTasks } from '../experimental/tasks/client.js'; -/** - * Determines which elicitation modes are supported based on declared client capabilities. - * - * According to the spec: - * - An empty elicitation capability object defaults to form mode support (backwards compatibility) - * - URL mode is only supported if explicitly declared - * - * @param capabilities - The client's elicitation capabilities - * @returns An object indicating which modes are supported - */ -export declare function getSupportedElicitationModes(capabilities: ClientCapabilities['elicitation']): { - supportsFormMode: boolean; - supportsUrlMode: boolean; -}; -export type ClientOptions = ProtocolOptions & { - /** - * Capabilities to advertise as being supported by this client. - */ - capabilities?: ClientCapabilities; - /** - * JSON Schema validator for tool output validation. - * - * The validator is used to validate structured content returned by tools - * against their declared output schemas. - * - * @default AjvJsonSchemaValidator - * - * @example - * ```typescript - * // ajv - * const client = new Client( - * { name: 'my-client', version: '1.0.0' }, - * { - * capabilities: {}, - * jsonSchemaValidator: new AjvJsonSchemaValidator() - * } - * ); - * - * // @cfworker/json-schema - * const client = new Client( - * { name: 'my-client', version: '1.0.0' }, - * { - * capabilities: {}, - * jsonSchemaValidator: new CfWorkerJsonSchemaValidator() - * } - * ); - * ``` - */ - jsonSchemaValidator?: jsonSchemaValidator; - /** - * Configure handlers for list changed notifications (tools, prompts, resources). - * - * @example - * ```typescript - * const client = new Client( - * { name: 'my-client', version: '1.0.0' }, - * { - * listChanged: { - * tools: { - * onChanged: (error, tools) => { - * if (error) { - * console.error('Failed to refresh tools:', error); - * return; - * } - * console.log('Tools updated:', tools); - * } - * }, - * prompts: { - * onChanged: (error, prompts) => console.log('Prompts updated:', prompts) - * } - * } - * } - * ); - * ``` - */ - listChanged?: ListChangedHandlers; -}; -/** - * An MCP client on top of a pluggable transport. - * - * The client will automatically begin the initialization flow with the server when connect() is called. - * - * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: - * - * ```typescript - * // Custom schemas - * const CustomRequestSchema = RequestSchema.extend({...}) - * const CustomNotificationSchema = NotificationSchema.extend({...}) - * const CustomResultSchema = ResultSchema.extend({...}) - * - * // Type aliases - * type CustomRequest = z.infer - * type CustomNotification = z.infer - * type CustomResult = z.infer - * - * // Create typed client - * const client = new Client({ - * name: "CustomClient", - * version: "1.0.0" - * }) - * ``` - */ -export declare class Client extends Protocol { - private _clientInfo; - private _serverCapabilities?; - private _serverVersion?; - private _capabilities; - private _instructions?; - private _jsonSchemaValidator; - private _cachedToolOutputValidators; - private _cachedKnownTaskTools; - private _cachedRequiredTaskTools; - private _experimental?; - private _listChangedDebounceTimers; - private _pendingListChangedConfig?; - /** - * Initializes this client with the given name and version information. - */ - constructor(_clientInfo: Implementation, options?: ClientOptions); - /** - * Set up handlers for list changed notifications based on config and server capabilities. - * This should only be called after initialization when server capabilities are known. - * Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability. - * @internal - */ - private _setupListChangedHandlers; - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental(): { - tasks: ExperimentalClientTasks; - }; - /** - * Registers new capabilities. This can only be called before connecting to a transport. - * - * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). - */ - registerCapabilities(capabilities: ClientCapabilities): void; - /** - * Override request handler registration to enforce client-side validation for elicitation. - */ - setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => ClientResult | ResultT | Promise): void; - protected assertCapability(capability: keyof ServerCapabilities, method: string): void; - connect(transport: Transport, options?: RequestOptions): Promise; - /** - * After initialization has completed, this will be populated with the server's reported capabilities. - */ - getServerCapabilities(): ServerCapabilities | undefined; - /** - * After initialization has completed, this will be populated with information about the server's name and version. - */ - getServerVersion(): Implementation | undefined; - /** - * After initialization has completed, this may be populated with information about the server's instructions. - */ - getInstructions(): string | undefined; - protected assertCapabilityForMethod(method: RequestT['method']): void; - protected assertNotificationCapability(method: NotificationT['method']): void; - protected assertRequestHandlerCapability(method: string): void; - protected assertTaskCapability(method: string): void; - protected assertTaskHandlerCapability(method: string): void; - ping(options?: RequestOptions): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - complete(params: CompleteRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - completion: { - [x: string]: unknown; - values: string[]; - total?: number | undefined; - hasMore?: boolean | undefined; - }; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - setLoggingLevel(level: LoggingLevel, options?: RequestOptions): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - getPrompt(params: GetPromptRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - messages: { - role: "user" | "assistant"; - content: { - type: "text"; - text: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "image"; - data: string; - mimeType: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "audio"; - data: string; - mimeType: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "resource"; - resource: { - uri: string; - text: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - } | { - uri: string; - blob: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - }; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - uri: string; - name: string; - type: "resource_link"; - description?: string | undefined; - mimeType?: string | undefined; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - description?: string | undefined; - }>; - listPrompts(params?: ListPromptsRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - prompts: { - name: string; - description?: string | undefined; - arguments?: { - name: string; - description?: string | undefined; - required?: boolean | undefined; - }[] | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - nextCursor?: string | undefined; - }>; - listResources(params?: ListResourcesRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - resources: { - uri: string; - name: string; - description?: string | undefined; - mimeType?: string | undefined; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - nextCursor?: string | undefined; - }>; - listResourceTemplates(params?: ListResourceTemplatesRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - resourceTemplates: { - uriTemplate: string; - name: string; - description?: string | undefined; - mimeType?: string | undefined; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - nextCursor?: string | undefined; - }>; - readResource(params: ReadResourceRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - contents: ({ - uri: string; - text: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - } | { - uri: string; - blob: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - })[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - subscribeResource(params: SubscribeRequest['params'], options?: RequestOptions): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - unsubscribeResource(params: UnsubscribeRequest['params'], options?: RequestOptions): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - /** - * Calls a tool and waits for the result. Automatically validates structured output if the tool has an outputSchema. - * - * For task-based execution with streaming behavior, use client.experimental.tasks.callToolStream() instead. - */ - callTool(params: CallToolRequest['params'], resultSchema?: typeof CallToolResultSchema | typeof CompatibilityCallToolResultSchema, options?: RequestOptions): Promise<{ - [x: string]: unknown; - content: ({ - type: "text"; - text: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "image"; - data: string; - mimeType: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "audio"; - data: string; - mimeType: string; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - type: "resource"; - resource: { - uri: string; - text: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - } | { - uri: string; - blob: string; - mimeType?: string | undefined; - _meta?: Record | undefined; - }; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: Record | undefined; - } | { - uri: string; - name: string; - type: "resource_link"; - description?: string | undefined; - mimeType?: string | undefined; - annotations?: { - audience?: ("user" | "assistant")[] | undefined; - priority?: number | undefined; - lastModified?: string | undefined; - } | undefined; - _meta?: { - [x: string]: unknown; - } | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - })[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - structuredContent?: Record | undefined; - isError?: boolean | undefined; - } | { - [x: string]: unknown; - toolResult: unknown; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - private isToolTask; - /** - * Check if a tool requires task-based execution. - * Unlike isToolTask which includes 'optional' tools, this only checks for 'required'. - */ - private isToolTaskRequired; - /** - * Cache validators for tool output schemas. - * Called after listTools() to pre-compile validators for better performance. - */ - private cacheToolMetadata; - /** - * Get cached validator for a tool - */ - private getToolOutputValidator; - listTools(params?: ListToolsRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - tools: { - inputSchema: { - [x: string]: unknown; - type: "object"; - properties?: Record | undefined; - required?: string[] | undefined; - }; - name: string; - description?: string | undefined; - outputSchema?: { - [x: string]: unknown; - type: "object"; - properties?: Record | undefined; - required?: string[] | undefined; - } | undefined; - annotations?: { - title?: string | undefined; - readOnlyHint?: boolean | undefined; - destructiveHint?: boolean | undefined; - idempotentHint?: boolean | undefined; - openWorldHint?: boolean | undefined; - } | undefined; - execution?: { - taskSupport?: "optional" | "required" | "forbidden" | undefined; - } | undefined; - _meta?: Record | undefined; - icons?: { - src: string; - mimeType?: string | undefined; - sizes?: string[] | undefined; - theme?: "light" | "dark" | undefined; - }[] | undefined; - title?: string | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - nextCursor?: string | undefined; - }>; - /** - * Set up a single list changed handler. - * @internal - */ - private _setupListChangedHandler; - sendRootsListChanged(): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts.map deleted file mode 100644 index 12d0abf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EACH,KAAK,eAAe,EACpB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iCAAiC,EACtC,KAAK,eAAe,EAIpB,KAAK,gBAAgB,EAErB,KAAK,cAAc,EAGnB,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EAEzB,KAAK,4BAA4B,EAEjC,KAAK,gBAAgB,EAErB,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EAExB,KA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mBAAmB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;IAI5E,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;IAI9E,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;IAIxF;;;;OAIG;IACG,QAAQ,CACV,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,YAAY,GAAE,OAAO,oBAAoB,GAAG,OAAO,iCAAwD,EAC3G,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkD5B,OAAO,CAAC,UAAU;IAQlB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAuBzB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAIxB,SAAS,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAS7E;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAwD1B,oBAAoB;CAG7B"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js deleted file mode 100644 index 49b12c6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +++ /dev/null @@ -1,624 +0,0 @@ -import { mergeCapabilities, Protocol } from '../shared/protocol.js'; -import { CallToolResultSchema, CompleteResultSchema, EmptyResultSchema, ErrorCode, GetPromptResultSchema, InitializeResultSchema, LATEST_PROTOCOL_VERSION, ListPromptsResultSchema, ListResourcesResultSchema, ListResourceTemplatesResultSchema, ListToolsResultSchema, McpError, ReadResourceResultSchema, SUPPORTED_PROTOCOL_VERSIONS, ElicitResultSchema, ElicitRequestSchema, CreateTaskResultSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, ToolListChangedNotificationSchema, PromptListChangedNotificationSchema, ResourceListChangedNotificationSchema, ListChangedOptionsBaseSchema } from '../types.js'; -import { AjvJsonSchemaValidator } from '../validation/ajv-provider.js'; -import { getObjectShape, isZ4Schema, safeParse } from '../server/zod-compat.js'; -import { ExperimentalClientTasks } from '../experimental/tasks/client.js'; -import { assertToolsCallTaskCapability, assertClientRequestTaskCapability } from '../experimental/tasks/helpers.js'; -/** - * Elicitation default application helper. Applies defaults to the data based on the schema. - * - * @param schema - The schema to apply defaults to. - * @param data - The data to apply defaults to. - */ -function applyElicitationDefaults(schema, data) { - if (!schema || data === null || typeof data !== 'object') - return; - // Handle object properties - if (schema.type === 'object' && schema.properties && typeof schema.properties === 'object') { - const obj = data; - const props = schema.properties; - for (const key of Object.keys(props)) { - const propSchema = props[key]; - // If missing or explicitly undefined, apply default if present - if (obj[key] === undefined && Object.prototype.hasOwnProperty.call(propSchema, 'default')) { - obj[key] = propSchema.default; - } - // Recurse into existing nested objects/arrays - if (obj[key] !== undefined) { - applyElicitationDefaults(propSchema, obj[key]); - } - } - } - if (Array.isArray(schema.anyOf)) { - for (const sub of schema.anyOf) { - // Skip boolean schemas (true/false are valid JSON Schemas but have no defaults) - if (typeof sub !== 'boolean') { - applyElicitationDefaults(sub, data); - } - } - } - // Combine schemas - if (Array.isArray(schema.oneOf)) { - for (const sub of schema.oneOf) { - // Skip boolean schemas (true/false are valid JSON Schemas but have no defaults) - if (typeof sub !== 'boolean') { - applyElicitationDefaults(sub, data); - } - } - } -} -/** - * Determines which elicitation modes are supported based on declared client capabilities. - * - * According to the spec: - * - An empty elicitation capability object defaults to form mode support (backwards compatibility) - * - URL mode is only supported if explicitly declared - * - * @param capabilities - The client's elicitation capabilities - * @returns An object indicating which modes are supported - */ -export function getSupportedElicitationModes(capabilities) { - if (!capabilities) { - return { supportsFormMode: false, supportsUrlMode: false }; - } - const hasFormCapability = capabilities.form !== undefined; - const hasUrlCapability = capabilities.url !== undefined; - // If neither form nor url are explicitly declared, form mode is supported (backwards compatibility) - const supportsFormMode = hasFormCapability || (!hasFormCapability && !hasUrlCapability); - const supportsUrlMode = hasUrlCapability; - return { supportsFormMode, supportsUrlMode }; -} -/** - * An MCP client on top of a pluggable transport. - * - * The client will automatically begin the initialization flow with the server when connect() is called. - * - * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: - * - * ```typescript - * // Custom schemas - * const CustomRequestSchema = RequestSchema.extend({...}) - * const CustomNotificationSchema = NotificationSchema.extend({...}) - * const CustomResultSchema = ResultSchema.extend({...}) - * - * // Type aliases - * type CustomRequest = z.infer - * type CustomNotification = z.infer - * type CustomResult = z.infer - * - * // Create typed client - * const client = new Client({ - * name: "CustomClient", - * version: "1.0.0" - * }) - * ``` - */ -export class Client extends Protocol { - /** - * Initializes this client with the given name and version information. - */ - constructor(_clientInfo, options) { - super(options); - this._clientInfo = _clientInfo; - this._cachedToolOutputValidators = new Map(); - this._cachedKnownTaskTools = new Set(); - this._cachedRequiredTaskTools = new Set(); - this._listChangedDebounceTimers = new Map(); - this._capabilities = options?.capabilities ?? {}; - this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator(); - // Store list changed config for setup after connection (when we know server capabilities) - if (options?.listChanged) { - this._pendingListChangedConfig = options.listChanged; - } - } - /** - * Set up handlers for list changed notifications based on config and server capabilities. - * This should only be called after initialization when server capabilities are known. - * Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability. - * @internal - */ - _setupListChangedHandlers(config) { - if (config.tools && this._serverCapabilities?.tools?.listChanged) { - this._setupListChangedHandler('tools', ToolListChangedNotificationSchema, config.tools, async () => { - const result = await this.listTools(); - return result.tools; - }); - } - if (config.prompts && this._serverCapabilities?.prompts?.listChanged) { - this._setupListChangedHandler('prompts', PromptListChangedNotificationSchema, config.prompts, async () => { - const result = await this.listPrompts(); - return result.prompts; - }); - } - if (config.resources && this._serverCapabilities?.resources?.listChanged) { - this._setupListChangedHandler('resources', ResourceListChangedNotificationSchema, config.resources, async () => { - const result = await this.listResources(); - return result.resources; - }); - } - } - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental() { - if (!this._experimental) { - this._experimental = { - tasks: new ExperimentalClientTasks(this) - }; - } - return this._experimental; - } - /** - * Registers new capabilities. This can only be called before connecting to a transport. - * - * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). - */ - registerCapabilities(capabilities) { - if (this.transport) { - throw new Error('Cannot register capabilities after connecting to transport'); - } - this._capabilities = mergeCapabilities(this._capabilities, capabilities); - } - /** - * Override request handler registration to enforce client-side validation for elicitation. - */ - setRequestHandler(requestSchema, handler) { - const shape = getObjectShape(requestSchema); - const methodSchema = shape?.method; - if (!methodSchema) { - throw new Error('Schema is missing a method literal'); - } - // Extract literal value using type-safe property access - let methodValue; - if (isZ4Schema(methodSchema)) { - const v4Schema = methodSchema; - const v4Def = v4Schema._zod?.def; - methodValue = v4Def?.value ?? v4Schema.value; - } - else { - const v3Schema = methodSchema; - const legacyDef = v3Schema._def; - methodValue = legacyDef?.value ?? v3Schema.value; - } - if (typeof methodValue !== 'string') { - throw new Error('Schema method literal must be a string'); - } - const method = methodValue; - if (method === 'elicitation/create') { - const wrappedHandler = async (request, extra) => { - const validatedRequest = safeParse(ElicitRequestSchema, request); - if (!validatedRequest.success) { - // Type guard: if success is false, error is guaranteed to exist - const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error); - throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation request: ${errorMessage}`); - } - const { params } = validatedRequest.data; - params.mode = params.mode ?? 'form'; - const { supportsFormMode, supportsUrlMode } = getSupportedElicitationModes(this._capabilities.elicitation); - if (params.mode === 'form' && !supportsFormMode) { - throw new McpError(ErrorCode.InvalidParams, 'Client does not support form-mode elicitation requests'); - } - if (params.mode === 'url' && !supportsUrlMode) { - throw new McpError(ErrorCode.InvalidParams, 'Client does not support URL-mode elicitation requests'); - } - const result = await Promise.resolve(handler(request, extra)); - // When task creation is requested, validate and return CreateTaskResult - if (params.task) { - const taskValidationResult = safeParse(CreateTaskResultSchema, result); - if (!taskValidationResult.success) { - const errorMessage = taskValidationResult.error instanceof Error - ? taskValidationResult.error.message - : String(taskValidationResult.error); - throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`); - } - return taskValidationResult.data; - } - // For non-task requests, validate against ElicitResultSchema - const validationResult = safeParse(ElicitResultSchema, result); - if (!validationResult.success) { - // Type guard: if success is false, error is guaranteed to exist - const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error); - throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation result: ${errorMessage}`); - } - const validatedResult = validationResult.data; - const requestedSchema = params.mode === 'form' ? params.requestedSchema : undefined; - if (params.mode === 'form' && validatedResult.action === 'accept' && validatedResult.content && requestedSchema) { - if (this._capabilities.elicitation?.form?.applyDefaults) { - try { - applyElicitationDefaults(requestedSchema, validatedResult.content); - } - catch { - // gracefully ignore errors in default application - } - } - } - return validatedResult; - }; - // Install the wrapped handler - return super.setRequestHandler(requestSchema, wrappedHandler); - } - if (method === 'sampling/createMessage') { - const wrappedHandler = async (request, extra) => { - const validatedRequest = safeParse(CreateMessageRequestSchema, request); - if (!validatedRequest.success) { - const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error); - throw new McpError(ErrorCode.InvalidParams, `Invalid sampling request: ${errorMessage}`); - } - const { params } = validatedRequest.data; - const result = await Promise.resolve(handler(request, extra)); - // When task creation is requested, validate and return CreateTaskResult - if (params.task) { - const taskValidationResult = safeParse(CreateTaskResultSchema, result); - if (!taskValidationResult.success) { - const errorMessage = taskValidationResult.error instanceof Error - ? taskValidationResult.error.message - : String(taskValidationResult.error); - throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`); - } - return taskValidationResult.data; - } - // For non-task requests, validate against appropriate schema based on tools presence - const hasTools = params.tools || params.toolChoice; - const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema; - const validationResult = safeParse(resultSchema, result); - if (!validationResult.success) { - const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error); - throw new McpError(ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`); - } - return validationResult.data; - }; - // Install the wrapped handler - return super.setRequestHandler(requestSchema, wrappedHandler); - } - // Other handlers use default behavior - return super.setRequestHandler(requestSchema, handler); - } - assertCapability(capability, method) { - if (!this._serverCapabilities?.[capability]) { - throw new Error(`Server does not support ${capability} (required for ${method})`); - } - } - async connect(transport, options) { - await super.connect(transport); - // When transport sessionId is already set this means we are trying to reconnect. - // In this case we don't need to initialize again. - if (transport.sessionId !== undefined) { - return; - } - try { - const result = await this.request({ - method: 'initialize', - params: { - protocolVersion: LATEST_PROTOCOL_VERSION, - capabilities: this._capabilities, - clientInfo: this._clientInfo - } - }, InitializeResultSchema, options); - if (result === undefined) { - throw new Error(`Server sent invalid initialize result: ${result}`); - } - if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) { - throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`); - } - this._serverCapabilities = result.capabilities; - this._serverVersion = result.serverInfo; - // HTTP transports must set the protocol version in each header after initialization. - if (transport.setProtocolVersion) { - transport.setProtocolVersion(result.protocolVersion); - } - this._instructions = result.instructions; - await this.notification({ - method: 'notifications/initialized' - }); - // Set up list changed handlers now that we know server capabilities - if (this._pendingListChangedConfig) { - this._setupListChangedHandlers(this._pendingListChangedConfig); - this._pendingListChangedConfig = undefined; - } - } - catch (error) { - // Disconnect if initialization fails. - void this.close(); - throw error; - } - } - /** - * After initialization has completed, this will be populated with the server's reported capabilities. - */ - getServerCapabilities() { - return this._serverCapabilities; - } - /** - * After initialization has completed, this will be populated with information about the server's name and version. - */ - getServerVersion() { - return this._serverVersion; - } - /** - * After initialization has completed, this may be populated with information about the server's instructions. - */ - getInstructions() { - return this._instructions; - } - assertCapabilityForMethod(method) { - switch (method) { - case 'logging/setLevel': - if (!this._serverCapabilities?.logging) { - throw new Error(`Server does not support logging (required for ${method})`); - } - break; - case 'prompts/get': - case 'prompts/list': - if (!this._serverCapabilities?.prompts) { - throw new Error(`Server does not support prompts (required for ${method})`); - } - break; - case 'resources/list': - case 'resources/templates/list': - case 'resources/read': - case 'resources/subscribe': - case 'resources/unsubscribe': - if (!this._serverCapabilities?.resources) { - throw new Error(`Server does not support resources (required for ${method})`); - } - if (method === 'resources/subscribe' && !this._serverCapabilities.resources.subscribe) { - throw new Error(`Server does not support resource subscriptions (required for ${method})`); - } - break; - case 'tools/call': - case 'tools/list': - if (!this._serverCapabilities?.tools) { - throw new Error(`Server does not support tools (required for ${method})`); - } - break; - case 'completion/complete': - if (!this._serverCapabilities?.completions) { - throw new Error(`Server does not support completions (required for ${method})`); - } - break; - case 'initialize': - // No specific capability required for initialize - break; - case 'ping': - // No specific capability required for ping - break; - } - } - assertNotificationCapability(method) { - switch (method) { - case 'notifications/roots/list_changed': - if (!this._capabilities.roots?.listChanged) { - throw new Error(`Client does not support roots list changed notifications (required for ${method})`); - } - break; - case 'notifications/initialized': - // No specific capability required for initialized - break; - case 'notifications/cancelled': - // Cancellation notifications are always allowed - break; - case 'notifications/progress': - // Progress notifications are always allowed - break; - } - } - assertRequestHandlerCapability(method) { - // Task handlers are registered in Protocol constructor before _capabilities is initialized - // Skip capability check for task methods during initialization - if (!this._capabilities) { - return; - } - switch (method) { - case 'sampling/createMessage': - if (!this._capabilities.sampling) { - throw new Error(`Client does not support sampling capability (required for ${method})`); - } - break; - case 'elicitation/create': - if (!this._capabilities.elicitation) { - throw new Error(`Client does not support elicitation capability (required for ${method})`); - } - break; - case 'roots/list': - if (!this._capabilities.roots) { - throw new Error(`Client does not support roots capability (required for ${method})`); - } - break; - case 'tasks/get': - case 'tasks/list': - case 'tasks/result': - case 'tasks/cancel': - if (!this._capabilities.tasks) { - throw new Error(`Client does not support tasks capability (required for ${method})`); - } - break; - case 'ping': - // No specific capability required for ping - break; - } - } - assertTaskCapability(method) { - assertToolsCallTaskCapability(this._serverCapabilities?.tasks?.requests, method, 'Server'); - } - assertTaskHandlerCapability(method) { - // Task handlers are registered in Protocol constructor before _capabilities is initialized - // Skip capability check for task methods during initialization - if (!this._capabilities) { - return; - } - assertClientRequestTaskCapability(this._capabilities.tasks?.requests, method, 'Client'); - } - async ping(options) { - return this.request({ method: 'ping' }, EmptyResultSchema, options); - } - async complete(params, options) { - return this.request({ method: 'completion/complete', params }, CompleteResultSchema, options); - } - async setLoggingLevel(level, options) { - return this.request({ method: 'logging/setLevel', params: { level } }, EmptyResultSchema, options); - } - async getPrompt(params, options) { - return this.request({ method: 'prompts/get', params }, GetPromptResultSchema, options); - } - async listPrompts(params, options) { - return this.request({ method: 'prompts/list', params }, ListPromptsResultSchema, options); - } - async listResources(params, options) { - return this.request({ method: 'resources/list', params }, ListResourcesResultSchema, options); - } - async listResourceTemplates(params, options) { - return this.request({ method: 'resources/templates/list', params }, ListResourceTemplatesResultSchema, options); - } - async readResource(params, options) { - return this.request({ method: 'resources/read', params }, ReadResourceResultSchema, options); - } - async subscribeResource(params, options) { - return this.request({ method: 'resources/subscribe', params }, EmptyResultSchema, options); - } - async unsubscribeResource(params, options) { - return this.request({ method: 'resources/unsubscribe', params }, EmptyResultSchema, options); - } - /** - * Calls a tool and waits for the result. Automatically validates structured output if the tool has an outputSchema. - * - * For task-based execution with streaming behavior, use client.experimental.tasks.callToolStream() instead. - */ - async callTool(params, resultSchema = CallToolResultSchema, options) { - // Guard: required-task tools need experimental API - if (this.isToolTaskRequired(params.name)) { - throw new McpError(ErrorCode.InvalidRequest, `Tool "${params.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`); - } - const result = await this.request({ method: 'tools/call', params }, resultSchema, options); - // Check if the tool has an outputSchema - const validator = this.getToolOutputValidator(params.name); - if (validator) { - // If tool has outputSchema, it MUST return structuredContent (unless it's an error) - if (!result.structuredContent && !result.isError) { - throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`); - } - // Only validate structured content if present (not when there's an error) - if (result.structuredContent) { - try { - // Validate the structured content against the schema - const validationResult = validator(result.structuredContent); - if (!validationResult.valid) { - throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`); - } - } - catch (error) { - if (error instanceof McpError) { - throw error; - } - throw new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`); - } - } - } - return result; - } - isToolTask(toolName) { - if (!this._serverCapabilities?.tasks?.requests?.tools?.call) { - return false; - } - return this._cachedKnownTaskTools.has(toolName); - } - /** - * Check if a tool requires task-based execution. - * Unlike isToolTask which includes 'optional' tools, this only checks for 'required'. - */ - isToolTaskRequired(toolName) { - return this._cachedRequiredTaskTools.has(toolName); - } - /** - * Cache validators for tool output schemas. - * Called after listTools() to pre-compile validators for better performance. - */ - cacheToolMetadata(tools) { - this._cachedToolOutputValidators.clear(); - this._cachedKnownTaskTools.clear(); - this._cachedRequiredTaskTools.clear(); - for (const tool of tools) { - // If the tool has an outputSchema, create and cache the validator - if (tool.outputSchema) { - const toolValidator = this._jsonSchemaValidator.getValidator(tool.outputSchema); - this._cachedToolOutputValidators.set(tool.name, toolValidator); - } - // If the tool supports task-based execution, cache that information - const taskSupport = tool.execution?.taskSupport; - if (taskSupport === 'required' || taskSupport === 'optional') { - this._cachedKnownTaskTools.add(tool.name); - } - if (taskSupport === 'required') { - this._cachedRequiredTaskTools.add(tool.name); - } - } - } - /** - * Get cached validator for a tool - */ - getToolOutputValidator(toolName) { - return this._cachedToolOutputValidators.get(toolName); - } - async listTools(params, options) { - const result = await this.request({ method: 'tools/list', params }, ListToolsResultSchema, options); - // Cache the tools and their output schemas for future validation - this.cacheToolMetadata(result.tools); - return result; - } - /** - * Set up a single list changed handler. - * @internal - */ - _setupListChangedHandler(listType, notificationSchema, options, fetcher) { - // Validate options using Zod schema (validates autoRefresh and debounceMs) - const parseResult = ListChangedOptionsBaseSchema.safeParse(options); - if (!parseResult.success) { - throw new Error(`Invalid ${listType} listChanged options: ${parseResult.error.message}`); - } - // Validate callback - if (typeof options.onChanged !== 'function') { - throw new Error(`Invalid ${listType} listChanged options: onChanged must be a function`); - } - const { autoRefresh, debounceMs } = parseResult.data; - const { onChanged } = options; - const refresh = async () => { - if (!autoRefresh) { - onChanged(null, null); - return; - } - try { - const items = await fetcher(); - onChanged(null, items); - } - catch (e) { - const error = e instanceof Error ? e : new Error(String(e)); - onChanged(error, null); - } - }; - const handler = () => { - if (debounceMs) { - // Clear any pending debounce timer for this list type - const existingTimer = this._listChangedDebounceTimers.get(listType); - if (existingTimer) { - clearTimeout(existingTimer); - } - // Set up debounced refresh - const timer = setTimeout(refresh, debounceMs); - this._listChangedDebounceTimers.set(listType, timer); - } - else { - // No debounce, refresh immediately - refresh(); - } - }; - // Register notification handler - this.setNotificationHandler(notificationSchema, handler); - } - async sendRootsListChanged() { - return this.notification({ method: 'notifications/roots/list_changed' }); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map deleted file mode 100644 index da53f92..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAA6C,MAAM,uBAAuB,CAAC;AAG/G,OAAO,EAEH,oBAAoB,EAOpB,oBAAoB,EACpB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AAsB,CAAC,kBAAqC,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED,KAAK,CAAC,oBAAoB;QACtB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC7E,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.d.ts deleted file mode 100644 index 726ac57..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { OAuthClientProvider } from './auth.js'; -import { FetchLike } from '../shared/transport.js'; -/** - * Middleware function that wraps and enhances fetch functionality. - * Takes a fetch handler and returns an enhanced fetch handler. - */ -export type Middleware = (next: FetchLike) => FetchLike; -/** - * Creates a fetch wrapper that handles OAuth authentication automatically. - * - * This wrapper will: - * - Add Authorization headers with access tokens - * - Handle 401 responses by attempting re-authentication - * - Retry the original request after successful auth - * - Handle OAuth errors appropriately (InvalidClientError, etc.) - * - * The baseUrl parameter is optional and defaults to using the domain from the request URL. - * However, you should explicitly provide baseUrl when: - * - Making requests to multiple subdomains (e.g., api.example.com, cdn.example.com) - * - Using API paths that differ from OAuth discovery paths (e.g., requesting /api/v1/data but OAuth is at /) - * - The OAuth server is on a different domain than your API requests - * - You want to ensure consistent OAuth behavior regardless of request URLs - * - * For MCP transports, set baseUrl to the same URL you pass to the transport constructor. - * - * Note: This wrapper is designed for general-purpose fetch operations. - * MCP transports (SSE and StreamableHTTP) already have built-in OAuth handling - * and should not need this wrapper. - * - * @param provider - OAuth client provider for authentication - * @param baseUrl - Base URL for OAuth server discovery (defaults to request URL domain) - * @returns A fetch middleware function - */ -export declare const withOAuth: (provider: OAuthClientProvider, baseUrl?: string | URL) => Middleware; -/** - * Logger function type for HTTP requests - */ -export type RequestLogger = (input: { - method: string; - url: string | URL; - status: number; - statusText: string; - duration: number; - requestHeaders?: Headers; - responseHeaders?: Headers; - error?: Error; -}) => void; -/** - * Configuration options for the logging middleware - */ -export type LoggingOptions = { - /** - * Custom logger function, defaults to console logging - */ - logger?: RequestLogger; - /** - * Whether to include request headers in logs - * @default false - */ - includeRequestHeaders?: boolean; - /** - * Whether to include response headers in logs - * @default false - */ - includeResponseHeaders?: boolean; - /** - * Status level filter - only log requests with status >= this value - * Set to 0 to log all requests, 400 to log only errors - * @default 0 - */ - statusLevel?: number; -}; -/** - * Creates a fetch middleware that logs HTTP requests and responses. - * - * When called without arguments `withLogging()`, it uses the default logger that: - * - Logs successful requests (2xx) to `console.log` - * - Logs error responses (4xx/5xx) and network errors to `console.error` - * - Logs all requests regardless of status (statusLevel: 0) - * - Does not include request or response headers in logs - * - Measures and displays request duration in milliseconds - * - * Important: the default logger uses both `console.log` and `console.error` so it should not be used with - * `stdio` transports and applications. - * - * @param options - Logging configuration options - * @returns A fetch middleware function - */ -export declare const withLogging: (options?: LoggingOptions) => Middleware; -/** - * Composes multiple fetch middleware functions into a single middleware pipeline. - * Middleware are applied in the order they appear, creating a chain of handlers. - * - * @example - * ```typescript - * // Create a middleware pipeline that handles both OAuth and logging - * const enhancedFetch = applyMiddlewares( - * withOAuth(oauthProvider, 'https://api.example.com'), - * withLogging({ statusLevel: 400 }) - * )(fetch); - * - * // Use the enhanced fetch - it will handle auth and log errors - * const response = await enhancedFetch('https://api.example.com/data'); - * ``` - * - * @param middleware - Array of fetch middleware to compose into a pipeline - * @returns A single composed middleware function - */ -export declare const applyMiddlewares: (...middleware: Middleware[]) => Middleware; -/** - * Helper function to create custom fetch middleware with cleaner syntax. - * Provides the next handler and request details as separate parameters for easier access. - * - * @example - * ```typescript - * // Create custom authentication middleware - * const customAuthMiddleware = createMiddleware(async (next, input, init) => { - * const headers = new Headers(init?.headers); - * headers.set('X-Custom-Auth', 'my-token'); - * - * const response = await next(input, { ...init, headers }); - * - * if (response.status === 401) { - * console.log('Authentication failed'); - * } - * - * return response; - * }); - * - * // Create conditional middleware - * const conditionalMiddleware = createMiddleware(async (next, input, init) => { - * const url = typeof input === 'string' ? input : input.toString(); - * - * // Only add headers for API routes - * if (url.includes('/api/')) { - * const headers = new Headers(init?.headers); - * headers.set('X-API-Version', 'v2'); - * return next(input, { ...init, headers }); - * } - * - * // Pass through for non-API routes - * return next(input, init); - * }); - * - * // Create caching middleware - * const cacheMiddleware = createMiddleware(async (next, input, init) => { - * const cacheKey = typeof input === 'string' ? input : input.toString(); - * - * // Check cache first - * const cached = await getFromCache(cacheKey); - * if (cached) { - * return new Response(cached, { status: 200 }); - * } - * - * // Make request and cache result - * const response = await next(input, init); - * if (response.ok) { - * await saveToCache(cacheKey, await response.clone().text()); - * } - * - * return response; - * }); - * ``` - * - * @param handler - Function that receives the next handler and request parameters - * @returns A fetch middleware function - */ -export declare const createMiddleware: (handler: (next: FetchLike, input: string | URL, init?: RequestInit) => Promise) => Middleware; -//# sourceMappingURL=middleware.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.d.ts.map deleted file mode 100644 index 88ac778..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../src/client/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AACvG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,SAAS,aACP,mBAAmB,YAAY,MAAM,GAAG,GAAG,KAAG,UA0DxD,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB,KAAK,IAAI,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,aAAa,cAAc,KAAQ,UA6E1D,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,kBAAmB,UAAU,EAAE,KAAG,UAI9D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,gBAAgB,YAAa,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,KAAG,UAE3H,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js deleted file mode 100644 index bfeb976..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js +++ /dev/null @@ -1,245 +0,0 @@ -import { auth, extractWWWAuthenticateParams, UnauthorizedError } from './auth.js'; -/** - * Creates a fetch wrapper that handles OAuth authentication automatically. - * - * This wrapper will: - * - Add Authorization headers with access tokens - * - Handle 401 responses by attempting re-authentication - * - Retry the original request after successful auth - * - Handle OAuth errors appropriately (InvalidClientError, etc.) - * - * The baseUrl parameter is optional and defaults to using the domain from the request URL. - * However, you should explicitly provide baseUrl when: - * - Making requests to multiple subdomains (e.g., api.example.com, cdn.example.com) - * - Using API paths that differ from OAuth discovery paths (e.g., requesting /api/v1/data but OAuth is at /) - * - The OAuth server is on a different domain than your API requests - * - You want to ensure consistent OAuth behavior regardless of request URLs - * - * For MCP transports, set baseUrl to the same URL you pass to the transport constructor. - * - * Note: This wrapper is designed for general-purpose fetch operations. - * MCP transports (SSE and StreamableHTTP) already have built-in OAuth handling - * and should not need this wrapper. - * - * @param provider - OAuth client provider for authentication - * @param baseUrl - Base URL for OAuth server discovery (defaults to request URL domain) - * @returns A fetch middleware function - */ -export const withOAuth = (provider, baseUrl) => next => { - return async (input, init) => { - const makeRequest = async () => { - const headers = new Headers(init?.headers); - // Add authorization header if tokens are available - const tokens = await provider.tokens(); - if (tokens) { - headers.set('Authorization', `Bearer ${tokens.access_token}`); - } - return await next(input, { ...init, headers }); - }; - let response = await makeRequest(); - // Handle 401 responses by attempting re-authentication - if (response.status === 401) { - try { - const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response); - // Use provided baseUrl or extract from request URL - const serverUrl = baseUrl || (typeof input === 'string' ? new URL(input).origin : input.origin); - const result = await auth(provider, { - serverUrl, - resourceMetadataUrl, - scope, - fetchFn: next - }); - if (result === 'REDIRECT') { - throw new UnauthorizedError('Authentication requires user authorization - redirect initiated'); - } - if (result !== 'AUTHORIZED') { - throw new UnauthorizedError(`Authentication failed with result: ${result}`); - } - // Retry the request with fresh tokens - response = await makeRequest(); - } - catch (error) { - if (error instanceof UnauthorizedError) { - throw error; - } - throw new UnauthorizedError(`Failed to re-authenticate: ${error instanceof Error ? error.message : String(error)}`); - } - } - // If we still have a 401 after re-auth attempt, throw an error - if (response.status === 401) { - const url = typeof input === 'string' ? input : input.toString(); - throw new UnauthorizedError(`Authentication failed for ${url}`); - } - return response; - }; -}; -/** - * Creates a fetch middleware that logs HTTP requests and responses. - * - * When called without arguments `withLogging()`, it uses the default logger that: - * - Logs successful requests (2xx) to `console.log` - * - Logs error responses (4xx/5xx) and network errors to `console.error` - * - Logs all requests regardless of status (statusLevel: 0) - * - Does not include request or response headers in logs - * - Measures and displays request duration in milliseconds - * - * Important: the default logger uses both `console.log` and `console.error` so it should not be used with - * `stdio` transports and applications. - * - * @param options - Logging configuration options - * @returns A fetch middleware function - */ -export const withLogging = (options = {}) => { - const { logger, includeRequestHeaders = false, includeResponseHeaders = false, statusLevel = 0 } = options; - const defaultLogger = input => { - const { method, url, status, statusText, duration, requestHeaders, responseHeaders, error } = input; - let message = error - ? `HTTP ${method} ${url} failed: ${error.message} (${duration}ms)` - : `HTTP ${method} ${url} ${status} ${statusText} (${duration}ms)`; - // Add headers to message if requested - if (includeRequestHeaders && requestHeaders) { - const reqHeaders = Array.from(requestHeaders.entries()) - .map(([key, value]) => `${key}: ${value}`) - .join(', '); - message += `\n Request Headers: {${reqHeaders}}`; - } - if (includeResponseHeaders && responseHeaders) { - const resHeaders = Array.from(responseHeaders.entries()) - .map(([key, value]) => `${key}: ${value}`) - .join(', '); - message += `\n Response Headers: {${resHeaders}}`; - } - if (error || status >= 400) { - // eslint-disable-next-line no-console - console.error(message); - } - else { - // eslint-disable-next-line no-console - console.log(message); - } - }; - const logFn = logger || defaultLogger; - return next => async (input, init) => { - const startTime = performance.now(); - const method = init?.method || 'GET'; - const url = typeof input === 'string' ? input : input.toString(); - const requestHeaders = includeRequestHeaders ? new Headers(init?.headers) : undefined; - try { - const response = await next(input, init); - const duration = performance.now() - startTime; - // Only log if status meets the log level threshold - if (response.status >= statusLevel) { - logFn({ - method, - url, - status: response.status, - statusText: response.statusText, - duration, - requestHeaders, - responseHeaders: includeResponseHeaders ? response.headers : undefined - }); - } - return response; - } - catch (error) { - const duration = performance.now() - startTime; - // Always log errors regardless of log level - logFn({ - method, - url, - status: 0, - statusText: 'Network Error', - duration, - requestHeaders, - error: error - }); - throw error; - } - }; -}; -/** - * Composes multiple fetch middleware functions into a single middleware pipeline. - * Middleware are applied in the order they appear, creating a chain of handlers. - * - * @example - * ```typescript - * // Create a middleware pipeline that handles both OAuth and logging - * const enhancedFetch = applyMiddlewares( - * withOAuth(oauthProvider, 'https://api.example.com'), - * withLogging({ statusLevel: 400 }) - * )(fetch); - * - * // Use the enhanced fetch - it will handle auth and log errors - * const response = await enhancedFetch('https://api.example.com/data'); - * ``` - * - * @param middleware - Array of fetch middleware to compose into a pipeline - * @returns A single composed middleware function - */ -export const applyMiddlewares = (...middleware) => { - return next => { - return middleware.reduce((handler, mw) => mw(handler), next); - }; -}; -/** - * Helper function to create custom fetch middleware with cleaner syntax. - * Provides the next handler and request details as separate parameters for easier access. - * - * @example - * ```typescript - * // Create custom authentication middleware - * const customAuthMiddleware = createMiddleware(async (next, input, init) => { - * const headers = new Headers(init?.headers); - * headers.set('X-Custom-Auth', 'my-token'); - * - * const response = await next(input, { ...init, headers }); - * - * if (response.status === 401) { - * console.log('Authentication failed'); - * } - * - * return response; - * }); - * - * // Create conditional middleware - * const conditionalMiddleware = createMiddleware(async (next, input, init) => { - * const url = typeof input === 'string' ? input : input.toString(); - * - * // Only add headers for API routes - * if (url.includes('/api/')) { - * const headers = new Headers(init?.headers); - * headers.set('X-API-Version', 'v2'); - * return next(input, { ...init, headers }); - * } - * - * // Pass through for non-API routes - * return next(input, init); - * }); - * - * // Create caching middleware - * const cacheMiddleware = createMiddleware(async (next, input, init) => { - * const cacheKey = typeof input === 'string' ? input : input.toString(); - * - * // Check cache first - * const cached = await getFromCache(cacheKey); - * if (cached) { - * return new Response(cached, { status: 200 }); - * } - * - * // Make request and cache result - * const response = await next(input, init); - * if (response.ok) { - * await saveToCache(cacheKey, await response.clone().text()); - * } - * - * return response; - * }); - * ``` - * - * @param handler - Function that receives the next handler and request parameters - * @returns A fetch middleware function - */ -export const createMiddleware = (handler) => { - return next => (input, init) => handler(next, input, init); -}; -//# sourceMappingURL=middleware.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js.map deleted file mode 100644 index e3ded1a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/client/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,4BAA4B,EAAuB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AASvG;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,SAAS,GAClB,CAAC,QAA6B,EAAE,OAAsB,EAAc,EAAE,CACtE,IAAI,CAAC,EAAE;IACH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,WAAW,GAAG,KAAK,IAAuB,EAAE;YAC9C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAE3C,mDAAmD;YACnD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC;YACvC,IAAI,MAAM,EAAE,CAAC;gBACT,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YAClE,CAAC;YAED,OAAO,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACnD,CAAC,CAAC;QAEF,IAAI,QAAQ,GAAG,MAAM,WAAW,EAAE,CAAC;QAEnC,uDAAuD;QACvD,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B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C,UAAU;oBAC/B,QAAQ;oBACR,cAAc;oBACd,eAAe,EAAE,sBAAsB,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;iBACzE,CAAC,CAAC;YACP,CAAC;YAED,OAAO,QAAQ,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;YAE/C,4CAA4C;YAC5C,KAAK,CAAC;gBACF,MAAM;gBACN,GAAG;gBACH,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,eAAe;gBAC3B,QAAQ;gBACR,cAAc;gBACd,KAAK,EAAE,KAAc;aACxB,CAAC,CAAC;YAEH,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC,CAAC;AACN,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAG,UAAwB,EAAc,EAAE;IACxE,OAAO,IAAI,CAAC,EAAE;QACV,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC,CAAC;AACN,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAwF,EAAc,EAAE;IACrI,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAqB,EAAE,IAAI,CAAC,CAAC;AAC/E,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts deleted file mode 100644 index acf99f1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { type ErrorEvent, type EventSourceInit } from 'eventsource'; -import { Transport, FetchLike } from '../shared/transport.js'; -import { JSONRPCMessage } from '../types.js'; -import { OAuthClientProvider } from './auth.js'; -export declare class SseError extends Error { - readonly code: number | undefined; - readonly event: ErrorEvent; - constructor(code: number | undefined, message: string | undefined, event: ErrorEvent); -} -/** - * Configuration options for the `SSEClientTransport`. - */ -export type SSEClientTransportOptions = { - /** - * An OAuth client provider to use for authentication. - * - * When an `authProvider` is specified and the SSE connection is started: - * 1. The connection is attempted with any existing access token from the `authProvider`. - * 2. If the access token has expired, the `authProvider` is used to refresh the token. - * 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`. - * - * After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `SSEClientTransport.finishAuth` with the authorization code before retrying the connection. - * - * If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown. - * - * `UnauthorizedError` might also be thrown when sending any message over the SSE transport, indicating that the session has expired, and needs to be re-authed and reconnected. - */ - authProvider?: OAuthClientProvider; - /** - * Customizes the initial SSE request to the server (the request that begins the stream). - * - * NOTE: Setting this property will prevent an `Authorization` header from - * being automatically attached to the SSE request, if an `authProvider` is - * also given. This can be worked around by setting the `Authorization` header - * manually. - */ - eventSourceInit?: EventSourceInit; - /** - * Customizes recurring POST requests to the server. - */ - requestInit?: RequestInit; - /** - * Custom fetch implementation used for all network requests. - */ - fetch?: FetchLike; -}; -/** - * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving - * messages and make separate POST requests for sending messages. - * @deprecated SSEClientTransport is deprecated. Prefer to use StreamableHTTPClientTransport where possible instead. Note that because some servers are still using SSE, clients may need to support both transports during the migration period. - */ -export declare class SSEClientTransport implements Transport { - private _eventSource?; - private _endpoint?; - private _abortController?; - private _url; - private _resourceMetadataUrl?; - private _scope?; - private _eventSourceInit?; - private _requestInit?; - private _authProvider?; - private _fetch?; - private _fetchWithInit; - private _protocolVersion?; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - constructor(url: URL, opts?: SSEClientTransportOptions); - private _authThenStart; - private _commonHeaders; - private _startOrAuth; - start(): Promise; - /** - * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. - */ - finishAuth(authorizationCode: string): Promise; - close(): Promise; - send(message: JSONRPCMessage): Promise; - setProtocolVersion(version: string): void; -} -//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts.map deleted file mode 100644 index 14ee939..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/client/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAyC,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAkD,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AAEnH,qBAAa,QAAS,SAAQ,KAAK;aAEX,IAAI,EAAE,MAAM,GAAG,SAAS;aAExB,KAAK,EAAE,UAAU;gBAFjB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS,EACX,KAAK,EAAE,UAAU;CAIxC;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC;;;;;;;;;;;;;OAaG;IACH,YAAY,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 No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js deleted file mode 100644 index 58c4741..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js +++ /dev/null @@ -1,206 +0,0 @@ -import { EventSource } from 'eventsource'; -import { createFetchWithInit, normalizeHeaders } from '../shared/transport.js'; -import { JSONRPCMessageSchema } from '../types.js'; -import { auth, extractWWWAuthenticateParams, UnauthorizedError } from './auth.js'; -export class SseError extends Error { - constructor(code, message, event) { - super(`SSE error: ${message}`); - this.code = code; - this.event = event; - } -} -/** - * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving - * messages and make separate POST requests for sending messages. - * @deprecated SSEClientTransport is deprecated. Prefer to use StreamableHTTPClientTransport where possible instead. Note that because some servers are still using SSE, clients may need to support both transports during the migration period. - */ -export class SSEClientTransport { - constructor(url, opts) { - this._url = url; - this._resourceMetadataUrl = undefined; - this._scope = undefined; - this._eventSourceInit = opts?.eventSourceInit; - this._requestInit = opts?.requestInit; - this._authProvider = opts?.authProvider; - this._fetch = opts?.fetch; - this._fetchWithInit = createFetchWithInit(opts?.fetch, opts?.requestInit); - } - async _authThenStart() { - if (!this._authProvider) { - throw new UnauthorizedError('No auth provider'); - } - let result; - try { - result = await auth(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - } - catch (error) { - this.onerror?.(error); - throw error; - } - if (result !== 'AUTHORIZED') { - throw new UnauthorizedError(); - } - return await this._startOrAuth(); - } - async _commonHeaders() { - const headers = {}; - if (this._authProvider) { - const tokens = await this._authProvider.tokens(); - if (tokens) { - headers['Authorization'] = `Bearer ${tokens.access_token}`; - } - } - if (this._protocolVersion) { - headers['mcp-protocol-version'] = this._protocolVersion; - } - const extraHeaders = normalizeHeaders(this._requestInit?.headers); - return new Headers({ - ...headers, - ...extraHeaders - }); - } - _startOrAuth() { - const fetchImpl = (this?._eventSourceInit?.fetch ?? this._fetch ?? fetch); - return new Promise((resolve, reject) => { - this._eventSource = new EventSource(this._url.href, { - ...this._eventSourceInit, - fetch: async (url, init) => { - const headers = await this._commonHeaders(); - headers.set('Accept', 'text/event-stream'); - const response = await fetchImpl(url, { - ...init, - headers - }); - if (response.status === 401 && response.headers.has('www-authenticate')) { - const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response); - this._resourceMetadataUrl = resourceMetadataUrl; - this._scope = scope; - } - return response; - } - }); - this._abortController = new AbortController(); - this._eventSource.onerror = event => { - if (event.code === 401 && this._authProvider) { - this._authThenStart().then(resolve, reject); - return; - } - const error = new SseError(event.code, event.message, event); - reject(error); - this.onerror?.(error); - }; - this._eventSource.onopen = () => { - // The connection is open, but we need to wait for the endpoint to be received. - }; - this._eventSource.addEventListener('endpoint', (event) => { - const messageEvent = event; - try { - this._endpoint = new URL(messageEvent.data, this._url); - if (this._endpoint.origin !== this._url.origin) { - throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`); - } - } - catch (error) { - reject(error); - this.onerror?.(error); - void this.close(); - return; - } - resolve(); - }); - this._eventSource.onmessage = (event) => { - const messageEvent = event; - let message; - try { - message = JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data)); - } - catch (error) { - this.onerror?.(error); - return; - } - this.onmessage?.(message); - }; - }); - } - async start() { - if (this._eventSource) { - throw new Error('SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.'); - } - return await this._startOrAuth(); - } - /** - * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. - */ - async finishAuth(authorizationCode) { - if (!this._authProvider) { - throw new UnauthorizedError('No auth provider'); - } - const result = await auth(this._authProvider, { - serverUrl: this._url, - authorizationCode, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - if (result !== 'AUTHORIZED') { - throw new UnauthorizedError('Failed to authorize'); - } - } - async close() { - this._abortController?.abort(); - this._eventSource?.close(); - this.onclose?.(); - } - async send(message) { - if (!this._endpoint) { - throw new Error('Not connected'); - } - try { - const headers = await this._commonHeaders(); - headers.set('content-type', 'application/json'); - const init = { - ...this._requestInit, - method: 'POST', - headers, - body: JSON.stringify(message), - signal: this._abortController?.signal - }; - const response = await (this._fetch ?? fetch)(this._endpoint, init); - if (!response.ok) { - const text = await response.text().catch(() => null); - if (response.status === 401 && this._authProvider) { - const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response); - this._resourceMetadataUrl = resourceMetadataUrl; - this._scope = scope; - const result = await auth(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - if (result !== 'AUTHORIZED') { - throw new UnauthorizedError(); - } - // Purposely _not_ awaited, so we don't call onerror twice - return this.send(message); - } - throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`); - } - // Release connection - POST responses don't have content we need - await response.body?.cancel(); - } - catch (error) { - this.onerror?.(error); - throw error; - } - } - setProtocolVersion(version) { - this._protocolVersion = version; - } -} -//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js.map deleted file mode 100644 index 9957f95..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../../src/client/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAyC,MAAM,aAAa,CAAC;AACjF,OAAO,EAAwB,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,IAAI,EAAc,4BAA4B,EAAuB,iBAAiB,EAA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b,IAAI,CAAC,OAAO,EAAE,CAAC,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC;IAED,kBAAkB,CAAC,OAAe;QAC9B,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;IACpC,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts deleted file mode 100644 index a411dba..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { IOType } from 'node:child_process'; -import { Stream } from 'node:stream'; -import { Transport } from '../shared/transport.js'; -import { JSONRPCMessage } from '../types.js'; -export type StdioServerParameters = { - /** - * The executable to run to start the server. - */ - command: string; - /** - * Command line arguments to pass to the executable. - */ - args?: string[]; - /** - * The environment to use when spawning the process. - * - * If not specified, the result of getDefaultEnvironment() will be used. - */ - env?: Record; - /** - * How to handle stderr of the child process. This matches the semantics of Node's `child_process.spawn`. - * - * The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr. - */ - stderr?: IOType | Stream | number; - /** - * The working directory to use when spawning the process. - * - * If not specified, the current working directory will be inherited. - */ - cwd?: string; -}; -/** - * Environment variables to inherit by default, if an environment is not explicitly given. - */ -export declare const DEFAULT_INHERITED_ENV_VARS: string[]; -/** - * Returns a default environment object including only environment variables deemed safe to inherit. - */ -export declare function getDefaultEnvironment(): Record; -/** - * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. - * - * This transport is only available in Node.js environments. - */ -export declare class StdioClientTransport implements Transport { - private _process?; - private _readBuffer; - private _serverParams; - private _stderrStream; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - constructor(server: StdioServerParameters); - /** - * Starts the server process and prepares to communicate with it. - */ - start(): Promise; - /** - * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". - * - * If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to - * attach listeners before the start method is invoked. This prevents loss of any early - * error output emitted by the child process. - */ - get stderr(): Stream | null; - /** - * The child process pid spawned by this transport. - * - * This is only available after the transport has been started. - */ - get pid(): number | null; - private processReadBuffer; - close(): Promise; - send(message: JSONRPCMessage): Promise; -} -//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts.map deleted file mode 100644 index 73b267b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/client/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,qBAAqB,GAAG;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAElC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,UAiBuB,CAAC;AAE/D;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkB9D;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IAClD,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,aAAa,CAA4B;IAEjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,MAAM,EAAE,qBAAqB;IAOzC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqD5B;;;;;;OAMG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,IAAI,CAM1B;IAED;;;;OAIG;IACH,IAAI,GAAG,IAAI,MAAM,GAAG,IAAI,CAEvB;IAED,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyC5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAc/C"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js deleted file mode 100644 index e1e4b9c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js +++ /dev/null @@ -1,191 +0,0 @@ -import spawn from 'cross-spawn'; -import process from 'node:process'; -import { PassThrough } from 'node:stream'; -import { ReadBuffer, serializeMessage } from '../shared/stdio.js'; -/** - * Environment variables to inherit by default, if an environment is not explicitly given. - */ -export const DEFAULT_INHERITED_ENV_VARS = process.platform === 'win32' - ? [ - 'APPDATA', - 'HOMEDRIVE', - 'HOMEPATH', - 'LOCALAPPDATA', - 'PATH', - 'PROCESSOR_ARCHITECTURE', - 'SYSTEMDRIVE', - 'SYSTEMROOT', - 'TEMP', - 'USERNAME', - 'USERPROFILE', - 'PROGRAMFILES' - ] - : /* list inspired by the default env inheritance of sudo */ - ['HOME', 'LOGNAME', 'PATH', 'SHELL', 'TERM', 'USER']; -/** - * Returns a default environment object including only environment variables deemed safe to inherit. - */ -export function getDefaultEnvironment() { - const env = {}; - for (const key of DEFAULT_INHERITED_ENV_VARS) { - const value = process.env[key]; - if (value === undefined) { - continue; - } - if (value.startsWith('()')) { - // Skip functions, which are a security risk. - continue; - } - env[key] = value; - } - return env; -} -/** - * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. - * - * This transport is only available in Node.js environments. - */ -export class StdioClientTransport { - constructor(server) { - this._readBuffer = new ReadBuffer(); - this._stderrStream = null; - this._serverParams = server; - if (server.stderr === 'pipe' || server.stderr === 'overlapped') { - this._stderrStream = new PassThrough(); - } - } - /** - * Starts the server process and prepares to communicate with it. - */ - async start() { - if (this._process) { - throw new Error('StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.'); - } - return new Promise((resolve, reject) => { - this._process = spawn(this._serverParams.command, this._serverParams.args ?? [], { - // merge default env with server env because mcp server needs some env vars - env: { - ...getDefaultEnvironment(), - ...this._serverParams.env - }, - stdio: ['pipe', 'pipe', this._serverParams.stderr ?? 'inherit'], - shell: false, - windowsHide: process.platform === 'win32' && isElectron(), - cwd: this._serverParams.cwd - }); - this._process.on('error', error => { - reject(error); - this.onerror?.(error); - }); - this._process.on('spawn', () => { - resolve(); - }); - this._process.on('close', _code => { - this._process = undefined; - this.onclose?.(); - }); - this._process.stdin?.on('error', error => { - this.onerror?.(error); - }); - this._process.stdout?.on('data', chunk => { - this._readBuffer.append(chunk); - this.processReadBuffer(); - }); - this._process.stdout?.on('error', error => { - this.onerror?.(error); - }); - if (this._stderrStream && this._process.stderr) { - this._process.stderr.pipe(this._stderrStream); - } - }); - } - /** - * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". - * - * If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to - * attach listeners before the start method is invoked. This prevents loss of any early - * error output emitted by the child process. - */ - get stderr() { - if (this._stderrStream) { - return this._stderrStream; - } - return this._process?.stderr ?? null; - } - /** - * The child process pid spawned by this transport. - * - * This is only available after the transport has been started. - */ - get pid() { - return this._process?.pid ?? null; - } - processReadBuffer() { - while (true) { - try { - const message = this._readBuffer.readMessage(); - if (message === null) { - break; - } - this.onmessage?.(message); - } - catch (error) { - this.onerror?.(error); - } - } - } - async close() { - if (this._process) { - const processToClose = this._process; - this._process = undefined; - const closePromise = new Promise(resolve => { - processToClose.once('close', () => { - resolve(); - }); - }); - try { - processToClose.stdin?.end(); - } - catch { - // ignore - } - await Promise.race([closePromise, new Promise(resolve => setTimeout(resolve, 2000).unref())]); - if (processToClose.exitCode === null) { - try { - processToClose.kill('SIGTERM'); - } - catch { - // ignore - } - await Promise.race([closePromise, new Promise(resolve => setTimeout(resolve, 2000).unref())]); - } - if (processToClose.exitCode === null) { - try { - processToClose.kill('SIGKILL'); - } - catch { - // ignore - } - } - } - this._readBuffer.clear(); - } - send(message) { - return new Promise(resolve => { - if (!this._process?.stdin) { - throw new Error('Not connected'); - } - const json = serializeMessage(message); - if (this._process.stdin.write(json)) { - resolve(); - } - else { - this._process.stdin.once('drain', resolve); - } - }); - } -} -function isElectron() { - return 'type' in process; -} -//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js.map deleted file mode 100644 index 6018233..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/client/stdio.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAU,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,OAA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,IAAI,CAAC;oBACD,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACnC,CAAC;gBAAC,MAAM,CAAC;oBACL,SAAS;gBACb,CAAC;YACL,CAAC;QACL,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,CAAC,OAAuB;QACxB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YACrC,CAAC;YAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClC,OAAO,EAAE,CAAC;YACd,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC/C,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,SAAS,UAAU;IACf,OAAO,MAAM,IAAI,OAAO,CAAC;AAC7B,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts deleted file mode 100644 index 6035b24..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { Transport, FetchLike } from '../shared/transport.js'; -import { JSONRPCMessage } from '../types.js'; -import { OAuthClientProvider } from './auth.js'; -export declare class StreamableHTTPError extends Error { - readonly code: number | undefined; - constructor(code: number | undefined, message: string | undefined); -} -/** - * Options for starting or authenticating an SSE connection - */ -export interface StartSSEOptions { - /** - * The resumption token used to continue long-running requests that were interrupted. - * - * This allows clients to reconnect and continue from where they left off. - */ - resumptionToken?: string; - /** - * A callback that is invoked when the resumption token changes. - * - * This allows clients to persist the latest token for potential reconnection. - */ - onresumptiontoken?: (token: string) => void; - /** - * Override Message ID to associate with the replay message - * so that response can be associate with the new resumed request. - */ - replayMessageId?: string | number; -} -/** - * Configuration options for reconnection behavior of the StreamableHTTPClientTransport. - */ -export interface StreamableHTTPReconnectionOptions { - /** - * Maximum backoff time between reconnection attempts in milliseconds. - * Default is 30000 (30 seconds). - */ - maxReconnectionDelay: number; - /** - * Initial backoff time between reconnection attempts in milliseconds. - * Default is 1000 (1 second). - */ - initialReconnectionDelay: number; - /** - * The factor by which the reconnection delay increases after each attempt. - * Default is 1.5. - */ - reconnectionDelayGrowFactor: number; - /** - * Maximum number of reconnection attempts before giving up. - * Default is 2. - */ - maxRetries: number; -} -/** - * Configuration options for the `StreamableHTTPClientTransport`. - */ -export type StreamableHTTPClientTransportOptions = { - /** - * An OAuth client provider to use for authentication. - * - * When an `authProvider` is specified and the connection is started: - * 1. The connection is attempted with any existing access token from the `authProvider`. - * 2. If the access token has expired, the `authProvider` is used to refresh the token. - * 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`. - * - * After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `StreamableHTTPClientTransport.finishAuth` with the authorization code before retrying the connection. - * - * If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown. - * - * `UnauthorizedError` might also be thrown when sending any message over the transport, indicating that the session has expired, and needs to be re-authed and reconnected. - */ - authProvider?: OAuthClientProvider; - /** - * Customizes HTTP requests to the server. - */ - requestInit?: RequestInit; - /** - * Custom fetch implementation used for all network requests. - */ - fetch?: FetchLike; - /** - * Options to configure the reconnection behavior. - */ - reconnectionOptions?: StreamableHTTPReconnectionOptions; - /** - * Session ID for the connection. This is used to identify the session on the server. - * When not provided and connecting to a server that supports session IDs, the server will generate a new session ID. - */ - sessionId?: string; -}; -/** - * Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. - * It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events - * for receiving messages. - */ -export declare class StreamableHTTPClientTransport implements Transport { - private _abortController?; - private _url; - private _resourceMetadataUrl?; - private _scope?; - private _requestInit?; - private _authProvider?; - private _fetch?; - private _fetchWithInit; - private _sessionId?; - private _reconnectionOptions; - private _protocolVersion?; - private _hasCompletedAuthFlow; - private _lastUpscopingHeader?; - private _serverRetryMs?; - private _reconnectionTimeout?; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - constructor(url: URL, opts?: StreamableHTTPClientTransportOptions); - private _authThenStart; - private _commonHeaders; - private _startOrAuthSse; - /** - * Calculates the next reconnection delay using backoff algorithm - * - * @param attempt Current reconnection attempt count for the specific stream - * @returns Time to wait in milliseconds before next reconnection attempt - */ - private _getNextReconnectionDelay; - /** - * Schedule a reconnection attempt using server-provided retry interval or backoff - * - * @param lastEventId The ID of the last received event for resumability - * @param attemptCount Current reconnection attempt count for this specific stream - */ - private _scheduleReconnection; - private _handleSseStream; - start(): Promise; - /** - * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. - */ - finishAuth(authorizationCode: string): Promise; - close(): Promise; - send(message: JSONRPCMessage | JSONRPCMessage[], options?: { - resumptionToken?: string; - onresumptiontoken?: (token: string) => void; - }): Promise; - get sessionId(): string | undefined; - /** - * Terminates the current session by sending a DELETE request to the server. - * - * Clients that no longer need a particular session - * (e.g., because the user is leaving the client application) SHOULD send an - * HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly - * terminate the session. - * - * The server MAY respond with HTTP 405 Method Not Allowed, indicating that - * the server does not allow clients to terminate sessions. - */ - terminateSession(): Promise; - setProtocolVersion(version: string): void; - get protocolVersion(): string | undefined; - /** - * Resume an SSE stream from a previous event ID. - * Opens a GET SSE connection with Last-Event-ID header to replay missed events. - * - * @param lastEventId The event ID to resume from - * @param options Optional callback to receive new resumption tokens - */ - resumeStream(lastEventId: string, options?: { - onresumptiontoken?: (token: string) => void; - }): Promise; -} -//# sourceMappingURL=streamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts.map deleted file mode 100644 index 5b6ffb8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../../src/client/streamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAyC,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAwE,cAAc,EAAwB,MAAM,aAAa,CAAC;AACzI,OAAO,EAAkD,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AAWnH,qBAAa,mBAAoB,SAAQ,KAAK;aAEtB,IAAI,EAAE,MAAM,GAAG,SAAS;gBAAxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS;CAIlC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAC9C;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,2BAA2B,EAAE,MAAM,CAAC;IAEpC;;;OAGG;IACH,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AKG;IACH,OAAO,CAAC,yBAAyB;IAejC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,gBAAgB;IA+GlB,KAAK;IAUX;;OAEG;IACG,UAAU,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,CACN,OAAO,EAAE,cAAc,GAAG,cAAc,EAAE,EAC1C,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GACpF,OAAO,CAAC,IAAI,CAAC;IA0JhB,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED;;;;;;;;;;OAUG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BvC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAGzC,IAAI,eAAe,IAAI,MAAM,GAAG,SAAS,CAExC;IAED;;;;;;OAMG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAMpH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js deleted file mode 100644 index 624172a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +++ /dev/null @@ -1,477 +0,0 @@ -import { createFetchWithInit, normalizeHeaders } from '../shared/transport.js'; -import { isInitializedNotification, isJSONRPCRequest, isJSONRPCResultResponse, JSONRPCMessageSchema } from '../types.js'; -import { auth, extractWWWAuthenticateParams, UnauthorizedError } from './auth.js'; -import { EventSourceParserStream } from 'eventsource-parser/stream'; -// Default reconnection options for StreamableHTTP connections -const DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = { - initialReconnectionDelay: 1000, - maxReconnectionDelay: 30000, - reconnectionDelayGrowFactor: 1.5, - maxRetries: 2 -}; -export class StreamableHTTPError extends Error { - constructor(code, message) { - super(`Streamable HTTP error: ${message}`); - this.code = code; - } -} -/** - * Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. - * It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events - * for receiving messages. - */ -export class StreamableHTTPClientTransport { - constructor(url, opts) { - this._hasCompletedAuthFlow = false; // Circuit breaker: detect auth success followed by immediate 401 - this._url = url; - this._resourceMetadataUrl = undefined; - this._scope = undefined; - this._requestInit = opts?.requestInit; - this._authProvider = opts?.authProvider; - this._fetch = opts?.fetch; - this._fetchWithInit = createFetchWithInit(opts?.fetch, opts?.requestInit); - this._sessionId = opts?.sessionId; - this._reconnectionOptions = opts?.reconnectionOptions ?? DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS; - } - async _authThenStart() { - if (!this._authProvider) { - throw new UnauthorizedError('No auth provider'); - } - let result; - try { - result = await auth(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - } - catch (error) { - this.onerror?.(error); - throw error; - } - if (result !== 'AUTHORIZED') { - throw new UnauthorizedError(); - } - return await this._startOrAuthSse({ resumptionToken: undefined }); - } - async _commonHeaders() { - const headers = {}; - if (this._authProvider) { - const tokens = await this._authProvider.tokens(); - if (tokens) { - headers['Authorization'] = `Bearer ${tokens.access_token}`; - } - } - if (this._sessionId) { - headers['mcp-session-id'] = this._sessionId; - } - if (this._protocolVersion) { - headers['mcp-protocol-version'] = this._protocolVersion; - } - const extraHeaders = normalizeHeaders(this._requestInit?.headers); - return new Headers({ - ...headers, - ...extraHeaders - }); - } - async _startOrAuthSse(options) { - const { resumptionToken } = options; - try { - // Try to open an initial SSE stream with GET to listen for server messages - // This is optional according to the spec - server may not support it - const headers = await this._commonHeaders(); - headers.set('Accept', 'text/event-stream'); - // Include Last-Event-ID header for resumable streams if provided - if (resumptionToken) { - headers.set('last-event-id', resumptionToken); - } - const response = await (this._fetch ?? fetch)(this._url, { - method: 'GET', - headers, - signal: this._abortController?.signal - }); - if (!response.ok) { - await response.body?.cancel(); - if (response.status === 401 && this._authProvider) { - // Need to authenticate - return await this._authThenStart(); - } - // 405 indicates that the server does not offer an SSE stream at GET endpoint - // This is an expected case that should not trigger an error - if (response.status === 405) { - return; - } - throw new StreamableHTTPError(response.status, `Failed to open SSE stream: ${response.statusText}`); - } - this._handleSseStream(response.body, options, true); - } - catch (error) { - this.onerror?.(error); - throw error; - } - } - /** - * Calculates the next reconnection delay using backoff algorithm - * - * @param attempt Current reconnection attempt count for the specific stream - * @returns Time to wait in milliseconds before next reconnection attempt - */ - _getNextReconnectionDelay(attempt) { - // Use server-provided retry value if available - if (this._serverRetryMs !== undefined) { - return this._serverRetryMs; - } - // Fall back to exponential backoff - const initialDelay = this._reconnectionOptions.initialReconnectionDelay; - const growFactor = this._reconnectionOptions.reconnectionDelayGrowFactor; - const maxDelay = this._reconnectionOptions.maxReconnectionDelay; - // Cap at maximum delay - return Math.min(initialDelay * Math.pow(growFactor, attempt), maxDelay); - } - /** - * Schedule a reconnection attempt using server-provided retry interval or backoff - * - * @param lastEventId The ID of the last received event for resumability - * @param attemptCount Current reconnection attempt count for this specific stream - */ - _scheduleReconnection(options, attemptCount = 0) { - // Use provided options or default options - const maxRetries = this._reconnectionOptions.maxRetries; - // Check if we've exceeded maximum retry attempts - if (attemptCount >= maxRetries) { - this.onerror?.(new Error(`Maximum reconnection attempts (${maxRetries}) exceeded.`)); - return; - } - // Calculate next delay based on current attempt count - const delay = this._getNextReconnectionDelay(attemptCount); - // Schedule the reconnection - this._reconnectionTimeout = setTimeout(() => { - // Use the last event ID to resume where we left off - this._startOrAuthSse(options).catch(error => { - this.onerror?.(new Error(`Failed to reconnect SSE stream: ${error instanceof Error ? error.message : String(error)}`)); - // Schedule another attempt if this one failed, incrementing the attempt counter - this._scheduleReconnection(options, attemptCount + 1); - }); - }, delay); - } - _handleSseStream(stream, options, isReconnectable) { - if (!stream) { - return; - } - const { onresumptiontoken, replayMessageId } = options; - let lastEventId; - // Track whether we've received a priming event (event with ID) - // Per spec, server SHOULD send a priming event with ID before closing - let hasPrimingEvent = false; - // Track whether we've received a response - if so, no need to reconnect - // Reconnection is for when server disconnects BEFORE sending response - let receivedResponse = false; - const processStream = async () => { - // this is the closest we can get to trying to catch network errors - // if something happens reader will throw - try { - // Create a pipeline: binary stream -> text decoder -> SSE parser - const reader = stream - .pipeThrough(new TextDecoderStream()) - .pipeThrough(new EventSourceParserStream({ - onRetry: (retryMs) => { - // Capture server-provided retry value for reconnection timing - this._serverRetryMs = retryMs; - } - })) - .getReader(); - while (true) { - const { value: event, done } = await reader.read(); - if (done) { - break; - } - // Update last event ID if provided - if (event.id) { - lastEventId = event.id; - // Mark that we've received a priming event - stream is now resumable - hasPrimingEvent = true; - onresumptiontoken?.(event.id); - } - // Skip events with no data (priming events, keep-alives) - if (!event.data) { - continue; - } - if (!event.event || event.event === 'message') { - try { - const message = JSONRPCMessageSchema.parse(JSON.parse(event.data)); - if (isJSONRPCResultResponse(message)) { - // Mark that we received a response - no need to reconnect for this request - receivedResponse = true; - if (replayMessageId !== undefined) { - message.id = replayMessageId; - } - } - this.onmessage?.(message); - } - catch (error) { - this.onerror?.(error); - } - } - } - // Handle graceful server-side disconnect - // Server may close connection after sending event ID and retry field - // Reconnect if: already reconnectable (GET stream) OR received a priming event (POST stream with event ID) - // BUT don't reconnect if we already received a response - the request is complete - const canResume = isReconnectable || hasPrimingEvent; - const needsReconnect = canResume && !receivedResponse; - if (needsReconnect && this._abortController && !this._abortController.signal.aborted) { - this._scheduleReconnection({ - resumptionToken: lastEventId, - onresumptiontoken, - replayMessageId - }, 0); - } - } - catch (error) { - // Handle stream errors - likely a network disconnect - this.onerror?.(new Error(`SSE stream disconnected: ${error}`)); - // Attempt to reconnect if the stream disconnects unexpectedly and we aren't closing - // Reconnect if: already reconnectable (GET stream) OR received a priming event (POST stream with event ID) - // BUT don't reconnect if we already received a response - the request is complete - const canResume = isReconnectable || hasPrimingEvent; - const needsReconnect = canResume && !receivedResponse; - if (needsReconnect && this._abortController && !this._abortController.signal.aborted) { - // Use the exponential backoff reconnection strategy - try { - this._scheduleReconnection({ - resumptionToken: lastEventId, - onresumptiontoken, - replayMessageId - }, 0); - } - catch (error) { - this.onerror?.(new Error(`Failed to reconnect: ${error instanceof Error ? error.message : String(error)}`)); - } - } - } - }; - processStream(); - } - async start() { - if (this._abortController) { - throw new Error('StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.'); - } - this._abortController = new AbortController(); - } - /** - * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. - */ - async finishAuth(authorizationCode) { - if (!this._authProvider) { - throw new UnauthorizedError('No auth provider'); - } - const result = await auth(this._authProvider, { - serverUrl: this._url, - authorizationCode, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - if (result !== 'AUTHORIZED') { - throw new UnauthorizedError('Failed to authorize'); - } - } - async close() { - if (this._reconnectionTimeout) { - clearTimeout(this._reconnectionTimeout); - this._reconnectionTimeout = undefined; - } - this._abortController?.abort(); - this.onclose?.(); - } - async send(message, options) { - try { - const { resumptionToken, onresumptiontoken } = options || {}; - if (resumptionToken) { - // If we have at last event ID, we need to reconnect the SSE stream - this._startOrAuthSse({ resumptionToken, replayMessageId: isJSONRPCRequest(message) ? message.id : undefined }).catch(err => this.onerror?.(err)); - return; - } - const headers = await this._commonHeaders(); - headers.set('content-type', 'application/json'); - headers.set('accept', 'application/json, text/event-stream'); - const init = { - ...this._requestInit, - method: 'POST', - headers, - body: JSON.stringify(message), - signal: this._abortController?.signal - }; - const response = await (this._fetch ?? fetch)(this._url, init); - // Handle session ID received during initialization - const sessionId = response.headers.get('mcp-session-id'); - if (sessionId) { - this._sessionId = sessionId; - } - if (!response.ok) { - const text = await response.text().catch(() => null); - if (response.status === 401 && this._authProvider) { - // Prevent infinite recursion when server returns 401 after successful auth - if (this._hasCompletedAuthFlow) { - throw new StreamableHTTPError(401, 'Server returned 401 after successful authentication'); - } - const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response); - this._resourceMetadataUrl = resourceMetadataUrl; - this._scope = scope; - const result = await auth(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetchWithInit - }); - if (result !== 'AUTHORIZED') { - throw new UnauthorizedError(); - } - // Mark that we completed auth flow - this._hasCompletedAuthFlow = true; - // Purposely _not_ awaited, so we don't call onerror twice - return this.send(message); - } - if (response.status === 403 && this._authProvider) { - const { resourceMetadataUrl, scope, error } = extractWWWAuthenticateParams(response); - if (error === 'insufficient_scope') { - const wwwAuthHeader = response.headers.get('WWW-Authenticate'); - // Check if we've already tried upscoping with this header to prevent infinite loops. - if (this._lastUpscopingHeader === wwwAuthHeader) { - throw new StreamableHTTPError(403, 'Server returned 403 after trying upscoping'); - } - if (scope) { - this._scope = scope; - } - if (resourceMetadataUrl) { - this._resourceMetadataUrl = resourceMetadataUrl; - } - // Mark that upscoping was tried. - this._lastUpscopingHeader = wwwAuthHeader ?? undefined; - const result = await auth(this._authProvider, { - serverUrl: this._url, - resourceMetadataUrl: this._resourceMetadataUrl, - scope: this._scope, - fetchFn: this._fetch - }); - if (result !== 'AUTHORIZED') { - throw new UnauthorizedError(); - } - return this.send(message); - } - } - throw new StreamableHTTPError(response.status, `Error POSTing to endpoint: ${text}`); - } - // Reset auth loop flag on successful response - this._hasCompletedAuthFlow = false; - this._lastUpscopingHeader = undefined; - // If the response is 202 Accepted, there's no body to process - if (response.status === 202) { - await response.body?.cancel(); - // if the accepted notification is initialized, we start the SSE stream - // if it's supported by the server - if (isInitializedNotification(message)) { - // Start without a lastEventId since this is a fresh connection - this._startOrAuthSse({ resumptionToken: undefined }).catch(err => this.onerror?.(err)); - } - return; - } - // Get original message(s) for detecting request IDs - const messages = Array.isArray(message) ? message : [message]; - const hasRequests = messages.filter(msg => 'method' in msg && 'id' in msg && msg.id !== undefined).length > 0; - // Check the response type - const contentType = response.headers.get('content-type'); - if (hasRequests) { - if (contentType?.includes('text/event-stream')) { - // Handle SSE stream responses for requests - // We use the same handler as standalone streams, which now supports - // reconnection with the last event ID - this._handleSseStream(response.body, { onresumptiontoken }, false); - } - else if (contentType?.includes('application/json')) { - // For non-streaming servers, we might get direct JSON responses - const data = await response.json(); - const responseMessages = Array.isArray(data) - ? data.map(msg => JSONRPCMessageSchema.parse(msg)) - : [JSONRPCMessageSchema.parse(data)]; - for (const msg of responseMessages) { - this.onmessage?.(msg); - } - } - else { - await response.body?.cancel(); - throw new StreamableHTTPError(-1, `Unexpected content type: ${contentType}`); - } - } - else { - // No requests in message but got 200 OK - still need to release connection - await response.body?.cancel(); - } - } - catch (error) { - this.onerror?.(error); - throw error; - } - } - get sessionId() { - return this._sessionId; - } - /** - * Terminates the current session by sending a DELETE request to the server. - * - * Clients that no longer need a particular session - * (e.g., because the user is leaving the client application) SHOULD send an - * HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly - * terminate the session. - * - * The server MAY respond with HTTP 405 Method Not Allowed, indicating that - * the server does not allow clients to terminate sessions. - */ - async terminateSession() { - if (!this._sessionId) { - return; // No session to terminate - } - try { - const headers = await this._commonHeaders(); - const init = { - ...this._requestInit, - method: 'DELETE', - headers, - signal: this._abortController?.signal - }; - const response = await (this._fetch ?? fetch)(this._url, init); - await response.body?.cancel(); - // We specifically handle 405 as a valid response according to the spec, - // meaning the server does not support explicit session termination - if (!response.ok && response.status !== 405) { - throw new StreamableHTTPError(response.status, `Failed to terminate session: ${response.statusText}`); - } - this._sessionId = undefined; - } - catch (error) { - this.onerror?.(error); - throw error; - } - } - setProtocolVersion(version) { - this._protocolVersion = version; - } - get protocolVersion() { - return this._protocolVersion; - } - /** - * Resume an SSE stream from a previous event ID. - * Opens a GET SSE connection with Last-Event-ID header to replay missed events. - * - * @param lastEventId The event ID to resume from - * @param options Optional callback to receive new resumption tokens - */ - async resumeStream(lastEventId, options) { - await this._startOrAuthSse({ - resumptionToken: lastEventId, - onresumptiontoken: options?.onresumptiontoken - }); - } -} -//# sourceMappingURL=streamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map deleted file mode 100644 index fd4e70c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttp.js","sourceRoot":"","sources":["../../../src/client/streamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,uBAAuB,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACzI,OAAO,EAAE,IAAI,EAAc,4BAA4B,EAAuB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnH,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,8DAA8D;AAC9D,MAAM,4CAA4C,GAAsC;IACpF,wBAAwB,EAAE,IAAI;IAC9B,oBAAoB,EAAE,KAAK;IAC3B,2BAA2B,EAAE,GAAG;IAChC,UAAU,EAAE,CAAC;CAChB,CAAC;AAEF,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC1C,YACoB,IAAwB,EACxC,OAA2B;QAE3B,KAAK,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;QAH3B,SAAI,GAAJ,IAAI,CAAoB;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of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.d.ts deleted file mode 100644 index 78f95de..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Transport } from '../shared/transport.js'; -import { JSONRPCMessage } from '../types.js'; -/** - * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. - */ -export declare class WebSocketClientTransport implements Transport { - private _socket?; - private _url; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - constructor(url: URL); - start(): Promise; - close(): Promise; - send(message: JSONRPCMessage): Promise; -} -//# sourceMappingURL=websocket.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.d.ts.map deleted file mode 100644 index 2882d98..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../src/client/websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAInE;;GAEG;AACH,qBAAa,wBAAyB,YAAW,SAAS;IACtD,OAAO,CAAC,OAAO,CAAC,CAAY;IAC5B,OAAO,CAAC,IAAI,CAAM;IAElB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG;IAIpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAsChB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAW/C"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.js deleted file mode 100644 index 1325e46..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.js +++ /dev/null @@ -1,54 +0,0 @@ -import { JSONRPCMessageSchema } from '../types.js'; -const SUBPROTOCOL = 'mcp'; -/** - * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. - */ -export class WebSocketClientTransport { - constructor(url) { - this._url = url; - } - start() { - if (this._socket) { - throw new Error('WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.'); - } - return new Promise((resolve, reject) => { - this._socket = new WebSocket(this._url, SUBPROTOCOL); - this._socket.onerror = event => { - const error = 'error' in event ? event.error : new Error(`WebSocket error: ${JSON.stringify(event)}`); - reject(error); - this.onerror?.(error); - }; - this._socket.onopen = () => { - resolve(); - }; - this._socket.onclose = () => { - this.onclose?.(); - }; - this._socket.onmessage = (event) => { - let message; - try { - message = JSONRPCMessageSchema.parse(JSON.parse(event.data)); - } - catch (error) { - this.onerror?.(error); - return; - } - this.onmessage?.(message); - }; - }); - } - async close() { - this._socket?.close(); - } - send(message) { - return new Promise((resolve, reject) => { - if (!this._socket) { - reject(new Error('Not connected')); - return; - } - this._socket?.send(JSON.stringify(message)); - resolve(); - }); - } -} -//# sourceMappingURL=websocket.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.js.map deleted file mode 100644 index bd2ed86..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/client/websocket.ts"],"names":[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C,IAAI,CAAC,CAAC,CAAC;gBACjE,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACb,IAAI,CAAC,OAAO,EAAE,CAAC,KAAc,CAAC,CAAC;oBAC/B,OAAO;gBACX,CAAC;gBAED,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC;YAC9B,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,OAAuB;QACxB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAChB,MAAM,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;gBACnC,OAAO;YACX,CAAC;YAED,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5C,OAAO,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.d.ts deleted file mode 100644 index 611f6eb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=elicitationUrlExample.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.d.ts.map deleted file mode 100644 index e749adf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationUrlExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/elicitationUrlExample.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.js deleted file mode 100644 index aa99e12..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.js +++ /dev/null @@ -1,690 +0,0 @@ -// Run with: npx tsx src/examples/client/elicitationUrlExample.ts -// -// This example demonstrates how to use URL elicitation to securely -// collect user input in a remote (HTTP) server. -// URL elicitation allows servers to prompt the end-user to open a URL in their browser -// to collect sensitive information. -import { Client } from '../../client/index.js'; -import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; -import { createInterface } from 'node:readline'; -import { ListToolsResultSchema, CallToolResultSchema, ElicitRequestSchema, McpError, ErrorCode, UrlElicitationRequiredError, ElicitationCompleteNotificationSchema } from '../../types.js'; -import { getDisplayName } from '../../shared/metadataUtils.js'; -import { exec } from 'node:child_process'; -import { InMemoryOAuthClientProvider } from './simpleOAuthClientProvider.js'; -import { UnauthorizedError } from '../../client/auth.js'; -import { createServer } from 'node:http'; -// Set up OAuth (required for this example) -const OAUTH_CALLBACK_PORT = 8090; // Use different port than auth server (3001) -const OAUTH_CALLBACK_URL = `http://localhost:${OAUTH_CALLBACK_PORT}/callback`; -let oauthProvider = undefined; -console.log('Getting OAuth token...'); -const clientMetadata = { - client_name: 'Elicitation MCP Client', - redirect_uris: [OAUTH_CALLBACK_URL], - grant_types: ['authorization_code', 'refresh_token'], - response_types: ['code'], - token_endpoint_auth_method: 'client_secret_post', - scope: 'mcp:tools' -}; -oauthProvider = new InMemoryOAuthClientProvider(OAUTH_CALLBACK_URL, clientMetadata, (redirectUrl) => { - console.log(`🌐 Opening browser for OAuth redirect: ${redirectUrl.toString()}`); - openBrowser(redirectUrl.toString()); -}); -// Create readline interface for user input -const readline = createInterface({ - input: process.stdin, - output: process.stdout -}); -let abortCommand = new AbortController(); -// Global client and transport for interactive commands -let client = null; -let transport = null; -let serverUrl = 'http://localhost:3000/mcp'; -let sessionId = undefined; -let isProcessingCommand = false; -let isProcessingElicitations = false; -const elicitationQueue = []; -let elicitationQueueSignal = null; -let elicitationsCompleteSignal = null; -// Map to track pending URL elicitations waiting for completion notifications -const pendingURLElicitations = new Map(); -async function main() { - console.log('MCP Interactive Client'); - console.log('====================='); - // Connect to server immediately with default settings - await connect(); - // Start the elicitation loop in the background - elicitationLoop().catch(error => { - console.error('Unexpected error in elicitation loop:', error); - process.exit(1); - }); - // Short delay allowing the server to send any SSE elicitations on connection - await new Promise(resolve => setTimeout(resolve, 200)); - // Wait until we are done processing any initial elicitations - await waitForElicitationsToComplete(); - // Print help and start the command loop - printHelp(); - await commandLoop(); -} -async function waitForElicitationsToComplete() { - // Wait until the queue is empty and nothing is being processed - while (elicitationQueue.length > 0 || isProcessingElicitations) { - await new Promise(resolve => setTimeout(resolve, 100)); - } -} -function printHelp() { - console.log('\nAvailable commands:'); - console.log(' connect [url] - Connect to MCP server (default: http://localhost:3000/mcp)'); - console.log(' disconnect - Disconnect from server'); - console.log(' terminate-session - Terminate the current session'); - console.log(' reconnect - Reconnect to the server'); - console.log(' list-tools - List available tools'); - console.log(' call-tool [args] - Call a tool with optional JSON arguments'); - console.log(' payment-confirm - Test URL elicitation via error response with payment-confirm tool'); - console.log(' third-party-auth - Test tool that requires third-party OAuth credentials'); - console.log(' help - Show this help'); - console.log(' quit - Exit the program'); -} -async function commandLoop() { - await new Promise(resolve => { - if (!isProcessingElicitations) { - resolve(); - } - else { - elicitationsCompleteSignal = resolve; - } - }); - readline.question('\n> ', { signal: abortCommand.signal }, async (input) => { - isProcessingCommand = true; - const args = input.trim().split(/\s+/); - const command = args[0]?.toLowerCase(); - try { - switch (command) { - case 'connect': - await connect(args[1]); - break; - case 'disconnect': - await disconnect(); - break; - case 'terminate-session': - await terminateSession(); - break; - case 'reconnect': - await reconnect(); - break; - case 'list-tools': - await listTools(); - break; - case 'call-tool': - if (args.length < 2) { - console.log('Usage: call-tool [args]'); - } - else { - const toolName = args[1]; - let toolArgs = {}; - if (args.length > 2) { - try { - toolArgs = JSON.parse(args.slice(2).join(' ')); - } - catch { - console.log('Invalid JSON arguments. Using empty args.'); - } - } - await callTool(toolName, toolArgs); - } - break; - case 'payment-confirm': - await callPaymentConfirmTool(); - break; - case 'third-party-auth': - await callThirdPartyAuthTool(); - break; - case 'help': - printHelp(); - break; - case 'quit': - case 'exit': - await cleanup(); - return; - default: - if (command) { - console.log(`Unknown command: ${command}`); - } - break; - } - } - catch (error) { - console.error(`Error executing command: ${error}`); - } - finally { - isProcessingCommand = false; - } - // Process another command after we've processed the this one - await commandLoop(); - }); -} -async function elicitationLoop() { - while (true) { - // Wait until we have elicitations to process - await new Promise(resolve => { - if (elicitationQueue.length > 0) { - resolve(); - } - else { - elicitationQueueSignal = resolve; - } - }); - isProcessingElicitations = true; - abortCommand.abort(); // Abort the command loop if it's running - // Process all queued elicitations - while (elicitationQueue.length > 0) { - const queued = elicitationQueue.shift(); - console.log(`📤 Processing queued elicitation (${elicitationQueue.length} remaining)`); - try { - const result = await handleElicitationRequest(queued.request); - queued.resolve(result); - } - catch (error) { - queued.reject(error instanceof Error ? error : new Error(String(error))); - } - } - console.log('✅ All queued elicitations processed. Resuming command loop...\n'); - isProcessingElicitations = false; - // Reset the abort controller for the next command loop - abortCommand = new AbortController(); - // Resume the command loop - if (elicitationsCompleteSignal) { - elicitationsCompleteSignal(); - elicitationsCompleteSignal = null; - } - } -} -async function openBrowser(url) { - const command = `open "${url}"`; - exec(command, error => { - if (error) { - console.error(`Failed to open browser: ${error.message}`); - console.log(`Please manually open: ${url}`); - } - }); -} -/** - * Enqueues an elicitation request and returns the result. - * - * This function is used so that our CLI (which can only handle one input request at a time) - * can handle elicitation requests and the command loop. - * - * @param request - The elicitation request to be handled - * @returns The elicitation result - */ -async function elicitationRequestHandler(request) { - // If we are processing a command, handle this elicitation immediately - if (isProcessingCommand) { - console.log('📋 Processing elicitation immediately (during command execution)'); - return await handleElicitationRequest(request); - } - // Otherwise, queue the request to be handled by the elicitation loop - console.log(`📥 Queueing elicitation request (queue size will be: ${elicitationQueue.length + 1})`); - return new Promise((resolve, reject) => { - elicitationQueue.push({ - request, - resolve, - reject - }); - // Signal the elicitation loop that there's work to do - if (elicitationQueueSignal) { - elicitationQueueSignal(); - elicitationQueueSignal = null; - } - }); -} -/** - * Handles an elicitation request. - * - * This function is used to handle the elicitation request and return the result. - * - * @param request - The elicitation request to be handled - * @returns The elicitation result - */ -async function handleElicitationRequest(request) { - const mode = request.params.mode; - console.log('\n🔔 Elicitation Request Received:'); - console.log(`Mode: ${mode}`); - if (mode === 'url') { - return { - action: await handleURLElicitation(request.params) - }; - } - else { - // Should not happen because the client declares its capabilities to the server, - // but being defensive is a good practice: - throw new McpError(ErrorCode.InvalidParams, `Unsupported elicitation mode: ${mode}`); - } -} -/** - * Handles a URL elicitation by opening the URL in the browser. - * - * Note: This is a shared code for both request handlers and error handlers. - * As a result of sharing schema, there is no big forking of logic for the client. - * - * @param params - The URL elicitation request parameters - * @returns The action to take (accept, cancel, or decline) - */ -async function handleURLElicitation(params) { - const url = params.url; - const elicitationId = params.elicitationId; - const message = params.message; - console.log(`🆔 Elicitation ID: ${elicitationId}`); // Print for illustration - // Parse URL to show domain for security - let domain = 'unknown domain'; - try { - const parsedUrl = new URL(url); - domain = parsedUrl.hostname; - } - catch { - console.error('Invalid URL provided by server'); - return 'decline'; - } - // Example security warning to help prevent phishing attacks - console.log('\n⚠️ \x1b[33mSECURITY WARNING\x1b[0m ⚠️'); - console.log('\x1b[33mThe server is requesting you to open an external URL.\x1b[0m'); - console.log('\x1b[33mOnly proceed if you trust this server and understand why it needs this.\x1b[0m\n'); - console.log(`🌐 Target domain: \x1b[36m${domain}\x1b[0m`); - console.log(`🔗 Full URL: \x1b[36m${url}\x1b[0m`); - console.log(`\nℹ️ Server's reason:\n\n\x1b[36m${message}\x1b[0m\n`); - // 1. Ask for user consent to open the URL - const consent = await new Promise(resolve => { - readline.question('\nDo you want to open this URL in your browser? (y/n): ', input => { - resolve(input.trim().toLowerCase()); - }); - }); - // 2. If user did not consent, return appropriate result - if (consent === 'no' || consent === 'n') { - console.log('❌ URL navigation declined.'); - return 'decline'; - } - else if (consent !== 'yes' && consent !== 'y') { - console.log('🚫 Invalid response. Cancelling elicitation.'); - return 'cancel'; - } - // 3. Wait for completion notification in the background - const completionPromise = new Promise((resolve, reject) => { - const timeout = setTimeout(() => { - pendingURLElicitations.delete(elicitationId); - console.log(`\x1b[31m❌ Elicitation ${elicitationId} timed out waiting for completion.\x1b[0m`); - reject(new Error('Elicitation completion timeout')); - }, 5 * 60 * 1000); // 5 minute timeout - pendingURLElicitations.set(elicitationId, { - resolve: () => { - clearTimeout(timeout); - resolve(); - }, - reject, - timeout - }); - }); - completionPromise.catch(error => { - console.error('Background completion wait failed:', error); - }); - // 4. Open the URL in the browser - console.log(`\n🚀 Opening browser to: ${url}`); - await openBrowser(url); - console.log('\n⏳ Waiting for you to complete the interaction in your browser...'); - console.log(' The server will send a notification once you complete the action.'); - // 5. Acknowledge the user accepted the elicitation - return 'accept'; -} -/** - * Example OAuth callback handler - in production, use a more robust approach - * for handling callbacks and storing tokens - */ -/** - * Starts a temporary HTTP server to receive the OAuth callback - */ -async function waitForOAuthCallback() { - return new Promise((resolve, reject) => { - const server = createServer((req, res) => { - // Ignore favicon requests - if (req.url === '/favicon.ico') { - res.writeHead(404); - res.end(); - return; - } - console.log(`📥 Received callback: ${req.url}`); - const parsedUrl = new URL(req.url || '', 'http://localhost'); - const code = parsedUrl.searchParams.get('code'); - const error = parsedUrl.searchParams.get('error'); - if (code) { - console.log(`✅ Authorization code received: ${code?.substring(0, 10)}...`); - res.writeHead(200, { 'Content-Type': 'text/html' }); - res.end(` - - -

Authorization Successful!

-

This simulates successful authorization of the MCP client, which now has an access token for the MCP server.

-

This window will close automatically in 10 seconds.

- - - - `); - resolve(code); - setTimeout(() => server.close(), 15000); - } - else if (error) { - console.log(`❌ Authorization error: ${error}`); - res.writeHead(400, { 'Content-Type': 'text/html' }); - res.end(` - - -

Authorization Failed

-

Error: ${error}

- - - `); - reject(new Error(`OAuth authorization failed: ${error}`)); - } - else { - console.log(`❌ No authorization code or error in callback`); - res.writeHead(400); - res.end('Bad request'); - reject(new Error('No authorization code provided')); - } - }); - server.listen(OAUTH_CALLBACK_PORT, () => { - console.log(`OAuth callback server started on http://localhost:${OAUTH_CALLBACK_PORT}`); - }); - }); -} -/** - * Attempts to connect to the MCP server with OAuth authentication. - * Handles OAuth flow recursively if authorization is required. - */ -async function attemptConnection(oauthProvider) { - console.log('🚢 Creating transport with OAuth provider...'); - const baseUrl = new URL(serverUrl); - transport = new StreamableHTTPClientTransport(baseUrl, { - sessionId: sessionId, - authProvider: oauthProvider - }); - console.log('🚢 Transport created'); - try { - console.log('🔌 Attempting connection (this will trigger OAuth redirect if needed)...'); - await client.connect(transport); - sessionId = transport.sessionId; - console.log('Transport created with session ID:', sessionId); - console.log('✅ Connected successfully'); - } - catch (error) { - if (error instanceof UnauthorizedError) { - console.log('🔐 OAuth required - waiting for authorization...'); - const callbackPromise = waitForOAuthCallback(); - const authCode = await callbackPromise; - await transport.finishAuth(authCode); - console.log('🔐 Authorization code received:', authCode); - console.log('🔌 Reconnecting with authenticated transport...'); - // Recursively retry connection after OAuth completion - await attemptConnection(oauthProvider); - } - else { - console.error('❌ Connection failed with non-auth error:', error); - throw error; - } - } -} -async function connect(url) { - if (client) { - console.log('Already connected. Disconnect first.'); - return; - } - if (url) { - serverUrl = url; - } - console.log(`🔗 Attempting to connect to ${serverUrl}...`); - // Create a new client with elicitation capability - console.log('👤 Creating MCP client...'); - client = new Client({ - name: 'example-client', - version: '1.0.0' - }, { - capabilities: { - elicitation: { - // Only URL elicitation is supported in this demo - // (see server/elicitationExample.ts for a demo of form mode elicitation) - url: {} - } - } - }); - console.log('👤 Client created'); - // Set up elicitation request handler with proper validation - client.setRequestHandler(ElicitRequestSchema, elicitationRequestHandler); - // Set up notification handler for elicitation completion - client.setNotificationHandler(ElicitationCompleteNotificationSchema, notification => { - const { elicitationId } = notification.params; - const pending = pendingURLElicitations.get(elicitationId); - if (pending) { - clearTimeout(pending.timeout); - pendingURLElicitations.delete(elicitationId); - console.log(`\x1b[32m✅ Elicitation ${elicitationId} completed!\x1b[0m`); - pending.resolve(); - } - else { - // Shouldn't happen - discard it! - console.warn(`Received completion notification for unknown elicitation: ${elicitationId}`); - } - }); - try { - console.log('🔐 Starting OAuth flow...'); - await attemptConnection(oauthProvider); - console.log('Connected to MCP server'); - // Set up error handler after connection is established so we don't double log errors - client.onerror = error => { - console.error('\x1b[31mClient error:', error, '\x1b[0m'); - }; - } - catch (error) { - console.error('Failed to connect:', error); - client = null; - transport = null; - return; - } -} -async function disconnect() { - if (!client || !transport) { - console.log('Not connected.'); - return; - } - try { - await transport.close(); - console.log('Disconnected from MCP server'); - client = null; - transport = null; - } - catch (error) { - console.error('Error disconnecting:', error); - } -} -async function terminateSession() { - if (!client || !transport) { - console.log('Not connected.'); - return; - } - try { - console.log('Terminating session with ID:', transport.sessionId); - await transport.terminateSession(); - console.log('Session terminated successfully'); - // Check if sessionId was cleared after termination - if (!transport.sessionId) { - console.log('Session ID has been cleared'); - sessionId = undefined; - // Also close the transport and clear client objects - await transport.close(); - console.log('Transport closed after session termination'); - client = null; - transport = null; - } - else { - console.log('Server responded with 405 Method Not Allowed (session termination not supported)'); - console.log('Session ID is still active:', transport.sessionId); - } - } - catch (error) { - console.error('Error terminating session:', error); - } -} -async function reconnect() { - if (client) { - await disconnect(); - } - await connect(); -} -async function listTools() { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const toolsRequest = { - method: 'tools/list', - params: {} - }; - const toolsResult = await client.request(toolsRequest, ListToolsResultSchema); - console.log('Available tools:'); - if (toolsResult.tools.length === 0) { - console.log(' No tools available'); - } - else { - for (const tool of toolsResult.tools) { - console.log(` - id: ${tool.name}, name: ${getDisplayName(tool)}, description: ${tool.description}`); - } - } - } - catch (error) { - console.log(`Tools not supported by this server (${error})`); - } -} -async function callTool(name, args) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const request = { - method: 'tools/call', - params: { - name, - arguments: args - } - }; - console.log(`Calling tool '${name}' with args:`, args); - const result = await client.request(request, CallToolResultSchema); - console.log('Tool result:'); - const resourceLinks = []; - result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else if (item.type === 'resource_link') { - const resourceLink = item; - resourceLinks.push(resourceLink); - console.log(` 📁 Resource Link: ${resourceLink.name}`); - console.log(` URI: ${resourceLink.uri}`); - if (resourceLink.mimeType) { - console.log(` Type: ${resourceLink.mimeType}`); - } - if (resourceLink.description) { - console.log(` Description: ${resourceLink.description}`); - } - } - else if (item.type === 'resource') { - console.log(` [Embedded Resource: ${item.resource.uri}]`); - } - else if (item.type === 'image') { - console.log(` [Image: ${item.mimeType}]`); - } - else if (item.type === 'audio') { - console.log(` [Audio: ${item.mimeType}]`); - } - else { - console.log(` [Unknown content type]:`, item); - } - }); - // Offer to read resource links - if (resourceLinks.length > 0) { - console.log(`\nFound ${resourceLinks.length} resource link(s). Use 'read-resource ' to read their content.`); - } - } - catch (error) { - if (error instanceof UrlElicitationRequiredError) { - console.log('\n🔔 Elicitation Required Error Received:'); - console.log(`Message: ${error.message}`); - for (const e of error.elicitations) { - await handleURLElicitation(e); // For the error handler, we discard the action result because we don't respond to an error response - } - return; - } - console.log(`Error calling tool ${name}: ${error}`); - } -} -async function cleanup() { - if (client && transport) { - try { - // First try to terminate the session gracefully - if (transport.sessionId) { - try { - console.log('Terminating session before exit...'); - await transport.terminateSession(); - console.log('Session terminated successfully'); - } - catch (error) { - console.error('Error terminating session:', error); - } - } - // Then close the transport - await transport.close(); - } - catch (error) { - console.error('Error closing transport:', error); - } - } - process.stdin.setRawMode(false); - readline.close(); - console.log('\nGoodbye!'); - process.exit(0); -} -async function callPaymentConfirmTool() { - console.log('Calling payment-confirm tool...'); - await callTool('payment-confirm', { cartId: 'cart_123' }); -} -async function callThirdPartyAuthTool() { - console.log('Calling third-party-auth tool...'); - await callTool('third-party-auth', { param1: 'test' }); -} -// Set up raw mode for keyboard input to capture Escape key -process.stdin.setRawMode(true); -process.stdin.on('data', async (data) => { - // Check for Escape key (27) - if (data.length === 1 && data[0] === 27) { - console.log('\nESC key pressed. Disconnecting from server...'); - // Abort current operation and disconnect from server - if (client && transport) { - await disconnect(); - console.log('Disconnected. Press Enter to continue.'); - } - else { - console.log('Not connected to server.'); - } - // Re-display the prompt - process.stdout.write('> '); - } -}); -// Handle Ctrl+C -process.on('SIGINT', async () => { - console.log('\nReceived SIGINT. Cleaning up...'); - await cleanup(); -}); -// Start the interactive client -main().catch((error) => { - console.error('Error running MCP client:', error); - process.exit(1); -}); -//# sourceMappingURL=elicitationUrlExample.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.js.map deleted file mode 100644 index f221fbe..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/elicitationUrlExample.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationUrlExample.js","sourceRoot":"","sources":["../../../../src/examples/client/elicitationUrlExample.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,mEAAmE;AACnE,gDAAgD;AAChD,uFAAuF;AACvF,oCAAoC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAEH,qBAAqB,EAErB,oBAAoB,EACpB,mBAAmB,EAKnB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B,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,gBAAgB;AAChB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,MAAM,OAAO,EAAE,CAAC;AACpB,CAAC,CAAC,CAAC;AAEH,+BAA+B;AAC/B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.d.ts deleted file mode 100644 index 0ac5af8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=multipleClientsParallel.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.d.ts.map deleted file mode 100644 index 91051dc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"multipleClientsParallel.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/multipleClientsParallel.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.js deleted file mode 100644 index 4264856..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.js +++ /dev/null @@ -1,132 +0,0 @@ -import { Client } from '../../client/index.js'; -import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; -import { CallToolResultSchema, LoggingMessageNotificationSchema } from '../../types.js'; -/** - * Multiple Clients MCP Example - * - * This client demonstrates how to: - * 1. Create multiple MCP clients in parallel - * 2. Each client calls a single tool - * 3. Track notifications from each client independently - */ -// Command line args processing -const args = process.argv.slice(2); -const serverUrl = args[0] || 'http://localhost:3000/mcp'; -async function createAndRunClient(config) { - console.log(`[${config.id}] Creating client: ${config.name}`); - const client = new Client({ - name: config.name, - version: '1.0.0' - }); - const transport = new StreamableHTTPClientTransport(new URL(serverUrl)); - // Set up client-specific error handler - client.onerror = error => { - console.error(`[${config.id}] Client error:`, error); - }; - // Set up client-specific notification handler - client.setNotificationHandler(LoggingMessageNotificationSchema, notification => { - console.log(`[${config.id}] Notification: ${notification.params.data}`); - }); - try { - // Connect to the server - await client.connect(transport); - console.log(`[${config.id}] Connected to MCP server`); - // Call the specified tool - console.log(`[${config.id}] Calling tool: ${config.toolName}`); - const toolRequest = { - method: 'tools/call', - params: { - name: config.toolName, - arguments: { - ...config.toolArguments, - // Add client ID to arguments for identification in notifications - caller: config.id - } - } - }; - const result = await client.request(toolRequest, CallToolResultSchema); - console.log(`[${config.id}] Tool call completed`); - // Keep the connection open for a bit to receive notifications - await new Promise(resolve => setTimeout(resolve, 5000)); - // Disconnect - await transport.close(); - console.log(`[${config.id}] Disconnected from MCP server`); - return { id: config.id, result }; - } - catch (error) { - console.error(`[${config.id}] Error:`, error); - throw error; - } -} -async function main() { - console.log('MCP Multiple Clients Example'); - console.log('============================'); - console.log(`Server URL: ${serverUrl}`); - console.log(''); - try { - // Define client configurations - const clientConfigs = [ - { - id: 'client1', - name: 'basic-client-1', - toolName: 'start-notification-stream', - toolArguments: { - interval: 3, // 1 second between notifications - count: 5 // Send 5 notifications - } - }, - { - id: 'client2', - name: 'basic-client-2', - toolName: 'start-notification-stream', - toolArguments: { - interval: 2, // 2 seconds between notifications - count: 3 // Send 3 notifications - } - }, - { - id: 'client3', - name: 'basic-client-3', - toolName: 'start-notification-stream', - toolArguments: { - interval: 1, // 0.5 second between notifications - count: 8 // Send 8 notifications - } - } - ]; - // Start all clients in parallel - console.log(`Starting ${clientConfigs.length} clients in parallel...`); - console.log(''); - const clientPromises = clientConfigs.map(config => createAndRunClient(config)); - const results = await Promise.all(clientPromises); - // Display results from all clients - console.log('\n=== Final Results ==='); - results.forEach(({ id, result }) => { - console.log(`\n[${id}] Tool result:`); - if (Array.isArray(result.content)) { - result.content.forEach((item) => { - if (item.type === 'text' && item.text) { - console.log(` ${item.text}`); - } - else { - console.log(` ${item.type} content:`, item); - } - }); - } - else { - console.log(` Unexpected result format:`, result); - } - }); - console.log('\n=== All clients completed successfully ==='); - } - catch (error) { - console.error('Error running multiple clients:', error); - process.exit(1); - } -} -// Start the example -main().catch((error) => { - console.error('Error running MCP multiple clients example:', error); - process.exit(1); -}); -//# sourceMappingURL=multipleClientsParallel.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.js.map deleted file mode 100644 index d02ce22..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/multipleClientsParallel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"multipleClientsParallel.js","sourceRoot":"","sources":["../../../../src/examples/client/multipleClientsParallel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAmB,oBAAoB,EAAE,gCAAgC,EAAkB,MAAM,gBAAgB,CAAC;AAEzH;;;;;;;GAOG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAA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AE,CAAC,CAAC;oBAClC,CAAC;yBAAM,CAAC;wBACJ,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,WAAW,EAAE,IAAI,CAAC,CAAC;oBACjD,CAAC;gBACL,CAAC,CAAC,CAAC;YACP,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;YACvD,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,oBAAoB;AACpB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;IACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.d.ts deleted file mode 100644 index e93d4d6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=parallelToolCallsClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.d.ts.map deleted file mode 100644 index 25a3b82..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parallelToolCallsClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/parallelToolCallsClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.js deleted file mode 100644 index 9d2a2e9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.js +++ /dev/null @@ -1,174 +0,0 @@ -import { Client } from '../../client/index.js'; -import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; -import { ListToolsResultSchema, CallToolResultSchema, LoggingMessageNotificationSchema } from '../../types.js'; -/** - * Parallel Tool Calls MCP Client - * - * This client demonstrates how to: - * 1. Start multiple tool calls in parallel - * 2. Track notifications from each tool call using a caller parameter - */ -// Command line args processing -const args = process.argv.slice(2); -const serverUrl = args[0] || 'http://localhost:3000/mcp'; -async function main() { - console.log('MCP Parallel Tool Calls Client'); - console.log('=============================='); - console.log(`Connecting to server at: ${serverUrl}`); - let client; - let transport; - try { - // Create client with streamable HTTP transport - client = new Client({ - name: 'parallel-tool-calls-client', - version: '1.0.0' - }); - client.onerror = error => { - console.error('Client error:', error); - }; - // Connect to the server - transport = new StreamableHTTPClientTransport(new URL(serverUrl)); - await client.connect(transport); - console.log('Successfully connected to MCP server'); - // Set up notification handler with caller identification - client.setNotificationHandler(LoggingMessageNotificationSchema, notification => { - console.log(`Notification: ${notification.params.data}`); - }); - console.log('List tools'); - const toolsRequest = await listTools(client); - console.log('Tools: ', toolsRequest); - // 2. Start multiple notification tools in parallel - console.log('\n=== Starting Multiple Notification Streams in Parallel ==='); - const toolResults = await startParallelNotificationTools(client); - // Log the results from each tool call - for (const [caller, result] of Object.entries(toolResults)) { - console.log(`\n=== Tool result for ${caller} ===`); - result.content.forEach((item) => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else { - console.log(` ${item.type} content:`, item); - } - }); - } - // 3. Wait for all notifications (10 seconds) - console.log('\n=== Waiting for all notifications ==='); - await new Promise(resolve => setTimeout(resolve, 10000)); - // 4. Disconnect - console.log('\n=== Disconnecting ==='); - await transport.close(); - console.log('Disconnected from MCP server'); - } - catch (error) { - console.error('Error running client:', error); - process.exit(1); - } -} -/** - * List available tools on the server - */ -async function listTools(client) { - try { - const toolsRequest = { - method: 'tools/list', - params: {} - }; - const toolsResult = await client.request(toolsRequest, ListToolsResultSchema); - console.log('Available tools:'); - if (toolsResult.tools.length === 0) { - console.log(' No tools available'); - } - else { - for (const tool of toolsResult.tools) { - console.log(` - ${tool.name}: ${tool.description}`); - } - } - } - catch (error) { - console.log(`Tools not supported by this server: ${error}`); - } -} -/** - * Start multiple notification tools in parallel with different configurations - * Each tool call includes a caller parameter to identify its notifications - */ -async function startParallelNotificationTools(client) { - try { - // Define multiple tool calls with different configurations - const toolCalls = [ - { - caller: 'fast-notifier', - request: { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { - interval: 2, // 0.5 second between notifications - count: 10, // Send 10 notifications - caller: 'fast-notifier' // Identify this tool call - } - } - } - }, - { - caller: 'slow-notifier', - request: { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { - interval: 5, // 2 seconds between notifications - count: 5, // Send 5 notifications - caller: 'slow-notifier' // Identify this tool call - } - } - } - }, - { - caller: 'burst-notifier', - request: { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { - interval: 1, // 0.1 second between notifications - count: 3, // Send just 3 notifications - caller: 'burst-notifier' // Identify this tool call - } - } - } - } - ]; - console.log(`Starting ${toolCalls.length} notification tools in parallel...`); - // Start all tool calls in parallel - const toolPromises = toolCalls.map(({ caller, request }) => { - console.log(`Starting tool call for ${caller}...`); - return client - .request(request, CallToolResultSchema) - .then(result => ({ caller, result })) - .catch(error => { - console.error(`Error in tool call for ${caller}:`, error); - throw error; - }); - }); - // Wait for all tool calls to complete - const results = await Promise.all(toolPromises); - // Organize results by caller - const resultsByTool = {}; - results.forEach(({ caller, result }) => { - resultsByTool[caller] = result; - }); - return resultsByTool; - } - catch (error) { - console.error(`Error starting parallel notification tools:`, error); - throw error; - } -} -// Start the client -main().catch((error) => { - console.error('Error running MCP client:', error); - process.exit(1); -}); -//# sourceMappingURL=parallelToolCallsClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.js.map deleted file mode 100644 index 0a04481..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/parallelToolCallsClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parallelToolCallsClient.js","sourceRoot":"","sources":["../../../../src/examples/client/parallelToolCallsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAEH,qBAAqB,EACrB,oBAAoB,EACpB,gCAAgC,EAEnC,MAAM,gBAAgB,CAAC;AAExB;;;;;;GAMG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,2BAA2B,CAAC;AAEzD,KAAK,UAAU,IAAI;IACf,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,4BAA4B,SAAS,EAAE,CAAC,CAAC;IAErD,IAAI,MAAc,CAAC;IACnB,IAAI,SAAwC,CAAC;IAE7C,IAAI,CAAC;QACD,+CAA+C;QAC/C,MAAM,GAAG,IAAI,MAAM,C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_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts deleted file mode 100644 index 876d25d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node -/** - * Example demonstrating client_credentials grant for machine-to-machine authentication. - * - * Supports two authentication methods based on environment variables: - * - * 1. client_secret_basic (default): - * MCP_CLIENT_ID - OAuth client ID (required) - * MCP_CLIENT_SECRET - OAuth client secret (required) - * - * 2. private_key_jwt (when MCP_CLIENT_PRIVATE_KEY_PEM is set): - * MCP_CLIENT_ID - OAuth client ID (required) - * MCP_CLIENT_PRIVATE_KEY_PEM - PEM-encoded private key for JWT signing (required) - * MCP_CLIENT_ALGORITHM - Signing algorithm (default: RS256) - * - * Common: - * MCP_SERVER_URL - Server URL (default: http://localhost:3000/mcp) - */ -export {}; -//# sourceMappingURL=simpleClientCredentials.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts.map deleted file mode 100644 index 7a935db..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleClientCredentials.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleClientCredentials.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;GAgBG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js deleted file mode 100644 index 7694bad..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node -/** - * Example demonstrating client_credentials grant for machine-to-machine authentication. - * - * Supports two authentication methods based on environment variables: - * - * 1. client_secret_basic (default): - * MCP_CLIENT_ID - OAuth client ID (required) - * MCP_CLIENT_SECRET - OAuth client secret (required) - * - * 2. private_key_jwt (when MCP_CLIENT_PRIVATE_KEY_PEM is set): - * MCP_CLIENT_ID - OAuth client ID (required) - * MCP_CLIENT_PRIVATE_KEY_PEM - PEM-encoded private key for JWT signing (required) - * MCP_CLIENT_ALGORITHM - Signing algorithm (default: RS256) - * - * Common: - * MCP_SERVER_URL - Server URL (default: http://localhost:3000/mcp) - */ -import { Client } from '../../client/index.js'; -import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; -import { ClientCredentialsProvider, PrivateKeyJwtProvider } from '../../client/auth-extensions.js'; -const DEFAULT_SERVER_URL = process.env.MCP_SERVER_URL || 'http://localhost:3000/mcp'; -function createProvider() { - const clientId = process.env.MCP_CLIENT_ID; - if (!clientId) { - console.error('MCP_CLIENT_ID environment variable is required'); - process.exit(1); - } - // If private key is provided, use private_key_jwt authentication - const privateKeyPem = process.env.MCP_CLIENT_PRIVATE_KEY_PEM; - if (privateKeyPem) { - const algorithm = process.env.MCP_CLIENT_ALGORITHM || 'RS256'; - console.log('Using private_key_jwt authentication'); - return new PrivateKeyJwtProvider({ - clientId, - privateKey: privateKeyPem, - algorithm - }); - } - // Otherwise, use client_secret_basic authentication - const clientSecret = process.env.MCP_CLIENT_SECRET; - if (!clientSecret) { - console.error('MCP_CLIENT_SECRET or MCP_CLIENT_PRIVATE_KEY_PEM environment variable is required'); - process.exit(1); - } - console.log('Using client_secret_basic authentication'); - return new ClientCredentialsProvider({ - clientId, - clientSecret - }); -} -async function main() { - const provider = createProvider(); - const client = new Client({ name: 'client-credentials-example', version: '1.0.0' }, { capabilities: {} }); - const transport = new StreamableHTTPClientTransport(new URL(DEFAULT_SERVER_URL), { - authProvider: provider - }); - await client.connect(transport); - console.log('Connected successfully.'); - const tools = await client.listTools(); - console.log('Available tools:', tools.tools.map(t => t.name).join(', ') || '(none)'); - await transport.close(); -} -main().catch(err => { - console.error(err); - process.exit(1); -}); -//# sourceMappingURL=simpleClientCredentials.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js.map deleted file mode 100644 index f6e7e21..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleClientCredentials.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleClientCredentials.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGnG,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,2BAA2B,CAAC;AAErF,SAAS,cAAc;IACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,iEAAiE;IACjE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC7D,IAAI,aAAa,EAAE,CAAC;QAChB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QACpD,OAAO,IAA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GAAG,CAAC,EAAE;IACf,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.d.ts deleted file mode 100644 index e4b43db..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -export {}; -//# sourceMappingURL=simpleOAuthClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.d.ts.map deleted file mode 100644 index c09eef8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleOAuthClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.js deleted file mode 100644 index c723097..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.js +++ /dev/null @@ -1,411 +0,0 @@ -#!/usr/bin/env node -import { createServer } from 'node:http'; -import { createInterface } from 'node:readline'; -import { URL } from 'node:url'; -import { exec } from 'node:child_process'; -import { Client } from '../../client/index.js'; -import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; -import { CallToolResultSchema, ListToolsResultSchema } from '../../types.js'; -import { UnauthorizedError } from '../../client/auth.js'; -import { InMemoryOAuthClientProvider } from './simpleOAuthClientProvider.js'; -// Configuration -const DEFAULT_SERVER_URL = 'http://localhost:3000/mcp'; -const CALLBACK_PORT = 8090; // Use different port than auth server (3001) -const CALLBACK_URL = `http://localhost:${CALLBACK_PORT}/callback`; -/** - * Interactive MCP client with OAuth authentication - * Demonstrates the complete OAuth flow with browser-based authorization - */ -class InteractiveOAuthClient { - constructor(serverUrl, clientMetadataUrl) { - this.serverUrl = serverUrl; - this.clientMetadataUrl = clientMetadataUrl; - this.client = null; - this.rl = createInterface({ - input: process.stdin, - output: process.stdout - }); - } - /** - * Prompts user for input via readline - */ - async question(query) { - return new Promise(resolve => { - this.rl.question(query, resolve); - }); - } - /** - * Opens the authorization URL in the user's default browser - */ - async openBrowser(url) { - console.log(`🌐 Opening browser for authorization: ${url}`); - const command = `open "${url}"`; - exec(command, error => { - if (error) { - console.error(`Failed to open browser: ${error.message}`); - console.log(`Please manually open: ${url}`); - } - }); - } - /** - * Example OAuth callback handler - in production, use a more robust approach - * for handling callbacks and storing tokens - */ - /** - * Starts a temporary HTTP server to receive the OAuth callback - */ - async waitForOAuthCallback() { - return new Promise((resolve, reject) => { - const server = createServer((req, res) => { - // Ignore favicon requests - if (req.url === '/favicon.ico') { - res.writeHead(404); - res.end(); - return; - } - console.log(`📥 Received callback: ${req.url}`); - const parsedUrl = new URL(req.url || '', 'http://localhost'); - const code = parsedUrl.searchParams.get('code'); - const error = parsedUrl.searchParams.get('error'); - if (code) { - console.log(`✅ Authorization code received: ${code?.substring(0, 10)}...`); - res.writeHead(200, { 'Content-Type': 'text/html' }); - res.end(` - - -

Authorization Successful!

-

You can close this window and return to the terminal.

- - - - `); - resolve(code); - setTimeout(() => server.close(), 3000); - } - else if (error) { - console.log(`❌ Authorization error: ${error}`); - res.writeHead(400, { 'Content-Type': 'text/html' }); - res.end(` - - -

Authorization Failed

-

Error: ${error}

- - - `); - reject(new Error(`OAuth authorization failed: ${error}`)); - } - else { - console.log(`❌ No authorization code or error in callback`); - res.writeHead(400); - res.end('Bad request'); - reject(new Error('No authorization code provided')); - } - }); - server.listen(CALLBACK_PORT, () => { - console.log(`OAuth callback server started on http://localhost:${CALLBACK_PORT}`); - }); - }); - } - async attemptConnection(oauthProvider) { - console.log('🚢 Creating transport with OAuth provider...'); - const baseUrl = new URL(this.serverUrl); - const transport = new StreamableHTTPClientTransport(baseUrl, { - authProvider: oauthProvider - }); - console.log('🚢 Transport created'); - try { - console.log('🔌 Attempting connection (this will trigger OAuth redirect)...'); - await this.client.connect(transport); - console.log('✅ Connected successfully'); - } - catch (error) { - if (error instanceof UnauthorizedError) { - console.log('🔐 OAuth required - waiting for authorization...'); - const callbackPromise = this.waitForOAuthCallback(); - const authCode = await callbackPromise; - await transport.finishAuth(authCode); - console.log('🔐 Authorization code received:', authCode); - console.log('🔌 Reconnecting with authenticated transport...'); - await this.attemptConnection(oauthProvider); - } - else { - console.error('❌ Connection failed with non-auth error:', error); - throw error; - } - } - } - /** - * Establishes connection to the MCP server with OAuth authentication - */ - async connect() { - console.log(`🔗 Attempting to connect to ${this.serverUrl}...`); - const clientMetadata = { - client_name: 'Simple OAuth MCP Client', - redirect_uris: [CALLBACK_URL], - grant_types: ['authorization_code', 'refresh_token'], - response_types: ['code'], - token_endpoint_auth_method: 'client_secret_post' - }; - console.log('🔐 Creating OAuth provider...'); - const oauthProvider = new InMemoryOAuthClientProvider(CALLBACK_URL, clientMetadata, (redirectUrl) => { - console.log(`📌 OAuth redirect handler called - opening browser`); - console.log(`Opening browser to: ${redirectUrl.toString()}`); - this.openBrowser(redirectUrl.toString()); - }, this.clientMetadataUrl); - console.log('🔐 OAuth provider created'); - console.log('👤 Creating MCP client...'); - this.client = new Client({ - name: 'simple-oauth-client', - version: '1.0.0' - }, { capabilities: {} }); - console.log('👤 Client created'); - console.log('🔐 Starting OAuth flow...'); - await this.attemptConnection(oauthProvider); - // Start interactive loop - await this.interactiveLoop(); - } - /** - * Main interactive loop for user commands - */ - async interactiveLoop() { - console.log('\n🎯 Interactive MCP Client with OAuth'); - console.log('Commands:'); - console.log(' list - List available tools'); - console.log(' call [args] - Call a tool'); - console.log(' stream [args] - Call a tool with streaming (shows task status)'); - console.log(' quit - Exit the client'); - console.log(); - while (true) { - try { - const command = await this.question('mcp> '); - if (!command.trim()) { - continue; - } - if (command === 'quit') { - console.log('\n👋 Goodbye!'); - this.close(); - process.exit(0); - } - else if (command === 'list') { - await this.listTools(); - } - else if (command.startsWith('call ')) { - await this.handleCallTool(command); - } - else if (command.startsWith('stream ')) { - await this.handleStreamTool(command); - } - else { - console.log("❌ Unknown command. Try 'list', 'call ', 'stream ', or 'quit'"); - } - } - catch (error) { - if (error instanceof Error && error.message === 'SIGINT') { - console.log('\n\n👋 Goodbye!'); - break; - } - console.error('❌ Error:', error); - } - } - } - async listTools() { - if (!this.client) { - console.log('❌ Not connected to server'); - return; - } - try { - const request = { - method: 'tools/list', - params: {} - }; - const result = await this.client.request(request, ListToolsResultSchema); - if (result.tools && result.tools.length > 0) { - console.log('\n📋 Available tools:'); - result.tools.forEach((tool, index) => { - console.log(`${index + 1}. ${tool.name}`); - if (tool.description) { - console.log(` Description: ${tool.description}`); - } - console.log(); - }); - } - else { - console.log('No tools available'); - } - } - catch (error) { - console.error('❌ Failed to list tools:', error); - } - } - async handleCallTool(command) { - const parts = command.split(/\s+/); - const toolName = parts[1]; - if (!toolName) { - console.log('❌ Please specify a tool name'); - return; - } - // Parse arguments (simple JSON-like format) - let toolArgs = {}; - if (parts.length > 2) { - const argsString = parts.slice(2).join(' '); - try { - toolArgs = JSON.parse(argsString); - } - catch { - console.log('❌ Invalid arguments format (expected JSON)'); - return; - } - } - await this.callTool(toolName, toolArgs); - } - async callTool(toolName, toolArgs) { - if (!this.client) { - console.log('❌ Not connected to server'); - return; - } - try { - const request = { - method: 'tools/call', - params: { - name: toolName, - arguments: toolArgs - } - }; - const result = await this.client.request(request, CallToolResultSchema); - console.log(`\n🔧 Tool '${toolName}' result:`); - if (result.content) { - result.content.forEach(content => { - if (content.type === 'text') { - console.log(content.text); - } - else { - console.log(content); - } - }); - } - else { - console.log(result); - } - } - catch (error) { - console.error(`❌ Failed to call tool '${toolName}':`, error); - } - } - async handleStreamTool(command) { - const parts = command.split(/\s+/); - const toolName = parts[1]; - if (!toolName) { - console.log('❌ Please specify a tool name'); - return; - } - // Parse arguments (simple JSON-like format) - let toolArgs = {}; - if (parts.length > 2) { - const argsString = parts.slice(2).join(' '); - try { - toolArgs = JSON.parse(argsString); - } - catch { - console.log('❌ Invalid arguments format (expected JSON)'); - return; - } - } - await this.streamTool(toolName, toolArgs); - } - async streamTool(toolName, toolArgs) { - if (!this.client) { - console.log('❌ Not connected to server'); - return; - } - try { - // Using the experimental tasks API - WARNING: may change without notice - console.log(`\n🔧 Streaming tool '${toolName}'...`); - const stream = this.client.experimental.tasks.callToolStream({ - name: toolName, - arguments: toolArgs - }, CallToolResultSchema, { - task: { - taskId: `task-${Date.now()}`, - ttl: 60000 - } - }); - // Iterate through all messages yielded by the generator - for await (const message of stream) { - switch (message.type) { - case 'taskCreated': - console.log(`✓ Task created: ${message.task.taskId}`); - break; - case 'taskStatus': - console.log(`⟳ Status: ${message.task.status}`); - if (message.task.statusMessage) { - console.log(` ${message.task.statusMessage}`); - } - break; - case 'result': - console.log('✓ Completed!'); - message.result.content.forEach(content => { - if (content.type === 'text') { - console.log(content.text); - } - else { - console.log(content); - } - }); - break; - case 'error': - console.log('✗ Error:'); - console.log(` ${message.error.message}`); - break; - } - } - } - catch (error) { - console.error(`❌ Failed to stream tool '${toolName}':`, error); - } - } - close() { - this.rl.close(); - if (this.client) { - // Note: Client doesn't have a close method in the current implementation - // This would typically close the transport connection - } - } -} -/** - * Main entry point - */ -async function main() { - const args = process.argv.slice(2); - const serverUrl = args[0] || DEFAULT_SERVER_URL; - const clientMetadataUrl = args[1]; - console.log('🚀 Simple MCP OAuth Client'); - console.log(`Connecting to: ${serverUrl}`); - if (clientMetadataUrl) { - console.log(`Client Metadata URL: ${clientMetadataUrl}`); - } - console.log(); - const client = new InteractiveOAuthClient(serverUrl, clientMetadataUrl); - // Handle graceful shutdown - process.on('SIGINT', () => { - console.log('\n\n👋 Goodbye!'); - client.close(); - process.exit(0); - }); - try { - await client.connect(); - } - catch (error) { - console.error('Failed to start client:', error); - process.exit(1); - } - finally { - client.close(); - } -} -// Run if this file is executed directly -main().catch(error => { - console.error('Unhandled error:', error); - process.exit(1); -}); -//# sourceMappingURL=simpleOAuthClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.js.map deleted file mode 100644 index b6470b6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleOAuthClient.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClient.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAAqC,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAChH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,gBAAgB;AAChB,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AACvD,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,6CAA6C;AACzE,MAAM,YAAY,GAAG,oBAAoB,aAAa,W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newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.d.ts deleted file mode 100644 index 092616c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { OAuthClientProvider } from '../../client/auth.js'; -import { OAuthClientInformationMixed, OAuthClientMetadata, OAuthTokens } from '../../shared/auth.js'; -/** - * In-memory OAuth client provider for demonstration purposes - * In production, you should persist tokens securely - */ -export declare class InMemoryOAuthClientProvider implements OAuthClientProvider { - private readonly _redirectUrl; - private readonly _clientMetadata; - readonly clientMetadataUrl?: string | undefined; - private _clientInformation?; - private _tokens?; - private _codeVerifier?; - constructor(_redirectUrl: string | URL, _clientMetadata: OAuthClientMetadata, onRedirect?: (url: URL) => void, clientMetadataUrl?: string | undefined); - private _onRedirect; - get redirectUrl(): string | URL; - get clientMetadata(): OAuthClientMetadata; - clientInformation(): OAuthClientInformationMixed | undefined; - saveClientInformation(clientInformation: OAuthClientInformationMixed): void; - tokens(): OAuthTokens | undefined; - saveTokens(tokens: OAuthTokens): void; - redirectToAuthorization(authorizationUrl: URL): void; - saveCodeVerifier(codeVerifier: string): void; - codeVerifier(): string; -} -//# sourceMappingURL=simpleOAuthClientProvider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.d.ts.map deleted file mode 100644 index 21efe94..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleOAuthClientProvider.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClientProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAErG;;;GAGG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;IAM/D,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe;aAEhB,iBAAiB,CAAC,EAAE,MAAM;IAR9C,OAAO,CAAC,kBAAkB,CAAC,CAA8B;IACzD,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,aAAa,CAAC,CAAS;gBAGV,YAAY,EAAE,MAAM,GAAG,GAAG,EAC1B,eAAe,EAAE,mBAAmB,EACrD,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,EACf,iBAAiB,CAAC,EAAE,MAAM,YAAA;IAS9C,OAAO,CAAC,WAAW,CAAqB;IAExC,IAAI,WAAW,IAAI,MAAM,GAAG,GAAG,CAE9B;IAED,IAAI,cAAc,IAAI,mBAAmB,CAExC;IAED,iBAAiB,IAAI,2BAA2B,GAAG,SAAS;IAI5D,qBAAqB,CAAC,iBAAiB,EAAE,2BAA2B,GAAG,IAAI;IAI3E,MAAM,IAAI,WAAW,GAAG,SAAS;IAIjC,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAIrC,uBAAuB,CAAC,gBAAgB,EAAE,GAAG,GAAG,IAAI;IAIpD,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAI5C,YAAY,IAAI,MAAM;CAMzB"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.js deleted file mode 100644 index 7c350d1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * In-memory OAuth client provider for demonstration purposes - * In production, you should persist tokens securely - */ -export class InMemoryOAuthClientProvider { - constructor(_redirectUrl, _clientMetadata, onRedirect, clientMetadataUrl) { - this._redirectUrl = _redirectUrl; - this._clientMetadata = _clientMetadata; - this.clientMetadataUrl = clientMetadataUrl; - this._onRedirect = - onRedirect || - (url => { - console.log(`Redirect to: ${url.toString()}`); - }); - } - get redirectUrl() { - return this._redirectUrl; - } - get clientMetadata() { - return this._clientMetadata; - } - clientInformation() { - return this._clientInformation; - } - saveClientInformation(clientInformation) { - this._clientInformation = clientInformation; - } - tokens() { - return this._tokens; - } - saveTokens(tokens) { - this._tokens = tokens; - } - redirectToAuthorization(authorizationUrl) { - this._onRedirect(authorizationUrl); - } - saveCodeVerifier(codeVerifier) { - this._codeVerifier = codeVerifier; - } - codeVerifier() { - if (!this._codeVerifier) { - throw new Error('No code verifier saved'); - } - return this._codeVerifier; - } -} -//# sourceMappingURL=simpleOAuthClientProvider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.js.map deleted file mode 100644 index 88f15cd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleOAuthClientProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleOAuthClientProvider.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClientProvider.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,OAAO,2BAA2B;IAKpC,YACqB,YAA0B,EAC1B,eAAoC,EACrD,UAA+B,EACf,iBAA0B;QAHzB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,oBAAe,GAAf,eAAe,CAAqB;QAErC,sBAAiB,GAAjB,iBAAiB,CAAS;QAE1C,IAAI,CAAC,WAAW;YACZ,UAAU;gBACV,CAAC,GAAG,CAAC,EAAE;oBACH,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAClD,CAAC,CAAC,CAAC;IACX,CAAC;IAID,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,qBAAqB,CAAC,iBAA8C;QAChE,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;IAChD,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,UAAU,CAAC,MAAmB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,uBAAuB,CAAC,gBAAqB;QACzC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC;IAED,gBAAgB,CAAC,YAAoB;QACjC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACtC,CAAC;IAED,YAAY;QACR,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.d.ts deleted file mode 100644 index a20be42..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=simpleStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.d.ts.map deleted file mode 100644 index 28406b0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.js deleted file mode 100644 index 2ece6a4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.js +++ /dev/null @@ -1,816 +0,0 @@ -import { Client } from '../../client/index.js'; -import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; -import { createInterface } from 'node:readline'; -import { ListToolsResultSchema, CallToolResultSchema, ListPromptsResultSchema, GetPromptResultSchema, ListResourcesResultSchema, LoggingMessageNotificationSchema, ResourceListChangedNotificationSchema, ElicitRequestSchema, ReadResourceResultSchema, RELATED_TASK_META_KEY, ErrorCode, McpError } from '../../types.js'; -import { getDisplayName } from '../../shared/metadataUtils.js'; -import { Ajv } from 'ajv'; -// Create readline interface for user input -const readline = createInterface({ - input: process.stdin, - output: process.stdout -}); -// Track received notifications for debugging resumability -let notificationCount = 0; -// Global client and transport for interactive commands -let client = null; -let transport = null; -let serverUrl = 'http://localhost:3000/mcp'; -let notificationsToolLastEventId = undefined; -let sessionId = undefined; -async function main() { - console.log('MCP Interactive Client'); - console.log('====================='); - // Connect to server immediately with default settings - await connect(); - // Print help and start the command loop - printHelp(); - commandLoop(); -} -function printHelp() { - console.log('\nAvailable commands:'); - console.log(' connect [url] - Connect to MCP server (default: http://localhost:3000/mcp)'); - console.log(' disconnect - Disconnect from server'); - console.log(' terminate-session - Terminate the current session'); - console.log(' reconnect - Reconnect to the server'); - console.log(' list-tools - List available tools'); - console.log(' call-tool [args] - Call a tool with optional JSON arguments'); - console.log(' call-tool-task [args] - Call a tool with task-based execution (example: call-tool-task delay {"duration":3000})'); - console.log(' greet [name] - Call the greet tool'); - console.log(' multi-greet [name] - Call the multi-greet tool with notifications'); - console.log(' collect-info [type] - Test form elicitation with collect-user-info tool (contact/preferences/feedback)'); - console.log(' start-notifications [interval] [count] - Start periodic notifications'); - console.log(' run-notifications-tool-with-resumability [interval] [count] - Run notification tool with resumability'); - console.log(' list-prompts - List available prompts'); - console.log(' get-prompt [name] [args] - Get a prompt with optional JSON arguments'); - console.log(' list-resources - List available resources'); - console.log(' read-resource - Read a specific resource by URI'); - console.log(' help - Show this help'); - console.log(' quit - Exit the program'); -} -function commandLoop() { - readline.question('\n> ', async (input) => { - const args = input.trim().split(/\s+/); - const command = args[0]?.toLowerCase(); - try { - switch (command) { - case 'connect': - await connect(args[1]); - break; - case 'disconnect': - await disconnect(); - break; - case 'terminate-session': - await terminateSession(); - break; - case 'reconnect': - await reconnect(); - break; - case 'list-tools': - await listTools(); - break; - case 'call-tool': - if (args.length < 2) { - console.log('Usage: call-tool [args]'); - } - else { - const toolName = args[1]; - let toolArgs = {}; - if (args.length > 2) { - try { - toolArgs = JSON.parse(args.slice(2).join(' ')); - } - catch { - console.log('Invalid JSON arguments. Using empty args.'); - } - } - await callTool(toolName, toolArgs); - } - break; - case 'greet': - await callGreetTool(args[1] || 'MCP User'); - break; - case 'multi-greet': - await callMultiGreetTool(args[1] || 'MCP User'); - break; - case 'collect-info': - await callCollectInfoTool(args[1] || 'contact'); - break; - case 'start-notifications': { - const interval = args[1] ? parseInt(args[1], 10) : 2000; - const count = args[2] ? parseInt(args[2], 10) : 10; - await startNotifications(interval, count); - break; - } - case 'run-notifications-tool-with-resumability': { - const interval = args[1] ? parseInt(args[1], 10) : 2000; - const count = args[2] ? parseInt(args[2], 10) : 10; - await runNotificationsToolWithResumability(interval, count); - break; - } - case 'call-tool-task': - if (args.length < 2) { - console.log('Usage: call-tool-task [args]'); - } - else { - const toolName = args[1]; - let toolArgs = {}; - if (args.length > 2) { - try { - toolArgs = JSON.parse(args.slice(2).join(' ')); - } - catch { - console.log('Invalid JSON arguments. Using empty args.'); - } - } - await callToolTask(toolName, toolArgs); - } - break; - case 'list-prompts': - await listPrompts(); - break; - case 'get-prompt': - if (args.length < 2) { - console.log('Usage: get-prompt [args]'); - } - else { - const promptName = args[1]; - let promptArgs = {}; - if (args.length > 2) { - try { - promptArgs = JSON.parse(args.slice(2).join(' ')); - } - catch { - console.log('Invalid JSON arguments. Using empty args.'); - } - } - await getPrompt(promptName, promptArgs); - } - break; - case 'list-resources': - await listResources(); - break; - case 'read-resource': - if (args.length < 2) { - console.log('Usage: read-resource '); - } - else { - await readResource(args[1]); - } - break; - case 'help': - printHelp(); - break; - case 'quit': - case 'exit': - await cleanup(); - return; - default: - if (command) { - console.log(`Unknown command: ${command}`); - } - break; - } - } - catch (error) { - console.error(`Error executing command: ${error}`); - } - // Continue the command loop - commandLoop(); - }); -} -async function connect(url) { - if (client) { - console.log('Already connected. Disconnect first.'); - return; - } - if (url) { - serverUrl = url; - } - console.log(`Connecting to ${serverUrl}...`); - try { - // Create a new client with form elicitation capability - client = new Client({ - name: 'example-client', - version: '1.0.0' - }, { - capabilities: { - elicitation: { - form: {} - } - } - }); - client.onerror = error => { - console.error('\x1b[31mClient error:', error, '\x1b[0m'); - }; - // Set up elicitation request handler with proper validation - client.setRequestHandler(ElicitRequestSchema, async (request) => { - if (request.params.mode !== 'form') { - throw new McpError(ErrorCode.InvalidParams, `Unsupported elicitation mode: ${request.params.mode}`); - } - console.log('\n🔔 Elicitation (form) Request Received:'); - console.log(`Message: ${request.params.message}`); - console.log(`Related Task: ${request.params._meta?.[RELATED_TASK_META_KEY]?.taskId}`); - console.log('Requested Schema:'); - console.log(JSON.stringify(request.params.requestedSchema, null, 2)); - const schema = request.params.requestedSchema; - const properties = schema.properties; - const required = schema.required || []; - // Set up AJV validator for the requested schema - const ajv = new Ajv(); - const validate = ajv.compile(schema); - let attempts = 0; - const maxAttempts = 3; - while (attempts < maxAttempts) { - attempts++; - console.log(`\nPlease provide the following information (attempt ${attempts}/${maxAttempts}):`); - const content = {}; - let inputCancelled = false; - // Collect input for each field - for (const [fieldName, fieldSchema] of Object.entries(properties)) { - const field = fieldSchema; - const isRequired = required.includes(fieldName); - let prompt = `${field.title || fieldName}`; - // Add helpful information to the prompt - if (field.description) { - prompt += ` (${field.description})`; - } - if (field.enum) { - prompt += ` [options: ${field.enum.join(', ')}]`; - } - if (field.type === 'number' || field.type === 'integer') { - if (field.minimum !== undefined && field.maximum !== undefined) { - prompt += ` [${field.minimum}-${field.maximum}]`; - } - else if (field.minimum !== undefined) { - prompt += ` [min: ${field.minimum}]`; - } - else if (field.maximum !== undefined) { - prompt += ` [max: ${field.maximum}]`; - } - } - if (field.type === 'string' && field.format) { - prompt += ` [format: ${field.format}]`; - } - if (isRequired) { - prompt += ' *required*'; - } - if (field.default !== undefined) { - prompt += ` [default: ${field.default}]`; - } - prompt += ': '; - const answer = await new Promise(resolve => { - readline.question(prompt, input => { - resolve(input.trim()); - }); - }); - // Check for cancellation - if (answer.toLowerCase() === 'cancel' || answer.toLowerCase() === 'c') { - inputCancelled = true; - break; - } - // Parse and validate the input - try { - if (answer === '' && field.default !== undefined) { - content[fieldName] = field.default; - } - else if (answer === '' && !isRequired) { - // Skip optional empty fields - continue; - } - else if (answer === '') { - throw new Error(`${fieldName} is required`); - } - else { - // Parse the value based on type - let parsedValue; - if (field.type === 'boolean') { - parsedValue = answer.toLowerCase() === 'true' || answer.toLowerCase() === 'yes' || answer === '1'; - } - else if (field.type === 'number') { - parsedValue = parseFloat(answer); - if (isNaN(parsedValue)) { - throw new Error(`${fieldName} must be a valid number`); - } - } - else if (field.type === 'integer') { - parsedValue = parseInt(answer, 10); - if (isNaN(parsedValue)) { - throw new Error(`${fieldName} must be a valid integer`); - } - } - else if (field.enum) { - if (!field.enum.includes(answer)) { - throw new Error(`${fieldName} must be one of: ${field.enum.join(', ')}`); - } - parsedValue = answer; - } - else { - parsedValue = answer; - } - content[fieldName] = parsedValue; - } - } - catch (error) { - console.log(`❌ Error: ${error}`); - // Continue to next attempt - break; - } - } - if (inputCancelled) { - return { action: 'cancel' }; - } - // If we didn't complete all fields due to an error, try again - if (Object.keys(content).length !== - Object.keys(properties).filter(name => required.includes(name) || content[name] !== undefined).length) { - if (attempts < maxAttempts) { - console.log('Please try again...'); - continue; - } - else { - console.log('Maximum attempts reached. Declining request.'); - return { action: 'decline' }; - } - } - // Validate the complete object against the schema - const isValid = validate(content); - if (!isValid) { - console.log('❌ Validation errors:'); - validate.errors?.forEach(error => { - console.log(` - ${error.instancePath || 'root'}: ${error.message}`); - }); - if (attempts < maxAttempts) { - console.log('Please correct the errors and try again...'); - continue; - } - else { - console.log('Maximum attempts reached. Declining request.'); - return { action: 'decline' }; - } - } - // Show the collected data and ask for confirmation - console.log('\n✅ Collected data:'); - console.log(JSON.stringify(content, null, 2)); - const confirmAnswer = await new Promise(resolve => { - readline.question('\nSubmit this information? (yes/no/cancel): ', input => { - resolve(input.trim().toLowerCase()); - }); - }); - if (confirmAnswer === 'yes' || confirmAnswer === 'y') { - return { - action: 'accept', - content - }; - } - else if (confirmAnswer === 'cancel' || confirmAnswer === 'c') { - return { action: 'cancel' }; - } - else if (confirmAnswer === 'no' || confirmAnswer === 'n') { - if (attempts < maxAttempts) { - console.log('Please re-enter the information...'); - continue; - } - else { - return { action: 'decline' }; - } - } - } - console.log('Maximum attempts reached. Declining request.'); - return { action: 'decline' }; - }); - transport = new StreamableHTTPClientTransport(new URL(serverUrl), { - sessionId: sessionId - }); - // Set up notification handlers - client.setNotificationHandler(LoggingMessageNotificationSchema, notification => { - notificationCount++; - console.log(`\nNotification #${notificationCount}: ${notification.params.level} - ${notification.params.data}`); - // Re-display the prompt - process.stdout.write('> '); - }); - client.setNotificationHandler(ResourceListChangedNotificationSchema, async (_) => { - console.log(`\nResource list changed notification received!`); - try { - if (!client) { - console.log('Client disconnected, cannot fetch resources'); - return; - } - const resourcesResult = await client.request({ - method: 'resources/list', - params: {} - }, ListResourcesResultSchema); - console.log('Available resources count:', resourcesResult.resources.length); - } - catch { - console.log('Failed to list resources after change notification'); - } - // Re-display the prompt - process.stdout.write('> '); - }); - // Connect the client - await client.connect(transport); - sessionId = transport.sessionId; - console.log('Transport created with session ID:', sessionId); - console.log('Connected to MCP server'); - } - catch (error) { - console.error('Failed to connect:', error); - client = null; - transport = null; - } -} -async function disconnect() { - if (!client || !transport) { - console.log('Not connected.'); - return; - } - try { - await transport.close(); - console.log('Disconnected from MCP server'); - client = null; - transport = null; - } - catch (error) { - console.error('Error disconnecting:', error); - } -} -async function terminateSession() { - if (!client || !transport) { - console.log('Not connected.'); - return; - } - try { - console.log('Terminating session with ID:', transport.sessionId); - await transport.terminateSession(); - console.log('Session terminated successfully'); - // Check if sessionId was cleared after termination - if (!transport.sessionId) { - console.log('Session ID has been cleared'); - sessionId = undefined; - // Also close the transport and clear client objects - await transport.close(); - console.log('Transport closed after session termination'); - client = null; - transport = null; - } - else { - console.log('Server responded with 405 Method Not Allowed (session termination not supported)'); - console.log('Session ID is still active:', transport.sessionId); - } - } - catch (error) { - console.error('Error terminating session:', error); - } -} -async function reconnect() { - if (client) { - await disconnect(); - } - await connect(); -} -async function listTools() { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const toolsRequest = { - method: 'tools/list', - params: {} - }; - const toolsResult = await client.request(toolsRequest, ListToolsResultSchema); - console.log('Available tools:'); - if (toolsResult.tools.length === 0) { - console.log(' No tools available'); - } - else { - for (const tool of toolsResult.tools) { - console.log(` - id: ${tool.name}, name: ${getDisplayName(tool)}, description: ${tool.description}`); - } - } - } - catch (error) { - console.log(`Tools not supported by this server (${error})`); - } -} -async function callTool(name, args) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const request = { - method: 'tools/call', - params: { - name, - arguments: args - } - }; - console.log(`Calling tool '${name}' with args:`, args); - const result = await client.request(request, CallToolResultSchema); - console.log('Tool result:'); - const resourceLinks = []; - result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else if (item.type === 'resource_link') { - const resourceLink = item; - resourceLinks.push(resourceLink); - console.log(` 📁 Resource Link: ${resourceLink.name}`); - console.log(` URI: ${resourceLink.uri}`); - if (resourceLink.mimeType) { - console.log(` Type: ${resourceLink.mimeType}`); - } - if (resourceLink.description) { - console.log(` Description: ${resourceLink.description}`); - } - } - else if (item.type === 'resource') { - console.log(` [Embedded Resource: ${item.resource.uri}]`); - } - else if (item.type === 'image') { - console.log(` [Image: ${item.mimeType}]`); - } - else if (item.type === 'audio') { - console.log(` [Audio: ${item.mimeType}]`); - } - else { - console.log(` [Unknown content type]:`, item); - } - }); - // Offer to read resource links - if (resourceLinks.length > 0) { - console.log(`\nFound ${resourceLinks.length} resource link(s). Use 'read-resource ' to read their content.`); - } - } - catch (error) { - console.log(`Error calling tool ${name}: ${error}`); - } -} -async function callGreetTool(name) { - await callTool('greet', { name }); -} -async function callMultiGreetTool(name) { - console.log('Calling multi-greet tool with notifications...'); - await callTool('multi-greet', { name }); -} -async function callCollectInfoTool(infoType) { - console.log(`Testing form elicitation with collect-user-info tool (${infoType})...`); - await callTool('collect-user-info', { infoType }); -} -async function startNotifications(interval, count) { - console.log(`Starting notification stream: interval=${interval}ms, count=${count || 'unlimited'}`); - await callTool('start-notification-stream', { interval, count }); -} -async function runNotificationsToolWithResumability(interval, count) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - console.log(`Starting notification stream with resumability: interval=${interval}ms, count=${count || 'unlimited'}`); - console.log(`Using resumption token: ${notificationsToolLastEventId || 'none'}`); - const request = { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { interval, count } - } - }; - const onLastEventIdUpdate = (event) => { - notificationsToolLastEventId = event; - console.log(`Updated resumption token: ${event}`); - }; - const result = await client.request(request, CallToolResultSchema, { - resumptionToken: notificationsToolLastEventId, - onresumptiontoken: onLastEventIdUpdate - }); - console.log('Tool result:'); - result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else { - console.log(` ${item.type} content:`, item); - } - }); - } - catch (error) { - console.log(`Error starting notification stream: ${error}`); - } -} -async function listPrompts() { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const promptsRequest = { - method: 'prompts/list', - params: {} - }; - const promptsResult = await client.request(promptsRequest, ListPromptsResultSchema); - console.log('Available prompts:'); - if (promptsResult.prompts.length === 0) { - console.log(' No prompts available'); - } - else { - for (const prompt of promptsResult.prompts) { - console.log(` - id: ${prompt.name}, name: ${getDisplayName(prompt)}, description: ${prompt.description}`); - } - } - } - catch (error) { - console.log(`Prompts not supported by this server (${error})`); - } -} -async function getPrompt(name, args) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const promptRequest = { - method: 'prompts/get', - params: { - name, - arguments: args - } - }; - const promptResult = await client.request(promptRequest, GetPromptResultSchema); - console.log('Prompt template:'); - promptResult.messages.forEach((msg, index) => { - console.log(` [${index + 1}] ${msg.role}: ${msg.content.type === 'text' ? msg.content.text : JSON.stringify(msg.content)}`); - }); - } - catch (error) { - console.log(`Error getting prompt ${name}: ${error}`); - } -} -async function listResources() { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const resourcesRequest = { - method: 'resources/list', - params: {} - }; - const resourcesResult = await client.request(resourcesRequest, ListResourcesResultSchema); - console.log('Available resources:'); - if (resourcesResult.resources.length === 0) { - console.log(' No resources available'); - } - else { - for (const resource of resourcesResult.resources) { - console.log(` - id: ${resource.name}, name: ${getDisplayName(resource)}, description: ${resource.uri}`); - } - } - } - catch (error) { - console.log(`Resources not supported by this server (${error})`); - } -} -async function readResource(uri) { - if (!client) { - console.log('Not connected to server.'); - return; - } - try { - const request = { - method: 'resources/read', - params: { uri } - }; - console.log(`Reading resource: ${uri}`); - const result = await client.request(request, ReadResourceResultSchema); - console.log('Resource contents:'); - for (const content of result.contents) { - console.log(` URI: ${content.uri}`); - if (content.mimeType) { - console.log(` Type: ${content.mimeType}`); - } - if ('text' in content && typeof content.text === 'string') { - console.log(' Content:'); - console.log(' ---'); - console.log(content.text - .split('\n') - .map((line) => ' ' + line) - .join('\n')); - console.log(' ---'); - } - else if ('blob' in content && typeof content.blob === 'string') { - console.log(` [Binary data: ${content.blob.length} bytes]`); - } - } - } - catch (error) { - console.log(`Error reading resource ${uri}: ${error}`); - } -} -async function callToolTask(name, args) { - if (!client) { - console.log('Not connected to server.'); - return; - } - console.log(`Calling tool '${name}' with task-based execution...`); - console.log('Arguments:', args); - // Use task-based execution - call now, fetch later - // Using the experimental tasks API - WARNING: may change without notice - console.log('This will return immediately while processing continues in the background...'); - try { - // Call the tool with task metadata using streaming API - const stream = client.experimental.tasks.callToolStream({ - name, - arguments: args - }, CallToolResultSchema, { - task: { - ttl: 60000 // Keep results for 60 seconds - } - }); - console.log('Waiting for task completion...'); - let lastStatus = ''; - for await (const message of stream) { - switch (message.type) { - case 'taskCreated': - console.log('Task created successfully with ID:', message.task.taskId); - break; - case 'taskStatus': - if (lastStatus !== message.task.status) { - console.log(` ${message.task.status}${message.task.statusMessage ? ` - ${message.task.statusMessage}` : ''}`); - } - lastStatus = message.task.status; - break; - case 'result': - console.log('Task completed!'); - console.log('Tool result:'); - message.result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - }); - break; - case 'error': - throw message.error; - } - } - } - catch (error) { - console.log(`Error with task-based execution: ${error}`); - } -} -async function cleanup() { - if (client && transport) { - try { - // First try to terminate the session gracefully - if (transport.sessionId) { - try { - console.log('Terminating session before exit...'); - await transport.terminateSession(); - console.log('Session terminated successfully'); - } - catch (error) { - console.error('Error terminating session:', error); - } - } - // Then close the transport - await transport.close(); - } - catch (error) { - console.error('Error closing transport:', error); - } - } - process.stdin.setRawMode(false); - readline.close(); - console.log('\nGoodbye!'); - process.exit(0); -} -// Set up raw mode for keyboard input to capture Escape key -process.stdin.setRawMode(true); -process.stdin.on('data', async (data) => { - // Check for Escape key (27) - if (data.length === 1 && data[0] === 27) { - console.log('\nESC key pressed. Disconnecting from server...'); - // Abort current operation and disconnect from server - if (client && transport) { - await disconnect(); - console.log('Disconnected. Press Enter to continue.'); - } - else { - console.log('Not connected to server.'); - } - // Re-display the prompt - process.stdout.write('> '); - } -}); -// Handle Ctrl+C -process.on('SIGINT', async () => { - console.log('\nReceived SIGINT. Cleaning up...'); - await cleanup(); -}); -// Start the interactive client -main().catch((error) => { - console.error('Error running MCP client:', error); - process.exit(1); -}); -//# sourceMappingURL=simpleStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.js.map deleted file mode 100644 index c9a780d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleStreamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAEH,qBAAqB,EAErB,oBAAoB,EAEpB,uBAAuB,EAEvB,qBAAqB,EAErB,yBAAyB,EACzB,gCAAgC,EAChC,qCAAqC,EACrC,mBAAmB,EAGnB,wBAAwB,EACxB,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,2CAA2C;AAC3C,MAAM,QAAQ,GAAG,eAAe,CAA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AAC;QAC1D,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAC5C,CAAC;QAED,wBAAwB;QACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,gBAAgB;AAChB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,MAAM,OAAO,EAAE,CAAC;AACpB,CAAC,CAAC,CAAC;AAEH,+BAA+B;AAC/B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.d.ts deleted file mode 100644 index c794066..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Simple interactive task client demonstrating elicitation and sampling responses. - * - * This client connects to simpleTaskInteractive.ts server and demonstrates: - * - Handling elicitation requests (y/n confirmation) - * - Handling sampling requests (returns a hardcoded haiku) - * - Using task-based tool execution with streaming - */ -export {}; -//# sourceMappingURL=simpleTaskInteractiveClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.d.ts.map deleted file mode 100644 index 89b7338..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleTaskInteractiveClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleTaskInteractiveClient.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.js deleted file mode 100644 index 5a238c5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Simple interactive task client demonstrating elicitation and sampling responses. - * - * This client connects to simpleTaskInteractive.ts server and demonstrates: - * - Handling elicitation requests (y/n confirmation) - * - Handling sampling requests (returns a hardcoded haiku) - * - Using task-based tool execution with streaming - */ -import { Client } from '../../client/index.js'; -import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; -import { createInterface } from 'node:readline'; -import { CallToolResultSchema, ElicitRequestSchema, CreateMessageRequestSchema, ErrorCode, McpError } from '../../types.js'; -// Create readline interface for user input -const readline = createInterface({ - input: process.stdin, - output: process.stdout -}); -function question(prompt) { - return new Promise(resolve => { - readline.question(prompt, answer => { - resolve(answer.trim()); - }); - }); -} -function getTextContent(result) { - const textContent = result.content.find((c) => c.type === 'text'); - return textContent?.text ?? '(no text)'; -} -async function elicitationCallback(params) { - console.log(`\n[Elicitation] Server asks: ${params.message}`); - // Simple terminal prompt for y/n - const response = await question('Your response (y/n): '); - const confirmed = ['y', 'yes', 'true', '1'].includes(response.toLowerCase()); - console.log(`[Elicitation] Responding with: confirm=${confirmed}`); - return { action: 'accept', content: { confirm: confirmed } }; -} -async function samplingCallback(params) { - // Get the prompt from the first message - let prompt = 'unknown'; - if (params.messages && params.messages.length > 0) { - const firstMessage = params.messages[0]; - const content = firstMessage.content; - if (typeof content === 'object' && !Array.isArray(content) && content.type === 'text' && 'text' in content) { - prompt = content.text; - } - else if (Array.isArray(content)) { - const textPart = content.find(c => c.type === 'text' && 'text' in c); - if (textPart && 'text' in textPart) { - prompt = textPart.text; - } - } - } - console.log(`\n[Sampling] Server requests LLM completion for: ${prompt}`); - // Return a hardcoded haiku (in real use, call your LLM here) - const haiku = `Cherry blossoms fall -Softly on the quiet pond -Spring whispers goodbye`; - console.log('[Sampling] Responding with haiku'); - return { - model: 'mock-haiku-model', - role: 'assistant', - content: { type: 'text', text: haiku } - }; -} -async function run(url) { - console.log('Simple Task Interactive Client'); - console.log('=============================='); - console.log(`Connecting to ${url}...`); - // Create client with elicitation and sampling capabilities - const client = new Client({ name: 'simple-task-interactive-client', version: '1.0.0' }, { - capabilities: { - elicitation: { form: {} }, - sampling: {} - } - }); - // Set up elicitation request handler - client.setRequestHandler(ElicitRequestSchema, async (request) => { - if (request.params.mode && request.params.mode !== 'form') { - throw new McpError(ErrorCode.InvalidParams, `Unsupported elicitation mode: ${request.params.mode}`); - } - return elicitationCallback(request.params); - }); - // Set up sampling request handler - client.setRequestHandler(CreateMessageRequestSchema, async (request) => { - return samplingCallback(request.params); - }); - // Connect to server - const transport = new StreamableHTTPClientTransport(new URL(url)); - await client.connect(transport); - console.log('Connected!\n'); - // List tools - const toolsResult = await client.listTools(); - console.log(`Available tools: ${toolsResult.tools.map(t => t.name).join(', ')}`); - // Demo 1: Elicitation (confirm_delete) - console.log('\n--- Demo 1: Elicitation ---'); - console.log('Calling confirm_delete tool...'); - const confirmStream = client.experimental.tasks.callToolStream({ name: 'confirm_delete', arguments: { filename: 'important.txt' } }, CallToolResultSchema, { task: { ttl: 60000 } }); - for await (const message of confirmStream) { - switch (message.type) { - case 'taskCreated': - console.log(`Task created: ${message.task.taskId}`); - break; - case 'taskStatus': - console.log(`Task status: ${message.task.status}`); - break; - case 'result': - console.log(`Result: ${getTextContent(message.result)}`); - break; - case 'error': - console.error(`Error: ${message.error}`); - break; - } - } - // Demo 2: Sampling (write_haiku) - console.log('\n--- Demo 2: Sampling ---'); - console.log('Calling write_haiku tool...'); - const haikuStream = client.experimental.tasks.callToolStream({ name: 'write_haiku', arguments: { topic: 'autumn leaves' } }, CallToolResultSchema, { - task: { ttl: 60000 } - }); - for await (const message of haikuStream) { - switch (message.type) { - case 'taskCreated': - console.log(`Task created: ${message.task.taskId}`); - break; - case 'taskStatus': - console.log(`Task status: ${message.task.status}`); - break; - case 'result': - console.log(`Result:\n${getTextContent(message.result)}`); - break; - case 'error': - console.error(`Error: ${message.error}`); - break; - } - } - // Cleanup - console.log('\nDemo complete. Closing connection...'); - await transport.close(); - readline.close(); -} -// Parse command line arguments -const args = process.argv.slice(2); -let url = 'http://localhost:8000/mcp'; -for (let i = 0; i < args.length; i++) { - if (args[i] === '--url' && args[i + 1]) { - url = args[i + 1]; - i++; - } -} -// Run the client -run(url).catch(error => { - console.error('Error running client:', error); - process.exit(1); -}); -//# sourceMappingURL=simpleTaskInteractiveClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.js.map deleted file mode 100644 index 6adb4ff..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleTaskInteractiveClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleTaskInteractiveClient.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleTaskInteractiveClient.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACH,oBAAoB,EAEpB,mBAAmB,EACnB,0BAA0B,EAG1B,SAAS,EACT,QAAQ,EACX,M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GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAClB,CAAC,EAAE,CAAC;IACR,CAAC;AACL,CAAC;AAED,iBAAiB;AACjB,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.d.ts deleted file mode 100644 index 134b4b0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=ssePollingClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.d.ts.map deleted file mode 100644 index 59e4153..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ssePollingClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/ssePollingClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.js deleted file mode 100644 index 6bd93a9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * SSE Polling Example Client (SEP-1699) - * - * This example demonstrates client-side behavior during server-initiated - * SSE stream disconnection and automatic reconnection. - * - * Key features demonstrated: - * - Automatic reconnection when server closes SSE stream - * - Event replay via Last-Event-ID header - * - Resumption token tracking via onresumptiontoken callback - * - * Run with: npx tsx src/examples/client/ssePollingClient.ts - * Requires: ssePollingExample.ts server running on port 3001 - */ -import { Client } from '../../client/index.js'; -import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; -import { CallToolResultSchema, LoggingMessageNotificationSchema } from '../../types.js'; -const SERVER_URL = 'http://localhost:3001/mcp'; -async function main() { - console.log('SSE Polling Example Client'); - console.log('=========================='); - console.log(`Connecting to ${SERVER_URL}...`); - console.log(''); - // Create transport with reconnection options - const transport = new StreamableHTTPClientTransport(new URL(SERVER_URL), { - // Use default reconnection options - SDK handles automatic reconnection - }); - // Track the last event ID for debugging - let lastEventId; - // Set up transport error handler to observe disconnections - // Filter out expected errors from SSE reconnection - transport.onerror = error => { - // Skip abort errors during intentional close - if (error.message.includes('AbortError')) - return; - // Show SSE disconnect (expected when server closes stream) - if (error.message.includes('Unexpected end of JSON')) { - console.log('[Transport] SSE stream disconnected - client will auto-reconnect'); - return; - } - console.log(`[Transport] Error: ${error.message}`); - }; - // Set up transport close handler - transport.onclose = () => { - console.log('[Transport] Connection closed'); - }; - // Create and connect client - const client = new Client({ - name: 'sse-polling-client', - version: '1.0.0' - }); - // Set up notification handler to receive progress updates - client.setNotificationHandler(LoggingMessageNotificationSchema, notification => { - const data = notification.params.data; - console.log(`[Notification] ${data}`); - }); - try { - await client.connect(transport); - console.log('[Client] Connected successfully'); - console.log(''); - // Call the long-task tool - console.log('[Client] Calling long-task tool...'); - console.log('[Client] Server will disconnect mid-task to demonstrate polling'); - console.log(''); - const result = await client.request({ - method: 'tools/call', - params: { - name: 'long-task', - arguments: {} - } - }, CallToolResultSchema, { - // Track resumption tokens for debugging - onresumptiontoken: token => { - lastEventId = token; - console.log(`[Event ID] ${token}`); - } - }); - console.log(''); - console.log('[Client] Tool completed!'); - console.log(`[Result] ${JSON.stringify(result.content, null, 2)}`); - console.log(''); - console.log(`[Debug] Final event ID: ${lastEventId}`); - } - catch (error) { - console.error('[Error]', error); - } - finally { - await transport.close(); - console.log('[Client] Disconnected'); - } -} -main().catch(console.error); -//# sourceMappingURL=ssePollingClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.js.map deleted file mode 100644 index c41b433..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/ssePollingClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ssePollingClient.js","sourceRoot":"","sources":["../../../../src/examples/client/ssePollingClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAExF,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAE/C,KAAK,UAAU,IAAI;IACf,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,iBAAiB,UAAU,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,6CAA6C;IAC7C,MAAM,SAAS,GAAG,IAAI,6BAA6B,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,EAAE;IACrE,wEAAwE;KAC3E,CAAC,CAAC;IAEH,wCAAwC;IACxC,IAAI,WAA+B,CAAC;IAEpC,2DAA2D;IAC3D,mDAAmD;IACnD,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE;QACxB,6CAA6C;QAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,C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AE,EAAE;aAChB;SACJ,EACD,oBAAoB,EACpB;YACI,wCAAwC;YACxC,iBAAiB,EAAE,KAAK,CAAC,EAAE;gBACvB,WAAW,GAAG,KAAK,CAAC;gBACpB,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,EAAE,CAAC,CAAC;YACvC,CAAC;SACJ,CACJ,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACnE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,2BAA2B,WAAW,EAAE,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;YAAS,CAAC;QACP,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACzC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts deleted file mode 100644 index c2679e6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=streamableHttpWithSseFallbackClient.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts.map deleted file mode 100644 index b79ae2a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttpWithSseFallbackClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js deleted file mode 100644 index 1bea768..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js +++ /dev/null @@ -1,166 +0,0 @@ -import { Client } from '../../client/index.js'; -import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; -import { SSEClientTransport } from '../../client/sse.js'; -import { ListToolsResultSchema, CallToolResultSchema, LoggingMessageNotificationSchema } from '../../types.js'; -/** - * Simplified Backwards Compatible MCP Client - * - * This client demonstrates backward compatibility with both: - * 1. Modern servers using Streamable HTTP transport (protocol version 2025-03-26) - * 2. Older servers using HTTP+SSE transport (protocol version 2024-11-05) - * - * Following the MCP specification for backwards compatibility: - * - Attempts to POST an initialize request to the server URL first (modern transport) - * - If that fails with 4xx status, falls back to GET request for SSE stream (older transport) - */ -// Command line args processing -const args = process.argv.slice(2); -const serverUrl = args[0] || 'http://localhost:3000/mcp'; -async function main() { - console.log('MCP Backwards Compatible Client'); - console.log('==============================='); - console.log(`Connecting to server at: ${serverUrl}`); - let client; - let transport; - try { - // Try connecting with automatic transport detection - const connection = await connectWithBackwardsCompatibility(serverUrl); - client = connection.client; - transport = connection.transport; - // Set up notification handler - client.setNotificationHandler(LoggingMessageNotificationSchema, notification => { - console.log(`Notification: ${notification.params.level} - ${notification.params.data}`); - }); - // DEMO WORKFLOW: - // 1. List available tools - console.log('\n=== Listing Available Tools ==='); - await listTools(client); - // 2. Call the notification tool - console.log('\n=== Starting Notification Stream ==='); - await startNotificationTool(client); - // 3. Wait for all notifications (5 seconds) - console.log('\n=== Waiting for all notifications ==='); - await new Promise(resolve => setTimeout(resolve, 5000)); - // 4. Disconnect - console.log('\n=== Disconnecting ==='); - await transport.close(); - console.log('Disconnected from MCP server'); - } - catch (error) { - console.error('Error running client:', error); - process.exit(1); - } -} -/** - * Connect to an MCP server with backwards compatibility - * Following the spec for client backward compatibility - */ -async function connectWithBackwardsCompatibility(url) { - console.log('1. Trying Streamable HTTP transport first...'); - // Step 1: Try Streamable HTTP transport first - const client = new Client({ - name: 'backwards-compatible-client', - version: '1.0.0' - }); - client.onerror = error => { - console.error('Client error:', error); - }; - const baseUrl = new URL(url); - try { - // Create modern transport - const streamableTransport = new StreamableHTTPClientTransport(baseUrl); - await client.connect(streamableTransport); - console.log('Successfully connected using modern Streamable HTTP transport.'); - return { - client, - transport: streamableTransport, - transportType: 'streamable-http' - }; - } - catch (error) { - // Step 2: If transport fails, try the older SSE transport - console.log(`StreamableHttp transport connection failed: ${error}`); - console.log('2. Falling back to deprecated HTTP+SSE transport...'); - try { - // Create SSE transport pointing to /sse endpoint - const sseTransport = new SSEClientTransport(baseUrl); - const sseClient = new Client({ - name: 'backwards-compatible-client', - version: '1.0.0' - }); - await sseClient.connect(sseTransport); - console.log('Successfully connected using deprecated HTTP+SSE transport.'); - return { - client: sseClient, - transport: sseTransport, - transportType: 'sse' - }; - } - catch (sseError) { - console.error(`Failed to connect with either transport method:\n1. Streamable HTTP error: ${error}\n2. SSE error: ${sseError}`); - throw new Error('Could not connect to server with any available transport'); - } - } -} -/** - * List available tools on the server - */ -async function listTools(client) { - try { - const toolsRequest = { - method: 'tools/list', - params: {} - }; - const toolsResult = await client.request(toolsRequest, ListToolsResultSchema); - console.log('Available tools:'); - if (toolsResult.tools.length === 0) { - console.log(' No tools available'); - } - else { - for (const tool of toolsResult.tools) { - console.log(` - ${tool.name}: ${tool.description}`); - } - } - } - catch (error) { - console.log(`Tools not supported by this server: ${error}`); - } -} -/** - * Start a notification stream by calling the notification tool - */ -async function startNotificationTool(client) { - try { - // Call the notification tool using reasonable defaults - const request = { - method: 'tools/call', - params: { - name: 'start-notification-stream', - arguments: { - interval: 1000, // 1 second between notifications - count: 5 // Send 5 notifications - } - } - }; - console.log('Calling notification tool...'); - const result = await client.request(request, CallToolResultSchema); - console.log('Tool result:'); - result.content.forEach(item => { - if (item.type === 'text') { - console.log(` ${item.text}`); - } - else { - console.log(` ${item.type} content:`, item); - } - }); - } - catch (error) { - console.log(`Error calling notification tool: ${error}`); - } -} -// Start the client -main().catch((error) => { - console.error('Error running MCP client:', error); - process.exit(1); -}); -//# sourceMappingURL=streamableHttpWithSseFallbackClient.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js.map deleted file mode 100644 index 0d9399d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttpWithSseFallbackClient.js","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAEH,qBAAqB,EAErB,oBAAoB,EACpB,gCAAgC,EACnC,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;GAUG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,O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extprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts deleted file mode 100644 index 218aeac..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { AuthorizationParams, OAuthServerProvider } from '../../server/auth/provider.js'; -import { OAuthRegisteredClientsStore } from '../../server/auth/clients.js'; -import { OAuthClientInformationFull, OAuthMetadata, OAuthTokens } from '../../shared/auth.js'; -import { Response } from 'express'; -import { AuthInfo } from '../../server/auth/types.js'; -export declare class DemoInMemoryClientsStore implements OAuthRegisteredClientsStore { - private clients; - getClient(clientId: string): Promise<{ - redirect_uris: string[]; - client_id: string; - token_endpoint_auth_method?: string | undefined; - grant_types?: string[] | undefined; - response_types?: string[] | undefined; - client_name?: string | undefined; - client_uri?: string | undefined; - logo_uri?: string | undefined; - scope?: string | undefined; - contacts?: string[] | undefined; - tos_uri?: string | undefined; - policy_uri?: string | undefined; - jwks_uri?: string | undefined; - jwks?: any; - software_id?: string | undefined; - software_version?: string | undefined; - software_statement?: string | undefined; - client_secret?: string | undefined; - client_id_issued_at?: number | undefined; - client_secret_expires_at?: number | undefined; - } | undefined>; - registerClient(clientMetadata: OAuthClientInformationFull): Promise<{ - redirect_uris: string[]; - client_id: string; - token_endpoint_auth_method?: string | undefined; - grant_types?: string[] | undefined; - response_types?: string[] | undefined; - client_name?: string | undefined; - client_uri?: string | undefined; - logo_uri?: string | undefined; - scope?: string | undefined; - contacts?: string[] | undefined; - tos_uri?: string | undefined; - policy_uri?: string | undefined; - jwks_uri?: string | undefined; - jwks?: any; - software_id?: string | undefined; - software_version?: string | undefined; - software_statement?: string | undefined; - client_secret?: string | undefined; - client_id_issued_at?: number | undefined; - client_secret_expires_at?: number | undefined; - }>; -} -/** - * 🚨 DEMO ONLY - NOT FOR PRODUCTION - * - * This example demonstrates MCP OAuth flow but lacks some of the features required for production use, - * for example: - * - Persistent token storage - * - Rate limiting - */ -export declare class DemoInMemoryAuthProvider implements OAuthServerProvider { - private validateResource?; - clientsStore: DemoInMemoryClientsStore; - private codes; - private tokens; - constructor(validateResource?: ((resource?: URL) => boolean) | undefined); - authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; - challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise; - exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, _codeVerifier?: string): Promise; - exchangeRefreshToken(_client: OAuthClientInformationFull, _refreshToken: string, _scopes?: string[], _resource?: URL): Promise; - verifyAccessToken(token: string): Promise; -} -export declare const setupAuthServer: ({ authServerUrl, mcpServerUrl, strictResource }: { - authServerUrl: URL; - mcpServerUrl: URL; - strictResource: boolean; -}) => OAuthMetadata; -//# sourceMappingURL=demoInMemoryOAuthProvider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map deleted file mode 100644 index 8a4a43f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"demoInMemoryOAuthProvider.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAgB,EAAW,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,4B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@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.js deleted file mode 100644 index 45bde70..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.js +++ /dev/null @@ -1,196 +0,0 @@ -import { randomUUID } from 'node:crypto'; -import express from 'express'; -import { createOAuthMetadata, mcpAuthRouter } from '../../server/auth/router.js'; -import { resourceUrlFromServerUrl } from '../../shared/auth-utils.js'; -import { InvalidRequestError } from '../../server/auth/errors.js'; -export class DemoInMemoryClientsStore { - constructor() { - this.clients = new Map(); - } - async getClient(clientId) { - return this.clients.get(clientId); - } - async registerClient(clientMetadata) { - this.clients.set(clientMetadata.client_id, clientMetadata); - return clientMetadata; - } -} -/** - * 🚨 DEMO ONLY - NOT FOR PRODUCTION - * - * This example demonstrates MCP OAuth flow but lacks some of the features required for production use, - * for example: - * - Persistent token storage - * - Rate limiting - */ -export class DemoInMemoryAuthProvider { - constructor(validateResource) { - this.validateResource = validateResource; - this.clientsStore = new DemoInMemoryClientsStore(); - this.codes = new Map(); - this.tokens = new Map(); - } - async authorize(client, params, res) { - const code = randomUUID(); - const searchParams = new URLSearchParams({ - code - }); - if (params.state !== undefined) { - searchParams.set('state', params.state); - } - this.codes.set(code, { - client, - params - }); - // Simulate a user login - // Set a secure HTTP-only session cookie with authorization info - if (res.cookie) { - const authCookieData = { - userId: 'demo_user', - name: 'Demo User', - timestamp: Date.now() - }; - res.cookie('demo_session', JSON.stringify(authCookieData), { - httpOnly: true, - secure: false, // In production, this should be true - sameSite: 'lax', - maxAge: 24 * 60 * 60 * 1000, // 24 hours - for demo purposes - path: '/' // Available to all routes - }); - } - if (!client.redirect_uris.includes(params.redirectUri)) { - throw new InvalidRequestError('Unregistered redirect_uri'); - } - const targetUrl = new URL(params.redirectUri); - targetUrl.search = searchParams.toString(); - res.redirect(targetUrl.toString()); - } - async challengeForAuthorizationCode(client, authorizationCode) { - // Store the challenge with the code data - const codeData = this.codes.get(authorizationCode); - if (!codeData) { - throw new Error('Invalid authorization code'); - } - return codeData.params.codeChallenge; - } - async exchangeAuthorizationCode(client, authorizationCode, - // Note: code verifier is checked in token.ts by default - // it's unused here for that reason. - _codeVerifier) { - const codeData = this.codes.get(authorizationCode); - if (!codeData) { - throw new Error('Invalid authorization code'); - } - if (codeData.client.client_id !== client.client_id) { - throw new Error(`Authorization code was not issued to this client, ${codeData.client.client_id} != ${client.client_id}`); - } - if (this.validateResource && !this.validateResource(codeData.params.resource)) { - throw new Error(`Invalid resource: ${codeData.params.resource}`); - } - this.codes.delete(authorizationCode); - const token = randomUUID(); - const tokenData = { - token, - clientId: client.client_id, - scopes: codeData.params.scopes || [], - expiresAt: Date.now() + 3600000, // 1 hour - resource: codeData.params.resource, - type: 'access' - }; - this.tokens.set(token, tokenData); - return { - access_token: token, - token_type: 'bearer', - expires_in: 3600, - scope: (codeData.params.scopes || []).join(' ') - }; - } - async exchangeRefreshToken(_client, _refreshToken, _scopes, _resource) { - throw new Error('Not implemented for example demo'); - } - async verifyAccessToken(token) { - const tokenData = this.tokens.get(token); - if (!tokenData || !tokenData.expiresAt || tokenData.expiresAt < Date.now()) { - throw new Error('Invalid or expired token'); - } - return { - token, - clientId: tokenData.clientId, - scopes: tokenData.scopes, - expiresAt: Math.floor(tokenData.expiresAt / 1000), - resource: tokenData.resource - }; - } -} -export const setupAuthServer = ({ authServerUrl, mcpServerUrl, strictResource }) => { - // Create separate auth server app - // NOTE: This is a separate app on a separate port to illustrate - // how to separate an OAuth Authorization Server from a Resource - // server in the SDK. The SDK is not intended to be provide a standalone - // authorization server. - const validateResource = strictResource - ? (resource) => { - if (!resource) - return false; - const expectedResource = resourceUrlFromServerUrl(mcpServerUrl); - return resource.toString() === expectedResource.toString(); - } - : undefined; - const provider = new DemoInMemoryAuthProvider(validateResource); - const authApp = express(); - authApp.use(express.json()); - // For introspection requests - authApp.use(express.urlencoded()); - // Add OAuth routes to the auth server - // NOTE: this will also add a protected resource metadata route, - // but it won't be used, so leave it. - authApp.use(mcpAuthRouter({ - provider, - issuerUrl: authServerUrl, - scopesSupported: ['mcp:tools'] - })); - authApp.post('/introspect', async (req, res) => { - try { - const { token } = req.body; - if (!token) { - res.status(400).json({ error: 'Token is required' }); - return; - } - const tokenInfo = await provider.verifyAccessToken(token); - res.json({ - active: true, - client_id: tokenInfo.clientId, - scope: tokenInfo.scopes.join(' '), - exp: tokenInfo.expiresAt, - aud: tokenInfo.resource - }); - return; - } - catch (error) { - res.status(401).json({ - active: false, - error: 'Unauthorized', - error_description: `Invalid token: ${error}` - }); - } - }); - const auth_port = authServerUrl.port; - // Start the auth server - authApp.listen(auth_port, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`OAuth Authorization Server listening on port ${auth_port}`); - }); - // Note: we could fetch this from the server, but then we end up - // with some top level async which gets annoying. - const oauthMetadata = createOAuthMetadata({ - provider, - issuerUrl: authServerUrl, - scopesSupported: ['mcp:tools'] - }); - oauthMetadata.introspection_endpoint = new URL('/introspect', authServerUrl).href; - return oauthMetadata; -}; -//# sourceMappingURL=demoInMemoryOAuthProvider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.js.map deleted file mode 100644 index 80fcc55..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"demoInMemoryOAuthProvider.js","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,OAA8B,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE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rB,iBAAiB,EAAE,kBAAkB,KAAK,EAAE;aAC/C,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC;IACrC,wBAAwB;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE;QAC9B,IAAI,KAAK,EAAE,CAAC;YACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;YAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,gDAAgD,SAAS,EAAE,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;IAEH,gEAAgE;IAChE,iDAAiD;IACjD,MAAM,aAAa,GAAkB,mBAAmB,CAAC;QACrD,QAAQ;QACR,SAAS,EAAE,aAAa;QACxB,eAAe,EAAE,CAAC,WAAW,CAAC;KACjC,CAAC,CAAC;IAEH,aAAa,CAAC,sBAAsB,GAAG,IAAI,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC;IAElF,OAAO,aAAa,CAAC;AACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.d.ts deleted file mode 100644 index e4b736e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=elicitationFormExample.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.d.ts.map deleted file mode 100644 index c569df4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationFormExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/elicitationFormExample.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.js deleted file mode 100644 index a7963a7..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.js +++ /dev/null @@ -1,435 +0,0 @@ -// Run with: npx tsx src/examples/server/elicitationFormExample.ts -// -// This example demonstrates how to use form elicitation to collect structured user input -// with JSON Schema validation via a local HTTP server with SSE streaming. -// Form elicitation allows servers to request *non-sensitive* user input through the client -// with schema-based validation. -// Note: See also elicitationUrlExample.ts for an example of using URL elicitation -// to collect *sensitive* user input via a browser. -import { randomUUID } from 'node:crypto'; -import { McpServer } from '../../server/mcp.js'; -import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; -import { isInitializeRequest } from '../../types.js'; -import { createMcpExpressApp } from '../../server/express.js'; -// Factory to create a new MCP server per session. -// Each session needs its own server+transport pair to avoid cross-session contamination. -const getServer = () => { - // Create MCP server - it will automatically use AjvJsonSchemaValidator with sensible defaults - // The validator supports format validation (email, date, etc.) if ajv-formats is installed - const mcpServer = new McpServer({ - name: 'form-elicitation-example-server', - version: '1.0.0' - }, { - capabilities: {} - }); - /** - * Example 1: Simple user registration tool - * Collects username, email, and password from the user - */ - mcpServer.registerTool('register_user', { - description: 'Register a new user account by collecting their information', - inputSchema: {} - }, async () => { - try { - // Request user information through form elicitation - const result = await mcpServer.server.elicitInput({ - mode: 'form', - message: 'Please provide your registration information:', - requestedSchema: { - type: 'object', - properties: { - username: { - type: 'string', - title: 'Username', - description: 'Your desired username (3-20 characters)', - minLength: 3, - maxLength: 20 - }, - email: { - type: 'string', - title: 'Email', - description: 'Your email address', - format: 'email' - }, - password: { - type: 'string', - title: 'Password', - description: 'Your password (min 8 characters)', - minLength: 8 - }, - newsletter: { - type: 'boolean', - title: 'Newsletter', - description: 'Subscribe to newsletter?', - default: false - } - }, - required: ['username', 'email', 'password'] - } - }); - // Handle the different possible actions - if (result.action === 'accept' && result.content) { - const { username, email, newsletter } = result.content; - return { - content: [ - { - type: 'text', - text: `Registration successful!\n\nUsername: ${username}\nEmail: ${email}\nNewsletter: ${newsletter ? 'Yes' : 'No'}` - } - ] - }; - } - else if (result.action === 'decline') { - return { - content: [ - { - type: 'text', - text: 'Registration cancelled by user.' - } - ] - }; - } - else { - return { - content: [ - { - type: 'text', - text: 'Registration was cancelled.' - } - ] - }; - } - } - catch (error) { - return { - content: [ - { - type: 'text', - text: `Registration failed: ${error instanceof Error ? error.message : String(error)}` - } - ], - isError: true - }; - } - }); - /** - * Example 2: Multi-step workflow with multiple form elicitation requests - * Demonstrates how to collect information in multiple steps - */ - mcpServer.registerTool('create_event', { - description: 'Create a calendar event by collecting event details', - inputSchema: {} - }, async () => { - try { - // Step 1: Collect basic event information - const basicInfo = await mcpServer.server.elicitInput({ - mode: 'form', - message: 'Step 1: Enter basic event information', - requestedSchema: { - type: 'object', - properties: { - title: { - type: 'string', - title: 'Event Title', - description: 'Name of the event', - minLength: 1 - }, - description: { - type: 'string', - title: 'Description', - description: 'Event description (optional)' - } - }, - required: ['title'] - } - }); - if (basicInfo.action !== 'accept' || !basicInfo.content) { - return { - content: [{ type: 'text', text: 'Event creation cancelled.' }] - }; - } - // Step 2: Collect date and time - const dateTime = await mcpServer.server.elicitInput({ - mode: 'form', - message: 'Step 2: Enter date and time', - requestedSchema: { - type: 'object', - properties: { - date: { - type: 'string', - title: 'Date', - description: 'Event date', - format: 'date' - }, - startTime: { - type: 'string', - title: 'Start Time', - description: 'Event start time (HH:MM)' - }, - duration: { - type: 'integer', - title: 'Duration', - description: 'Duration in minutes', - minimum: 15, - maximum: 480 - } - }, - required: ['date', 'startTime', 'duration'] - } - }); - if (dateTime.action !== 'accept' || !dateTime.content) { - return { - content: [{ type: 'text', text: 'Event creation cancelled.' }] - }; - } - // Combine all collected information - const event = { - ...basicInfo.content, - ...dateTime.content - }; - return { - content: [ - { - type: 'text', - text: `Event created successfully!\n\n${JSON.stringify(event, null, 2)}` - } - ] - }; - } - catch (error) { - return { - content: [ - { - type: 'text', - text: `Event creation failed: ${error instanceof Error ? error.message : String(error)}` - } - ], - isError: true - }; - } - }); - /** - * Example 3: Collecting address information - * Demonstrates validation with patterns and optional fields - */ - mcpServer.registerTool('update_shipping_address', { - description: 'Update shipping address with validation', - inputSchema: {} - }, async () => { - try { - const result = await mcpServer.server.elicitInput({ - mode: 'form', - message: 'Please provide your shipping address:', - requestedSchema: { - type: 'object', - properties: { - name: { - type: 'string', - title: 'Full Name', - description: 'Recipient name', - minLength: 1 - }, - street: { - type: 'string', - title: 'Street Address', - minLength: 1 - }, - city: { - type: 'string', - title: 'City', - minLength: 1 - }, - state: { - type: 'string', - title: 'State/Province', - minLength: 2, - maxLength: 2 - }, - zipCode: { - type: 'string', - title: 'ZIP/Postal Code', - description: '5-digit ZIP code' - }, - phone: { - type: 'string', - title: 'Phone Number (optional)', - description: 'Contact phone number' - } - }, - required: ['name', 'street', 'city', 'state', 'zipCode'] - } - }); - if (result.action === 'accept' && result.content) { - return { - content: [ - { - type: 'text', - text: `Address updated successfully!\n\n${JSON.stringify(result.content, null, 2)}` - } - ] - }; - } - else if (result.action === 'decline') { - return { - content: [{ type: 'text', text: 'Address update cancelled by user.' }] - }; - } - else { - return { - content: [{ type: 'text', text: 'Address update was cancelled.' }] - }; - } - } - catch (error) { - return { - content: [ - { - type: 'text', - text: `Address update failed: ${error instanceof Error ? error.message : String(error)}` - } - ], - isError: true - }; - } - }); - return mcpServer; -}; -async function main() { - const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000; - const app = createMcpExpressApp(); - // Map to store transports by session ID - const transports = {}; - // MCP POST endpoint - const mcpPostHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (sessionId) { - console.log(`Received MCP request for session: ${sessionId}`); - } - try { - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport for this session - transport = transports[sessionId]; - } - else if (!sessionId && isInitializeRequest(req.body)) { - // New initialization request - create new transport - transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: () => randomUUID(), - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}, removing from transports map`); - delete transports[sid]; - } - }; - // Create a new server per session and connect it to the transport - const mcpServer = getServer(); - await mcpServer.connect(transport); - await transport.handleRequest(req, res, req.body); - return; - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } - }; - app.post('/mcp', mcpPostHandler); - // Handle GET requests for SSE streams - const mcpGetHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Establishing SSE stream for session ${sessionId}`); - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - }; - app.get('/mcp', mcpGetHandler); - // Handle DELETE requests for session termination - const mcpDeleteHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Received session termination request for session ${sessionId}`); - try { - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - } - catch (error) { - console.error('Error handling session termination:', error); - if (!res.headersSent) { - res.status(500).send('Error processing session termination'); - } - } - }; - app.delete('/mcp', mcpDeleteHandler); - // Start listening - app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`Form elicitation example server is running on http://localhost:${PORT}/mcp`); - console.log('Available tools:'); - console.log(' - register_user: Collect user registration information'); - console.log(' - create_event: Multi-step event creation'); - console.log(' - update_shipping_address: Collect and validate address'); - console.log('\nConnect your MCP client to this server using the HTTP transport.'); - }); - // Handle server shutdown - process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); - }); -} -main().catch(error => { - console.error('Server error:', error); - process.exit(1); -}); -//# sourceMappingURL=elicitationFormExample.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.js.map deleted file mode 100644 index 33d6fb9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationFormExample.js","sourceRoot":"","sources":["../../../../src/examples/server/elicitationFormExample.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,yFAAyF;AACzF,0EAA0E;AAC1E,2FAA2F;AAC3F,gCAAgC;AAChC,kFAAkF;AAClF,mDAAmD;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OA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CAA6C,CAAC,CAAC;QAC3D,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;QACzE,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IAEH,yBAAyB;IACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;QAEvC,6DAA6D;QAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACjC,IAAI,CAAC;gBACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;gBAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;gBACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;YACjC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;YAC9E,CAAC;QACL,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.d.ts deleted file mode 100644 index 611f6eb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=elicitationUrlExample.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.d.ts.map deleted file mode 100644 index 04acd66..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationUrlExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/elicitationUrlExample.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.js deleted file mode 100644 index 8aa072c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.js +++ /dev/null @@ -1,651 +0,0 @@ -// Run with: npx tsx src/examples/server/elicitationUrlExample.ts -// -// This example demonstrates how to use URL elicitation to securely collect -// *sensitive* user input in a remote (HTTP) server. -// URL elicitation allows servers to prompt the end-user to open a URL in their browser -// to collect sensitive information. -// Note: See also elicitationFormExample.ts for an example of using form (not URL) elicitation -// to collect *non-sensitive* user input with a structured schema. -import express from 'express'; -import { randomUUID } from 'node:crypto'; -import { z } from 'zod'; -import { McpServer } from '../../server/mcp.js'; -import { createMcpExpressApp } from '../../server/express.js'; -import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; -import { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from '../../server/auth/router.js'; -import { requireBearerAuth } from '../../server/auth/middleware/bearerAuth.js'; -import { UrlElicitationRequiredError, isInitializeRequest } from '../../types.js'; -import { InMemoryEventStore } from '../shared/inMemoryEventStore.js'; -import { setupAuthServer } from './demoInMemoryOAuthProvider.js'; -import { checkResourceAllowed } from '../../shared/auth-utils.js'; -import cors from 'cors'; -// Create an MCP server with implementation details -const getServer = () => { - const mcpServer = new McpServer({ - name: 'url-elicitation-http-server', - version: '1.0.0' - }, { - capabilities: { logging: {} } - }); - mcpServer.registerTool('payment-confirm', { - description: 'A tool that confirms a payment directly with a user', - inputSchema: { - cartId: z.string().describe('The ID of the cart to confirm') - } - }, async ({ cartId }, extra) => { - /* - In a real world scenario, there would be some logic here to check if the user has the provided cartId. - For the purposes of this example, we'll throw an error (-> elicits the client to open a URL to confirm payment) - */ - const sessionId = extra.sessionId; - if (!sessionId) { - throw new Error('Expected a Session ID'); - } - // Create and track the elicitation - const elicitationId = generateTrackedElicitation(sessionId, elicitationId => mcpServer.server.createElicitationCompletionNotifier(elicitationId)); - throw new UrlElicitationRequiredError([ - { - mode: 'url', - message: 'This tool requires a payment confirmation. Open the link to confirm payment!', - url: `http://localhost:${MCP_PORT}/confirm-payment?session=${sessionId}&elicitation=${elicitationId}&cartId=${encodeURIComponent(cartId)}`, - elicitationId - } - ]); - }); - mcpServer.registerTool('third-party-auth', { - description: 'A demo tool that requires third-party OAuth credentials', - inputSchema: { - param1: z.string().describe('First parameter') - } - }, async (_, extra) => { - /* - In a real world scenario, there would be some logic here to check if we already have a valid access token for the user. - Auth info (with a subject or `sub` claim) can be typically be found in `extra.authInfo`. - If we do, we can just return the result of the tool call. - If we don't, we can throw an ElicitationRequiredError to request the user to authenticate. - For the purposes of this example, we'll throw an error (-> elicits the client to open a URL to authenticate). - */ - const sessionId = extra.sessionId; - if (!sessionId) { - throw new Error('Expected a Session ID'); - } - // Create and track the elicitation - const elicitationId = generateTrackedElicitation(sessionId, elicitationId => mcpServer.server.createElicitationCompletionNotifier(elicitationId)); - // Simulate OAuth callback and token exchange after 5 seconds - // In a real app, this would be called from your OAuth callback handler - setTimeout(() => { - console.log(`Simulating OAuth token received for elicitation ${elicitationId}`); - completeURLElicitation(elicitationId); - }, 5000); - throw new UrlElicitationRequiredError([ - { - mode: 'url', - message: 'This tool requires access to your example.com account. Open the link to authenticate!', - url: 'https://www.example.com/oauth/authorize', - elicitationId - } - ]); - }); - return mcpServer; -}; -const elicitationsMap = new Map(); -// Clean up old elicitations after 1 hour to prevent memory leaks -const ELICITATION_TTL_MS = 60 * 60 * 1000; // 1 hour -const CLEANUP_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes -function cleanupOldElicitations() { - const now = new Date(); - for (const [id, metadata] of elicitationsMap.entries()) { - if (now.getTime() - metadata.createdAt.getTime() > ELICITATION_TTL_MS) { - elicitationsMap.delete(id); - console.log(`Cleaned up expired elicitation: ${id}`); - } - } -} -setInterval(cleanupOldElicitations, CLEANUP_INTERVAL_MS); -/** - * Elicitation IDs must be unique strings within the MCP session - * UUIDs are used in this example for simplicity - */ -function generateElicitationId() { - return randomUUID(); -} -/** - * Helper function to create and track a new elicitation. - */ -function generateTrackedElicitation(sessionId, createCompletionNotifier) { - const elicitationId = generateElicitationId(); - // Create a Promise and its resolver for tracking completion - let completeResolver; - const completedPromise = new Promise(resolve => { - completeResolver = resolve; - }); - const completionNotifier = createCompletionNotifier ? createCompletionNotifier(elicitationId) : undefined; - // Store the elicitation in our map - elicitationsMap.set(elicitationId, { - status: 'pending', - completedPromise, - completeResolver: completeResolver, - createdAt: new Date(), - sessionId, - completionNotifier - }); - return elicitationId; -} -/** - * Helper function to complete an elicitation. - */ -function completeURLElicitation(elicitationId) { - const elicitation = elicitationsMap.get(elicitationId); - if (!elicitation) { - console.warn(`Attempted to complete unknown elicitation: ${elicitationId}`); - return; - } - if (elicitation.status === 'complete') { - console.warn(`Elicitation already complete: ${elicitationId}`); - return; - } - // Update metadata - elicitation.status = 'complete'; - // Send completion notification to the client - if (elicitation.completionNotifier) { - console.log(`Sending notifications/elicitation/complete notification for elicitation ${elicitationId}`); - elicitation.completionNotifier().catch(error => { - console.error(`Failed to send completion notification for elicitation ${elicitationId}:`, error); - }); - } - // Resolve the promise to unblock any waiting code - elicitation.completeResolver(); -} -const MCP_PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000; -const AUTH_PORT = process.env.MCP_AUTH_PORT ? parseInt(process.env.MCP_AUTH_PORT, 10) : 3001; -const app = createMcpExpressApp(); -// Allow CORS all domains, expose the Mcp-Session-Id header -app.use(cors({ - origin: '*', // Allow all origins - exposedHeaders: ['Mcp-Session-Id'], - credentials: true // Allow cookies to be sent cross-origin -})); -// Set up OAuth (required for this example) -let authMiddleware = null; -// Create auth middleware for MCP endpoints -const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}/mcp`); -const authServerUrl = new URL(`http://localhost:${AUTH_PORT}`); -const oauthMetadata = setupAuthServer({ authServerUrl, mcpServerUrl, strictResource: true }); -const tokenVerifier = { - verifyAccessToken: async (token) => { - const endpoint = oauthMetadata.introspection_endpoint; - if (!endpoint) { - throw new Error('No token verification endpoint available in metadata'); - } - const response = await fetch(endpoint, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: new URLSearchParams({ - token: token - }).toString() - }); - if (!response.ok) { - const text = await response.text().catch(() => null); - throw new Error(`Invalid or expired token: ${text}`); - } - const data = await response.json(); - if (!data.aud) { - throw new Error(`Resource Indicator (RFC8707) missing`); - } - if (!checkResourceAllowed({ requestedResource: data.aud, configuredResource: mcpServerUrl })) { - throw new Error(`Expected resource indicator ${mcpServerUrl}, got: ${data.aud}`); - } - // Convert the response to AuthInfo format - return { - token, - clientId: data.client_id, - scopes: data.scope ? data.scope.split(' ') : [], - expiresAt: data.exp - }; - } -}; -// Add metadata routes to the main MCP server -app.use(mcpAuthMetadataRouter({ - oauthMetadata, - resourceServerUrl: mcpServerUrl, - scopesSupported: ['mcp:tools'], - resourceName: 'MCP Demo Server' -})); -authMiddleware = requireBearerAuth({ - verifier: tokenVerifier, - requiredScopes: [], - resourceMetadataUrl: getOAuthProtectedResourceMetadataUrl(mcpServerUrl) -}); -/** - * API Key Form Handling - * - * Many servers today require an API key to operate, but there's no scalable way to do this dynamically for remote servers within MCP protocol. - * URL-mode elicitation enables the server to host a simple form and get the secret data securely from the user without involving the LLM or client. - **/ -async function sendApiKeyElicitation(sessionId, sender, createCompletionNotifier) { - if (!sessionId) { - console.error('No session ID provided'); - throw new Error('Expected a Session ID to track elicitation'); - } - console.log('🔑 URL elicitation demo: Requesting API key from client...'); - const elicitationId = generateTrackedElicitation(sessionId, createCompletionNotifier); - try { - const result = await sender({ - mode: 'url', - message: 'Please provide your API key to authenticate with this server', - // Host the form on the same server. In a real app, you might coordinate passing these state variables differently. - url: `http://localhost:${MCP_PORT}/api-key-form?session=${sessionId}&elicitation=${elicitationId}`, - elicitationId - }); - switch (result.action) { - case 'accept': - console.log('🔑 URL elicitation demo: Client accepted the API key elicitation (now pending form submission)'); - // Wait for the API key to be submitted via the form - // The form submission will complete the elicitation - break; - default: - console.log('🔑 URL elicitation demo: Client declined to provide an API key'); - // In a real app, this might close the connection, but for the demo, we'll continue - break; - } - } - catch (error) { - console.error('Error during API key elicitation:', error); - } -} -// API Key Form endpoint - serves a simple HTML form -app.get('/api-key-form', (req, res) => { - const mcpSessionId = req.query.session; - const elicitationId = req.query.elicitation; - if (!mcpSessionId || !elicitationId) { - res.status(400).send('

Error

Missing required parameters

'); - return; - } - // Check for user session cookie - // In production, this is often handled by some user auth middleware to ensure the user has a valid session - // This session is different from the MCP session. - // This userSession is the cookie that the MCP Server's Authorization Server sets for the user when they log in. - const userSession = getUserSessionCookie(req.headers.cookie); - if (!userSession) { - res.status(401).send('

Error

Unauthorized - please reconnect to login again

'); - return; - } - // Serve a simple HTML form - res.send(` - - - - Submit Your API Key - - - -

API Key Required

-
✓ Logged in as: ${userSession.name}
-
- - - - - -
This is a demo showing how a server can securely elicit sensitive data from a user using a URL.
- - - `); -}); -// Handle API key form submission -app.post('/api-key-form', express.urlencoded(), (req, res) => { - const { session: sessionId, apiKey, elicitation: elicitationId } = req.body; - if (!sessionId || !apiKey || !elicitationId) { - res.status(400).send('

Error

Missing required parameters

'); - return; - } - // Check for user session cookie here too - const userSession = getUserSessionCookie(req.headers.cookie); - if (!userSession) { - res.status(401).send('

Error

Unauthorized - please reconnect to login again

'); - return; - } - // A real app might store this API key to be used later for the user. - console.log(`🔑 Received API key \x1b[32m${apiKey}\x1b[0m for session ${sessionId}`); - // If we have an elicitationId, complete the elicitation - completeURLElicitation(elicitationId); - // Send a success response - res.send(` - - - - Success - - - -
-

Success ✓

-

API key received.

-
-

You can close this window and return to your MCP client.

- - - `); -}); -// Helper to get the user session from the demo_session cookie -function getUserSessionCookie(cookieHeader) { - if (!cookieHeader) - return null; - const cookies = cookieHeader.split(';'); - for (const cookie of cookies) { - const [name, value] = cookie.trim().split('='); - if (name === 'demo_session' && value) { - try { - return JSON.parse(decodeURIComponent(value)); - } - catch (error) { - console.error('Failed to parse demo_session cookie:', error); - return null; - } - } - } - return null; -} -/** - * Payment Confirmation Form Handling - * - * This demonstrates how a server can use URL-mode elicitation to get user confirmation - * for sensitive operations like payment processing. - **/ -// Payment Confirmation Form endpoint - serves a simple HTML form -app.get('/confirm-payment', (req, res) => { - const mcpSessionId = req.query.session; - const elicitationId = req.query.elicitation; - const cartId = req.query.cartId; - if (!mcpSessionId || !elicitationId) { - res.status(400).send('

Error

Missing required parameters

'); - return; - } - // Check for user session cookie - // In production, this is often handled by some user auth middleware to ensure the user has a valid session - // This session is different from the MCP session. - // This userSession is the cookie that the MCP Server's Authorization Server sets for the user when they log in. - const userSession = getUserSessionCookie(req.headers.cookie); - if (!userSession) { - res.status(401).send('

Error

Unauthorized - please reconnect to login again

'); - return; - } - // Serve a simple HTML form - res.send(` - - - - Confirm Payment - - - -

Confirm Payment

-
✓ Logged in as: ${userSession.name}
- ${cartId ? `
Cart ID: ${cartId}
` : ''} -
- ⚠️ Please review your order before confirming. -
-
- - - ${cartId ? `` : ''} - - - -
This is a demo showing how a server can securely get user confirmation for sensitive operations using URL-mode elicitation.
- - - `); -}); -// Handle Payment Confirmation form submission -app.post('/confirm-payment', express.urlencoded(), (req, res) => { - const { session: sessionId, elicitation: elicitationId, cartId, action } = req.body; - if (!sessionId || !elicitationId) { - res.status(400).send('

Error

Missing required parameters

'); - return; - } - // Check for user session cookie here too - const userSession = getUserSessionCookie(req.headers.cookie); - if (!userSession) { - res.status(401).send('

Error

Unauthorized - please reconnect to login again

'); - return; - } - if (action === 'confirm') { - // A real app would process the payment here - console.log(`💳 Payment confirmed for cart ${cartId || 'unknown'} by user ${userSession.name} (session ${sessionId})`); - // Complete the elicitation - completeURLElicitation(elicitationId); - // Send a success response - res.send(` - - - - Payment Confirmed - - - -
-

Payment Confirmed ✓

-

Your payment has been successfully processed.

- ${cartId ? `

Cart ID: ${cartId}

` : ''} -
-

You can close this window and return to your MCP client.

- - - `); - } - else if (action === 'cancel') { - console.log(`💳 Payment cancelled for cart ${cartId || 'unknown'} by user ${userSession.name} (session ${sessionId})`); - // The client will still receive a notifications/elicitation/complete notification, - // which indicates that the out-of-band interaction is complete (but not necessarily successful) - completeURLElicitation(elicitationId); - res.send(` - - - - Payment Cancelled - - - -
-

Payment Cancelled

-

Your payment has been cancelled.

-
-

You can close this window and return to your MCP client.

- - - `); - } - else { - res.status(400).send('

Error

Invalid action

'); - } -}); -// Map to store transports by session ID -const transports = {}; -const sessionsNeedingElicitation = {}; -// MCP POST endpoint -const mcpPostHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - console.debug(`Received MCP POST for session: ${sessionId || 'unknown'}`); - try { - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport - transport = transports[sessionId]; - } - else if (!sessionId && isInitializeRequest(req.body)) { - const server = getServer(); - // New initialization request - const eventStore = new InMemoryEventStore(); - transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: () => randomUUID(), - eventStore, // Enable resumability - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - // This avoids race conditions where requests might come in before the session is stored - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - sessionsNeedingElicitation[sessionId] = { - elicitationSender: params => server.server.elicitInput(params), - createCompletionNotifier: elicitationId => server.server.createElicitationCompletionNotifier(elicitationId) - }; - } - }); - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}, removing from transports map`); - delete transports[sid]; - delete sessionsNeedingElicitation[sid]; - } - }; - // Connect the transport to the MCP server BEFORE handling the request - // so responses can flow back through the same transport - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - return; // Already handled - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - no need to reconnect - // The existing transport is already connected to the server - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}; -// Set up routes with auth middleware -app.post('/mcp', authMiddleware, mcpPostHandler); -// Handle GET requests for SSE streams (using built-in support from StreamableHTTP) -const mcpGetHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - // Check for Last-Event-ID header for resumability - const lastEventId = req.headers['last-event-id']; - if (lastEventId) { - console.log(`Client reconnecting with Last-Event-ID: ${lastEventId}`); - } - else { - console.log(`Establishing new SSE stream for session ${sessionId}`); - } - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - if (sessionsNeedingElicitation[sessionId]) { - const { elicitationSender, createCompletionNotifier } = sessionsNeedingElicitation[sessionId]; - // Send an elicitation request to the client in the background - sendApiKeyElicitation(sessionId, elicitationSender, createCompletionNotifier) - .then(() => { - // Only delete on successful send for this demo - delete sessionsNeedingElicitation[sessionId]; - console.log(`🔑 URL elicitation demo: Finished sending API key elicitation request for session ${sessionId}`); - }) - .catch(error => { - console.error('Error sending API key elicitation:', error); - // Keep in map to potentially retry on next reconnect - }); - } -}; -// Set up GET route with conditional auth middleware -app.get('/mcp', authMiddleware, mcpGetHandler); -// Handle DELETE requests for session termination (according to MCP spec) -const mcpDeleteHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Received session termination request for session ${sessionId}`); - try { - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - } - catch (error) { - console.error('Error handling session termination:', error); - if (!res.headersSent) { - res.status(500).send('Error processing session termination'); - } - } -}; -// Set up DELETE route with auth middleware -app.delete('/mcp', authMiddleware, mcpDeleteHandler); -app.listen(MCP_PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`MCP Streamable HTTP Server listening on port ${MCP_PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - delete sessionsNeedingElicitation[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=elicitationUrlExample.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.js.map deleted file mode 100644 index fe2a5f7..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elicitationUrlExample.js","sourceRoot":"","sources":["../../../../src/examples/server/elicitationUrlExample.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,oDAAoD;AACpD,uFAAuF;AACvF,oCAAoC;AACpC,8FAA8F;AAC9F,kEAAkE;AAElE,OAAO,OAA8B,MAAM,SAAS,CAAC;AAC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5E,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;YAC7B,OAAO,0BAA0B,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.d.ts deleted file mode 100644 index bc6abdd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Example MCP server using Hono with WebStandardStreamableHTTPServerTransport - * - * This example demonstrates using the Web Standard transport directly with Hono, - * which works on any runtime: Node.js, Cloudflare Workers, Deno, Bun, etc. - * - * Run with: npx tsx src/examples/server/honoWebStandardStreamableHttp.ts - */ -export {}; -//# sourceMappingURL=honoWebStandardStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.d.ts.map deleted file mode 100644 index a6a6199..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"honoWebStandardStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/honoWebStandardStreamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.js deleted file mode 100644 index 37c2885..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Example MCP server using Hono with WebStandardStreamableHTTPServerTransport - * - * This example demonstrates using the Web Standard transport directly with Hono, - * which works on any runtime: Node.js, Cloudflare Workers, Deno, Bun, etc. - * - * Run with: npx tsx src/examples/server/honoWebStandardStreamableHttp.ts - */ -import { Hono } from 'hono'; -import { cors } from 'hono/cors'; -import { serve } from '@hono/node-server'; -import * as z from 'zod/v4'; -import { McpServer } from '../../server/mcp.js'; -import { WebStandardStreamableHTTPServerTransport } from '../../server/webStandardStreamableHttp.js'; -// Factory function to create a new MCP server per request (stateless mode) -const getServer = () => { - const server = new McpServer({ - name: 'hono-webstandard-mcp-server', - version: '1.0.0' - }); - // Register a simple greeting tool - server.registerTool('greet', { - title: 'Greeting Tool', - description: 'A simple greeting tool', - inputSchema: { name: z.string().describe('Name to greet') } - }, async ({ name }) => { - return { - content: [{ type: 'text', text: `Hello, ${name}! (from Hono + WebStandard transport)` }] - }; - }); - return server; -}; -// Create the Hono app -const app = new Hono(); -// Enable CORS for all origins -app.use('*', cors({ - origin: '*', - allowMethods: ['GET', 'POST', 'DELETE', 'OPTIONS'], - allowHeaders: ['Content-Type', 'mcp-session-id', 'Last-Event-ID', 'mcp-protocol-version'], - exposeHeaders: ['mcp-session-id', 'mcp-protocol-version'] -})); -// Health check endpoint -app.get('/health', c => c.json({ status: 'ok' })); -// MCP endpoint - create a fresh transport and server per request (stateless) -app.all('/mcp', async (c) => { - const transport = new WebStandardStreamableHTTPServerTransport(); - const server = getServer(); - await server.connect(transport); - return transport.handleRequest(c.req.raw); -}); -// Start the server -const PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000; -console.log(`Starting Hono MCP server on port ${PORT}`); -console.log(`Health check: http://localhost:${PORT}/health`); -console.log(`MCP endpoint: http://localhost:${PORT}/mcp`); -serve({ - fetch: app.fetch, - port: PORT -}); -//# sourceMappingURL=honoWebStandardStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.js.map deleted file mode 100644 index 96374ea..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/honoWebStandardStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"honoWebStandardStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/honoWebStandardStreamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,wCAAwC,EAAE,MAAM,2CAA2C,CAAC;AAGrG,2EAA2E;AAC3E,MAAM,SAAS,GA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AE,CAAC;IACjE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAE9E,OAAO,CAAC,GAAG,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC;AACxD,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,SAAS,CAAC,CAAC;AAC7D,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,MAAM,CAAC,CAAC;AAE1D,KAAK,CAAC;IACF,KAAK,EAAE,GAAG,CAAC,KAAK;IAChB,IAAI,EAAE,IAAI;CACb,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts deleted file mode 100644 index 477fa6b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=jsonResponseStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts.map deleted file mode 100644 index ee8117e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jsonResponseStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.js deleted file mode 100644 index b2ef0ce..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.js +++ /dev/null @@ -1,146 +0,0 @@ -import { randomUUID } from 'node:crypto'; -import { McpServer } from '../../server/mcp.js'; -import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; -import * as z from 'zod/v4'; -import { isInitializeRequest } from '../../types.js'; -import { createMcpExpressApp } from '../../server/express.js'; -// Create an MCP server with implementation details -const getServer = () => { - const server = new McpServer({ - name: 'json-response-streamable-http-server', - version: '1.0.0' - }, { - capabilities: { - logging: {} - } - }); - // Register a simple tool that returns a greeting - server.registerTool('greet', { - description: 'A simple greeting tool', - inputSchema: { - name: z.string().describe('Name to greet') - } - }, async ({ name }) => { - return { - content: [ - { - type: 'text', - text: `Hello, ${name}!` - } - ] - }; - }); - // Register a tool that sends multiple greetings with notifications - server.registerTool('multi-greet', { - description: 'A tool that sends different greetings with delays between them', - inputSchema: { - name: z.string().describe('Name to greet') - } - }, async ({ name }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - await server.sendLoggingMessage({ - level: 'debug', - data: `Starting multi-greet for ${name}` - }, extra.sessionId); - await sleep(1000); // Wait 1 second before first greeting - await server.sendLoggingMessage({ - level: 'info', - data: `Sending first greeting to ${name}` - }, extra.sessionId); - await sleep(1000); // Wait another second before second greeting - await server.sendLoggingMessage({ - level: 'info', - data: `Sending second greeting to ${name}` - }, extra.sessionId); - return { - content: [ - { - type: 'text', - text: `Good morning, ${name}!` - } - ] - }; - }); - return server; -}; -const app = createMcpExpressApp(); -// Map to store transports by session ID -const transports = {}; -app.post('/mcp', async (req, res) => { - console.log('Received MCP request:', req.body); - try { - // Check for existing session ID - const sessionId = req.headers['mcp-session-id']; - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport - transport = transports[sessionId]; - } - else if (!sessionId && isInitializeRequest(req.body)) { - // New initialization request - use JSON response mode - transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: () => randomUUID(), - enableJsonResponse: true, // Enable JSON response mode - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - // This avoids race conditions where requests might come in before the session is stored - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Connect the transport to the MCP server BEFORE handling the request - const server = getServer(); - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - return; // Already handled - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - no need to reconnect - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}); -// Handle GET requests for SSE streams according to spec -app.get('/mcp', async (req, res) => { - // Since this is a very simple example, we don't support GET requests for this server - // The spec requires returning 405 Method Not Allowed in this case - res.status(405).set('Allow', 'POST').send('Method Not Allowed'); -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`MCP Streamable HTTP Server listening on port ${PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - process.exit(0); -}); -//# sourceMappingURL=jsonResponseStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.js.map deleted file mode 100644 index 8a52d91..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jsonResponseStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,SAAS,CACxB;QACI,IAAI,EAAE,sCAAsC;QAC5C,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE;YACV,OAAO,EAAE,EAAE;SACd;KACJ,CACJ,CAAC;IAEF,iDAAiD;IACjD,MAAM,CAAC,YAAY,CACf,OAAO,EACP;QACI,WAAW,EAAE,wBAAwB;QACrC,WAAW,EAAE;YACT,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;SAC7C;KACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAA2B,EAAE;QACxC,OAAO;YACH,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,IAAI,GAAG;iBAC1B;aACJ;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;IAEF,mEAAmE;IACnE,MAAM,CAAC,YAAY,CACf,aAAa,EACb;QACI,WAAW,EAAE,gEAAgE;QAC7E,WAAW,EAAE;YACT,I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AAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.d.ts deleted file mode 100644 index a6cb497..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -/** - * Example MCP server using the high-level McpServer API with outputSchema - * This demonstrates how to easily create tools with structured output - */ -export {}; -//# sourceMappingURL=mcpServerOutputSchema.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.d.ts.map deleted file mode 100644 index bd3abdc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcpServerOutputSchema.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";AACA;;;GAGG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.js deleted file mode 100644 index 17b52b7..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.js +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env node -/** - * Example MCP server using the high-level McpServer API with outputSchema - * This demonstrates how to easily create tools with structured output - */ -import { McpServer } from '../../server/mcp.js'; -import { StdioServerTransport } from '../../server/stdio.js'; -import * as z from 'zod/v4'; -const server = new McpServer({ - name: 'mcp-output-schema-high-level-example', - version: '1.0.0' -}); -// Define a tool with structured output - Weather data -server.registerTool('get_weather', { - description: 'Get weather information for a city', - inputSchema: { - city: z.string().describe('City name'), - country: z.string().describe('Country code (e.g., US, UK)') - }, - outputSchema: { - temperature: z.object({ - celsius: z.number(), - fahrenheit: z.number() - }), - conditions: z.enum(['sunny', 'cloudy', 'rainy', 'stormy', 'snowy']), - humidity: z.number().min(0).max(100), - wind: z.object({ - speed_kmh: z.number(), - direction: z.string() - }) - } -}, async ({ city, country }) => { - // Parameters are available but not used in this example - void city; - void country; - // Simulate weather API call - const temp_c = Math.round((Math.random() * 35 - 5) * 10) / 10; - const conditions = ['sunny', 'cloudy', 'rainy', 'stormy', 'snowy'][Math.floor(Math.random() * 5)]; - const structuredContent = { - temperature: { - celsius: temp_c, - fahrenheit: Math.round(((temp_c * 9) / 5 + 32) * 10) / 10 - }, - conditions, - humidity: Math.round(Math.random() * 100), - wind: { - speed_kmh: Math.round(Math.random() * 50), - direction: ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'][Math.floor(Math.random() * 8)] - } - }; - return { - content: [ - { - type: 'text', - text: JSON.stringify(structuredContent, null, 2) - } - ], - structuredContent - }; -}); -async function main() { - const transport = new StdioServerTransport(); - await server.connect(transport); - console.error('High-level Output Schema Example Server running on stdio'); -} -main().catch(error => { - console.error('Server error:', error); - process.exit(1); -}); -//# sourceMappingURL=mcpServerOutputSchema.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.js.map deleted file mode 100644 index b932b85..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/mcpServerOutputSchema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcpServerOutputSchema.js","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"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C,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC9E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.d.ts deleted file mode 100644 index 4269b78..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=simpleSseServer.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.d.ts.map deleted file mode 100644 index 08a1b45..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleSseServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.js deleted file mode 100644 index 60c3eb6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.js +++ /dev/null @@ -1,143 +0,0 @@ -import { McpServer } from '../../server/mcp.js'; -import { SSEServerTransport } from '../../server/sse.js'; -import * as z from 'zod/v4'; -import { createMcpExpressApp } from '../../server/express.js'; -/** - * This example server demonstrates the deprecated HTTP+SSE transport - * (protocol version 2024-11-05). It mainly used for testing backward compatible clients. - * - * The server exposes two endpoints: - * - /mcp: For establishing the SSE stream (GET) - * - /messages: For receiving client messages (POST) - * - */ -// Create an MCP server instance -const getServer = () => { - const server = new McpServer({ - name: 'simple-sse-server', - version: '1.0.0' - }, { capabilities: { logging: {} } }); - server.registerTool('start-notification-stream', { - description: 'Starts sending periodic notifications', - inputSchema: { - interval: z.number().describe('Interval in milliseconds between notifications').default(1000), - count: z.number().describe('Number of notifications to send').default(10) - } - }, async ({ interval, count }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - let counter = 0; - // Send the initial notification - await server.sendLoggingMessage({ - level: 'info', - data: `Starting notification stream with ${count} messages every ${interval}ms` - }, extra.sessionId); - // Send periodic notifications - while (counter < count) { - counter++; - await sleep(interval); - try { - await server.sendLoggingMessage({ - level: 'info', - data: `Notification #${counter} at ${new Date().toISOString()}` - }, extra.sessionId); - } - catch (error) { - console.error('Error sending notification:', error); - } - } - return { - content: [ - { - type: 'text', - text: `Completed sending ${count} notifications every ${interval}ms` - } - ] - }; - }); - return server; -}; -const app = createMcpExpressApp(); -// Store transports by session ID -const transports = {}; -// SSE endpoint for establishing the stream -app.get('/mcp', async (req, res) => { - console.log('Received GET request to /sse (establishing SSE stream)'); - try { - // Create a new SSE transport for the client - // The endpoint for POST messages is '/messages' - const transport = new SSEServerTransport('/messages', res); - // Store the transport by session ID - const sessionId = transport.sessionId; - transports[sessionId] = transport; - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - console.log(`SSE transport closed for session ${sessionId}`); - delete transports[sessionId]; - }; - // Connect the transport to the MCP server - const server = getServer(); - await server.connect(transport); - console.log(`Established SSE stream with session ID: ${sessionId}`); - } - catch (error) { - console.error('Error establishing SSE stream:', error); - if (!res.headersSent) { - res.status(500).send('Error establishing SSE stream'); - } - } -}); -// Messages endpoint for receiving client JSON-RPC requests -app.post('/messages', async (req, res) => { - console.log('Received POST request to /messages'); - // Extract session ID from URL query parameter - // In the SSE protocol, this is added by the client based on the endpoint event - const sessionId = req.query.sessionId; - if (!sessionId) { - console.error('No session ID provided in request URL'); - res.status(400).send('Missing sessionId parameter'); - return; - } - const transport = transports[sessionId]; - if (!transport) { - console.error(`No active transport found for session ID: ${sessionId}`); - res.status(404).send('Session not found'); - return; - } - try { - // Handle the POST message with the transport - await transport.handlePostMessage(req, res, req.body); - } - catch (error) { - console.error('Error handling request:', error); - if (!res.headersSent) { - res.status(500).send('Error handling request'); - } - } -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`Simple SSE Server (deprecated protocol version 2024-11-05) listening on port ${PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=simpleSseServer.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.js.map deleted file mode 100644 index 8028aa5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleSseServer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleSseServer.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;;;;;;GAQG;AAEH,gCAAgC;AAChC,MAA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C,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;IACrB,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,gFAAgF,IAAI,EAAE,CAAC,CAAC;AACxG,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts deleted file mode 100644 index 0aa4ad2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=simpleStatelessStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts.map deleted file mode 100644 index 92deb06..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStatelessStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.js deleted file mode 100644 index aa66f0e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.js +++ /dev/null @@ -1,141 +0,0 @@ -import { McpServer } from '../../server/mcp.js'; -import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; -import * as z from 'zod/v4'; -import { createMcpExpressApp } from '../../server/express.js'; -const getServer = () => { - // Create an MCP server with implementation details - const server = new McpServer({ - name: 'stateless-streamable-http-server', - version: '1.0.0' - }, { capabilities: { logging: {} } }); - // Register a simple prompt - server.registerPrompt('greeting-template', { - description: 'A simple greeting prompt template', - argsSchema: { - name: z.string().describe('Name to include in greeting') - } - }, async ({ name }) => { - return { - messages: [ - { - role: 'user', - content: { - type: 'text', - text: `Please greet ${name} in a friendly manner.` - } - } - ] - }; - }); - // Register a tool specifically for testing resumability - server.registerTool('start-notification-stream', { - description: 'Starts sending periodic notifications for testing resumability', - inputSchema: { - interval: z.number().describe('Interval in milliseconds between notifications').default(100), - count: z.number().describe('Number of notifications to send (0 for 100)').default(10) - } - }, async ({ interval, count }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - let counter = 0; - while (count === 0 || counter < count) { - counter++; - try { - await server.sendLoggingMessage({ - level: 'info', - data: `Periodic notification #${counter} at ${new Date().toISOString()}` - }, extra.sessionId); - } - catch (error) { - console.error('Error sending notification:', error); - } - // Wait for the specified interval - await sleep(interval); - } - return { - content: [ - { - type: 'text', - text: `Started sending periodic notifications every ${interval}ms` - } - ] - }; - }); - // Create a simple resource at a fixed URI - server.registerResource('greeting-resource', 'https://example.com/greetings/default', { mimeType: 'text/plain' }, async () => { - return { - contents: [ - { - uri: 'https://example.com/greetings/default', - text: 'Hello, world!' - } - ] - }; - }); - return server; -}; -const app = createMcpExpressApp(); -app.post('/mcp', async (req, res) => { - const server = getServer(); - try { - const transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: undefined - }); - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - res.on('close', () => { - console.log('Request closed'); - transport.close(); - server.close(); - }); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}); -app.get('/mcp', async (req, res) => { - console.log('Received GET MCP request'); - res.writeHead(405).end(JSON.stringify({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Method not allowed.' - }, - id: null - })); -}); -app.delete('/mcp', async (req, res) => { - console.log('Received DELETE MCP request'); - res.writeHead(405).end(JSON.stringify({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Method not allowed.' - }, - id: null - })); -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`MCP Stateless Streamable HTTP Server listening on port ${PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - process.exit(0); -}); -//# sourceMappingURL=simpleStatelessStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.js.map deleted file mode 100644 index 0617e71..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStatelessStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStatelessStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,mDAAmD;IACnD,MAAM,MAAM,GAAG,IAAI,SAAS,CACxB;QACI,IAAI,EAAE,kCAAkC;QACxC,OAAO,EAAE,OAAO;KACnB,EACD,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CACpC,CAAC;IAEF,2BAA2B;IAC3B,MAAM,CAAC,cAAc,CACjB,mBAAmB,EACnB;QACI,WAAW,EAAE,mCAAmC;QAChD,UAAU,EAAE;YACR,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;SAC3D;KACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAA4B,EAAE;QACzC,OAAO;YACH,QAAQ,EAAE;gBACN;oBACI,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACL,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,gBAAgB,IAAI,wBAAwB;qB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CAAC,CAAC;AAClF,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.d.ts deleted file mode 100644 index a20be42..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=simpleStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.d.ts.map deleted file mode 100644 index e3cf042..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.js deleted file mode 100644 index 742c306..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.js +++ /dev/null @@ -1,636 +0,0 @@ -import { randomUUID } from 'node:crypto'; -import * as z from 'zod/v4'; -import { McpServer } from '../../server/mcp.js'; -import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; -import { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from '../../server/auth/router.js'; -import { requireBearerAuth } from '../../server/auth/middleware/bearerAuth.js'; -import { createMcpExpressApp } from '../../server/express.js'; -import { ElicitResultSchema, isInitializeRequest } from '../../types.js'; -import { InMemoryEventStore } from '../shared/inMemoryEventStore.js'; -import { InMemoryTaskStore, InMemoryTaskMessageQueue } from '../../experimental/tasks/stores/in-memory.js'; -import { setupAuthServer } from './demoInMemoryOAuthProvider.js'; -import { checkResourceAllowed } from '../../shared/auth-utils.js'; -// Check for OAuth flag -const useOAuth = process.argv.includes('--oauth'); -const strictOAuth = process.argv.includes('--oauth-strict'); -// Create shared task store for demonstration -const taskStore = new InMemoryTaskStore(); -// Create an MCP server with implementation details -const getServer = () => { - const server = new McpServer({ - name: 'simple-streamable-http-server', - version: '1.0.0', - icons: [{ src: './mcp.svg', sizes: ['512x512'], mimeType: 'image/svg+xml' }], - websiteUrl: 'https://github.com/modelcontextprotocol/typescript-sdk' - }, { - capabilities: { logging: {}, tasks: { requests: { tools: { call: {} } } } }, - taskStore, // Enable task support - taskMessageQueue: new InMemoryTaskMessageQueue() - }); - // Register a simple tool that returns a greeting - server.registerTool('greet', { - title: 'Greeting Tool', // Display name for UI - description: 'A simple greeting tool', - inputSchema: { - name: z.string().describe('Name to greet') - } - }, async ({ name }) => { - return { - content: [ - { - type: 'text', - text: `Hello, ${name}!` - } - ] - }; - }); - // Register a tool that sends multiple greetings with notifications (with annotations) - server.registerTool('multi-greet', { - description: 'A tool that sends different greetings with delays between them', - inputSchema: { - name: z.string().describe('Name to greet') - }, - annotations: { - title: 'Multiple Greeting Tool', - readOnlyHint: true, - openWorldHint: false - } - }, async ({ name }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - await server.sendLoggingMessage({ - level: 'debug', - data: `Starting multi-greet for ${name}` - }, extra.sessionId); - await sleep(1000); // Wait 1 second before first greeting - await server.sendLoggingMessage({ - level: 'info', - data: `Sending first greeting to ${name}` - }, extra.sessionId); - await sleep(1000); // Wait another second before second greeting - await server.sendLoggingMessage({ - level: 'info', - data: `Sending second greeting to ${name}` - }, extra.sessionId); - return { - content: [ - { - type: 'text', - text: `Good morning, ${name}!` - } - ] - }; - }); - // Register a tool that demonstrates form elicitation (user input collection with a schema) - // This creates a closure that captures the server instance - server.registerTool('collect-user-info', { - description: 'A tool that collects user information through form elicitation', - inputSchema: { - infoType: z.enum(['contact', 'preferences', 'feedback']).describe('Type of information to collect') - } - }, async ({ infoType }, extra) => { - let message; - let requestedSchema; - switch (infoType) { - case 'contact': - message = 'Please provide your contact information'; - requestedSchema = { - type: 'object', - properties: { - name: { - type: 'string', - title: 'Full Name', - description: 'Your full name' - }, - email: { - type: 'string', - title: 'Email Address', - description: 'Your email address', - format: 'email' - }, - phone: { - type: 'string', - title: 'Phone Number', - description: 'Your phone number (optional)' - } - }, - required: ['name', 'email'] - }; - break; - case 'preferences': - message = 'Please set your preferences'; - requestedSchema = { - type: 'object', - properties: { - theme: { - type: 'string', - title: 'Theme', - description: 'Choose your preferred theme', - enum: ['light', 'dark', 'auto'], - enumNames: ['Light', 'Dark', 'Auto'] - }, - notifications: { - type: 'boolean', - title: 'Enable Notifications', - description: 'Would you like to receive notifications?', - default: true - }, - frequency: { - type: 'string', - title: 'Notification Frequency', - description: 'How often would you like notifications?', - enum: ['daily', 'weekly', 'monthly'], - enumNames: ['Daily', 'Weekly', 'Monthly'] - } - }, - required: ['theme'] - }; - break; - case 'feedback': - message = 'Please provide your feedback'; - requestedSchema = { - type: 'object', - properties: { - rating: { - type: 'integer', - title: 'Rating', - description: 'Rate your experience (1-5)', - minimum: 1, - maximum: 5 - }, - comments: { - type: 'string', - title: 'Comments', - description: 'Additional comments (optional)', - maxLength: 500 - }, - recommend: { - type: 'boolean', - title: 'Would you recommend this?', - description: 'Would you recommend this to others?' - } - }, - required: ['rating', 'recommend'] - }; - break; - default: - throw new Error(`Unknown info type: ${infoType}`); - } - try { - // Use sendRequest through the extra parameter to elicit input - const result = await extra.sendRequest({ - method: 'elicitation/create', - params: { - mode: 'form', - message, - requestedSchema - } - }, ElicitResultSchema); - if (result.action === 'accept') { - return { - content: [ - { - type: 'text', - text: `Thank you! Collected ${infoType} information: ${JSON.stringify(result.content, null, 2)}` - } - ] - }; - } - else if (result.action === 'decline') { - return { - content: [ - { - type: 'text', - text: `No information was collected. User declined ${infoType} information request.` - } - ] - }; - } - else { - return { - content: [ - { - type: 'text', - text: `Information collection was cancelled by the user.` - } - ] - }; - } - } - catch (error) { - return { - content: [ - { - type: 'text', - text: `Error collecting ${infoType} information: ${error}` - } - ] - }; - } - }); - // Register a simple prompt with title - server.registerPrompt('greeting-template', { - title: 'Greeting Template', // Display name for UI - description: 'A simple greeting prompt template', - argsSchema: { - name: z.string().describe('Name to include in greeting') - } - }, async ({ name }) => { - return { - messages: [ - { - role: 'user', - content: { - type: 'text', - text: `Please greet ${name} in a friendly manner.` - } - } - ] - }; - }); - // Register a tool specifically for testing resumability - server.registerTool('start-notification-stream', { - description: 'Starts sending periodic notifications for testing resumability', - inputSchema: { - interval: z.number().describe('Interval in milliseconds between notifications').default(100), - count: z.number().describe('Number of notifications to send (0 for 100)').default(50) - } - }, async ({ interval, count }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - let counter = 0; - while (count === 0 || counter < count) { - counter++; - try { - await server.sendLoggingMessage({ - level: 'info', - data: `Periodic notification #${counter} at ${new Date().toISOString()}` - }, extra.sessionId); - } - catch (error) { - console.error('Error sending notification:', error); - } - // Wait for the specified interval - await sleep(interval); - } - return { - content: [ - { - type: 'text', - text: `Started sending periodic notifications every ${interval}ms` - } - ] - }; - }); - // Create a simple resource at a fixed URI - server.registerResource('greeting-resource', 'https://example.com/greetings/default', { - title: 'Default Greeting', // Display name for UI - description: 'A simple greeting resource', - mimeType: 'text/plain' - }, async () => { - return { - contents: [ - { - uri: 'https://example.com/greetings/default', - text: 'Hello, world!' - } - ] - }; - }); - // Create additional resources for ResourceLink demonstration - server.registerResource('example-file-1', 'file:///example/file1.txt', { - title: 'Example File 1', - description: 'First example file for ResourceLink demonstration', - mimeType: 'text/plain' - }, async () => { - return { - contents: [ - { - uri: 'file:///example/file1.txt', - text: 'This is the content of file 1' - } - ] - }; - }); - server.registerResource('example-file-2', 'file:///example/file2.txt', { - title: 'Example File 2', - description: 'Second example file for ResourceLink demonstration', - mimeType: 'text/plain' - }, async () => { - return { - contents: [ - { - uri: 'file:///example/file2.txt', - text: 'This is the content of file 2' - } - ] - }; - }); - // Register a tool that returns ResourceLinks - server.registerTool('list-files', { - title: 'List Files with ResourceLinks', - description: 'Returns a list of files as ResourceLinks without embedding their content', - inputSchema: { - includeDescriptions: z.boolean().optional().describe('Whether to include descriptions in the resource links') - } - }, async ({ includeDescriptions = true }) => { - const resourceLinks = [ - { - type: 'resource_link', - uri: 'https://example.com/greetings/default', - name: 'Default Greeting', - mimeType: 'text/plain', - ...(includeDescriptions && { description: 'A simple greeting resource' }) - }, - { - type: 'resource_link', - uri: 'file:///example/file1.txt', - name: 'Example File 1', - mimeType: 'text/plain', - ...(includeDescriptions && { description: 'First example file for ResourceLink demonstration' }) - }, - { - type: 'resource_link', - uri: 'file:///example/file2.txt', - name: 'Example File 2', - mimeType: 'text/plain', - ...(includeDescriptions && { description: 'Second example file for ResourceLink demonstration' }) - } - ]; - return { - content: [ - { - type: 'text', - text: 'Here are the available files as resource links:' - }, - ...resourceLinks, - { - type: 'text', - text: '\nYou can read any of these resources using their URI.' - } - ] - }; - }); - // Register a long-running tool that demonstrates task execution - // Using the experimental tasks API - WARNING: may change without notice - server.experimental.tasks.registerToolTask('delay', { - title: 'Delay', - description: 'A simple tool that delays for a specified duration, useful for testing task execution', - inputSchema: { - duration: z.number().describe('Duration in milliseconds').default(5000) - } - }, { - async createTask({ duration }, { taskStore, taskRequestedTtl }) { - // Create the task - const task = await taskStore.createTask({ - ttl: taskRequestedTtl - }); - // Simulate out-of-band work - (async () => { - await new Promise(resolve => setTimeout(resolve, duration)); - await taskStore.storeTaskResult(task.taskId, 'completed', { - content: [ - { - type: 'text', - text: `Completed ${duration}ms delay` - } - ] - }); - })(); - // Return CreateTaskResult with the created task - return { - task - }; - }, - async getTask(_args, { taskId, taskStore }) { - return await taskStore.getTask(taskId); - }, - async getTaskResult(_args, { taskId, taskStore }) { - const result = await taskStore.getTaskResult(taskId); - return result; - } - }); - return server; -}; -const MCP_PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000; -const AUTH_PORT = process.env.MCP_AUTH_PORT ? parseInt(process.env.MCP_AUTH_PORT, 10) : 3001; -const app = createMcpExpressApp(); -// Set up OAuth if enabled -let authMiddleware = null; -if (useOAuth) { - // Create auth middleware for MCP endpoints - const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}/mcp`); - const authServerUrl = new URL(`http://localhost:${AUTH_PORT}`); - const oauthMetadata = setupAuthServer({ authServerUrl, mcpServerUrl, strictResource: strictOAuth }); - const tokenVerifier = { - verifyAccessToken: async (token) => { - const endpoint = oauthMetadata.introspection_endpoint; - if (!endpoint) { - throw new Error('No token verification endpoint available in metadata'); - } - const response = await fetch(endpoint, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: new URLSearchParams({ - token: token - }).toString() - }); - if (!response.ok) { - const text = await response.text().catch(() => null); - throw new Error(`Invalid or expired token: ${text}`); - } - const data = await response.json(); - if (strictOAuth) { - if (!data.aud) { - throw new Error(`Resource Indicator (RFC8707) missing`); - } - if (!checkResourceAllowed({ requestedResource: data.aud, configuredResource: mcpServerUrl })) { - throw new Error(`Expected resource indicator ${mcpServerUrl}, got: ${data.aud}`); - } - } - // Convert the response to AuthInfo format - return { - token, - clientId: data.client_id, - scopes: data.scope ? data.scope.split(' ') : [], - expiresAt: data.exp - }; - } - }; - // Add metadata routes to the main MCP server - app.use(mcpAuthMetadataRouter({ - oauthMetadata, - resourceServerUrl: mcpServerUrl, - scopesSupported: ['mcp:tools'], - resourceName: 'MCP Demo Server' - })); - authMiddleware = requireBearerAuth({ - verifier: tokenVerifier, - requiredScopes: [], - resourceMetadataUrl: getOAuthProtectedResourceMetadataUrl(mcpServerUrl) - }); -} -// Map to store transports by session ID -const transports = {}; -// MCP POST endpoint with optional auth -const mcpPostHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (sessionId) { - console.log(`Received MCP request for session: ${sessionId}`); - } - else { - console.log('Request body:', req.body); - } - if (useOAuth && req.auth) { - console.log('Authenticated user:', req.auth); - } - try { - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport - transport = transports[sessionId]; - } - else if (!sessionId && isInitializeRequest(req.body)) { - // New initialization request - const eventStore = new InMemoryEventStore(); - transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: () => randomUUID(), - eventStore, // Enable resumability - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - // This avoids race conditions where requests might come in before the session is stored - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}, removing from transports map`); - delete transports[sid]; - } - }; - // Connect the transport to the MCP server BEFORE handling the request - // so responses can flow back through the same transport - const server = getServer(); - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - return; // Already handled - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - no need to reconnect - // The existing transport is already connected to the server - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}; -// Set up routes with conditional auth middleware -if (useOAuth && authMiddleware) { - app.post('/mcp', authMiddleware, mcpPostHandler); -} -else { - app.post('/mcp', mcpPostHandler); -} -// Handle GET requests for SSE streams (using built-in support from StreamableHTTP) -const mcpGetHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - if (useOAuth && req.auth) { - console.log('Authenticated SSE connection from user:', req.auth); - } - // Check for Last-Event-ID header for resumability - const lastEventId = req.headers['last-event-id']; - if (lastEventId) { - console.log(`Client reconnecting with Last-Event-ID: ${lastEventId}`); - } - else { - console.log(`Establishing new SSE stream for session ${sessionId}`); - } - const transport = transports[sessionId]; - await transport.handleRequest(req, res); -}; -// Set up GET route with conditional auth middleware -if (useOAuth && authMiddleware) { - app.get('/mcp', authMiddleware, mcpGetHandler); -} -else { - app.get('/mcp', mcpGetHandler); -} -// Handle DELETE requests for session termination (according to MCP spec) -const mcpDeleteHandler = async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Received session termination request for session ${sessionId}`); - try { - const transport = transports[sessionId]; - await transport.handleRequest(req, res); - } - catch (error) { - console.error('Error handling session termination:', error); - if (!res.headersSent) { - res.status(500).send('Error processing session termination'); - } - } -}; -// Set up DELETE route with conditional auth middleware -if (useOAuth && authMiddleware) { - app.delete('/mcp', authMiddleware, mcpDeleteHandler); -} -else { - app.delete('/mcp', mcpDeleteHandler); -} -app.listen(MCP_PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`MCP Streamable HTTP Server listening on port ${MCP_PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=simpleStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.js.map deleted file mode 100644 index 9f42584..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleStreamableHttp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,oCAAoC,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAEH,kBAAkB,EAElB,mBAAmB,EAItB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAC3G,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,uBAAuB;AACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAClD,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAE5D,6CAA6C;AAC7C,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAE1C,mDAAmD;AACnD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K,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.d.ts deleted file mode 100644 index 661c9f0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Simple interactive task server demonstrating elicitation and sampling. - * - * This server demonstrates the task message queue pattern from the MCP Tasks spec: - * - confirm_delete: Uses elicitation to ask the user for confirmation - * - write_haiku: Uses sampling to request an LLM to generate content - * - * Both tools use the "call-now, fetch-later" pattern where the initial call - * creates a task, and the result is fetched via tasks/result endpoint. - */ -export {}; -//# sourceMappingURL=simpleTaskInteractive.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.d.ts.map deleted file mode 100644 index 3e48b9e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleTaskInteractive.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleTaskInteractive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.js deleted file mode 100644 index 2200492..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.js +++ /dev/null @@ -1,598 +0,0 @@ -/** - * Simple interactive task server demonstrating elicitation and sampling. - * - * This server demonstrates the task message queue pattern from the MCP Tasks spec: - * - confirm_delete: Uses elicitation to ask the user for confirmation - * - write_haiku: Uses sampling to request an LLM to generate content - * - * Both tools use the "call-now, fetch-later" pattern where the initial call - * creates a task, and the result is fetched via tasks/result endpoint. - */ -import { randomUUID } from 'node:crypto'; -import { Server } from '../../server/index.js'; -import { createMcpExpressApp } from '../../server/express.js'; -import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; -import { RELATED_TASK_META_KEY, ListToolsRequestSchema, CallToolRequestSchema, GetTaskRequestSchema, GetTaskPayloadRequestSchema } from '../../types.js'; -import { isTerminal } from '../../experimental/tasks/interfaces.js'; -import { InMemoryTaskStore } from '../../experimental/tasks/stores/in-memory.js'; -// ============================================================================ -// Resolver - Promise-like for passing results between async operations -// ============================================================================ -class Resolver { - constructor() { - this._done = false; - this._promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - }); - } - setResult(value) { - if (this._done) - return; - this._done = true; - this._resolve(value); - } - setException(error) { - if (this._done) - return; - this._done = true; - this._reject(error); - } - wait() { - return this._promise; - } - done() { - return this._done; - } -} -class TaskMessageQueueWithResolvers { - constructor() { - this.queues = new Map(); - this.waitResolvers = new Map(); - } - getQueue(taskId) { - let queue = this.queues.get(taskId); - if (!queue) { - queue = []; - this.queues.set(taskId, queue); - } - return queue; - } - async enqueue(taskId, message, _sessionId, maxSize) { - const queue = this.getQueue(taskId); - if (maxSize !== undefined && queue.length >= maxSize) { - throw new Error(`Task message queue overflow: queue size (${queue.length}) exceeds maximum (${maxSize})`); - } - queue.push(message); - // Notify any waiters - this.notifyWaiters(taskId); - } - async enqueueWithResolver(taskId, message, resolver, originalRequestId) { - const queue = this.getQueue(taskId); - const queuedMessage = { - type: 'request', - message, - timestamp: Date.now(), - resolver, - originalRequestId - }; - queue.push(queuedMessage); - this.notifyWaiters(taskId); - } - async dequeue(taskId, _sessionId) { - const queue = this.getQueue(taskId); - return queue.shift(); - } - async dequeueAll(taskId, _sessionId) { - const queue = this.queues.get(taskId) ?? []; - this.queues.delete(taskId); - return queue; - } - async waitForMessage(taskId) { - // Check if there are already messages - const queue = this.getQueue(taskId); - if (queue.length > 0) - return; - // Wait for a message to be added - return new Promise(resolve => { - let waiters = this.waitResolvers.get(taskId); - if (!waiters) { - waiters = []; - this.waitResolvers.set(taskId, waiters); - } - waiters.push(resolve); - }); - } - notifyWaiters(taskId) { - const waiters = this.waitResolvers.get(taskId); - if (waiters) { - this.waitResolvers.delete(taskId); - for (const resolve of waiters) { - resolve(); - } - } - } - cleanup() { - this.queues.clear(); - this.waitResolvers.clear(); - } -} -// ============================================================================ -// Extended task store with wait functionality -// ============================================================================ -class TaskStoreWithNotifications extends InMemoryTaskStore { - constructor() { - super(...arguments); - this.updateResolvers = new Map(); - } - async updateTaskStatus(taskId, status, statusMessage, sessionId) { - await super.updateTaskStatus(taskId, status, statusMessage, sessionId); - this.notifyUpdate(taskId); - } - async storeTaskResult(taskId, status, result, sessionId) { - await super.storeTaskResult(taskId, status, result, sessionId); - this.notifyUpdate(taskId); - } - async waitForUpdate(taskId) { - return new Promise(resolve => { - let waiters = this.updateResolvers.get(taskId); - if (!waiters) { - waiters = []; - this.updateResolvers.set(taskId, waiters); - } - waiters.push(resolve); - }); - } - notifyUpdate(taskId) { - const waiters = this.updateResolvers.get(taskId); - if (waiters) { - this.updateResolvers.delete(taskId); - for (const resolve of waiters) { - resolve(); - } - } - } -} -// ============================================================================ -// Task Result Handler - delivers queued messages and routes responses -// ============================================================================ -class TaskResultHandler { - constructor(store, queue) { - this.store = store; - this.queue = queue; - this.pendingRequests = new Map(); - } - async handle(taskId, server, _sessionId) { - while (true) { - // Get fresh task state - const task = await this.store.getTask(taskId); - if (!task) { - throw new Error(`Task not found: ${taskId}`); - } - // Dequeue and send all pending messages - await this.deliverQueuedMessages(taskId, server, _sessionId); - // If task is terminal, return result - if (isTerminal(task.status)) { - const result = await this.store.getTaskResult(taskId); - // Add related-task metadata per spec - return { - ...result, - _meta: { - ...(result._meta || {}), - [RELATED_TASK_META_KEY]: { taskId } - } - }; - } - // Wait for task update or new message - await this.waitForUpdate(taskId); - } - } - async deliverQueuedMessages(taskId, server, _sessionId) { - while (true) { - const message = await this.queue.dequeue(taskId); - if (!message) - break; - console.log(`[Server] Delivering queued ${message.type} message for task ${taskId}`); - if (message.type === 'request') { - const reqMessage = message; - // Send the request via the server - // Store the resolver so we can route the response back - if (reqMessage.resolver && reqMessage.originalRequestId) { - this.pendingRequests.set(reqMessage.originalRequestId, reqMessage.resolver); - } - // Send the message - for elicitation/sampling, we use the server's methods - // But since we're in tasks/result context, we need to send via transport - // This is simplified - in production you'd use proper message routing - try { - const request = reqMessage.message; - let response; - if (request.method === 'elicitation/create') { - // Send elicitation request to client - const params = request.params; - response = await server.elicitInput(params); - } - else if (request.method === 'sampling/createMessage') { - // Send sampling request to client - const params = request.params; - response = await server.createMessage(params); - } - else { - throw new Error(`Unknown request method: ${request.method}`); - } - // Route response back to resolver - if (reqMessage.resolver) { - reqMessage.resolver.setResult(response); - } - } - catch (error) { - if (reqMessage.resolver) { - reqMessage.resolver.setException(error instanceof Error ? error : new Error(String(error))); - } - } - } - // For notifications, we'd send them too but this example focuses on requests - } - } - async waitForUpdate(taskId) { - // Race between store update and queue message - await Promise.race([this.store.waitForUpdate(taskId), this.queue.waitForMessage(taskId)]); - } - routeResponse(requestId, response) { - const resolver = this.pendingRequests.get(requestId); - if (resolver && !resolver.done()) { - this.pendingRequests.delete(requestId); - resolver.setResult(response); - return true; - } - return false; - } - routeError(requestId, error) { - const resolver = this.pendingRequests.get(requestId); - if (resolver && !resolver.done()) { - this.pendingRequests.delete(requestId); - resolver.setException(error); - return true; - } - return false; - } -} -// ============================================================================ -// Task Session - wraps server to enqueue requests during task execution -// ============================================================================ -class TaskSession { - constructor(server, taskId, store, queue) { - this.server = server; - this.taskId = taskId; - this.store = store; - this.queue = queue; - this.requestCounter = 0; - } - nextRequestId() { - return `task-${this.taskId}-${++this.requestCounter}`; - } - async elicit(message, requestedSchema) { - // Update task status to input_required - await this.store.updateTaskStatus(this.taskId, 'input_required'); - const requestId = this.nextRequestId(); - // Build the elicitation request with related-task metadata - const params = { - message, - requestedSchema, - mode: 'form', - _meta: { - [RELATED_TASK_META_KEY]: { taskId: this.taskId } - } - }; - const jsonrpcRequest = { - jsonrpc: '2.0', - id: requestId, - method: 'elicitation/create', - params - }; - // Create resolver to wait for response - const resolver = new Resolver(); - // Enqueue the request - await this.queue.enqueueWithResolver(this.taskId, jsonrpcRequest, resolver, requestId); - try { - // Wait for response - const response = await resolver.wait(); - // Update status back to working - await this.store.updateTaskStatus(this.taskId, 'working'); - return response; - } - catch (error) { - await this.store.updateTaskStatus(this.taskId, 'working'); - throw error; - } - } - async createMessage(messages, maxTokens) { - // Update task status to input_required - await this.store.updateTaskStatus(this.taskId, 'input_required'); - const requestId = this.nextRequestId(); - // Build the sampling request with related-task metadata - const params = { - messages, - maxTokens, - _meta: { - [RELATED_TASK_META_KEY]: { taskId: this.taskId } - } - }; - const jsonrpcRequest = { - jsonrpc: '2.0', - id: requestId, - method: 'sampling/createMessage', - params - }; - // Create resolver to wait for response - const resolver = new Resolver(); - // Enqueue the request - await this.queue.enqueueWithResolver(this.taskId, jsonrpcRequest, resolver, requestId); - try { - // Wait for response - const response = await resolver.wait(); - // Update status back to working - await this.store.updateTaskStatus(this.taskId, 'working'); - return response; - } - catch (error) { - await this.store.updateTaskStatus(this.taskId, 'working'); - throw error; - } - } -} -// ============================================================================ -// Server Setup -// ============================================================================ -const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 8000; -// Create shared stores -const taskStore = new TaskStoreWithNotifications(); -const messageQueue = new TaskMessageQueueWithResolvers(); -const taskResultHandler = new TaskResultHandler(taskStore, messageQueue); -// Track active task executions -const activeTaskExecutions = new Map(); -// Create the server -const createServer = () => { - const server = new Server({ name: 'simple-task-interactive', version: '1.0.0' }, { - capabilities: { - tools: {}, - tasks: { - requests: { - tools: { call: {} } - } - } - } - }); - // Register tools - server.setRequestHandler(ListToolsRequestSchema, async () => { - return { - tools: [ - { - name: 'confirm_delete', - description: 'Asks for confirmation before deleting (demonstrates elicitation)', - inputSchema: { - type: 'object', - properties: { - filename: { type: 'string' } - } - }, - execution: { taskSupport: 'required' } - }, - { - name: 'write_haiku', - description: 'Asks LLM to write a haiku (demonstrates sampling)', - inputSchema: { - type: 'object', - properties: { - topic: { type: 'string' } - } - }, - execution: { taskSupport: 'required' } - } - ] - }; - }); - // Handle tool calls - server.setRequestHandler(CallToolRequestSchema, async (request, extra) => { - const { name, arguments: args } = request.params; - const taskParams = (request.params._meta?.task || request.params.task); - // Validate task mode - these tools require tasks - if (!taskParams) { - throw new Error(`Tool ${name} requires task mode`); - } - // Create task - const taskOptions = { - ttl: taskParams.ttl, - pollInterval: taskParams.pollInterval ?? 1000 - }; - const task = await taskStore.createTask(taskOptions, extra.requestId, request, extra.sessionId); - console.log(`\n[Server] ${name} called, task created: ${task.taskId}`); - // Start background task execution - const taskExecution = (async () => { - try { - const taskSession = new TaskSession(server, task.taskId, taskStore, messageQueue); - if (name === 'confirm_delete') { - const filename = args?.filename ?? 'unknown.txt'; - console.log(`[Server] confirm_delete: asking about '${filename}'`); - console.log('[Server] Sending elicitation request to client...'); - const result = await taskSession.elicit(`Are you sure you want to delete '${filename}'?`, { - type: 'object', - properties: { - confirm: { type: 'boolean' } - }, - required: ['confirm'] - }); - console.log(`[Server] Received elicitation response: action=${result.action}, content=${JSON.stringify(result.content)}`); - let text; - if (result.action === 'accept' && result.content) { - const confirmed = result.content.confirm; - text = confirmed ? `Deleted '${filename}'` : 'Deletion cancelled'; - } - else { - text = 'Deletion cancelled'; - } - console.log(`[Server] Completing task with result: ${text}`); - await taskStore.storeTaskResult(task.taskId, 'completed', { - content: [{ type: 'text', text }] - }); - } - else if (name === 'write_haiku') { - const topic = args?.topic ?? 'nature'; - console.log(`[Server] write_haiku: topic '${topic}'`); - console.log('[Server] Sending sampling request to client...'); - const result = await taskSession.createMessage([ - { - role: 'user', - content: { type: 'text', text: `Write a haiku about ${topic}` } - } - ], 50); - let haiku = 'No response'; - if (result.content && 'text' in result.content) { - haiku = result.content.text; - } - console.log(`[Server] Received sampling response: ${haiku.substring(0, 50)}...`); - console.log('[Server] Completing task with haiku'); - await taskStore.storeTaskResult(task.taskId, 'completed', { - content: [{ type: 'text', text: `Haiku:\n${haiku}` }] - }); - } - } - catch (error) { - console.error(`[Server] Task ${task.taskId} failed:`, error); - await taskStore.storeTaskResult(task.taskId, 'failed', { - content: [{ type: 'text', text: `Error: ${error}` }], - isError: true - }); - } - finally { - activeTaskExecutions.delete(task.taskId); - } - })(); - activeTaskExecutions.set(task.taskId, { - promise: taskExecution, - server, - sessionId: extra.sessionId ?? '' - }); - return { task }; - }); - // Handle tasks/get - server.setRequestHandler(GetTaskRequestSchema, async (request) => { - const { taskId } = request.params; - const task = await taskStore.getTask(taskId); - if (!task) { - throw new Error(`Task ${taskId} not found`); - } - return task; - }); - // Handle tasks/result - server.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => { - const { taskId } = request.params; - console.log(`[Server] tasks/result called for task ${taskId}`); - return taskResultHandler.handle(taskId, server, extra.sessionId ?? ''); - }); - return server; -}; -// ============================================================================ -// Express App Setup -// ============================================================================ -const app = createMcpExpressApp(); -// Map to store transports by session ID -const transports = {}; -// Helper to check if request is initialize -const isInitializeRequest = (body) => { - return typeof body === 'object' && body !== null && 'method' in body && body.method === 'initialize'; -}; -// MCP POST endpoint -app.post('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - try { - let transport; - if (sessionId && transports[sessionId]) { - transport = transports[sessionId]; - } - else if (!sessionId && isInitializeRequest(req.body)) { - transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: () => randomUUID(), - onsessioninitialized: sid => { - console.log(`Session initialized: ${sid}`); - transports[sid] = transport; - } - }); - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}`); - delete transports[sid]; - } - }; - const server = createServer(); - await server.connect(transport); - await transport.handleRequest(req, res, req.body); - return; - } - else { - res.status(400).json({ - jsonrpc: '2.0', - error: { code: -32000, message: 'Bad Request: No valid session ID' }, - id: null - }); - return; - } - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { code: -32603, message: 'Internal server error' }, - id: null - }); - } - } -}); -// Handle GET requests for SSE streams -app.get('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - const transport = transports[sessionId]; - await transport.handleRequest(req, res); -}); -// Handle DELETE requests for session termination -app.delete('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Session termination request: ${sessionId}`); - const transport = transports[sessionId]; - await transport.handleRequest(req, res); -}); -// Start server -app.listen(PORT, () => { - console.log(`Starting server on http://localhost:${PORT}/mcp`); - console.log('\nAvailable tools:'); - console.log(' - confirm_delete: Demonstrates elicitation (asks user y/n)'); - console.log(' - write_haiku: Demonstrates sampling (requests LLM completion)'); -}); -// Handle shutdown -process.on('SIGINT', async () => { - console.log('\nShutting down server...'); - for (const sessionId of Object.keys(transports)) { - try { - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing session ${sessionId}:`, error); - } - } - taskStore.cleanup(); - messageQueue.cleanup(); - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=simpleTaskInteractive.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.js.map deleted file mode 100644 index 7c71678..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"simpleTaskInteractive.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleTaskInteractive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAMH,qBAAqB,EAWrB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAE9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAkD,UAAU,EAAqB,MAAM,wCAAwC,CAAC;AACvI,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEjF,+EAA+E;AAC/E,uEAAuE;AACvE,+EAA+E;AAE/E,MAAM,QAAQ;IAMV;QAFQ,UAAK,GAAG,KAAK,CAAC;QAGlB,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC/C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,CA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AAG,EAAE,KAAK,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;IACD,SAAS,CAAC,OAAO,EAAE,CAAC;IACpB,YAAY,CAAC,OAAO,EAAE,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts deleted file mode 100644 index c536d0c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map deleted file mode 100644 index fb982c8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sseAndStreamableHttpCompatibleServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js deleted file mode 100644 index 020cb0f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js +++ /dev/null @@ -1,231 +0,0 @@ -import { randomUUID } from 'node:crypto'; -import { McpServer } from '../../server/mcp.js'; -import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; -import { SSEServerTransport } from '../../server/sse.js'; -import * as z from 'zod/v4'; -import { isInitializeRequest } from '../../types.js'; -import { InMemoryEventStore } from '../shared/inMemoryEventStore.js'; -import { createMcpExpressApp } from '../../server/express.js'; -/** - * This example server demonstrates backwards compatibility with both: - * 1. The deprecated HTTP+SSE transport (protocol version 2024-11-05) - * 2. The Streamable HTTP transport (protocol version 2025-11-25) - * - * It maintains a single MCP server instance but exposes two transport options: - * - /mcp: The new Streamable HTTP endpoint (supports GET/POST/DELETE) - * - /sse: The deprecated SSE endpoint for older clients (GET to establish stream) - * - /messages: The deprecated POST endpoint for older clients (POST to send messages) - */ -const getServer = () => { - const server = new McpServer({ - name: 'backwards-compatible-server', - version: '1.0.0' - }, { capabilities: { logging: {} } }); - // Register a simple tool that sends notifications over time - server.registerTool('start-notification-stream', { - description: 'Starts sending periodic notifications for testing resumability', - inputSchema: { - interval: z.number().describe('Interval in milliseconds between notifications').default(100), - count: z.number().describe('Number of notifications to send (0 for 100)').default(50) - } - }, async ({ interval, count }, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - let counter = 0; - while (count === 0 || counter < count) { - counter++; - try { - await server.sendLoggingMessage({ - level: 'info', - data: `Periodic notification #${counter} at ${new Date().toISOString()}` - }, extra.sessionId); - } - catch (error) { - console.error('Error sending notification:', error); - } - // Wait for the specified interval - await sleep(interval); - } - return { - content: [ - { - type: 'text', - text: `Started sending periodic notifications every ${interval}ms` - } - ] - }; - }); - return server; -}; -// Create Express application -const app = createMcpExpressApp(); -// Store transports by session ID -const transports = {}; -//============================================================================= -// STREAMABLE HTTP TRANSPORT (PROTOCOL VERSION 2025-11-25) -//============================================================================= -// Handle all MCP Streamable HTTP requests (GET, POST, DELETE) on a single endpoint -app.all('/mcp', async (req, res) => { - console.log(`Received ${req.method} request to /mcp`); - try { - // Check for existing session ID - const sessionId = req.headers['mcp-session-id']; - let transport; - if (sessionId && transports[sessionId]) { - // Check if the transport is of the correct type - const existingTransport = transports[sessionId]; - if (existingTransport instanceof StreamableHTTPServerTransport) { - // Reuse existing transport - transport = existingTransport; - } - else { - // Transport exists but is not a StreamableHTTPServerTransport (could be SSEServerTransport) - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: Session exists but uses a different transport protocol' - }, - id: null - }); - return; - } - } - else if (!sessionId && req.method === 'POST' && isInitializeRequest(req.body)) { - const eventStore = new InMemoryEventStore(); - transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: () => randomUUID(), - eventStore, // Enable resumability - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - console.log(`StreamableHTTP session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Set up onclose handler to clean up transport when closed - transport.onclose = () => { - const sid = transport.sessionId; - if (sid && transports[sid]) { - console.log(`Transport closed for session ${sid}, removing from transports map`); - delete transports[sid]; - } - }; - // Connect the transport to the MCP server - const server = getServer(); - await server.connect(transport); - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with the transport - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}); -//============================================================================= -// DEPRECATED HTTP+SSE TRANSPORT (PROTOCOL VERSION 2024-11-05) -//============================================================================= -app.get('/sse', async (req, res) => { - console.log('Received GET request to /sse (deprecated SSE transport)'); - const transport = new SSEServerTransport('/messages', res); - transports[transport.sessionId] = transport; - res.on('close', () => { - delete transports[transport.sessionId]; - }); - const server = getServer(); - await server.connect(transport); -}); -app.post('/messages', async (req, res) => { - const sessionId = req.query.sessionId; - let transport; - const existingTransport = transports[sessionId]; - if (existingTransport instanceof SSEServerTransport) { - // Reuse existing transport - transport = existingTransport; - } - else { - // Transport exists but is not a SSEServerTransport (could be StreamableHTTPServerTransport) - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: Session exists but uses a different transport protocol' - }, - id: null - }); - return; - } - if (transport) { - await transport.handlePostMessage(req, res, req.body); - } - else { - res.status(400).send('No transport found for sessionId'); - } -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`Backwards compatible MCP server listening on port ${PORT}`); - console.log(` -============================================== -SUPPORTED TRANSPORT OPTIONS: - -1. Streamable Http(Protocol version: 2025-11-25) - Endpoint: /mcp - Methods: GET, POST, DELETE - Usage: - - Initialize with POST to /mcp - - Establish SSE stream with GET to /mcp - - Send requests with POST to /mcp - - Terminate session with DELETE to /mcp - -2. Http + SSE (Protocol version: 2024-11-05) - Endpoints: /sse (GET) and /messages (POST) - Usage: - - Establish SSE stream with GET to /sse - - Send requests with POST to /messages?sessionId= -============================================== -`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - // Close all active transports to properly clean up resources - for (const sessionId in transports) { - try { - console.log(`Closing transport for session ${sessionId}`); - await transports[sessionId].close(); - delete transports[sessionId]; - } - catch (error) { - console.error(`Error closing transport for session ${sessionId}:`, error); - } - } - console.log('Server shutdown complete'); - process.exit(0); -}); -//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js.map deleted file mode 100644 index bea467a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sseAndStreamableHttpComp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K,CAAC,EAAE;IACrB,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,qDAAqD,IAAI,EAAE,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;CAmBf,CAAC,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.d.ts deleted file mode 100644 index 63e4554..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=ssePollingExample.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.d.ts.map deleted file mode 100644 index 9382731..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ssePollingExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/ssePollingExample.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.js deleted file mode 100644 index 28d2a04..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.js +++ /dev/null @@ -1,102 +0,0 @@ -import { randomUUID } from 'node:crypto'; -import { McpServer } from '../../server/mcp.js'; -import { createMcpExpressApp } from '../../server/express.js'; -import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; -import { InMemoryEventStore } from '../shared/inMemoryEventStore.js'; -import cors from 'cors'; -// Factory to create a new MCP server per session. -// Each session needs its own server+transport pair to avoid cross-session contamination. -const getServer = () => { - const server = new McpServer({ - name: 'sse-polling-example', - version: '1.0.0' - }, { - capabilities: { logging: {} } - }); - // Register a long-running tool that demonstrates server-initiated disconnect - server.tool('long-task', 'A long-running task that sends progress updates. Server will disconnect mid-task to demonstrate polling.', {}, async (_args, extra) => { - const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); - console.log(`[${extra.sessionId}] Starting long-task...`); - // Send first progress notification - await server.sendLoggingMessage({ - level: 'info', - data: 'Progress: 25% - Starting work...' - }, extra.sessionId); - await sleep(1000); - // Send second progress notification - await server.sendLoggingMessage({ - level: 'info', - data: 'Progress: 50% - Halfway there...' - }, extra.sessionId); - await sleep(1000); - // Server decides to disconnect the client to free resources - // Client will reconnect via GET with Last-Event-ID after the transport's retryInterval - // Use extra.closeSSEStream callback - available when eventStore is configured - if (extra.closeSSEStream) { - console.log(`[${extra.sessionId}] Closing SSE stream to trigger client polling...`); - extra.closeSSEStream(); - } - // Continue processing while client is disconnected - // Events are stored in eventStore and will be replayed on reconnect - await sleep(500); - await server.sendLoggingMessage({ - level: 'info', - data: 'Progress: 75% - Almost done (sent while client disconnected)...' - }, extra.sessionId); - await sleep(500); - await server.sendLoggingMessage({ - level: 'info', - data: 'Progress: 100% - Complete!' - }, extra.sessionId); - console.log(`[${extra.sessionId}] Task complete`); - return { - content: [ - { - type: 'text', - text: 'Long task completed successfully!' - } - ] - }; - }); - return server; -}; -// Set up Express app -const app = createMcpExpressApp(); -app.use(cors()); -// Create event store for resumability -const eventStore = new InMemoryEventStore(); -// Track transports by session ID for session reuse -const transports = new Map(); -// Handle all MCP requests -app.all('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - // Reuse existing transport or create new one - let transport = sessionId ? transports.get(sessionId) : undefined; - if (!transport) { - transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: () => randomUUID(), - eventStore, - retryInterval: 2000, // Default retry interval for priming events - onsessioninitialized: id => { - console.log(`[${id}] Session initialized`); - transports.set(id, transport); - } - }); - // Create a new server per session and connect it to the transport - const server = getServer(); - await server.connect(transport); - } - await transport.handleRequest(req, res, req.body); -}); -// Start the server -const PORT = 3001; -app.listen(PORT, () => { - console.log(`SSE Polling Example Server running on http://localhost:${PORT}/mcp`); - console.log(''); - console.log('This server demonstrates SEP-1699 SSE polling:'); - console.log('- retryInterval: 2000ms (client waits 2s before reconnecting)'); - console.log('- eventStore: InMemoryEventStore (events are persisted for replay)'); - console.log(''); - console.log('Try calling the "long-task" tool to see server-initiated disconnect in action.'); -}); -//# sourceMappingURL=ssePollingExample.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.js.map deleted file mode 100644 index 94c7c25..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ssePollingExample.js","sourceRoot":"","sources":["../../../../src/examples/server/ssePollingExample.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,SAAS,CACxB;QACI,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;KAChC,CACJ,CAAC;IAEF,6EAA6E;IAC7E,MAAM,CAAC,IAAI,CACP,WAAW,EACX,0GAA0G,EAC1G,EAAE,EACF,KAAK,EAAE,KAAK,EAAE,KAAK,EAA2B,EAAE;QAC5C,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QAE9E,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,SAAS,yBAAyB,CAAC,CAAC;QAE1D,mCAAmC;QACnC,MAAM,MAAM,CAAC,kBAAkB,CAC3B;YACI,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,kCAAkC;SAC3C,EACD,KAAK,CAAC,SAAS,CAClB,CAAC;QACF,MAAM,KA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C;IAC9D,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;AAClG,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts deleted file mode 100644 index 4df1783..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=standaloneSseWithGetStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map deleted file mode 100644 index df60dc5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"standaloneSseWithGetStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js deleted file mode 100644 index 5009acd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js +++ /dev/null @@ -1,122 +0,0 @@ -import { randomUUID } from 'node:crypto'; -import { McpServer } from '../../server/mcp.js'; -import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; -import { isInitializeRequest } from '../../types.js'; -import { createMcpExpressApp } from '../../server/express.js'; -// Factory to create a new MCP server per session. -// Each session needs its own server+transport pair to avoid cross-session contamination. -const getServer = () => { - const server = new McpServer({ - name: 'resource-list-changed-notification-server', - version: '1.0.0' - }); - const addResource = (name, content) => { - const uri = `https://mcp-example.com/dynamic/${encodeURIComponent(name)}`; - server.registerResource(name, uri, { mimeType: 'text/plain', description: `Dynamic resource: ${name}` }, async () => { - return { - contents: [{ uri, text: content }] - }; - }); - }; - addResource('example-resource', 'Initial content for example-resource'); - // Periodically add new resources to demonstrate notifications - const resourceChangeInterval = setInterval(() => { - const name = randomUUID(); - addResource(name, `Content for ${name}`); - }, 5000); - // Clean up the interval when the server closes - server.server.onclose = () => { - clearInterval(resourceChangeInterval); - }; - return server; -}; -// Store transports by session ID to send notifications -const transports = {}; -const app = createMcpExpressApp(); -app.post('/mcp', async (req, res) => { - console.log('Received MCP request:', req.body); - try { - // Check for existing session ID - const sessionId = req.headers['mcp-session-id']; - let transport; - if (sessionId && transports[sessionId]) { - // Reuse existing transport - transport = transports[sessionId]; - } - else if (!sessionId && isInitializeRequest(req.body)) { - // New initialization request - transport = new StreamableHTTPServerTransport({ - sessionIdGenerator: () => randomUUID(), - onsessioninitialized: sessionId => { - // Store the transport by session ID when session is initialized - // This avoids race conditions where requests might come in before the session is stored - console.log(`Session initialized with ID: ${sessionId}`); - transports[sessionId] = transport; - } - }); - // Create a new server per session and connect it to the transport - const server = getServer(); - await server.connect(transport); - // Handle the request - the onsessioninitialized callback will store the transport - await transport.handleRequest(req, res, req.body); - return; // Already handled - } - else { - // Invalid request - no session ID or not initialization request - res.status(400).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Bad Request: No valid session ID provided' - }, - id: null - }); - return; - } - // Handle the request with existing transport - await transport.handleRequest(req, res, req.body); - } - catch (error) { - console.error('Error handling MCP request:', error); - if (!res.headersSent) { - res.status(500).json({ - jsonrpc: '2.0', - error: { - code: -32603, - message: 'Internal server error' - }, - id: null - }); - } - } -}); -// Handle GET requests for SSE streams (now using built-in support from StreamableHTTP) -app.get('/mcp', async (req, res) => { - const sessionId = req.headers['mcp-session-id']; - if (!sessionId || !transports[sessionId]) { - res.status(400).send('Invalid or missing session ID'); - return; - } - console.log(`Establishing SSE stream for session ${sessionId}`); - const transport = transports[sessionId]; - await transport.handleRequest(req, res); -}); -// Start the server -const PORT = 3000; -app.listen(PORT, error => { - if (error) { - console.error('Failed to start server:', error); - process.exit(1); - } - console.log(`Server listening on port ${PORT}`); -}); -// Handle server shutdown -process.on('SIGINT', async () => { - console.log('Shutting down server...'); - for (const sessionId in transports) { - await transports[sessionId].close(); - delete transports[sessionId]; - } - process.exit(0); -}); -//# sourceMappingURL=standaloneSseWithGetStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js.map deleted file mode 100644 index a89e87f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"standaloneSseWithGetStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAsB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE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AAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;QACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.d.ts deleted file mode 100644 index acc24b6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=toolWithSampleServer.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.d.ts.map deleted file mode 100644 index bd0cebc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"toolWithSampleServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/toolWithSampleServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.js deleted file mode 100644 index 0b7df6c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.js +++ /dev/null @@ -1,48 +0,0 @@ -// Run with: npx tsx src/examples/server/toolWithSampleServer.ts -import { McpServer } from '../../server/mcp.js'; -import { StdioServerTransport } from '../../server/stdio.js'; -import * as z from 'zod/v4'; -const mcpServer = new McpServer({ - name: 'tools-with-sample-server', - version: '1.0.0' -}); -// Tool that uses LLM sampling to summarize any text -mcpServer.registerTool('summarize', { - description: 'Summarize any text using an LLM', - inputSchema: { - text: z.string().describe('Text to summarize') - } -}, async ({ text }) => { - // Call the LLM through MCP sampling - const response = await mcpServer.server.createMessage({ - messages: [ - { - role: 'user', - content: { - type: 'text', - text: `Please summarize the following text concisely:\n\n${text}` - } - } - ], - maxTokens: 500 - }); - // Since we're not passing tools param to createMessage, response.content is single content - return { - content: [ - { - type: 'text', - text: response.content.type === 'text' ? response.content.text : 'Unable to generate summary' - } - ] - }; -}); -async function main() { - const transport = new StdioServerTransport(); - await mcpServer.connect(transport); - console.log('MCP server is running...'); -} -main().catch(error => { - console.error('Server error:', error); - process.exit(1); -}); -//# sourceMappingURL=toolWithSampleServer.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.js.map deleted file mode 100644 index 4fc372c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/toolWithSampleServer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"toolWithSampleServer.js","sourceRoot":"","sources":["../../../../src/examples/server/toolWithSampleServer.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,SA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,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.d.ts deleted file mode 100644 index 26ff38c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { JSONRPCMessage } from '../../types.js'; -import { EventStore } from '../../server/streamableHttp.js'; -/** - * Simple in-memory implementation of the EventStore interface for resumability - * This is primarily intended for examples and testing, not for production use - * where a persistent storage solution would be more appropriate. - */ -export declare class InMemoryEventStore implements EventStore { - private events; - /** - * Generates a unique event ID for a given stream ID - */ - private generateEventId; - /** - * Extracts the stream ID from an event ID - */ - private getStreamIdFromEventId; - /** - * Stores an event with a generated event ID - * Implements EventStore.storeEvent - */ - storeEvent(streamId: string, message: JSONRPCMessage): Promise; - /** - * Replays events that occurred after a specific event ID - * Implements EventStore.replayEventsAfter - */ - replayEventsAfter(lastEventId: string, { send }: { - send: (eventId: string, message: JSONRPCMessage) => Promise; - }): Promise; -} -//# sourceMappingURL=inMemoryEventStore.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.d.ts.map deleted file mode 100644 index a67ee6c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemoryEventStore.d.ts","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,UAAU;IACjD,OAAO,CAAC,MAAM,CAAyE;IAEvF;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAK9B;;;OAGG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAM5E;;;OAGG;IACG,iBAAiB,CACnB,WAAW,EAAE,MAAM,EACnB,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,GAChF,OAAO,CAAC,MAAM,CAAC;CAkCrB"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.js deleted file mode 100644 index 35f6dbb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Simple in-memory implementation of the EventStore interface for resumability - * This is primarily intended for examples and testing, not for production use - * where a persistent storage solution would be more appropriate. - */ -export class InMemoryEventStore { - constructor() { - this.events = new Map(); - } - /** - * Generates a unique event ID for a given stream ID - */ - generateEventId(streamId) { - return `${streamId}_${Date.now()}_${Math.random().toString(36).substring(2, 10)}`; - } - /** - * Extracts the stream ID from an event ID - */ - getStreamIdFromEventId(eventId) { - const parts = eventId.split('_'); - return parts.length > 0 ? parts[0] : ''; - } - /** - * Stores an event with a generated event ID - * Implements EventStore.storeEvent - */ - async storeEvent(streamId, message) { - const eventId = this.generateEventId(streamId); - this.events.set(eventId, { streamId, message }); - return eventId; - } - /** - * Replays events that occurred after a specific event ID - * Implements EventStore.replayEventsAfter - */ - async replayEventsAfter(lastEventId, { send }) { - if (!lastEventId || !this.events.has(lastEventId)) { - return ''; - } - // Extract the stream ID from the event ID - const streamId = this.getStreamIdFromEventId(lastEventId); - if (!streamId) { - return ''; - } - let foundLastEvent = false; - // Sort events by eventId for chronological ordering - const sortedEvents = [...this.events.entries()].sort((a, b) => a[0].localeCompare(b[0])); - for (const [eventId, { streamId: eventStreamId, message }] of sortedEvents) { - // Only include events from the same stream - if (eventStreamId !== streamId) { - continue; - } - // Start sending events after we find the lastEventId - if (eventId === lastEventId) { - foundLastEvent = true; - continue; - } - if (foundLastEvent) { - await send(eventId, message); - } - } - return streamId; - } -} -//# sourceMappingURL=inMemoryEventStore.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.js.map deleted file mode 100644 index b9e6af6..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/shared/inMemoryEventStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemoryEventStore.js","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QACY,WAAM,GAA+D,IAAI,GAAG,EAAE,CAAC;IAoE3F,CAAC;IAlEG;;OAEG;IACK,eAAe,CAAC,QAAgB;QACpC,OAAO,GAAG,QAAQ,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IACtF,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,OAAe;QAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;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E,CAAC;gBACjB,MAAM,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACjC,CAAC;QACL,CAAC;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.d.ts deleted file mode 100644 index 2a86335..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Experimental MCP SDK features. - * WARNING: These APIs are experimental and may change without notice. - * - * Import experimental features from this module: - * ```typescript - * import { TaskStore, InMemoryTaskStore } from '@modelcontextprotocol/sdk/experimental'; - * ``` - * - * @experimental - */ -export * from './tasks/index.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.d.ts.map deleted file mode 100644 index 410892a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/experimental/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.js deleted file mode 100644 index 650f4e4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Experimental MCP SDK features. - * WARNING: These APIs are experimental and may change without notice. - * - * Import experimental features from this module: - * ```typescript - * import { TaskStore, InMemoryTaskStore } from '@modelcontextprotocol/sdk/experimental'; - * ``` - * - * @experimental - */ -export * from './tasks/index.js'; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.js.map deleted file mode 100644 index 3639685..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/experimental/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.d.ts deleted file mode 100644 index 9c7a928..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.d.ts +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Experimental client task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import type { Client } from '../../client/index.js'; -import type { RequestOptions } from '../../shared/protocol.js'; -import type { ResponseMessage } from '../../shared/responseMessage.js'; -import type { AnyObjectSchema, SchemaOutput } from '../../server/zod-compat.js'; -import type { CallToolRequest, ClientRequest, Notification, Request, Result } from '../../types.js'; -import { CallToolResultSchema, type CompatibilityCallToolResultSchema } from '../../types.js'; -import type { GetTaskResult, ListTasksResult, CancelTaskResult } from './types.js'; -/** - * Experimental task features for MCP clients. - * - * Access via `client.experimental.tasks`: - * ```typescript - * const stream = client.experimental.tasks.callToolStream({ name: 'tool', arguments: {} }); - * const task = await client.experimental.tasks.getTask(taskId); - * ``` - * - * @experimental - */ -export declare class ExperimentalClientTasks { - private readonly _client; - constructor(_client: Client); - /** - * Calls a tool and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to tool execution, allowing you to - * observe intermediate task status updates for long-running tool calls. - * Automatically validates structured output if the tool has an outputSchema. - * - * @example - * ```typescript - * const stream = client.experimental.tasks.callToolStream({ name: 'myTool', arguments: {} }); - * for await (const message of stream) { - * switch (message.type) { - * case 'taskCreated': - * console.log('Tool execution started:', message.task.taskId); - * break; - * case 'taskStatus': - * console.log('Tool status:', message.task.status); - * break; - * case 'result': - * console.log('Tool result:', message.result); - * break; - * case 'error': - * console.error('Tool error:', message.error); - * break; - * } - * } - * ``` - * - * @param params - Tool call parameters (name and arguments) - * @param resultSchema - Zod schema for validating the result (defaults to CallToolResultSchema) - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - callToolStream(params: CallToolRequest['params'], resultSchema?: T, options?: RequestOptions): AsyncGenerator>, void, void>; - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * @returns The task status - * - * @experimental - */ - getTask(taskId: string, options?: RequestOptions): Promise; - /** - * Retrieves the result of a completed task. - * - * @param taskId - The task identifier - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options - * @returns The task result - * - * @experimental - */ - getTaskResult(taskId: string, resultSchema?: T, options?: RequestOptions): Promise>; - /** - * Lists tasks with optional pagination. - * - * @param cursor - Optional pagination cursor - * @param options - Optional request options - * @returns List of tasks with optional next cursor - * - * @experimental - */ - listTasks(cursor?: string, options?: RequestOptions): Promise; - /** - * Cancels a running task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * - * @experimental - */ - cancelTask(taskId: string, options?: RequestOptions): Promise; - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to request processing, allowing you to - * observe intermediate task status updates for task-augmented requests. - * - * @param request - The request to send - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - requestStream(request: ClientRequest | RequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>; -} -//# sourceMappingURL=client.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.d.ts.map deleted file mode 100644 index e54158d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,KAAK,iCAAiC,EAAuB,MAAM,gBAAgB,CAAC;AAEnH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAgBnF;;;;;;;;;;GAUG;AACH,qBAAa,uBAAuB,CAChC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAClC,aAAa,SAAS,YAAY,GAAG,YAAY,EACjD,OAAO,SAAS,MAAM,GAAG,MAAM;IAEnB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC;IAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACI,cAAc,CAAC,CAAC,SAAS,OAAO,oBAAoB,GAAG,OAAO,iCAAiC,EAClG,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,YAAY,GAAE,CAA6B,EAC3C,OAAO,CAAC,EAAE,cAAc,GACzB,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAyE/D;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAM/E;;;;;;;;;OASG;IACG,aAAa,CAAC,CAAC,SAAS,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAapI;;;;;;;;OAQG;IACG,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IASpF;;;;;;;OAOG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IASrF;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,CAAC,SAAS,eAAe,EACnC,OAAO,EAAE,aAAa,GAAG,QAAQ,EACjC,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,EAAE,cAAc,GACzB,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;CAWlE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js deleted file mode 100644 index 0c1d8af..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Experimental client task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import { CallToolResultSchema, McpError, ErrorCode } from '../../types.js'; -/** - * Experimental task features for MCP clients. - * - * Access via `client.experimental.tasks`: - * ```typescript - * const stream = client.experimental.tasks.callToolStream({ name: 'tool', arguments: {} }); - * const task = await client.experimental.tasks.getTask(taskId); - * ``` - * - * @experimental - */ -export class ExperimentalClientTasks { - constructor(_client) { - this._client = _client; - } - /** - * Calls a tool and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to tool execution, allowing you to - * observe intermediate task status updates for long-running tool calls. - * Automatically validates structured output if the tool has an outputSchema. - * - * @example - * ```typescript - * const stream = client.experimental.tasks.callToolStream({ name: 'myTool', arguments: {} }); - * for await (const message of stream) { - * switch (message.type) { - * case 'taskCreated': - * console.log('Tool execution started:', message.task.taskId); - * break; - * case 'taskStatus': - * console.log('Tool status:', message.task.status); - * break; - * case 'result': - * console.log('Tool result:', message.result); - * break; - * case 'error': - * console.error('Tool error:', message.error); - * break; - * } - * } - * ``` - * - * @param params - Tool call parameters (name and arguments) - * @param resultSchema - Zod schema for validating the result (defaults to CallToolResultSchema) - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - async *callToolStream(params, resultSchema = CallToolResultSchema, options) { - // Access Client's internal methods - const clientInternal = this._client; - // Add task creation parameters if server supports it and not explicitly provided - const optionsWithTask = { - ...options, - // We check if the tool is known to be a task during auto-configuration, but assume - // the caller knows what they're doing if they pass this explicitly - task: options?.task ?? (clientInternal.isToolTask(params.name) ? {} : undefined) - }; - const stream = clientInternal.requestStream({ method: 'tools/call', params }, resultSchema, optionsWithTask); - // Get the validator for this tool (if it has an output schema) - const validator = clientInternal.getToolOutputValidator(params.name); - // Iterate through the stream and validate the final result if needed - for await (const message of stream) { - // If this is a result message and the tool has an output schema, validate it - if (message.type === 'result' && validator) { - const result = message.result; - // If tool has outputSchema, it MUST return structuredContent (unless it's an error) - if (!result.structuredContent && !result.isError) { - yield { - type: 'error', - error: new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`) - }; - return; - } - // Only validate structured content if present (not when there's an error) - if (result.structuredContent) { - try { - // Validate the structured content against the schema - const validationResult = validator(result.structuredContent); - if (!validationResult.valid) { - yield { - type: 'error', - error: new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`) - }; - return; - } - } - catch (error) { - if (error instanceof McpError) { - yield { type: 'error', error }; - return; - } - yield { - type: 'error', - error: new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`) - }; - return; - } - } - } - // Yield the message (either validated result or any other message type) - yield message; - } - } - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * @returns The task status - * - * @experimental - */ - async getTask(taskId, options) { - return this._client.getTask({ taskId }, options); - } - /** - * Retrieves the result of a completed task. - * - * @param taskId - The task identifier - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options - * @returns The task result - * - * @experimental - */ - async getTaskResult(taskId, resultSchema, options) { - // Delegate to the client's underlying Protocol method - return this._client.getTaskResult({ taskId }, resultSchema, options); - } - /** - * Lists tasks with optional pagination. - * - * @param cursor - Optional pagination cursor - * @param options - Optional request options - * @returns List of tasks with optional next cursor - * - * @experimental - */ - async listTasks(cursor, options) { - // Delegate to the client's underlying Protocol method - return this._client.listTasks(cursor ? { cursor } : undefined, options); - } - /** - * Cancels a running task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * - * @experimental - */ - async cancelTask(taskId, options) { - // Delegate to the client's underlying Protocol method - return this._client.cancelTask({ taskId }, options); - } - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to request processing, allowing you to - * observe intermediate task status updates for task-augmented requests. - * - * @param request - The request to send - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - requestStream(request, resultSchema, options) { - return this._client.requestStream(request, resultSchema, options); - } -} -//# sourceMappingURL=client.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js.map deleted file mode 100644 index ae79ccf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,EAAE,oBAAoB,EAA0C,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAkBnH;;;;;;;;;;GAUG;AACH,MAAM,OAAO,uBAAuB;IAKhC,YAA6B,OAAiD;QAAjD,YAAO,GAAP,OAAO,CAA0C;IAAG,CAAC;IAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,KAAK,CAAC,CAAC,cAAc,CACjB,MAAiC,EACjC,eAAkB,oBAAyB,EAC3C,OAAwB;QAExB,mCAAmC;QACnC,MAAM,cAAc,GAAG,IAAI,CAAC,OAA8C,CAAC;QAE3E,iFAAiF;QACjF,MAAM,eAAe,GAAG;YACpB,GAAG,OAAO;YACV,mFAAmF;YACnF,mEAAmE;YACnE,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;SACnF,CAAC;QAEF,MAAM,MAAM,GAAG,cAAc,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC;QAE7G,+DAA+D;QAC/D,MAAM,SAAS,GAAG,cAAc,CAA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esm/experimental/tasks/helpers.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.d.ts deleted file mode 100644 index f5e505f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Experimental task capability assertion helpers. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -/** - * Type representing the task requests capability structure. - * This is derived from ClientTasksCapability.requests and ServerTasksCapability.requests. - */ -interface TaskRequestsCapability { - tools?: { - call?: object; - }; - sampling?: { - createMessage?: object; - }; - elicitation?: { - create?: object; - }; -} -/** - * Asserts that task creation is supported for tools/call. - * Used by Client.assertTaskCapability and Server.assertTaskHandlerCapability. - * - * @param requests - The task requests capability object - * @param method - The method being checked - * @param entityName - 'Server' or 'Client' for error messages - * @throws Error if the capability is not supported - * - * @experimental - */ -export declare function assertToolsCallTaskCapability(requests: TaskRequestsCapability | undefined, method: string, entityName: 'Server' | 'Client'): void; -/** - * Asserts that task creation is supported for sampling/createMessage or elicitation/create. - * Used by Server.assertTaskCapability and Client.assertTaskHandlerCapability. - * - * @param requests - The task requests capability object - * @param method - The method being checked - * @param entityName - 'Server' or 'Client' for error messages - * @throws Error if the capability is not supported - * - * @experimental - */ -export declare function assertClientRequestTaskCapability(requests: TaskRequestsCapability | undefined, method: string, entityName: 'Server' | 'Client'): void; -export {}; -//# sourceMappingURL=helpers.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.d.ts.map deleted file mode 100644 index 99dc903..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,UAAU,sBAAsB;IAC5B,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,WAAW,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CACzC,QAAQ,EAAE,sBAAsB,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAChC,IAAI,CAgBN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iCAAiC,CAC7C,QAAQ,EAAE,sBAAsB,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAChC,IAAI,CAsBN"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js deleted file mode 100644 index 3880031..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Experimental task capability assertion helpers. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -/** - * Asserts that task creation is supported for tools/call. - * Used by Client.assertTaskCapability and Server.assertTaskHandlerCapability. - * - * @param requests - The task requests capability object - * @param method - The method being checked - * @param entityName - 'Server' or 'Client' for error messages - * @throws Error if the capability is not supported - * - * @experimental - */ -export function assertToolsCallTaskCapability(requests, method, entityName) { - if (!requests) { - throw new Error(`${entityName} does not support task creation (required for ${method})`); - } - switch (method) { - case 'tools/call': - if (!requests.tools?.call) { - throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`); - } - break; - default: - // Method doesn't support tasks, which is fine - no error - break; - } -} -/** - * Asserts that task creation is supported for sampling/createMessage or elicitation/create. - * Used by Server.assertTaskCapability and Client.assertTaskHandlerCapability. - * - * @param requests - The task requests capability object - * @param method - The method being checked - * @param entityName - 'Server' or 'Client' for error messages - * @throws Error if the capability is not supported - * - * @experimental - */ -export function assertClientRequestTaskCapability(requests, method, entityName) { - if (!requests) { - throw new Error(`${entityName} does not support task creation (required for ${method})`); - } - switch (method) { - case 'sampling/createMessage': - if (!requests.sampling?.createMessage) { - throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`); - } - break; - case 'elicitation/create': - if (!requests.elicitation?.create) { - throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`); - } - break; - default: - // Method doesn't support tasks, which is fine - no error - break; - } -} -//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js.map deleted file mode 100644 index 0cb1d79..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,6BAA6B,CACzC,QAA4C,EAC5C,MAAc,EACd,UAA+B;IAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,iDAAiD,MAAM,GAAG,CAAC,CAAC;IAC7F,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,YAAY;YACb,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,gEAAgE,MAAM,GAAG,CAAC,CAAC;YAC5G,CAAC;YACD,MAAM;QAEV;YACI,yDAAyD;YACzD,MAAM;IACd,CAAC;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iCAAiC,CAC7C,QAA4C,EAC5C,MAAc,EACd,UAA+B;IAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,iDAAiD,MAAM,GAAG,CAAC,CAAC;IAC7F,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,wBAAwB;YACzB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC;gBACpC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,4EAA4E,MAAM,GAAG,CAAC,CAAC;YACxH,CAAC;YACD,MAAM;QAEV,KAAK,oBAAoB;YACrB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,wEAAwE,MAAM,GAAG,CAAC,CAAC;YACpH,CAAC;YACD,MAAM;QAEV;YACI,yDAAyD;YACzD,MAAM;IACd,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.d.ts deleted file mode 100644 index 33ab791..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Experimental task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -export * from './types.js'; -export * from './interfaces.js'; -export * from './helpers.js'; -export * from './client.js'; -export * from './server.js'; -export * from './mcp-server.js'; -export * from './stores/in-memory.js'; -export type { ResponseMessage, TaskStatusMessage, TaskCreatedMessage, ResultMessage, ErrorMessage, BaseResponseMessage } from '../../shared/responseMessage.js'; -export { takeResult, toArrayAsync } from '../../shared/responseMessage.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.d.ts.map deleted file mode 100644 index cf117ed..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,cAAc,CAAC;AAG7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,uBAAuB,CAAC;AAGtC,YAAY,EACR,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.js deleted file mode 100644 index aaa84f5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Experimental task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -// Re-export spec types for convenience -export * from './types.js'; -// SDK implementation interfaces -export * from './interfaces.js'; -// Assertion helpers -export * from './helpers.js'; -// Wrapper classes -export * from './client.js'; -export * from './server.js'; -export * from './mcp-server.js'; -// Store implementations -export * from './stores/in-memory.js'; -export { takeResult, toArrayAsync } from '../../shared/responseMessage.js'; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.js.map deleted file mode 100644 index a01409c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uCAAuC;AACvC,cAAc,YAAY,CAAC;AAE3B,gCAAgC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,oBAAoB;AACpB,cAAc,cAAc,CAAC;AAE7B,kBAAkB;AAClB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAEhC,wBAAwB;AACxB,cAAc,uBAAuB,CAAC;AAWtC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.d.ts deleted file mode 100644 index b0bb989..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.d.ts +++ /dev/null @@ -1,232 +0,0 @@ -/** - * Experimental task interfaces for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - */ -import { Task, RequestId, Result, JSONRPCRequest, JSONRPCNotification, JSONRPCResultResponse, JSONRPCErrorResponse, ServerRequest, ServerNotification, CallToolResult, GetTaskResult, ToolExecution, Request } from '../../types.js'; -import { CreateTaskResult } from './types.js'; -import type { RequestHandlerExtra, RequestTaskStore } from '../../shared/protocol.js'; -import type { ZodRawShapeCompat, AnySchema, ShapeOutput } from '../../server/zod-compat.js'; -/** - * Extended handler extra with task store for task creation. - * @experimental - */ -export interface CreateTaskRequestHandlerExtra extends RequestHandlerExtra { - taskStore: RequestTaskStore; -} -/** - * Extended handler extra with task ID and store for task operations. - * @experimental - */ -export interface TaskRequestHandlerExtra extends RequestHandlerExtra { - taskId: string; - taskStore: RequestTaskStore; -} -/** - * Base callback type for tool handlers. - * @experimental - */ -export type BaseToolCallback, Args extends undefined | ZodRawShapeCompat | AnySchema = undefined> = Args extends ZodRawShapeCompat ? (args: ShapeOutput, extra: ExtraT) => SendResultT | Promise : Args extends AnySchema ? (args: unknown, extra: ExtraT) => SendResultT | Promise : (extra: ExtraT) => SendResultT | Promise; -/** - * Handler for creating a task. - * @experimental - */ -export type CreateTaskRequestHandler = BaseToolCallback; -/** - * Handler for task operations (get, getResult). - * @experimental - */ -export type TaskRequestHandler = BaseToolCallback; -/** - * Interface for task-based tool handlers. - * @experimental - */ -export interface ToolTaskHandler { - createTask: CreateTaskRequestHandler; - getTask: TaskRequestHandler; - getTaskResult: TaskRequestHandler; -} -/** - * Task-specific execution configuration. - * taskSupport cannot be 'forbidden' for task-based tools. - * @experimental - */ -export type TaskToolExecution = Omit & { - taskSupport: TaskSupport extends 'forbidden' | undefined ? never : TaskSupport; -}; -/** - * Represents a message queued for side-channel delivery via tasks/result. - * - * This is a serializable data structure that can be stored in external systems. - * All fields are JSON-serializable. - */ -export type QueuedMessage = QueuedRequest | QueuedNotification | QueuedResponse | QueuedError; -export interface BaseQueuedMessage { - /** Type of message */ - type: string; - /** When the message was queued (milliseconds since epoch) */ - timestamp: number; -} -export interface QueuedRequest extends BaseQueuedMessage { - type: 'request'; - /** The actual JSONRPC request */ - message: JSONRPCRequest; -} -export interface QueuedNotification extends BaseQueuedMessage { - type: 'notification'; - /** The actual JSONRPC notification */ - message: JSONRPCNotification; -} -export interface QueuedResponse extends BaseQueuedMessage { - type: 'response'; - /** The actual JSONRPC response */ - message: JSONRPCResultResponse; -} -export interface QueuedError extends BaseQueuedMessage { - type: 'error'; - /** The actual JSONRPC error */ - message: JSONRPCErrorResponse; -} -/** - * Interface for managing per-task FIFO message queues. - * - * Similar to TaskStore, this allows pluggable queue implementations - * (in-memory, Redis, other distributed queues, etc.). - * - * Each method accepts taskId and optional sessionId parameters to enable - * a single queue instance to manage messages for multiple tasks, with - * isolation based on task ID and session ID. - * - * All methods are async to support external storage implementations. - * All data in QueuedMessage must be JSON-serializable. - * - * @experimental - */ -export interface TaskMessageQueue { - /** - * Adds a message to the end of the queue for a specific task. - * Atomically checks queue size and throws if maxSize would be exceeded. - * @param taskId The task identifier - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error - * @throws Error if maxSize is specified and would be exceeded - */ - enqueue(taskId: string, message: QueuedMessage, sessionId?: string, maxSize?: number): Promise; - /** - * Removes and returns the first message from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns The first message, or undefined if the queue is empty - */ - dequeue(taskId: string, sessionId?: string): Promise; - /** - * Removes and returns all messages from the queue for a specific task. - * Used when tasks are cancelled or failed to clean up pending messages. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns Array of all messages that were in the queue - */ - dequeueAll(taskId: string, sessionId?: string): Promise; -} -/** - * Task creation options. - * @experimental - */ -export interface CreateTaskOptions { - /** - * Time in milliseconds to keep task results available after completion. - * If null, the task has unlimited lifetime until manually cleaned up. - */ - ttl?: number | null; - /** - * Time in milliseconds to wait between task status requests. - */ - pollInterval?: number; - /** - * Additional context to pass to the task store. - */ - context?: Record; -} -/** - * Interface for storing and retrieving task state and results. - * - * Similar to Transport, this allows pluggable task storage implementations - * (in-memory, database, distributed cache, etc.). - * - * @experimental - */ -export interface TaskStore { - /** - * Creates a new task with the given creation parameters and original request. - * The implementation must generate a unique taskId and createdAt timestamp. - * - * TTL Management: - * - The implementation receives the TTL suggested by the requestor via taskParams.ttl - * - The implementation MAY override the requested TTL (e.g., to enforce limits) - * - The actual TTL used MUST be returned in the Task object - * - Null TTL indicates unlimited task lifetime (no automatic cleanup) - * - Cleanup SHOULD occur automatically after TTL expires, regardless of task status - * - * @param taskParams - The task creation parameters from the request (ttl, pollInterval) - * @param requestId - The JSON-RPC request ID - * @param request - The original request that triggered task creation - * @param sessionId - Optional session ID for binding the task to a specific session - * @returns The created task object - */ - createTask(taskParams: CreateTaskOptions, requestId: RequestId, request: Request, sessionId?: string): Promise; - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param sessionId - Optional session ID for binding the query to a specific session - * @returns The task object, or null if it does not exist - */ - getTask(taskId: string, sessionId?: string): Promise; - /** - * Stores the result of a task and sets its final status. - * - * @param taskId - The task identifier - * @param status - The final status: 'completed' for success, 'failed' for errors - * @param result - The result to store - * @param sessionId - Optional session ID for binding the operation to a specific session - */ - storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result, sessionId?: string): Promise; - /** - * Retrieves the stored result of a task. - * - * @param taskId - The task identifier - * @param sessionId - Optional session ID for binding the query to a specific session - * @returns The stored result - */ - getTaskResult(taskId: string, sessionId?: string): Promise; - /** - * Updates a task's status (e.g., to 'cancelled', 'failed', 'completed'). - * - * @param taskId - The task identifier - * @param status - The new status - * @param statusMessage - Optional diagnostic message for failed tasks or other status information - * @param sessionId - Optional session ID for binding the operation to a specific session - */ - updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string, sessionId?: string): Promise; - /** - * Lists tasks, optionally starting from a pagination cursor. - * - * @param cursor - Optional cursor for pagination - * @param sessionId - Optional session ID for binding the query to a specific session - * @returns An object containing the tasks array and an optional nextCursor - */ - listTasks(cursor?: string, sessionId?: string): Promise<{ - tasks: Task[]; - nextCursor?: string; - }>; -} -/** - * Checks if a task status represents a terminal state. - * Terminal states are those where the task has finished and will not change. - * - * @param status - The task status to check - * @returns True if the status is terminal (completed, failed, or cancelled) - * @experimental - */ -export declare function isTerminal(status: Task['status']): boolean; -//# sourceMappingURL=interfaces.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.d.ts.map deleted file mode 100644 index afd1d70..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,IAAI,EACJ,SAAS,EACT,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,OAAO,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAM5F;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC;IACzG,SAAS,EAAE,gBAAgB,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC;IACnG,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,gBAAgB,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CACxB,WAAW,SAAS,MAAM,EAC1B,MAAM,SAAS,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,EACrE,IAAI,SAAS,SAAS,GAAG,iBAAiB,GAAG,SAAS,GAAG,SAAS,IAClE,IAAI,SAAS,iBAAiB,GAC5B,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,GAAG,OAAO,CAAC,W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GAAG,OAAO,CAE1D"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js deleted file mode 100644 index d4949de..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Experimental task interfaces for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - */ -/** - * Checks if a task status represents a terminal state. - * Terminal states are those where the task has finished and will not change. - * - * @param status - The task status to check - * @returns True if the status is terminal (completed, failed, or cancelled) - * @experimental - */ -export function isTerminal(status) { - return status === 'completed' || status === 'failed' || status === 'cancelled'; -} -//# sourceMappingURL=interfaces.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js.map deleted file mode 100644 index c298990..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmRH;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,MAAsB;IAC7C,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,CAAC;AACnF,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.d.ts deleted file mode 100644 index b3244f9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Experimental McpServer task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import type { McpServer, RegisteredTool } from '../../server/mcp.js'; -import type { ZodRawShapeCompat, AnySchema } from '../../server/zod-compat.js'; -import type { ToolAnnotations } from '../../types.js'; -import type { ToolTaskHandler, TaskToolExecution } from './interfaces.js'; -/** - * Experimental task features for McpServer. - * - * Access via `server.experimental.tasks`: - * ```typescript - * server.experimental.tasks.registerToolTask('long-running', config, handler); - * ``` - * - * @experimental - */ -export declare class ExperimentalMcpServerTasks { - private readonly _mcpServer; - constructor(_mcpServer: McpServer); - /** - * Registers a task-based tool with a config object and handler. - * - * Task-based tools support long-running operations that can be polled for status - * and results. The handler must implement `createTask`, `getTask`, and `getTaskResult` - * methods. - * - * @example - * ```typescript - * server.experimental.tasks.registerToolTask('long-computation', { - * description: 'Performs a long computation', - * inputSchema: { input: z.string() }, - * execution: { taskSupport: 'required' } - * }, { - * createTask: async (args, extra) => { - * const task = await extra.taskStore.createTask({ ttl: 300000 }); - * startBackgroundWork(task.taskId, args); - * return { task }; - * }, - * getTask: async (args, extra) => { - * return extra.taskStore.getTask(extra.taskId); - * }, - * getTaskResult: async (args, extra) => { - * return extra.taskStore.getTaskResult(extra.taskId); - * } - * }); - * ``` - * - * @param name - The tool name - * @param config - Tool configuration (description, schemas, etc.) - * @param handler - Task handler with createTask, getTask, getTaskResult methods - * @returns RegisteredTool for managing the tool's lifecycle - * - * @experimental - */ - registerToolTask(name: string, config: { - title?: string; - description?: string; - outputSchema?: OutputArgs; - annotations?: ToolAnnotations; - execution?: TaskToolExecution; - _meta?: Record; - }, handler: ToolTaskHandler): RegisteredTool; - registerToolTask(name: string, config: { - title?: string; - description?: string; - inputSchema: InputArgs; - outputSchema?: OutputArgs; - annotations?: ToolAnnotations; - execution?: TaskToolExecution; - _meta?: Record; - }, handler: ToolTaskHandler): RegisteredTool; -} -//# sourceMappingURL=mcp-server.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.d.ts.map deleted file mode 100644 index 84ee9e0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/mcp-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAoB1E;;;;;;;;;GASG;AACH,qBAAa,0BAA0B;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,SAAS;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,gBAAgB,CAAC,UAAU,SAAS,SAAS,GAAG,iBAAiB,GAAG,SAAS,EACzE,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,UAAU,CAAC;QAC1B,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,SAAS,CAAC,EAAE,iBAAiB,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,EACD,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,GACpC,cAAc;IAEjB,gBAAgB,CAAC,SAAS,SAAS,iBAAiB,GAAG,SAAS,EAAE,UAAU,SAAS,SAAS,GAAG,iBAAiB,GAAG,SAAS,EAC1H,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,SAAS,CAAC;QACvB,YAAY,CAAC,EAAE,UAAU,CAAC;QAC1B,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,SAAS,CAAC,EAAE,iBAAiB,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,EACD,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,GACpC,cAAc;CAsCpB"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js deleted file mode 100644 index 39b9d10..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Experimental McpServer task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -/** - * Experimental task features for McpServer. - * - * Access via `server.experimental.tasks`: - * ```typescript - * server.experimental.tasks.registerToolTask('long-running', config, handler); - * ``` - * - * @experimental - */ -export class ExperimentalMcpServerTasks { - constructor(_mcpServer) { - this._mcpServer = _mcpServer; - } - registerToolTask(name, config, handler) { - // Validate that taskSupport is not 'forbidden' for task-based tools - const execution = { taskSupport: 'required', ...config.execution }; - if (execution.taskSupport === 'forbidden') { - throw new Error(`Cannot register task-based tool '${name}' with taskSupport 'forbidden'. Use registerTool() instead.`); - } - // Access McpServer's internal _createRegisteredTool method - const mcpServerInternal = this._mcpServer; - return mcpServerInternal._createRegisteredTool(name, config.title, config.description, config.inputSchema, config.outputSchema, config.annotations, execution, config._meta, handler); - } -} -//# sourceMappingURL=mcp-server.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js.map deleted file mode 100644 index c01a314..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/mcp-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH;;;;;;;;;GASG;AACH,MAAM,OAAO,0BAA0B;IACnC,YAA6B,UAAqB;QAArB,eAAU,GAAV,UAAU,CAAW;IAAG,CAAC;IAgEtD,gBAAgB,CAIZ,IAAY,EACZ,MAQC,EACD,OAAmC;QAEnC,oEAAoE;QACpE,MAAM,SAAS,GAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAClF,IAAI,SAAS,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,6DAA6D,CAAC,CAAC;QAC3H,CAAC;QAED,2DAA2D;QAC3D,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAA0C,CAAC;QAC1E,OAAO,iBAAiB,CAAC,qBAAqB,CAC1C,IAAI,EACJ,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,WAAW,EAClB,SAAS,EACT,MAAM,CAAC,KAAK,EACZ,OAAwD,CAC3D,CAAC;IACN,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.d.ts deleted file mode 100644 index 185e0ba..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Experimental server task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import type { Server } from '../../server/index.js'; -import type { RequestOptions } from '../../shared/protocol.js'; -import type { ResponseMessage } from '../../shared/responseMessage.js'; -import type { AnySchema, SchemaOutput } from '../../server/zod-compat.js'; -import type { ServerRequest, Notification, Request, Result, GetTaskResult, ListTasksResult, CancelTaskResult } from '../../types.js'; -/** - * Experimental task features for low-level MCP servers. - * - * Access via `server.experimental.tasks`: - * ```typescript - * const stream = server.experimental.tasks.requestStream(request, schema, options); - * ``` - * - * For high-level server usage with task-based tools, use `McpServer.experimental.tasks` instead. - * - * @experimental - */ -export declare class ExperimentalServerTasks { - private readonly _server; - constructor(_server: Server); - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to request processing, allowing you to - * observe intermediate task status updates for task-augmented requests. - * - * @param request - The request to send - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - requestStream(request: ServerRequest | RequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>; - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * @returns The task status - * - * @experimental - */ - getTask(taskId: string, options?: RequestOptions): Promise; - /** - * Retrieves the result of a completed task. - * - * @param taskId - The task identifier - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options - * @returns The task result - * - * @experimental - */ - getTaskResult(taskId: string, resultSchema?: T, options?: RequestOptions): Promise>; - /** - * Lists tasks with optional pagination. - * - * @param cursor - Optional pagination cursor - * @param options - Optional request options - * @returns List of tasks with optional next cursor - * - * @experimental - */ - listTasks(cursor?: string, options?: RequestOptions): Promise; - /** - * Cancels a running task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * - * @experimental - */ - cancelTask(taskId: string, options?: RequestOptions): Promise; -} -//# sourceMappingURL=server.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.d.ts.map deleted file mode 100644 index a168185..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAErI;;;;;;;;;;;GAWG;AACH,qBAAa,uBAAuB,CAChC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAClC,aAAa,SAAS,YAAY,GAAG,YAAY,EACjD,OAAO,SAAS,MAAM,GAAG,MAAM;IAEnB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC;IAE9E;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,CAAC,SAAS,SAAS,EAC7B,OAAO,EAAE,aAAa,GAAG,QAAQ,EACjC,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,EAAE,cAAc,GACzB,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAY/D;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAK/E;;;;;;;;;OASG;IACG,aAAa,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAY9H;;;;;;;;OAQG;IACG,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAQpF;;;;;;;OAOG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAOxF"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js deleted file mode 100644 index 3b429bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Experimental server task features for MCP SDK. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -/** - * Experimental task features for low-level MCP servers. - * - * Access via `server.experimental.tasks`: - * ```typescript - * const stream = server.experimental.tasks.requestStream(request, schema, options); - * ``` - * - * For high-level server usage with task-based tools, use `McpServer.experimental.tasks` instead. - * - * @experimental - */ -export class ExperimentalServerTasks { - constructor(_server) { - this._server = _server; - } - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * This method provides streaming access to request processing, allowing you to - * observe intermediate task status updates for task-augmented requests. - * - * @param request - The request to send - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options (timeout, signal, task creation params, etc.) - * @returns AsyncGenerator that yields ResponseMessage objects - * - * @experimental - */ - requestStream(request, resultSchema, options) { - return this._server.requestStream(request, resultSchema, options); - } - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * @returns The task status - * - * @experimental - */ - async getTask(taskId, options) { - return this._server.getTask({ taskId }, options); - } - /** - * Retrieves the result of a completed task. - * - * @param taskId - The task identifier - * @param resultSchema - Zod schema for validating the result - * @param options - Optional request options - * @returns The task result - * - * @experimental - */ - async getTaskResult(taskId, resultSchema, options) { - return this._server.getTaskResult({ taskId }, resultSchema, options); - } - /** - * Lists tasks with optional pagination. - * - * @param cursor - Optional pagination cursor - * @param options - Optional request options - * @returns List of tasks with optional next cursor - * - * @experimental - */ - async listTasks(cursor, options) { - return this._server.listTasks(cursor ? { cursor } : undefined, options); - } - /** - * Cancels a running task. - * - * @param taskId - The task identifier - * @param options - Optional request options - * - * @experimental - */ - async cancelTask(taskId, options) { - return this._server.cancelTask({ taskId }, options); - } -} -//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js.map deleted file mode 100644 index 4395efd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,uBAAuB;IAKhC,YAA6B,OAAiD;QAAjD,YAAO,GAAP,OAAO,CAA0C;IAAG,CAAC;IAElF;;;;;;;;;;;;;OAaG;IACH,aAAa,CACT,OAAiC,EACjC,YAAe,EACf,OAAwB;QAUxB,OAAQ,IAAI,CAAC,OAA8C,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAwB;QAElD,OAAQ,IAAI,CAAC,OAAwC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,aAAa,CAAsB,MAAc,EAAE,YAAgB,EAAE,OAAwB;QAC/F,OACI,IAAI,CAAC,OAOR,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,SAAS,CAAC,MAAe,EAAE,OAAwB;QACrD,OACI,IAAI,CAAC,OAGR,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,OAAwB;QACrD,OACI,IAAI,CAAC,OAGR,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.d.ts deleted file mode 100644 index d30795e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * In-memory implementations of TaskStore and TaskMessageQueue. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import { Task, RequestId, Result, Request } from '../../../types.js'; -import { TaskStore, TaskMessageQueue, QueuedMessage, CreateTaskOptions } from '../interfaces.js'; -/** - * A simple in-memory implementation of TaskStore for demonstration purposes. - * - * This implementation stores all tasks in memory and provides automatic cleanup - * based on the ttl duration specified in the task creation parameters. - * - * Note: This is not suitable for production use as all data is lost on restart. - * For production, consider implementing TaskStore with a database or distributed cache. - * - * @experimental - */ -export declare class InMemoryTaskStore implements TaskStore { - private tasks; - private cleanupTimers; - /** - * Generates a unique task ID. - * Uses 16 bytes of random data encoded as hex (32 characters). - */ - private generateTaskId; - createTask(taskParams: CreateTaskOptions, requestId: RequestId, request: Request, _sessionId?: string): Promise; - getTask(taskId: string, _sessionId?: string): Promise; - storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result, _sessionId?: string): Promise; - getTaskResult(taskId: string, _sessionId?: string): Promise; - updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string, _sessionId?: string): Promise; - listTasks(cursor?: string, _sessionId?: string): Promise<{ - tasks: Task[]; - nextCursor?: string; - }>; - /** - * Cleanup all timers (useful for testing or graceful shutdown) - */ - cleanup(): void; - /** - * Get all tasks (useful for debugging) - */ - getAllTasks(): Task[]; -} -/** - * A simple in-memory implementation of TaskMessageQueue for demonstration purposes. - * - * This implementation stores messages in memory, organized by task ID and optional session ID. - * Messages are stored in FIFO queues per task. - * - * Note: This is not suitable for production use in distributed systems. - * For production, consider implementing TaskMessageQueue with Redis or other distributed queues. - * - * @experimental - */ -export declare class InMemoryTaskMessageQueue implements TaskMessageQueue { - private queues; - /** - * Generates a queue key from taskId. - * SessionId is intentionally ignored because taskIds are globally unique - * and tasks need to be accessible across HTTP requests/sessions. - */ - private getQueueKey; - /** - * Gets or creates a queue for the given task and session. - */ - private getQueue; - /** - * Adds a message to the end of the queue for a specific task. - * Atomically checks queue size and throws if maxSize would be exceeded. - * @param taskId The task identifier - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error - * @throws Error if maxSize is specified and would be exceeded - */ - enqueue(taskId: string, message: QueuedMessage, sessionId?: string, maxSize?: number): Promise; - /** - * Removes and returns the first message from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns The first message, or undefined if the queue is empty - */ - dequeue(taskId: string, sessionId?: string): Promise; - /** - * Removes and returns all messages from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns Array of all messages that were in the queue - */ - dequeueAll(taskId: string, sessionId?: string): Promise; -} -//# sourceMappingURL=in-memory.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.d.ts.map deleted file mode 100644 index 1825e87..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"in-memory.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/tasks/stores/in-memory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAc,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAU7G;;;;;;;;;;GAUG;AACH,qBAAa,iBAAkB,YAAW,SAAS;IAC/C,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,aAAa,CAAoD;IAEzE;;;OAGG;IACH,OAAO,CAAC,cAAc;IAIhB,UAAU,CAAC,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CrH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAKlE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,EAAE,MAAM,EAAE,MAAM,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m/experimental/tasks/stores/in-memory.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.js deleted file mode 100644 index 6458ec5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.js +++ /dev/null @@ -1,246 +0,0 @@ -/** - * In-memory implementations of TaskStore and TaskMessageQueue. - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ -import { isTerminal } from '../interfaces.js'; -import { randomBytes } from 'node:crypto'; -/** - * A simple in-memory implementation of TaskStore for demonstration purposes. - * - * This implementation stores all tasks in memory and provides automatic cleanup - * based on the ttl duration specified in the task creation parameters. - * - * Note: This is not suitable for production use as all data is lost on restart. - * For production, consider implementing TaskStore with a database or distributed cache. - * - * @experimental - */ -export class InMemoryTaskStore { - constructor() { - this.tasks = new Map(); - this.cleanupTimers = new Map(); - } - /** - * Generates a unique task ID. - * Uses 16 bytes of random data encoded as hex (32 characters). - */ - generateTaskId() { - return randomBytes(16).toString('hex'); - } - async createTask(taskParams, requestId, request, _sessionId) { - // Generate a unique task ID - const taskId = this.generateTaskId(); - // Ensure uniqueness - if (this.tasks.has(taskId)) { - throw new Error(`Task with ID ${taskId} already exists`); - } - const actualTtl = taskParams.ttl ?? null; - // Create task with generated ID and timestamps - const createdAt = new Date().toISOString(); - const task = { - taskId, - status: 'working', - ttl: actualTtl, - createdAt, - lastUpdatedAt: createdAt, - pollInterval: taskParams.pollInterval ?? 1000 - }; - this.tasks.set(taskId, { - task, - request, - requestId - }); - // Schedule cleanup if ttl is specified - // Cleanup occurs regardless of task status - if (actualTtl) { - const timer = setTimeout(() => { - this.tasks.delete(taskId); - this.cleanupTimers.delete(taskId); - }, actualTtl); - this.cleanupTimers.set(taskId, timer); - } - return task; - } - async getTask(taskId, _sessionId) { - const stored = this.tasks.get(taskId); - return stored ? { ...stored.task } : null; - } - async storeTaskResult(taskId, status, result, _sessionId) { - const stored = this.tasks.get(taskId); - if (!stored) { - throw new Error(`Task with ID ${taskId} not found`); - } - // Don't allow storing results for tasks already in terminal state - if (isTerminal(stored.task.status)) { - throw new Error(`Cannot store result for task ${taskId} in terminal status '${stored.task.status}'. Task results can only be stored once.`); - } - stored.result = result; - stored.task.status = status; - stored.task.lastUpdatedAt = new Date().toISOString(); - // Reset cleanup timer to start from now (if ttl is set) - if (stored.task.ttl) { - const existingTimer = this.cleanupTimers.get(taskId); - if (existingTimer) { - clearTimeout(existingTimer); - } - const timer = setTimeout(() => { - this.tasks.delete(taskId); - this.cleanupTimers.delete(taskId); - }, stored.task.ttl); - this.cleanupTimers.set(taskId, timer); - } - } - async getTaskResult(taskId, _sessionId) { - const stored = this.tasks.get(taskId); - if (!stored) { - throw new Error(`Task with ID ${taskId} not found`); - } - if (!stored.result) { - throw new Error(`Task ${taskId} has no result stored`); - } - return stored.result; - } - async updateTaskStatus(taskId, status, statusMessage, _sessionId) { - const stored = this.tasks.get(taskId); - if (!stored) { - throw new Error(`Task with ID ${taskId} not found`); - } - // Don't allow transitions from terminal states - if (isTerminal(stored.task.status)) { - throw new Error(`Cannot update task ${taskId} from terminal status '${stored.task.status}' to '${status}'. Terminal states (completed, failed, cancelled) cannot transition to other states.`); - } - stored.task.status = status; - if (statusMessage) { - stored.task.statusMessage = statusMessage; - } - stored.task.lastUpdatedAt = new Date().toISOString(); - // If task is in a terminal state and has ttl, start cleanup timer - if (isTerminal(status) && stored.task.ttl) { - const existingTimer = this.cleanupTimers.get(taskId); - if (existingTimer) { - clearTimeout(existingTimer); - } - const timer = setTimeout(() => { - this.tasks.delete(taskId); - this.cleanupTimers.delete(taskId); - }, stored.task.ttl); - this.cleanupTimers.set(taskId, timer); - } - } - async listTasks(cursor, _sessionId) { - const PAGE_SIZE = 10; - const allTaskIds = Array.from(this.tasks.keys()); - let startIndex = 0; - if (cursor) { - const cursorIndex = allTaskIds.indexOf(cursor); - if (cursorIndex >= 0) { - startIndex = cursorIndex + 1; - } - else { - // Invalid cursor - throw error - throw new Error(`Invalid cursor: ${cursor}`); - } - } - const pageTaskIds = allTaskIds.slice(startIndex, startIndex + PAGE_SIZE); - const tasks = pageTaskIds.map(taskId => { - const stored = this.tasks.get(taskId); - return { ...stored.task }; - }); - const nextCursor = startIndex + PAGE_SIZE < allTaskIds.length ? pageTaskIds[pageTaskIds.length - 1] : undefined; - return { tasks, nextCursor }; - } - /** - * Cleanup all timers (useful for testing or graceful shutdown) - */ - cleanup() { - for (const timer of this.cleanupTimers.values()) { - clearTimeout(timer); - } - this.cleanupTimers.clear(); - this.tasks.clear(); - } - /** - * Get all tasks (useful for debugging) - */ - getAllTasks() { - return Array.from(this.tasks.values()).map(stored => ({ ...stored.task })); - } -} -/** - * A simple in-memory implementation of TaskMessageQueue for demonstration purposes. - * - * This implementation stores messages in memory, organized by task ID and optional session ID. - * Messages are stored in FIFO queues per task. - * - * Note: This is not suitable for production use in distributed systems. - * For production, consider implementing TaskMessageQueue with Redis or other distributed queues. - * - * @experimental - */ -export class InMemoryTaskMessageQueue { - constructor() { - this.queues = new Map(); - } - /** - * Generates a queue key from taskId. - * SessionId is intentionally ignored because taskIds are globally unique - * and tasks need to be accessible across HTTP requests/sessions. - */ - getQueueKey(taskId, _sessionId) { - return taskId; - } - /** - * Gets or creates a queue for the given task and session. - */ - getQueue(taskId, sessionId) { - const key = this.getQueueKey(taskId, sessionId); - let queue = this.queues.get(key); - if (!queue) { - queue = []; - this.queues.set(key, queue); - } - return queue; - } - /** - * Adds a message to the end of the queue for a specific task. - * Atomically checks queue size and throws if maxSize would be exceeded. - * @param taskId The task identifier - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error - * @throws Error if maxSize is specified and would be exceeded - */ - async enqueue(taskId, message, sessionId, maxSize) { - const queue = this.getQueue(taskId, sessionId); - // Atomically check size and enqueue - if (maxSize !== undefined && queue.length >= maxSize) { - throw new Error(`Task message queue overflow: queue size (${queue.length}) exceeds maximum (${maxSize})`); - } - queue.push(message); - } - /** - * Removes and returns the first message from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns The first message, or undefined if the queue is empty - */ - async dequeue(taskId, sessionId) { - const queue = this.getQueue(taskId, sessionId); - return queue.shift(); - } - /** - * Removes and returns all messages from the queue for a specific task. - * @param taskId The task identifier - * @param sessionId Optional session ID for binding the query to a specific session - * @returns Array of all messages that were in the queue - */ - async dequeueAll(taskId, sessionId) { - const key = this.getQueueKey(taskId, sessionId); - const queue = this.queues.get(key) ?? []; - this.queues.delete(key); - return queue; - } -} -//# sourceMappingURL=in-memory.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.js.map deleted file mode 100644 index 12d7545..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"in-memory.js","sourceRoot":"","sources":["../../../../../src/experimental/tasks/stores/in-memory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAa,UAAU,EAAsD,MAAM,kBAAkB,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS1C;;;;;;;;;;GAUG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QACY,UAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;QACtC,kBAAa,GAAG,IAAI,GAAG,EAAyC,CAAC;IAsL7E,CAAC;IApLG;;;OAGG;IACK,cAAc;QAClB,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,UAA6B,EAAE,SAAoB,EAAE,OAAgB,EAAE,UAAmB;QACvG,4BAA4B;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAA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M,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAsB,EAAE,SAAkB,EAAE,OAAgB;QACtF,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAE/C,oCAAoC;QACpC,IAAI,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,IAAI,OAAO,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CAAC,4CAA4C,KAAK,CAAC,MAAM,sBAAsB,OAAO,GAAG,CAAC,CAAC;QAC9G,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,SAAkB;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC/C,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,SAAkB;QAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACxB,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.d.ts deleted file mode 100644 index 6022e19..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Re-exports of task-related types from the MCP protocol spec. - * WARNING: These APIs are experimental and may change without notice. - * - * These types are defined in types.ts (matching the protocol spec) and - * re-exported here for convenience when working with experimental task features. - */ -export { TaskCreationParamsSchema, RelatedTaskMetadataSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema } from '../../types.js'; -export type { Task, TaskCreationParams, RelatedTaskMetadata, CreateTaskResult, TaskStatusNotificationParams, TaskStatusNotification, GetTaskRequest, GetTaskResult, GetTaskPayloadRequest, ListTasksRequest, ListTasksResult, CancelTaskRequest, CancelTaskResult } from '../../types.js'; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.d.ts.map deleted file mode 100644 index f7b9ead..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACH,wBAAwB,EACxB,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,kCAAkC,EAClC,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC9B,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACR,IAAI,EACJ,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACnB,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.js deleted file mode 100644 index 2162c09..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Re-exports of task-related types from the MCP protocol spec. - * WARNING: These APIs are experimental and may change without notice. - * - * These types are defined in types.ts (matching the protocol spec) and - * re-exported here for convenience when working with experimental task features. - */ -// Task schemas (Zod) -export { TaskCreationParamsSchema, RelatedTaskMetadataSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema } from '../../types.js'; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.js.map deleted file mode 100644 index f52e75e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qBAAqB;AACrB,OAAO,EACH,wBAAwB,EACxB,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,kCAAkC,EAClC,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC9B,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.d.ts deleted file mode 100644 index 32a931a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Transport } from './shared/transport.js'; -import { JSONRPCMessage, RequestId } from './types.js'; -import { AuthInfo } from './server/auth/types.js'; -/** - * In-memory transport for creating clients and servers that talk to each other within the same process. - */ -export declare class InMemoryTransport implements Transport { - private _otherTransport?; - private _messageQueue; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage, extra?: { - authInfo?: AuthInfo; - }) => void; - sessionId?: string; - /** - * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. - */ - static createLinkedPair(): [InMemoryTransport, InMemoryTransport]; - start(): Promise; - close(): Promise; - /** - * Sends a message with optional auth info. - * This is useful for testing authentication scenarios. - */ - send(message: JSONRPCMessage, options?: { - relatedRequestId?: RequestId; - authInfo?: AuthInfo; - }): Promise; -} -//# sourceMappingURL=inMemory.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.d.ts.map deleted file mode 100644 index 46bc74b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemory.d.ts","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOlD;;GAEG;AACH,qBAAa,iBAAkB,YAAW,SAAS;IAC/C,OAAO,CAAC,eAAe,CAAC,CAAoB;IAC5C,OAAO,CAAC,aAAa,CAAuB;IAE5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAQ3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAWtH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js deleted file mode 100644 index 62d86a2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * In-memory transport for creating clients and servers that talk to each other within the same process. - */ -export class InMemoryTransport { - constructor() { - this._messageQueue = []; - } - /** - * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. - */ - static createLinkedPair() { - const clientTransport = new InMemoryTransport(); - const serverTransport = new InMemoryTransport(); - clientTransport._otherTransport = serverTransport; - serverTransport._otherTransport = clientTransport; - return [clientTransport, serverTransport]; - } - async start() { - // Process any messages that were queued before start was called - while (this._messageQueue.length > 0) { - const queuedMessage = this._messageQueue.shift(); - this.onmessage?.(queuedMessage.message, queuedMessage.extra); - } - } - async close() { - const other = this._otherTransport; - this._otherTransport = undefined; - await other?.close(); - this.onclose?.(); - } - /** - * Sends a message with optional auth info. - * This is useful for testing authentication scenarios. - */ - async send(message, options) { - if (!this._otherTransport) { - throw new Error('Not connected'); - } - if (this._otherTransport.onmessage) { - this._otherTransport.onmessage(message, { authInfo: options?.authInfo }); - } - else { - this._otherTransport._messageQueue.push({ message, extra: { authInfo: options?.authInfo } }); - } - } -} -//# sourceMappingURL=inMemory.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js.map deleted file mode 100644 index 60ededd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemory.js","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QAEY,kBAAa,GAAoB,EAAE,CAAC;IAgDhD,CAAC;IAzCG;;OAEG;IACH,MAAM,CAAC,gBAAgB;QACnB,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,KAAK;QACP,gEAAgE;QAChE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAG,CAAC;YAClD,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QACjE,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACP,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,MAAM,KAAK,EAAE,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuB,EAAE,OAA+D;QAC/F,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7E,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACjG,CAAC;IACL,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/package.json b/node_modules/@modelcontextprotocol/sdk/dist/esm/package.json deleted file mode 100644 index 6990891..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type": "module"} diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.d.ts deleted file mode 100644 index be6899a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { OAuthClientInformationFull } from '../../shared/auth.js'; -/** - * Stores information about registered OAuth clients for this server. - */ -export interface OAuthRegisteredClientsStore { - /** - * Returns information about a registered client, based on its ID. - */ - getClient(clientId: string): OAuthClientInformationFull | undefined | Promise; - /** - * Registers a new client with the server. The client ID and secret will be automatically generated by the library. A modified version of the client information can be returned to reflect specific values enforced by the server. - * - * NOTE: Implementations should NOT delete expired client secrets in-place. Auth middleware provided by this library will automatically check the `client_secret_expires_at` field and reject requests with expired secrets. Any custom logic for authenticating clients should check the `client_secret_expires_at` field as well. - * - * If unimplemented, dynamic client registration is unsupported. - */ - registerClient?(client: Omit): OAuthClientInformationFull | Promise; -} -//# sourceMappingURL=clients.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.d.ts.map deleted file mode 100644 index ab3851d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;IAEtH;;;;;;OAMG;IACH,cAAc,CAAC,CACX,MAAM,EAAE,IAAI,CAAC,0BAA0B,EAAE,WAAW,GAAG,qBAAqB,CAAC,GAC9E,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACvE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.js deleted file mode 100644 index 6181a57..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=clients.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.js.map deleted file mode 100644 index 0210104..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.d.ts deleted file mode 100644 index 7fddf95..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.d.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { OAuthErrorResponse } from '../../shared/auth.js'; -/** - * Base class for all OAuth errors - */ -export declare class OAuthError extends Error { - readonly errorUri?: string | undefined; - static errorCode: string; - constructor(message: string, errorUri?: string | undefined); - /** - * Converts the error to a standard OAuth error response object - */ - toResponseObject(): OAuthErrorResponse; - get errorCode(): string; -} -/** - * Invalid request error - The request is missing a required parameter, - * includes an invalid parameter value, includes a parameter more than once, - * or is otherwise malformed. - */ -export declare class InvalidRequestError extends OAuthError { - static errorCode: string; -} -/** - * Invalid client error - Client authentication failed (e.g., unknown client, no client - * authentication included, or unsupported authentication method). - */ -export declare class InvalidClientError extends OAuthError { - static errorCode: string; -} -/** - * Invalid grant error - The provided authorization grant or refresh token is - * invalid, expired, revoked, does not match the redirection URI used in the - * authorization request, or was issued to another client. - */ -export declare class InvalidGrantError extends OAuthError { - static errorCode: string; -} -/** - * Unauthorized client error - The authenticated client is not authorized to use - * this authorization grant type. - */ -export declare class UnauthorizedClientError extends OAuthError { - static errorCode: string; -} -/** - * Unsupported grant type error - The authorization grant type is not supported - * by the authorization server. - */ -export declare class UnsupportedGrantTypeError extends OAuthError { - static errorCode: string; -} -/** - * Invalid scope error - The requested scope is invalid, unknown, malformed, or - * exceeds the scope granted by the resource owner. - */ -export declare class InvalidScopeError extends OAuthError { - static errorCode: string; -} -/** - * Access denied error - The resource owner or authorization server denied the request. - */ -export declare class AccessDeniedError extends OAuthError { - static errorCode: string; -} -/** - * Server error - The authorization server encountered an unexpected condition - * that prevented it from fulfilling the request. - */ -export declare class ServerError extends OAuthError { - static errorCode: string; -} -/** - * Temporarily unavailable error - The authorization server is currently unable to - * handle the request due to a temporary overloading or maintenance of the server. - */ -export declare class TemporarilyUnavailableError extends OAuthError { - static errorCode: string; -} -/** - * Unsupported response type error - The authorization server does not support - * obtaining an authorization code using this method. - */ -export declare class UnsupportedResponseTypeError extends OAuthError { - static errorCode: string; -} -/** - * Unsupported token type error - The authorization server does not support - * the requested token type. - */ -export declare class UnsupportedTokenTypeError extends OAuthError { - static errorCode: string; -} -/** - * Invalid token error - The access token provided is expired, revoked, malformed, - * or invalid for other reasons. - */ -export declare class InvalidTokenError extends OAuthError { - static errorCode: string; -} -/** - * Method not allowed error - The HTTP method used is not allowed for this endpoint. - * (Custom, non-standard error) - */ -export declare class MethodNotAllowedError extends OAuthError { - static errorCode: string; -} -/** - * Too many requests error - Rate limit exceeded. - * (Custom, non-standard error based on RFC 6585) - */ -export declare class TooManyRequestsError extends OAuthError { - static errorCode: string; -} -/** - * Invalid client metadata error - The client metadata is invalid. - * (Custom error for dynamic client registration - RFC 7591) - */ -export declare class InvalidClientMetadataError extends OAuthError { - static errorCode: string; -} -/** - * Insufficient scope error - The request requires higher privileges than provided by the access token. - */ -export declare class InsufficientScopeError extends OAuthError { - static errorCode: string; -} -/** - * Invalid target error - The requested resource is invalid, missing, unknown, or malformed. - * (Custom error for resource indicators - RFC 8707) - */ -export declare class InvalidTargetError extends OAuthError { - static errorCode: string; -} -/** - * A utility class for defining one-off error codes - */ -export declare class CustomOAuthError extends OAuthError { - private readonly customErrorCode; - constructor(customErrorCode: string, message: string, errorUri?: string); - get errorCode(): string; -} -/** - * A full list of all OAuthErrors, enabling parsing from error responses - */ -export declare const OAUTH_ERRORS: { - readonly [x: string]: typeof InvalidRequestError; -}; -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.d.ts.map deleted file mode 100644 index 5c0e992..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAKb,QAAQ,CAAC,EAAE,MAAM;IAJrC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC;gBAGrB,OAAO,EAAE,MAAM,EACC,QAAQ,CAAC,EAAE,MAAM,YAAA;IAMrC;;OAEG;IACH,gBAAgB,IAAI,kBAAkB;IAatC,IAAI,SAAS,IAAI,MAAM,CAEtB;CACJ;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;IAC/C,MAAM,CAAC,SAAS,SAAqB;CACxC;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;IAC9C,MAAM,CAAC,SAAS,SAAoB;CACvC;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;IAC7C,MAAM,CAAC,SAAS,SAAmB;CACtC;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,UAAU;IACnD,MAAM,CAAC,SAAS,SAAyB;CAC5C;AAED;;;GA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Q,CAAC,EAAE,MAAM;IAKrB,IAAI,SAAS,IAAI,MAAM,CAEtB;CACJ;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;;CAkBf,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js deleted file mode 100644 index 7106ab9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Base class for all OAuth errors - */ -export class OAuthError extends Error { - constructor(message, errorUri) { - super(message); - this.errorUri = errorUri; - this.name = this.constructor.name; - } - /** - * Converts the error to a standard OAuth error response object - */ - toResponseObject() { - const response = { - error: this.errorCode, - error_description: this.message - }; - if (this.errorUri) { - response.error_uri = this.errorUri; - } - return response; - } - get errorCode() { - return this.constructor.errorCode; - } -} -/** - * Invalid request error - The request is missing a required parameter, - * includes an invalid parameter value, includes a parameter more than once, - * or is otherwise malformed. - */ -export class InvalidRequestError extends OAuthError { -} -InvalidRequestError.errorCode = 'invalid_request'; -/** - * Invalid client error - Client authentication failed (e.g., unknown client, no client - * authentication included, or unsupported authentication method). - */ -export class InvalidClientError extends OAuthError { -} -InvalidClientError.errorCode = 'invalid_client'; -/** - * Invalid grant error - The provided authorization grant or refresh token is - * invalid, expired, revoked, does not match the redirection URI used in the - * authorization request, or was issued to another client. - */ -export class InvalidGrantError extends OAuthError { -} -InvalidGrantError.errorCode = 'invalid_grant'; -/** - * Unauthorized client error - The authenticated client is not authorized to use - * this authorization grant type. - */ -export class UnauthorizedClientError extends OAuthError { -} -UnauthorizedClientError.errorCode = 'unauthorized_client'; -/** - * Unsupported grant type error - The authorization grant type is not supported - * by the authorization server. - */ -export class UnsupportedGrantTypeError extends OAuthError { -} -UnsupportedGrantTypeError.errorCode = 'unsupported_grant_type'; -/** - * Invalid scope error - The requested scope is invalid, unknown, malformed, or - * exceeds the scope granted by the resource owner. - */ -export class InvalidScopeError extends OAuthError { -} -InvalidScopeError.errorCode = 'invalid_scope'; -/** - * Access denied error - The resource owner or authorization server denied the request. - */ -export class AccessDeniedError extends OAuthError { -} -AccessDeniedError.errorCode = 'access_denied'; -/** - * Server error - The authorization server encountered an unexpected condition - * that prevented it from fulfilling the request. - */ -export class ServerError extends OAuthError { -} -ServerError.errorCode = 'server_error'; -/** - * Temporarily unavailable error - The authorization server is currently unable to - * handle the request due to a temporary overloading or maintenance of the server. - */ -export class TemporarilyUnavailableError extends OAuthError { -} -TemporarilyUnavailableError.errorCode = 'temporarily_unavailable'; -/** - * Unsupported response type error - The authorization server does not support - * obtaining an authorization code using this method. - */ -export class UnsupportedResponseTypeError extends OAuthError { -} -UnsupportedResponseTypeError.errorCode = 'unsupported_response_type'; -/** - * Unsupported token type error - The authorization server does not support - * the requested token type. - */ -export class UnsupportedTokenTypeError extends OAuthError { -} -UnsupportedTokenTypeError.errorCode = 'unsupported_token_type'; -/** - * Invalid token error - The access token provided is expired, revoked, malformed, - * or invalid for other reasons. - */ -export class InvalidTokenError extends OAuthError { -} -InvalidTokenError.errorCode = 'invalid_token'; -/** - * Method not allowed error - The HTTP method used is not allowed for this endpoint. - * (Custom, non-standard error) - */ -export class MethodNotAllowedError extends OAuthError { -} -MethodNotAllowedError.errorCode = 'method_not_allowed'; -/** - * Too many requests error - Rate limit exceeded. - * (Custom, non-standard error based on RFC 6585) - */ -export class TooManyRequestsError extends OAuthError { -} -TooManyRequestsError.errorCode = 'too_many_requests'; -/** - * Invalid client metadata error - The client metadata is invalid. - * (Custom error for dynamic client registration - RFC 7591) - */ -export class InvalidClientMetadataError extends OAuthError { -} -InvalidClientMetadataError.errorCode = 'invalid_client_metadata'; -/** - * Insufficient scope error - The request requires higher privileges than provided by the access token. - */ -export class InsufficientScopeError extends OAuthError { -} -InsufficientScopeError.errorCode = 'insufficient_scope'; -/** - * Invalid target error - The requested resource is invalid, missing, unknown, or malformed. - * (Custom error for resource indicators - RFC 8707) - */ -export class InvalidTargetError extends OAuthError { -} -InvalidTargetError.errorCode = 'invalid_target'; -/** - * A utility class for defining one-off error codes - */ -export class CustomOAuthError extends OAuthError { - constructor(customErrorCode, message, errorUri) { - super(message, errorUri); - this.customErrorCode = customErrorCode; - } - get errorCode() { - return this.customErrorCode; - } -} -/** - * A full list of all OAuthErrors, enabling parsing from error responses - */ -export const OAUTH_ERRORS = { - [InvalidRequestError.errorCode]: InvalidRequestError, - [InvalidClientError.errorCode]: InvalidClientError, - [InvalidGrantError.errorCode]: InvalidGrantError, - [UnauthorizedClientError.errorCode]: UnauthorizedClientError, - [UnsupportedGrantTypeError.errorCode]: UnsupportedGrantTypeError, - [InvalidScopeError.errorCode]: InvalidScopeError, - [AccessDeniedError.errorCode]: AccessDeniedError, - [ServerError.errorCode]: ServerError, - [TemporarilyUnavailableError.errorCode]: TemporarilyUnavailableError, - [UnsupportedResponseTypeError.errorCode]: UnsupportedResponseTypeError, - [UnsupportedTokenTypeError.errorCode]: UnsupportedTokenTypeError, - [InvalidTokenError.errorCode]: InvalidTokenError, - [MethodNotAllowedError.errorCode]: MethodNotAllowedError, - [TooManyRequestsError.errorCode]: TooManyRequestsError, - [InvalidClientMetadataError.errorCode]: InvalidClientMetadataError, - [InsufficientScopeError.errorCode]: InsufficientScopeError, - [InvalidTargetError.errorCode]: InvalidTargetError -}; -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js.map deleted file mode 100644 index 1461367..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IAGjC,YACI,OAAe,EACC,QAAiB;QAEjC,KAAK,CAA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AAE,iBAAiB;IAChD,CAAC,uBAAuB,CAAC,SAAS,CAAC,EAAE,uBAAuB;IAC5D,CAAC,yBAAyB,CAAC,SAAS,CAAC,EAAE,yBAAyB;IAChE,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,iBAAiB;IAChD,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,iBAAiB;IAChD,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,2BAA2B,CAAC,SAAS,CAAC,EAAE,2BAA2B;IACpE,CAAC,4BAA4B,CAAC,SAAS,CAAC,EAAE,4BAA4B;IACtE,CAAC,yBAAyB,CAAC,SAAS,CAAC,EAAE,yBAAyB;IAChE,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,iBAAiB;IAChD,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,qBAAqB;IACxD,CAAC,oBAAoB,CAAC,SAAS,CAAC,EAAE,oBAAoB;IACtD,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,0BAA0B;IAClE,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,sBAAsB;IAC1D,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE,kBAAkB;CAC5C,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.d.ts deleted file mode 100644 index 38e9829..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthServerProvider } from '../provider.js'; -import { Options as RateLimitOptions } from 'express-rate-limit'; -export type AuthorizationHandlerOptions = { - provider: OAuthServerProvider; - /** - * Rate limiting configuration for the authorization endpoint. - * Set to false to disable rate limiting for this endpoint. - */ - rateLimit?: Partial | false; -}; -export declare function authorizationHandler({ provider, rateLimit: rateLimitConfig }: AuthorizationHandlerOptions): RequestHandler; -//# sourceMappingURL=authorize.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.d.ts.map deleted file mode 100644 index b067988..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,2BAA2B,GAAG;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAqBF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAgH1H"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.js deleted file mode 100644 index e29f094..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.js +++ /dev/null @@ -1,138 +0,0 @@ -import * as z from 'zod/v4'; -import express from 'express'; -import { rateLimit } from 'express-rate-limit'; -import { allowedMethods } from '../middleware/allowedMethods.js'; -import { InvalidRequestError, InvalidClientError, ServerError, TooManyRequestsError, OAuthError } from '../errors.js'; -// Parameters that must be validated in order to issue redirects. -const ClientAuthorizationParamsSchema = z.object({ - client_id: z.string(), - redirect_uri: z - .string() - .optional() - .refine(value => value === undefined || URL.canParse(value), { message: 'redirect_uri must be a valid URL' }) -}); -// Parameters that must be validated for a successful authorization request. Failure can be reported to the redirect URI. -const RequestAuthorizationParamsSchema = z.object({ - response_type: z.literal('code'), - code_challenge: z.string(), - code_challenge_method: z.literal('S256'), - scope: z.string().optional(), - state: z.string().optional(), - resource: z.string().url().optional() -}); -export function authorizationHandler({ provider, rateLimit: rateLimitConfig }) { - // Create a router to apply middleware - const router = express.Router(); - router.use(allowedMethods(['GET', 'POST'])); - router.use(express.urlencoded({ extended: false })); - // Apply rate limiting unless explicitly disabled - if (rateLimitConfig !== false) { - router.use(rateLimit({ - windowMs: 15 * 60 * 1000, // 15 minutes - max: 100, // 100 requests per windowMs - standardHeaders: true, - legacyHeaders: false, - message: new TooManyRequestsError('You have exceeded the rate limit for authorization requests').toResponseObject(), - ...rateLimitConfig - })); - } - router.all('/', async (req, res) => { - res.setHeader('Cache-Control', 'no-store'); - // In the authorization flow, errors are split into two categories: - // 1. Pre-redirect errors (direct response with 400) - // 2. Post-redirect errors (redirect with error parameters) - // Phase 1: Validate client_id and redirect_uri. Any errors here must be direct responses. - let client_id, redirect_uri, client; - try { - const result = ClientAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query); - if (!result.success) { - throw new InvalidRequestError(result.error.message); - } - client_id = result.data.client_id; - redirect_uri = result.data.redirect_uri; - client = await provider.clientsStore.getClient(client_id); - if (!client) { - throw new InvalidClientError('Invalid client_id'); - } - if (redirect_uri !== undefined) { - if (!client.redirect_uris.includes(redirect_uri)) { - throw new InvalidRequestError('Unregistered redirect_uri'); - } - } - else if (client.redirect_uris.length === 1) { - redirect_uri = client.redirect_uris[0]; - } - else { - throw new InvalidRequestError('redirect_uri must be specified when client has multiple registered URIs'); - } - } - catch (error) { - // Pre-redirect errors - return direct response - // - // These don't need to be JSON encoded, as they'll be displayed in a user - // agent, but OTOH they all represent exceptional situations (arguably, - // "programmer error"), so presenting a nice HTML page doesn't help the - // user anyway. - if (error instanceof OAuthError) { - const status = error instanceof ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - return; - } - // Phase 2: Validate other parameters. Any errors here should go into redirect responses. - let state; - try { - // Parse and validate authorization parameters - const parseResult = RequestAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query); - if (!parseResult.success) { - throw new InvalidRequestError(parseResult.error.message); - } - const { scope, code_challenge, resource } = parseResult.data; - state = parseResult.data.state; - // Validate scopes - let requestedScopes = []; - if (scope !== undefined) { - requestedScopes = scope.split(' '); - } - // All validation passed, proceed with authorization - await provider.authorize(client, { - state, - scopes: requestedScopes, - redirectUri: redirect_uri, - codeChallenge: code_challenge, - resource: resource ? new URL(resource) : undefined - }, res); - } - catch (error) { - // Post-redirect errors - redirect with error parameters - if (error instanceof OAuthError) { - res.redirect(302, createErrorRedirect(redirect_uri, error, state)); - } - else { - const serverError = new ServerError('Internal Server Error'); - res.redirect(302, createErrorRedirect(redirect_uri, serverError, state)); - } - } - }); - return router; -} -/** - * Helper function to create redirect URL with error parameters - */ -function createErrorRedirect(redirectUri, error, state) { - const errorUrl = new URL(redirectUri); - errorUrl.searchParams.set('error', error.errorCode); - errorUrl.searchParams.set('error_description', error.message); - if (error.errorUri) { - errorUrl.searchParams.set('error_uri', error.errorUri); - } - if (state) { - errorUrl.searchParams.set('state', state); - } - return errorUrl.href; -} -//# sourceMappingURL=authorize.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.js.map deleted file mode 100644 index 6911f9a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorize.js","sourceRoot":"","sources":["../../../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AC,CAAC;gBAC7D,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,mBAAmB,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;YAC7E,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAAC,WAAmB,EAAE,KAAiB,EAAE,KAAc;IAC/E,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACpD,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACR,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.d.ts deleted file mode 100644 index 4d03286..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthMetadata, OAuthProtectedResourceMetadata } from '../../../shared/auth.js'; -export declare function metadataHandler(metadata: OAuthMetadata | OAuthProtectedResourceMetadata): RequestHandler; -//# sourceMappingURL=metadata.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.d.ts.map deleted file mode 100644 index 55e3a50..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAIxF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,8BAA8B,GAAG,cAAc,CAaxG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.js deleted file mode 100644 index 94dadb7..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.js +++ /dev/null @@ -1,15 +0,0 @@ -import express from 'express'; -import cors from 'cors'; -import { allowedMethods } from '../middleware/allowedMethods.js'; -export function metadataHandler(metadata) { - // Nested router so we can configure middleware and restrict HTTP method - const router = express.Router(); - // Configure CORS to allow any origin, to make accessible to web-based MCP clients - router.use(cors()); - router.use(allowedMethods(['GET', 'OPTIONS'])); - router.get('/', (req, res) => { - res.status(200).json(metadata); - }); - return router; -} -//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.js.map deleted file mode 100644 index 625ed94..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,OAA2B,MAAM,SAAS,CAAC;AAElD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,UAAU,eAAe,CAAC,QAAwD;IACpF,wEAAwE;IACxE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACzB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.d.ts deleted file mode 100644 index e9add28..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthRegisteredClientsStore } from '../clients.js'; -import { Options as RateLimitOptions } from 'express-rate-limit'; -export type ClientRegistrationHandlerOptions = { - /** - * A store used to save information about dynamically registered OAuth clients. - */ - clientsStore: OAuthRegisteredClientsStore; - /** - * The number of seconds after which to expire issued client secrets, or 0 to prevent expiration of client secrets (not recommended). - * - * If not set, defaults to 30 days. - */ - clientSecretExpirySeconds?: number; - /** - * Rate limiting configuration for the client registration endpoint. - * Set to false to disable rate limiting for this endpoint. - * Registration endpoints are particularly sensitive to abuse and should be rate limited. - */ - rateLimit?: Partial | false; - /** - * Whether to generate a client ID before calling the client registration endpoint. - * - * If not set, defaults to true. - */ - clientIdGeneration?: boolean; -}; -export declare function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds, rateLimit: rateLimitConfig, clientIdGeneration }: ClientRegistrationHandlerOptions): RequestHandler; -//# sourceMappingURL=register.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.d.ts.map deleted file mode 100644 index a38ebdb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,gCAAgC,GAAG;IAC3C;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;IAE1C;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;IAE9C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAIF,wBAAgB,yBAAyB,CAAC,EACtC,YAAY,EACZ,yBAAgE,EAChE,SAAS,EAAE,eAAe,EAC1B,kBAAyB,EAC5B,EAAE,gCAAgC,GAAG,cAAc,CA0EnD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.js deleted file mode 100644 index ef6c44d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.js +++ /dev/null @@ -1,71 +0,0 @@ -import express from 'express'; -import { OAuthClientMetadataSchema } from '../../../shared/auth.js'; -import crypto from 'node:crypto'; -import cors from 'cors'; -import { rateLimit } from 'express-rate-limit'; -import { allowedMethods } from '../middleware/allowedMethods.js'; -import { InvalidClientMetadataError, ServerError, TooManyRequestsError, OAuthError } from '../errors.js'; -const DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS = 30 * 24 * 60 * 60; // 30 days -export function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS, rateLimit: rateLimitConfig, clientIdGeneration = true }) { - if (!clientsStore.registerClient) { - throw new Error('Client registration store does not support registering clients'); - } - // Nested router so we can configure middleware and restrict HTTP method - const router = express.Router(); - // Configure CORS to allow any origin, to make accessible to web-based MCP clients - router.use(cors()); - router.use(allowedMethods(['POST'])); - router.use(express.json()); - // Apply rate limiting unless explicitly disabled - stricter limits for registration - if (rateLimitConfig !== false) { - router.use(rateLimit({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 20, // 20 requests per hour - stricter as registration is sensitive - standardHeaders: true, - legacyHeaders: false, - message: new TooManyRequestsError('You have exceeded the rate limit for client registration requests').toResponseObject(), - ...rateLimitConfig - })); - } - router.post('/', async (req, res) => { - res.setHeader('Cache-Control', 'no-store'); - try { - const parseResult = OAuthClientMetadataSchema.safeParse(req.body); - if (!parseResult.success) { - throw new InvalidClientMetadataError(parseResult.error.message); - } - const clientMetadata = parseResult.data; - const isPublicClient = clientMetadata.token_endpoint_auth_method === 'none'; - // Generate client credentials - const clientSecret = isPublicClient ? undefined : crypto.randomBytes(32).toString('hex'); - const clientIdIssuedAt = Math.floor(Date.now() / 1000); - // Calculate client secret expiry time - const clientsDoExpire = clientSecretExpirySeconds > 0; - const secretExpiryTime = clientsDoExpire ? clientIdIssuedAt + clientSecretExpirySeconds : 0; - const clientSecretExpiresAt = isPublicClient ? undefined : secretExpiryTime; - let clientInfo = { - ...clientMetadata, - client_secret: clientSecret, - client_secret_expires_at: clientSecretExpiresAt - }; - if (clientIdGeneration) { - clientInfo.client_id = crypto.randomUUID(); - clientInfo.client_id_issued_at = clientIdIssuedAt; - } - clientInfo = await clientsStore.registerClient(clientInfo); - res.status(201).json(clientInfo); - } - catch (error) { - if (error instanceof OAuthError) { - const status = error instanceof ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }); - return router; -} -//# sourceMappingURL=register.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.js.map deleted file mode 100644 index 3f4c082..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":"AAAA,OAAO,OAA2B,MAAM,SAAS,CAAC;AAClD,OAAO,EAA8B,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,SAAS,EAA+B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8BzG,MAAM,oCAAoC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;AAE1E,MAAM,UAAU,yBAAyB,CAAC,EACtC,YAAY,EACZ,yBAAy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MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.d.ts deleted file mode 100644 index 2be32bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { OAuthServerProvider } from '../provider.js'; -import { RequestHandler } from 'express'; -import { Options as RateLimitOptions } from 'express-rate-limit'; -export type RevocationHandlerOptions = { - provider: OAuthServerProvider; - /** - * Rate limiting configuration for the token revocation endpoint. - * Set to false to disable rate limiting for this endpoint. - */ - rateLimit?: Partial | false; -}; -export declare function revocationHandler({ provider, rateLimit: rateLimitConfig }: RevocationHandlerOptions): RequestHandler; -//# sourceMappingURL=revoke.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.d.ts.map deleted file mode 100644 index fb13cf1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,cAAc,CA4DpH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.js deleted file mode 100644 index 68f5284..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.js +++ /dev/null @@ -1,59 +0,0 @@ -import express from 'express'; -import cors from 'cors'; -import { authenticateClient } from '../middleware/clientAuth.js'; -import { OAuthTokenRevocationRequestSchema } from '../../../shared/auth.js'; -import { rateLimit } from 'express-rate-limit'; -import { allowedMethods } from '../middleware/allowedMethods.js'; -import { InvalidRequestError, ServerError, TooManyRequestsError, OAuthError } from '../errors.js'; -export function revocationHandler({ provider, rateLimit: rateLimitConfig }) { - if (!provider.revokeToken) { - throw new Error('Auth provider does not support revoking tokens'); - } - // Nested router so we can configure middleware and restrict HTTP method - const router = express.Router(); - // Configure CORS to allow any origin, to make accessible to web-based MCP clients - router.use(cors()); - router.use(allowedMethods(['POST'])); - router.use(express.urlencoded({ extended: false })); - // Apply rate limiting unless explicitly disabled - if (rateLimitConfig !== false) { - router.use(rateLimit({ - windowMs: 15 * 60 * 1000, // 15 minutes - max: 50, // 50 requests per windowMs - standardHeaders: true, - legacyHeaders: false, - message: new TooManyRequestsError('You have exceeded the rate limit for token revocation requests').toResponseObject(), - ...rateLimitConfig - })); - } - // Authenticate and extract client details - router.use(authenticateClient({ clientsStore: provider.clientsStore })); - router.post('/', async (req, res) => { - res.setHeader('Cache-Control', 'no-store'); - try { - const parseResult = OAuthTokenRevocationRequestSchema.safeParse(req.body); - if (!parseResult.success) { - throw new InvalidRequestError(parseResult.error.message); - } - const client = req.client; - if (!client) { - // This should never happen - throw new ServerError('Internal Server Error'); - } - await provider.revokeToken(client, parseResult.data); - res.status(200).json({}); - } - catch (error) { - if (error instanceof OAuthError) { - const status = error instanceof ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }); - return router; -} -//# sourceMappingURL=revoke.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.js.map deleted file mode 100644 index e1a0b1d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"revoke.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":"AACA,OAAO,OAA2B,MAAM,SAAS,CAAC;AAClD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAA+B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAWlG,MAAM,UAAU,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAA4B;IAChG,IAAI,CAA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C,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC7D,CAAC;YAED,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,2BAA2B;gBAC3B,MAAM,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;YACnD,CAAC;YAED,MAAM,QAAQ,CAAC,WAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;YACtD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;gBAC9B,MAAM,MAAM,GAAG,KAAK,YAAY,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.d.ts deleted file mode 100644 index 24d1c87..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthServerProvider } from '../provider.js'; -import { Options as RateLimitOptions } from 'express-rate-limit'; -export type TokenHandlerOptions = { - provider: OAuthServerProvider; - /** - * Rate limiting configuration for the token endpoint. - * Set to false to disable rate limiting for this endpoint. - */ - rateLimit?: Partial | false; -}; -export declare function tokenHandler({ provider, rateLimit: rateLimitConfig }: TokenHandlerOptions): RequestHandler; -//# sourceMappingURL=token.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.d.ts.map deleted file mode 100644 index 68189b0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAmBF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,mBAAmB,GAAG,cAAc,CA+G1G"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.js deleted file mode 100644 index b413c49..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.js +++ /dev/null @@ -1,107 +0,0 @@ -import * as z from 'zod/v4'; -import express from 'express'; -import cors from 'cors'; -import { verifyChallenge } from 'pkce-challenge'; -import { authenticateClient } from '../middleware/clientAuth.js'; -import { rateLimit } from 'express-rate-limit'; -import { allowedMethods } from '../middleware/allowedMethods.js'; -import { InvalidRequestError, InvalidGrantError, UnsupportedGrantTypeError, ServerError, TooManyRequestsError, OAuthError } from '../errors.js'; -const TokenRequestSchema = z.object({ - grant_type: z.string() -}); -const AuthorizationCodeGrantSchema = z.object({ - code: z.string(), - code_verifier: z.string(), - redirect_uri: z.string().optional(), - resource: z.string().url().optional() -}); -const RefreshTokenGrantSchema = z.object({ - refresh_token: z.string(), - scope: z.string().optional(), - resource: z.string().url().optional() -}); -export function tokenHandler({ provider, rateLimit: rateLimitConfig }) { - // Nested router so we can configure middleware and restrict HTTP method - const router = express.Router(); - // Configure CORS to allow any origin, to make accessible to web-based MCP clients - router.use(cors()); - router.use(allowedMethods(['POST'])); - router.use(express.urlencoded({ extended: false })); - // Apply rate limiting unless explicitly disabled - if (rateLimitConfig !== false) { - router.use(rateLimit({ - windowMs: 15 * 60 * 1000, // 15 minutes - max: 50, // 50 requests per windowMs - standardHeaders: true, - legacyHeaders: false, - message: new TooManyRequestsError('You have exceeded the rate limit for token requests').toResponseObject(), - ...rateLimitConfig - })); - } - // Authenticate and extract client details - router.use(authenticateClient({ clientsStore: provider.clientsStore })); - router.post('/', async (req, res) => { - res.setHeader('Cache-Control', 'no-store'); - try { - const parseResult = TokenRequestSchema.safeParse(req.body); - if (!parseResult.success) { - throw new InvalidRequestError(parseResult.error.message); - } - const { grant_type } = parseResult.data; - const client = req.client; - if (!client) { - // This should never happen - throw new ServerError('Internal Server Error'); - } - switch (grant_type) { - case 'authorization_code': { - const parseResult = AuthorizationCodeGrantSchema.safeParse(req.body); - if (!parseResult.success) { - throw new InvalidRequestError(parseResult.error.message); - } - const { code, code_verifier, redirect_uri, resource } = parseResult.data; - const skipLocalPkceValidation = provider.skipLocalPkceValidation; - // Perform local PKCE validation unless explicitly skipped - // (e.g. to validate code_verifier in upstream server) - if (!skipLocalPkceValidation) { - const codeChallenge = await provider.challengeForAuthorizationCode(client, code); - if (!(await verifyChallenge(code_verifier, codeChallenge))) { - throw new InvalidGrantError('code_verifier does not match the challenge'); - } - } - // Passes the code_verifier to the provider if PKCE validation didn't occur locally - const tokens = await provider.exchangeAuthorizationCode(client, code, skipLocalPkceValidation ? code_verifier : undefined, redirect_uri, resource ? new URL(resource) : undefined); - res.status(200).json(tokens); - break; - } - case 'refresh_token': { - const parseResult = RefreshTokenGrantSchema.safeParse(req.body); - if (!parseResult.success) { - throw new InvalidRequestError(parseResult.error.message); - } - const { refresh_token, scope, resource } = parseResult.data; - const scopes = scope?.split(' '); - const tokens = await provider.exchangeRefreshToken(client, refresh_token, scopes, resource ? new URL(resource) : undefined); - res.status(200).json(tokens); - break; - } - // Additional auth methods will not be added on the server side of the SDK. - case 'client_credentials': - default: - throw new UnsupportedGrantTypeError('The grant type is not supported by this authorization server.'); - } - } - catch (error) { - if (error instanceof OAuthError) { - const status = error instanceof ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }); - return router; -} -//# sourceMappingURL=token.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.js.map deleted file mode 100644 index 07f182a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,OAA2B,MAAM,SAAS,CAAC;AAElD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6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contextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.d.ts deleted file mode 100644 index ee6037e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { RequestHandler } from 'express'; -/** - * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response. - * - * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST']) - * @returns Express middleware that returns a 405 error if method not in allowed list - */ -export declare function allowedMethods(allowedMethods: string[]): RequestHandler; -//# sourceMappingURL=allowedMethods.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.d.ts.map deleted file mode 100644 index d3de93e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"allowedMethods.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,cAAc,CAUvE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.js deleted file mode 100644 index af2ba08..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.js +++ /dev/null @@ -1,18 +0,0 @@ -import { MethodNotAllowedError } from '../errors.js'; -/** - * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response. - * - * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST']) - * @returns Express middleware that returns a 405 error if method not in allowed list - */ -export function allowedMethods(allowedMethods) { - return (req, res, next) => { - if (allowedMethods.includes(req.method)) { - next(); - return; - } - const error = new MethodNotAllowedError(`The method ${req.method} is not allowed for this endpoint`); - res.status(405).set('Allow', allowedMethods.join(', ')).json(error.toResponseObject()); - }; -} -//# sourceMappingURL=allowedMethods.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.js.map deleted file mode 100644 index c410979..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"allowedMethods.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,cAAwB;IACnD,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACtB,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,IAAI,EAAE,CAAC;YACP,OAAO;QACX,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,qBAAqB,CAAC,cAAc,GAAG,CAAC,MAAM,mCAAmC,CAAC,CAAC;QACrG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC3F,CAAC,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.d.ts deleted file mode 100644 index 1073075..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthTokenVerifier } from '../provider.js'; -import { AuthInfo } from '../types.js'; -export type BearerAuthMiddlewareOptions = { - /** - * A provider used to verify tokens. - */ - verifier: OAuthTokenVerifier; - /** - * Optional scopes that the token must have. - */ - requiredScopes?: string[]; - /** - * Optional resource metadata URL to include in WWW-Authenticate header. - */ - resourceMetadataUrl?: string; -}; -declare module 'express-serve-static-core' { - interface Request { - /** - * Information about the validated access token, if the `requireBearerAuth` middleware was used. - */ - auth?: AuthInfo; - } -} -/** - * Middleware that requires a valid Bearer token in the Authorization header. - * - * This will validate the token with the auth provider and add the resulting auth info to the request object. - * - * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header - * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec. - */ -export declare function requireBearerAuth({ verifier, requiredScopes, resourceMetadataUrl }: BearerAuthMiddlewareOptions): RequestHandler; -//# sourceMappingURL=bearerAuth.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.d.ts.map deleted file mode 100644 index c9d939f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bearerAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,2BAA2B,GAAG;IACtC;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,CAAC;KACnB;CACJ;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,cAAmB,EAAE,mBAAmB,EAAE,EAAE,2BAA2B,GAAG,cAAc,CA8DrI"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.js deleted file mode 100644 index 0c527b4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.js +++ /dev/null @@ -1,72 +0,0 @@ -import { InsufficientScopeError, InvalidTokenError, OAuthError, ServerError } from '../errors.js'; -/** - * Middleware that requires a valid Bearer token in the Authorization header. - * - * This will validate the token with the auth provider and add the resulting auth info to the request object. - * - * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header - * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec. - */ -export function requireBearerAuth({ verifier, requiredScopes = [], resourceMetadataUrl }) { - return async (req, res, next) => { - try { - const authHeader = req.headers.authorization; - if (!authHeader) { - throw new InvalidTokenError('Missing Authorization header'); - } - const [type, token] = authHeader.split(' '); - if (type.toLowerCase() !== 'bearer' || !token) { - throw new InvalidTokenError("Invalid Authorization header format, expected 'Bearer TOKEN'"); - } - const authInfo = await verifier.verifyAccessToken(token); - // Check if token has the required scopes (if any) - if (requiredScopes.length > 0) { - const hasAllScopes = requiredScopes.every(scope => authInfo.scopes.includes(scope)); - if (!hasAllScopes) { - throw new InsufficientScopeError('Insufficient scope'); - } - } - // Check if the token is set to expire or if it is expired - if (typeof authInfo.expiresAt !== 'number' || isNaN(authInfo.expiresAt)) { - throw new InvalidTokenError('Token has no expiration time'); - } - else if (authInfo.expiresAt < Date.now() / 1000) { - throw new InvalidTokenError('Token has expired'); - } - req.auth = authInfo; - next(); - } - catch (error) { - // Build WWW-Authenticate header parts - const buildWwwAuthHeader = (errorCode, message) => { - let header = `Bearer error="${errorCode}", error_description="${message}"`; - if (requiredScopes.length > 0) { - header += `, scope="${requiredScopes.join(' ')}"`; - } - if (resourceMetadataUrl) { - header += `, resource_metadata="${resourceMetadataUrl}"`; - } - return header; - }; - if (error instanceof InvalidTokenError) { - res.set('WWW-Authenticate', buildWwwAuthHeader(error.errorCode, error.message)); - res.status(401).json(error.toResponseObject()); - } - else if (error instanceof InsufficientScopeError) { - res.set('WWW-Authenticate', buildWwwAuthHeader(error.errorCode, error.message)); - res.status(403).json(error.toResponseObject()); - } - else if (error instanceof ServerError) { - res.status(500).json(error.toResponseObject()); - } - else if (error instanceof OAuthError) { - res.status(400).json(error.toResponseObject()); - } - else { - const serverError = new ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }; -} -//# sourceMappingURL=bearerAuth.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.js.map deleted file mode 100644 index d8d0179..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bearerAuth.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA8BlG;;;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AG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACnD,CAAC;iBAAM,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;gBACrC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.d.ts deleted file mode 100644 index 837f95f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { RequestHandler } from 'express'; -import { OAuthRegisteredClientsStore } from '../clients.js'; -import { OAuthClientInformationFull } from '../../../shared/auth.js'; -export type ClientAuthenticationMiddlewareOptions = { - /** - * A store used to read information about registered OAuth clients. - */ - clientsStore: OAuthRegisteredClientsStore; -}; -declare module 'express-serve-static-core' { - interface Request { - /** - * The authenticated client for this request, if the `authenticateClient` middleware was used. - */ - client?: OAuthClientInformationFull; - } -} -export declare function authenticateClient({ clientsStore }: ClientAuthenticationMiddlewareOptions): RequestHandler; -//# sourceMappingURL=clientAuth.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.d.ts.map deleted file mode 100644 index 5455132..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clientAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/clientAuth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAGrE,MAAM,MAAM,qCAAqC,GAAG;IAChD;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;CAC7C,CAAC;AAOF,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb;;WAEG;QACH,MAAM,CAAC,EAAE,0BAA0B,CAAC;KACvC;CACJ;AAED,wBAAgB,kBAAkB,CAAC,EAAE,YAAY,EAAE,EAAE,qCAAqC,GAAG,cAAc,CAoC1G"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.js deleted file mode 100644 index cce72a2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.js +++ /dev/null @@ -1,45 +0,0 @@ -import * as z from 'zod/v4'; -import { InvalidRequestError, InvalidClientError, ServerError, OAuthError } from '../errors.js'; -const ClientAuthenticatedRequestSchema = z.object({ - client_id: z.string(), - client_secret: z.string().optional() -}); -export function authenticateClient({ clientsStore }) { - return async (req, res, next) => { - try { - const result = ClientAuthenticatedRequestSchema.safeParse(req.body); - if (!result.success) { - throw new InvalidRequestError(String(result.error)); - } - const { client_id, client_secret } = result.data; - const client = await clientsStore.getClient(client_id); - if (!client) { - throw new InvalidClientError('Invalid client_id'); - } - if (client.client_secret) { - if (!client_secret) { - throw new InvalidClientError('Client secret is required'); - } - if (client.client_secret !== client_secret) { - throw new InvalidClientError('Invalid client_secret'); - } - if (client.client_secret_expires_at && client.client_secret_expires_at < Math.floor(Date.now() / 1000)) { - throw new InvalidClientError('Client secret has expired'); - } - } - req.client = client; - next(); - } - catch (error) { - if (error instanceof OAuthError) { - const status = error instanceof ServerError ? 500 : 400; - res.status(status).json(error.toResponseObject()); - } - else { - const serverError = new ServerError('Internal Server Error'); - res.status(500).json(serverError.toResponseObject()); - } - } - }; -} -//# sourceMappingURL=clientAuth.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.js.map deleted file mode 100644 index 5023c02..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clientAuth.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/clientAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAShG,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAWH,MAAM,UAAU,kBAAkB,CAAC,EAAE,YAAY,EAAyC;IACtF,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC5B,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,gCAAgC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,MAAM,IAAI,mBAAmB,CAAC,MAA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7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.d.ts deleted file mode 100644 index 3e4eca3..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Response } from 'express'; -import { OAuthRegisteredClientsStore } from './clients.js'; -import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '../../shared/auth.js'; -import { AuthInfo } from './types.js'; -export type AuthorizationParams = { - state?: string; - scopes?: string[]; - codeChallenge: string; - redirectUri: string; - resource?: URL; -}; -/** - * Implements an end-to-end OAuth server. - */ -export interface OAuthServerProvider { - /** - * A store used to read information about registered OAuth clients. - */ - get clientsStore(): OAuthRegisteredClientsStore; - /** - * Begins the authorization flow, which can either be implemented by this server itself or via redirection to a separate authorization server. - * - * This server must eventually issue a redirect with an authorization response or an error response to the given redirect URI. Per OAuth 2.1: - * - In the successful case, the redirect MUST include the `code` and `state` (if present) query parameters. - * - In the error case, the redirect MUST include the `error` query parameter, and MAY include an optional `error_description` query parameter. - */ - authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; - /** - * Returns the `codeChallenge` that was used when the indicated authorization began. - */ - challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise; - /** - * Exchanges an authorization code for an access token. - */ - exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string, resource?: URL): Promise; - /** - * Exchanges a refresh token for an access token. - */ - exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[], resource?: URL): Promise; - /** - * Verifies an access token and returns information about it. - */ - verifyAccessToken(token: string): Promise; - /** - * Revokes an access or refresh token. If unimplemented, token revocation is not supported (not recommended). - * - * If the given token is invalid or already revoked, this method should do nothing. - */ - revokeToken?(client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise; - /** - * Whether to skip local PKCE validation. - * - * If true, the server will not perform PKCE validation locally and will pass the code_verifier to the upstream server. - * - * NOTE: This should only be true if the upstream server is performing the actual PKCE validation. - */ - skipLocalPkceValidation?: boolean; -} -/** - * Slim implementation useful for token verification - */ -export interface OAuthTokenVerifier { - /** - * Verifies an access token and returns information about it. - */ - verifyAccessToken(token: string): Promise; -} -//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.d.ts.map deleted file mode 100644 index d1a4bff..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC;;OAEG;IACH,IAAI,YAAY,IAAI,2BAA2B,CAAC;IAEhD;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,EAAE,0BAA0B,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzG;;OAEG;IACH,6BAA6B,CAAC,MAAM,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9G;;OAEG;IACH,yBAAyB,CACrB,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,GAAG,GACf,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAExI;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpD;;;;OAIG;IACH,WAAW,CAAC,CAAC,MAAM,EAAE,0BAA0B,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtG;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.js deleted file mode 100644 index be31058..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=provider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.js.map deleted file mode 100644 index b968414..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.d.ts deleted file mode 100644 index ee6f350..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Response } from 'express'; -import { OAuthRegisteredClientsStore } from '../clients.js'; -import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '../../../shared/auth.js'; -import { AuthInfo } from '../types.js'; -import { AuthorizationParams, OAuthServerProvider } from '../provider.js'; -import { FetchLike } from '../../../shared/transport.js'; -export type ProxyEndpoints = { - authorizationUrl: string; - tokenUrl: string; - revocationUrl?: string; - registrationUrl?: string; -}; -export type ProxyOptions = { - /** - * Individual endpoint URLs for proxying specific OAuth operations - */ - endpoints: ProxyEndpoints; - /** - * Function to verify access tokens and return auth info - */ - verifyAccessToken: (token: string) => Promise; - /** - * Function to fetch client information from the upstream server - */ - getClient: (clientId: string) => Promise; - /** - * Custom fetch implementation used for all network requests. - */ - fetch?: FetchLike; -}; -/** - * Implements an OAuth server that proxies requests to another OAuth server. - */ -export declare class ProxyOAuthServerProvider implements OAuthServerProvider { - protected readonly _endpoints: ProxyEndpoints; - protected readonly _verifyAccessToken: (token: string) => Promise; - protected readonly _getClient: (clientId: string) => Promise; - protected readonly _fetch?: FetchLike; - skipLocalPkceValidation: boolean; - revokeToken?: (client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest) => Promise; - constructor(options: ProxyOptions); - get clientsStore(): OAuthRegisteredClientsStore; - authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; - challengeForAuthorizationCode(_client: OAuthClientInformationFull, _authorizationCode: string): Promise; - exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string, resource?: URL): Promise; - exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[], resource?: URL): Promise; - verifyAccessToken(token: string): Promise; -} -//# sourceMappingURL=proxyProvider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.d.ts.map deleted file mode 100644 index 124c105..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"proxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/providers/proxyProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACH,0BAA0B,EAE1B,2BAA2B,EAC3B,WAAW,EAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,MAAM,MAAM,cAAc,GAAG;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAA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yBAAyB,CAC3B,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,GAAG,GACf,OAAO,CAAC,WAAW,CAAC;IAwCjB,oBAAoB,CACtB,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,MAAM,EAAE,EACjB,QAAQ,CAAC,EAAE,GAAG,GACf,OAAO,CAAC,WAAW,CAAC;IAoCjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAG5D"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js deleted file mode 100644 index fef1ff5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js +++ /dev/null @@ -1,155 +0,0 @@ -import { OAuthClientInformationFullSchema, OAuthTokensSchema } from '../../../shared/auth.js'; -import { ServerError } from '../errors.js'; -/** - * Implements an OAuth server that proxies requests to another OAuth server. - */ -export class ProxyOAuthServerProvider { - constructor(options) { - this.skipLocalPkceValidation = true; - this._endpoints = options.endpoints; - this._verifyAccessToken = options.verifyAccessToken; - this._getClient = options.getClient; - this._fetch = options.fetch; - if (options.endpoints?.revocationUrl) { - this.revokeToken = async (client, request) => { - const revocationUrl = this._endpoints.revocationUrl; - if (!revocationUrl) { - throw new Error('No revocation endpoint configured'); - } - const params = new URLSearchParams(); - params.set('token', request.token); - params.set('client_id', client.client_id); - if (client.client_secret) { - params.set('client_secret', client.client_secret); - } - if (request.token_type_hint) { - params.set('token_type_hint', request.token_type_hint); - } - const response = await (this._fetch ?? fetch)(revocationUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: params.toString() - }); - await response.body?.cancel(); - if (!response.ok) { - throw new ServerError(`Token revocation failed: ${response.status}`); - } - }; - } - } - get clientsStore() { - const registrationUrl = this._endpoints.registrationUrl; - return { - getClient: this._getClient, - ...(registrationUrl && { - registerClient: async (client) => { - const response = await (this._fetch ?? fetch)(registrationUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(client) - }); - if (!response.ok) { - await response.body?.cancel(); - throw new ServerError(`Client registration failed: ${response.status}`); - } - const data = await response.json(); - return OAuthClientInformationFullSchema.parse(data); - } - }) - }; - } - async authorize(client, params, res) { - // Start with required OAuth parameters - const targetUrl = new URL(this._endpoints.authorizationUrl); - const searchParams = new URLSearchParams({ - client_id: client.client_id, - response_type: 'code', - redirect_uri: params.redirectUri, - code_challenge: params.codeChallenge, - code_challenge_method: 'S256' - }); - // Add optional standard OAuth parameters - if (params.state) - searchParams.set('state', params.state); - if (params.scopes?.length) - searchParams.set('scope', params.scopes.join(' ')); - if (params.resource) - searchParams.set('resource', params.resource.href); - targetUrl.search = searchParams.toString(); - res.redirect(targetUrl.toString()); - } - async challengeForAuthorizationCode(_client, _authorizationCode) { - // In a proxy setup, we don't store the code challenge ourselves - // Instead, we proxy the token request and let the upstream server validate it - return ''; - } - async exchangeAuthorizationCode(client, authorizationCode, codeVerifier, redirectUri, resource) { - const params = new URLSearchParams({ - grant_type: 'authorization_code', - client_id: client.client_id, - code: authorizationCode - }); - if (client.client_secret) { - params.append('client_secret', client.client_secret); - } - if (codeVerifier) { - params.append('code_verifier', codeVerifier); - } - if (redirectUri) { - params.append('redirect_uri', redirectUri); - } - if (resource) { - params.append('resource', resource.href); - } - const response = await (this._fetch ?? fetch)(this._endpoints.tokenUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: params.toString() - }); - if (!response.ok) { - await response.body?.cancel(); - throw new ServerError(`Token exchange failed: ${response.status}`); - } - const data = await response.json(); - return OAuthTokensSchema.parse(data); - } - async exchangeRefreshToken(client, refreshToken, scopes, resource) { - const params = new URLSearchParams({ - grant_type: 'refresh_token', - client_id: client.client_id, - refresh_token: refreshToken - }); - if (client.client_secret) { - params.set('client_secret', client.client_secret); - } - if (scopes?.length) { - params.set('scope', scopes.join(' ')); - } - if (resource) { - params.set('resource', resource.href); - } - const response = await (this._fetch ?? fetch)(this._endpoints.tokenUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: params.toString() - }); - if (!response.ok) { - await response.body?.cancel(); - throw new ServerError(`Token refresh failed: ${response.status}`); - } - const data = await response.json(); - return OAuthTokensSchema.parse(data); - } - async verifyAccessToken(token) { - return this._verifyAccessToken(token); - } -} -//# sourceMappingURL=proxyProvider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js.map deleted file mode 100644 index b77ac30..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"proxyProvider.js","sourceRoot":"","sources":["../../../../../src/server/auth/providers/proxyProvider.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,gCAAgC,EAGhC,iBAAiB,EACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAgC3C;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAUjC,YAAY,OAAqB;QAJjC,4BAAuB,GAAG,IAAI,CAAC;QAK3B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,OAAO,CAA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Q,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACpE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACL,cAAc,EAAE,mCAAmC;aACtD;YACD,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE;SAC1B,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;YAC9B,MAAM,IAAI,WAAW,CAAC,yBAAyB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACtE,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAAa;QACjC,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.d.ts deleted file mode 100644 index 43dabde..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -import express, { RequestHandler } from 'express'; -import { ClientRegistrationHandlerOptions } from './handlers/register.js'; -import { TokenHandlerOptions } from './handlers/token.js'; -import { AuthorizationHandlerOptions } from './handlers/authorize.js'; -import { RevocationHandlerOptions } from './handlers/revoke.js'; -import { OAuthServerProvider } from './provider.js'; -import { OAuthMetadata } from '../../shared/auth.js'; -export type AuthRouterOptions = { - /** - * A provider implementing the actual authorization logic for this router. - */ - provider: OAuthServerProvider; - /** - * The authorization server's issuer identifier, which is a URL that uses the "https" scheme and has no query or fragment components. - */ - issuerUrl: URL; - /** - * The base URL of the authorization server to use for the metadata endpoints. - * - * If not provided, the issuer URL will be used as the base URL. - */ - baseUrl?: URL; - /** - * An optional URL of a page containing human-readable information that developers might want or need to know when using the authorization server. - */ - serviceDocumentationUrl?: URL; - /** - * An optional list of scopes supported by this authorization server - */ - scopesSupported?: string[]; - /** - * The resource name to be displayed in protected resource metadata - */ - resourceName?: string; - /** - * The URL of the protected resource (RS) whose metadata we advertise. - * If not provided, falls back to `baseUrl` and then to `issuerUrl` (AS=RS). - */ - resourceServerUrl?: URL; - authorizationOptions?: Omit; - clientRegistrationOptions?: Omit; - revocationOptions?: Omit; - tokenOptions?: Omit; -}; -export declare const createOAuthMetadata: (options: { - provider: OAuthServerProvider; - issuerUrl: URL; - baseUrl?: URL; - serviceDocumentationUrl?: URL; - scopesSupported?: string[]; -}) => OAuthMetadata; -/** - * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported). - * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients. - * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead. - * - * By default, rate limiting is applied to all endpoints to prevent abuse. - * - * This router MUST be installed at the application root, like so: - * - * const app = express(); - * app.use(mcpAuthRouter(...)); - */ -export declare function mcpAuthRouter(options: AuthRouterOptions): RequestHandler; -export type AuthMetadataOptions = { - /** - * OAuth Metadata as would be returned from the authorization server - * this MCP server relies on - */ - oauthMetadata: OAuthMetadata; - /** - * The url of the MCP server, for use in protected resource metadata - */ - resourceServerUrl: URL; - /** - * The url for documentation for the MCP server - */ - serviceDocumentationUrl?: URL; - /** - * An optional list of scopes supported by this MCP server - */ - scopesSupported?: string[]; - /** - * An optional resource name to display in resource metadata - */ - resourceName?: string; -}; -export declare function mcpAuthMetadataRouter(options: AuthMetadataOptions): express.Router; -/** - * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL - * from a given server URL. This replaces the path with the standard metadata endpoint. - * - * @param serverUrl - The base URL of the protected resource server - * @returns The URL for the OAuth protected resource metadata endpoint - * - * @example - * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp')) - * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource/mcp' - */ -export declare function getOAuthProtectedResourceMetadataUrl(serverUrl: URL): string; -//# sourceMappingURL=router.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.d.ts.map deleted file mode 100644 index 615cb96..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAA6B,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAgB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAwB,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAqB,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,aAAa,EAAkC,MAAM,sBAAsB,CAAC;AAUrF,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,mBAAmB,CAAC;IAE9B;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;IAEd;;OAEG;IACH,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC;IAGxB,oBAAoB,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAC;IACrE,yBAAyB,CAAC,EAAE,IAAI,CAAC,gCAAgC,EAAE,cAAc,CAAC,CAAC;IACnF,iBAAiB,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;CACxD,CAAC;AAeF,eAAO,MAAM,mBAAmB,YAAa;IACzC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,SAAS,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,KAAG,aAgCH,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,cAAc,CAyCxE;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;;OAGG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,iBAAiB,EAAE,GAAG,CAAC;IAEvB;;OAEG;IACH,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAuBlF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oCAAoC,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,CAI3E"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.js deleted file mode 100644 index c33a542..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.js +++ /dev/null @@ -1,118 +0,0 @@ -import express from 'express'; -import { clientRegistrationHandler } from './handlers/register.js'; -import { tokenHandler } from './handlers/token.js'; -import { authorizationHandler } from './handlers/authorize.js'; -import { revocationHandler } from './handlers/revoke.js'; -import { metadataHandler } from './handlers/metadata.js'; -// Check for dev mode flag that allows HTTP issuer URLs (for development/testing only) -const allowInsecureIssuerUrl = process.env.MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === 'true' || process.env.MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === '1'; -if (allowInsecureIssuerUrl) { - // eslint-disable-next-line no-console - console.warn('MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL is enabled - HTTP issuer URLs are allowed. Do not use in production.'); -} -const checkIssuerUrl = (issuer) => { - // Technically RFC 8414 does not permit a localhost HTTPS exemption, but this will be necessary for ease of testing - if (issuer.protocol !== 'https:' && issuer.hostname !== 'localhost' && issuer.hostname !== '127.0.0.1' && !allowInsecureIssuerUrl) { - throw new Error('Issuer URL must be HTTPS'); - } - if (issuer.hash) { - throw new Error(`Issuer URL must not have a fragment: ${issuer}`); - } - if (issuer.search) { - throw new Error(`Issuer URL must not have a query string: ${issuer}`); - } -}; -export const createOAuthMetadata = (options) => { - const issuer = options.issuerUrl; - const baseUrl = options.baseUrl; - checkIssuerUrl(issuer); - const authorization_endpoint = '/authorize'; - const token_endpoint = '/token'; - const registration_endpoint = options.provider.clientsStore.registerClient ? '/register' : undefined; - const revocation_endpoint = options.provider.revokeToken ? '/revoke' : undefined; - const metadata = { - issuer: issuer.href, - service_documentation: options.serviceDocumentationUrl?.href, - authorization_endpoint: new URL(authorization_endpoint, baseUrl || issuer).href, - response_types_supported: ['code'], - code_challenge_methods_supported: ['S256'], - token_endpoint: new URL(token_endpoint, baseUrl || issuer).href, - token_endpoint_auth_methods_supported: ['client_secret_post', 'none'], - grant_types_supported: ['authorization_code', 'refresh_token'], - scopes_supported: options.scopesSupported, - revocation_endpoint: revocation_endpoint ? new URL(revocation_endpoint, baseUrl || issuer).href : undefined, - revocation_endpoint_auth_methods_supported: revocation_endpoint ? ['client_secret_post'] : undefined, - registration_endpoint: registration_endpoint ? new URL(registration_endpoint, baseUrl || issuer).href : undefined - }; - return metadata; -}; -/** - * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported). - * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients. - * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead. - * - * By default, rate limiting is applied to all endpoints to prevent abuse. - * - * This router MUST be installed at the application root, like so: - * - * const app = express(); - * app.use(mcpAuthRouter(...)); - */ -export function mcpAuthRouter(options) { - const oauthMetadata = createOAuthMetadata(options); - const router = express.Router(); - router.use(new URL(oauthMetadata.authorization_endpoint).pathname, authorizationHandler({ provider: options.provider, ...options.authorizationOptions })); - router.use(new URL(oauthMetadata.token_endpoint).pathname, tokenHandler({ provider: options.provider, ...options.tokenOptions })); - router.use(mcpAuthMetadataRouter({ - oauthMetadata, - // Prefer explicit RS; otherwise fall back to AS baseUrl, then to issuer (back-compat) - resourceServerUrl: options.resourceServerUrl ?? options.baseUrl ?? new URL(oauthMetadata.issuer), - serviceDocumentationUrl: options.serviceDocumentationUrl, - scopesSupported: options.scopesSupported, - resourceName: options.resourceName - })); - if (oauthMetadata.registration_endpoint) { - router.use(new URL(oauthMetadata.registration_endpoint).pathname, clientRegistrationHandler({ - clientsStore: options.provider.clientsStore, - ...options.clientRegistrationOptions - })); - } - if (oauthMetadata.revocation_endpoint) { - router.use(new URL(oauthMetadata.revocation_endpoint).pathname, revocationHandler({ provider: options.provider, ...options.revocationOptions })); - } - return router; -} -export function mcpAuthMetadataRouter(options) { - checkIssuerUrl(new URL(options.oauthMetadata.issuer)); - const router = express.Router(); - const protectedResourceMetadata = { - resource: options.resourceServerUrl.href, - authorization_servers: [options.oauthMetadata.issuer], - scopes_supported: options.scopesSupported, - resource_name: options.resourceName, - resource_documentation: options.serviceDocumentationUrl?.href - }; - // Serve PRM at the path-specific URL per RFC 9728 - const rsPath = new URL(options.resourceServerUrl.href).pathname; - router.use(`/.well-known/oauth-protected-resource${rsPath === '/' ? '' : rsPath}`, metadataHandler(protectedResourceMetadata)); - // Always add this for OAuth Authorization Server metadata per RFC 8414 - router.use('/.well-known/oauth-authorization-server', metadataHandler(options.oauthMetadata)); - return router; -} -/** - * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL - * from a given server URL. This replaces the path with the standard metadata endpoint. - * - * @param serverUrl - The base URL of the protected resource server - * @returns The URL for the OAuth protected resource metadata endpoint - * - * @example - * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp')) - * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource/mcp' - */ -export function getOAuthProtectedResourceMetadataUrl(serverUrl) { - const u = new URL(serverUrl.href); - const rsPath = u.pathname && u.pathname !== '/' ? u.pathname : ''; - return new URL(`/.well-known/oauth-protected-resource${rsPath}`, u).href; -} -//# sourceMappingURL=router.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.js.map deleted file mode 100644 index 6487fb0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAA2B,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAoC,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,YAAY,EAAuB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAA+B,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAA4B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIzD,sFAAsF;A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AAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.d.ts deleted file mode 100644 index 05ec848..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Information about a validated access token, provided to request handlers. - */ -export interface AuthInfo { - /** - * The access token. - */ - token: string; - /** - * The client ID associated with this token. - */ - clientId: string; - /** - * Scopes associated with this token. - */ - scopes: string[]; - /** - * When the token expires (in seconds since epoch). - */ - expiresAt?: number; - /** - * The RFC 8707 resource server identifier for which this token is valid. - * If set, this MUST match the MCP server's resource identifier (minus hash fragment). - */ - resource?: URL; - /** - * Additional data associated with the token. - * This field should be used for any additional data that needs to be attached to the auth info. - */ - extra?: Record; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.d.ts.map deleted file mode 100644 index 021e947..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.js deleted file mode 100644 index 718fd38..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.js.map deleted file mode 100644 index 0d8063d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.d.ts deleted file mode 100644 index 1b3159a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { AnySchema, SchemaInput } from './zod-compat.js'; -export declare const COMPLETABLE_SYMBOL: unique symbol; -export type CompleteCallback = (value: SchemaInput, context?: { - arguments?: Record; -}) => SchemaInput[] | Promise[]>; -export type CompletableMeta = { - complete: CompleteCallback; -}; -export type CompletableSchema = T & { - [COMPLETABLE_SYMBOL]: CompletableMeta; -}; -/** - * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP. - * Works with both Zod v3 and v4 schemas. - */ -export declare function completable(schema: T, complete: CompleteCallback): CompletableSchema; -/** - * Checks if a schema is completable (has completion metadata). - */ -export declare function isCompletable(schema: unknown): schema is CompletableSchema; -/** - * Gets the completer callback from a completable schema, if it exists. - */ -export declare function getCompleter(schema: T): CompleteCallback | undefined; -/** - * Unwraps a completable schema to get the underlying schema. - * For backward compatibility with code that called `.unwrap()`. - */ -export declare function unwrapCompletable(schema: CompletableSchema): T; -export declare enum McpZodTypeKind { - Completable = "McpCompletable" -} -export interface CompletableDef { - type: T; - complete: CompleteCallback; - typeName: McpZodTypeKind.Completable; -} -//# sourceMappingURL=completable.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.d.ts.map deleted file mode 100644 index 83ea2f1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"completable.d.ts","sourceRoot":"","sources":["../../../src/server/completable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzD,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAAsC,CAAC;AAE/E,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,CAC5D,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EACrB,OAAO,CAAC,EAAE;IACN,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,KACA,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAElD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI;IAC3D,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,GAAG;IACrD,CAAC,kBAAkB,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAQ/G;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAErF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAG5F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAEtF;AAID,oBAAY,cAAc;IACtB,WAAW,mBAAmB;CACjC;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC3D,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC9B,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC;CACxC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js deleted file mode 100644 index 827f7d4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +++ /dev/null @@ -1,41 +0,0 @@ -export const COMPLETABLE_SYMBOL = Symbol.for('mcp.completable'); -/** - * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP. - * Works with both Zod v3 and v4 schemas. - */ -export function completable(schema, complete) { - Object.defineProperty(schema, COMPLETABLE_SYMBOL, { - value: { complete }, - enumerable: false, - writable: false, - configurable: false - }); - return schema; -} -/** - * Checks if a schema is completable (has completion metadata). - */ -export function isCompletable(schema) { - return !!schema && typeof schema === 'object' && COMPLETABLE_SYMBOL in schema; -} -/** - * Gets the completer callback from a completable schema, if it exists. - */ -export function getCompleter(schema) { - const meta = schema[COMPLETABLE_SYMBOL]; - return meta?.complete; -} -/** - * Unwraps a completable schema to get the underlying schema. - * For backward compatibility with code that called `.unwrap()`. - */ -export function unwrapCompletable(schema) { - return schema; -} -// Legacy exports for backward compatibility -// These types are deprecated but kept for existing code -export var McpZodTypeKind; -(function (McpZodTypeKind) { - McpZodTypeKind["Completable"] = "McpCompletable"; -})(McpZodTypeKind || (McpZodTypeKind = {})); -//# sourceMappingURL=completable.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map deleted file mode 100644 index a5ae859..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"completable.js","sourceRoot":"","sources":["../../../src/server/completable.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAkB,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAiB/E;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAsB,MAAS,EAAE,QAA6B;IACrF,MAAM,CAAC,cAAc,CAAC,MAAgB,EAAE,kBAAkB,EAAE;QACxD,KAAK,EAAE,EAAE,QAAQ,EAAwB;QACzC,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,KAAK;KACtB,CAAC,CAAC;IACH,OAAO,MAA8B,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAe;IACzC,OAAO,CAAC,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,kBAAkB,IAAK,MAAiB,CAAC;AAC9F,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAsB,MAAS;IACvD,MAAM,IAAI,GAAI,MAAmE,CAAC,kBAAkB,CAAC,CAAC;IACtG,OAAO,IAAI,EAAE,QAA2C,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAsB,MAA4B;IAC/E,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,4CAA4C;AAC5C,wDAAwD;AACxD,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACtB,gDAA8B,CAAA;AAClC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts deleted file mode 100644 index 7746e82..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Express } from 'express'; -/** - * Options for creating an MCP Express application. - */ -export interface CreateMcpExpressAppOptions { - /** - * The hostname to bind to. Defaults to '127.0.0.1'. - * When set to '127.0.0.1', 'localhost', or '::1', DNS rebinding protection is automatically enabled. - */ - host?: string; - /** - * List of allowed hostnames for DNS rebinding protection. - * If provided, host header validation will be applied using this list. - * For IPv6, provide addresses with brackets (e.g., '[::1]'). - * - * This is useful when binding to '0.0.0.0' or '::' but still wanting - * to restrict which hostnames are allowed. - */ - allowedHosts?: string[]; -} -/** - * Creates an Express application pre-configured for MCP servers. - * - * When the host is '127.0.0.1', 'localhost', or '::1' (the default is '127.0.0.1'), - * DNS rebinding protection middleware is automatically applied to protect against - * DNS rebinding attacks on localhost servers. - * - * @param options - Configuration options - * @returns A configured Express application - * - * @example - * ```typescript - * // Basic usage - defaults to 127.0.0.1 with DNS rebinding protection - * const app = createMcpExpressApp(); - * - * // Custom host - DNS rebinding protection only applied for localhost hosts - * const app = createMcpExpressApp({ host: '0.0.0.0' }); // No automatic DNS rebinding protection - * const app = createMcpExpressApp({ host: 'localhost' }); // DNS rebinding protection enabled - * - * // Custom allowed hosts for non-localhost binding - * const app = createMcpExpressApp({ host: '0.0.0.0', allowedHosts: ['myapp.local', 'localhost'] }); - * ``` - */ -export declare function createMcpExpressApp(options?: CreateMcpExpressAppOptions): Express; -//# sourceMappingURL=express.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts.map deleted file mode 100644 index 5f607a9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../../src/server/express.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,0BAA+B,GAAG,OAAO,CA0BrF"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js deleted file mode 100644 index a23a57b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js +++ /dev/null @@ -1,50 +0,0 @@ -import express from 'express'; -import { hostHeaderValidation, localhostHostValidation } from './middleware/hostHeaderValidation.js'; -/** - * Creates an Express application pre-configured for MCP servers. - * - * When the host is '127.0.0.1', 'localhost', or '::1' (the default is '127.0.0.1'), - * DNS rebinding protection middleware is automatically applied to protect against - * DNS rebinding attacks on localhost servers. - * - * @param options - Configuration options - * @returns A configured Express application - * - * @example - * ```typescript - * // Basic usage - defaults to 127.0.0.1 with DNS rebinding protection - * const app = createMcpExpressApp(); - * - * // Custom host - DNS rebinding protection only applied for localhost hosts - * const app = createMcpExpressApp({ host: '0.0.0.0' }); // No automatic DNS rebinding protection - * const app = createMcpExpressApp({ host: 'localhost' }); // DNS rebinding protection enabled - * - * // Custom allowed hosts for non-localhost binding - * const app = createMcpExpressApp({ host: '0.0.0.0', allowedHosts: ['myapp.local', 'localhost'] }); - * ``` - */ -export function createMcpExpressApp(options = {}) { - const { host = '127.0.0.1', allowedHosts } = options; - const app = express(); - app.use(express.json()); - // If allowedHosts is explicitly provided, use that for validation - if (allowedHosts) { - app.use(hostHeaderValidation(allowedHosts)); - } - else { - // Apply DNS rebinding protection automatically for localhost hosts - const localhostHosts = ['127.0.0.1', 'localhost', '::1']; - if (localhostHosts.includes(host)) { - app.use(localhostHostValidation()); - } - else if (host === '0.0.0.0' || host === '::') { - // Warn when binding to all interfaces without DNS rebinding protection - // eslint-disable-next-line no-console - console.warn(`Warning: Server is binding to ${host} without DNS rebinding protection. ` + - 'Consider using the allowedHosts option to restrict allowed hosts, ' + - 'or use authentication to protect your server.'); - } - } - return app; -} -//# sourceMappingURL=express.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js.map deleted file mode 100644 index 0ebc4c8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"express.js","sourceRoot":"","sources":["../../../src/server/express.ts"],"names":[],"mappings":"AAAA,OAAO,OAAoB,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAuBrG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAsC,EAAE;IACxE,MAAM,EAAE,IAAI,GAAG,WAAW,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAErD,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IACtB,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAExB,kEAAkE;IAClE,IAAI,YAAY,EAAE,CAAC;QACf,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACJ,mEAAmE;QACnE,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,GAAG,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC,CAAC;QACvC,CAAC;aAAM,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC7C,uEAAuE;YACvE,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACR,iCAAiC,IAAI,qCAAqC;gBACtE,oEAAoE;gBACpE,+CAA+C,CACtD,CAAC;QACN,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts deleted file mode 100644 index cfa236e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { Protocol, type NotificationOptions, type ProtocolOptions, type RequestOptions } from '../shared/protocol.js'; -import { type ClientCapabilities, type CreateMessageRequest, type CreateMessageResult, type CreateMessageResultWithTools, type CreateMessageRequestParamsBase, type CreateMessageRequestParamsWithTools, type ElicitRequestFormParams, type ElicitRequestURLParams, type ElicitResult, type Implementation, type ListRootsRequest, type LoggingMessageNotification, type ResourceUpdatedNotification, type ServerCapabilities, type ServerNotification, type ServerRequest, type ServerResult, type Request, type Notification, type Result } from '../types.js'; -import type { jsonSchemaValidator } from '../validation/types.js'; -import { AnyObjectSchema, SchemaOutput } from './zod-compat.js'; -import { RequestHandlerExtra } from '../shared/protocol.js'; -import { ExperimentalServerTasks } from '../experimental/tasks/server.js'; -export type ServerOptions = ProtocolOptions & { - /** - * Capabilities to advertise as being supported by this server. - */ - capabilities?: ServerCapabilities; - /** - * Optional instructions describing how to use the server and its features. - */ - instructions?: string; - /** - * JSON Schema validator for elicitation response validation. - * - * The validator is used to validate user input returned from elicitation - * requests against the requested schema. - * - * @default AjvJsonSchemaValidator - * - * @example - * ```typescript - * // ajv (default) - * const server = new Server( - * { name: 'my-server', version: '1.0.0' }, - * { - * capabilities: {} - * jsonSchemaValidator: new AjvJsonSchemaValidator() - * } - * ); - * - * // @cfworker/json-schema - * const server = new Server( - * { name: 'my-server', version: '1.0.0' }, - * { - * capabilities: {}, - * jsonSchemaValidator: new CfWorkerJsonSchemaValidator() - * } - * ); - * ``` - */ - jsonSchemaValidator?: jsonSchemaValidator; -}; -/** - * An MCP server on top of a pluggable transport. - * - * This server will automatically respond to the initialization flow as initiated from the client. - * - * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: - * - * ```typescript - * // Custom schemas - * const CustomRequestSchema = RequestSchema.extend({...}) - * const CustomNotificationSchema = NotificationSchema.extend({...}) - * const CustomResultSchema = ResultSchema.extend({...}) - * - * // Type aliases - * type CustomRequest = z.infer - * type CustomNotification = z.infer - * type CustomResult = z.infer - * - * // Create typed server - * const server = new Server({ - * name: "CustomServer", - * version: "1.0.0" - * }) - * ``` - * @deprecated Use `McpServer` instead for the high-level API. Only use `Server` for advanced use cases. - */ -export declare class Server extends Protocol { - private _serverInfo; - private _clientCapabilities?; - private _clientVersion?; - private _capabilities; - private _instructions?; - private _jsonSchemaValidator; - private _experimental?; - /** - * Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification). - */ - oninitialized?: () => void; - /** - * Initializes this server with the given name and version information. - */ - constructor(_serverInfo: Implementation, options?: ServerOptions); - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental(): { - tasks: ExperimentalServerTasks; - }; - private _loggingLevels; - private readonly LOG_LEVEL_SEVERITY; - private isMessageIgnored; - /** - * Registers new capabilities. This can only be called before connecting to a transport. - * - * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). - */ - registerCapabilities(capabilities: ServerCapabilities): void; - /** - * Override request handler registration to enforce server-side validation for tools/call. - */ - setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => ServerResult | ResultT | Promise): void; - protected assertCapabilityForMethod(method: RequestT['method']): void; - protected assertNotificationCapability(method: (ServerNotification | NotificationT)['method']): void; - protected assertRequestHandlerCapability(method: string): void; - protected assertTaskCapability(method: string): void; - protected assertTaskHandlerCapability(method: string): void; - private _oninitialize; - /** - * After initialization has completed, this will be populated with the client's reported capabilities. - */ - getClientCapabilities(): ClientCapabilities | undefined; - /** - * After initialization has completed, this will be populated with information about the client's name and version. - */ - getClientVersion(): Implementation | undefined; - private getCapabilities; - ping(): Promise<{ - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - /** - * Request LLM sampling from the client (without tools). - * Returns single content block for backwards compatibility. - */ - createMessage(params: CreateMessageRequestParamsBase, options?: RequestOptions): Promise; - /** - * Request LLM sampling from the client with tool support. - * Returns content that may be a single block or array (for parallel tool calls). - */ - createMessage(params: CreateMessageRequestParamsWithTools, options?: RequestOptions): Promise; - /** - * Request LLM sampling from the client. - * When tools may or may not be present, returns the union type. - */ - createMessage(params: CreateMessageRequest['params'], options?: RequestOptions): Promise; - /** - * Creates an elicitation request for the given parameters. - * For backwards compatibility, `mode` may be omitted for form requests and will default to `'form'`. - * @param params The parameters for the elicitation request. - * @param options Optional request options. - * @returns The result of the elicitation request. - */ - elicitInput(params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions): Promise; - /** - * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete` - * notification for the specified elicitation ID. - * - * @param elicitationId The ID of the elicitation to mark as complete. - * @param options Optional notification options. Useful when the completion notification should be related to a prior request. - * @returns A function that emits the completion notification when awaited. - */ - createElicitationCompletionNotifier(elicitationId: string, options?: NotificationOptions): () => Promise; - listRoots(params?: ListRootsRequest['params'], options?: RequestOptions): Promise<{ - [x: string]: unknown; - roots: { - uri: string; - name?: string | undefined; - _meta?: Record | undefined; - }[]; - _meta?: { - [x: string]: unknown; - progressToken?: string | number | undefined; - "io.modelcontextprotocol/related-task"?: { - taskId: string; - } | undefined; - } | undefined; - }>; - /** - * Sends a logging message to the client, if connected. - * Note: You only need to send the parameters object, not the entire JSON RPC message - * @see LoggingMessageNotification - * @param params - * @param sessionId optional for stateless and backward compatibility - */ - sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise; - sendResourceUpdated(params: ResourceUpdatedNotification['params']): Promise; - sendResourceListChanged(): Promise; - sendToolListChanged(): Promise; - sendPromptListChanged(): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts.map deleted file mode 100644 index fe0fa65..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACzI,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,KAAK,4BAA4B,EAEjC,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAIjB,KAAK,cAAc,EAMnB,KAAK,gBAAgB,EAIrB,KAAK,0BAA0B,EAE/B,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EACvB,KAAK,kBAAk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AAC,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAEnH;;;OAGG;IACG,aAAa,CAAC,MAAM,EAAE,mCAAmC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAEjI;;;OAGG;IACG,aAAa,CACf,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EACtC,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,mBAAmB,GAAG,4BAA4B,CAAC;IAwD9D;;;;;;OAMG;IACG,WAAW,CAAC,MAAM,EAAE,uBAAuB,GAAG,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAgD5H;;;;;;;OAOG;IACH,mCAAmC,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC;IAiBxG,SAAS,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;IAI7E;;;;;;OAMG;IACG,kBAAkB,CAAC,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM;IAQnF,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC;IAOjE,uBAAuB;IAMvB,mBAAmB;IAInB,qBAAqB;CAG9B"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js deleted file mode 100644 index 51d060e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +++ /dev/null @@ -1,440 +0,0 @@ -import { mergeCapabilities, Protocol } from '../shared/protocol.js'; -import { CreateMessageResultSchema, CreateMessageResultWithToolsSchema, ElicitResultSchema, EmptyResultSchema, ErrorCode, InitializedNotificationSchema, InitializeRequestSchema, LATEST_PROTOCOL_VERSION, ListRootsResultSchema, LoggingLevelSchema, McpError, SetLevelRequestSchema, SUPPORTED_PROTOCOL_VERSIONS, CallToolRequestSchema, CallToolResultSchema, CreateTaskResultSchema } from '../types.js'; -import { AjvJsonSchemaValidator } from '../validation/ajv-provider.js'; -import { getObjectShape, isZ4Schema, safeParse } from './zod-compat.js'; -import { ExperimentalServerTasks } from '../experimental/tasks/server.js'; -import { assertToolsCallTaskCapability, assertClientRequestTaskCapability } from '../experimental/tasks/helpers.js'; -/** - * An MCP server on top of a pluggable transport. - * - * This server will automatically respond to the initialization flow as initiated from the client. - * - * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: - * - * ```typescript - * // Custom schemas - * const CustomRequestSchema = RequestSchema.extend({...}) - * const CustomNotificationSchema = NotificationSchema.extend({...}) - * const CustomResultSchema = ResultSchema.extend({...}) - * - * // Type aliases - * type CustomRequest = z.infer - * type CustomNotification = z.infer - * type CustomResult = z.infer - * - * // Create typed server - * const server = new Server({ - * name: "CustomServer", - * version: "1.0.0" - * }) - * ``` - * @deprecated Use `McpServer` instead for the high-level API. Only use `Server` for advanced use cases. - */ -export class Server extends Protocol { - /** - * Initializes this server with the given name and version information. - */ - constructor(_serverInfo, options) { - super(options); - this._serverInfo = _serverInfo; - // Map log levels by session id - this._loggingLevels = new Map(); - // Map LogLevelSchema to severity index - this.LOG_LEVEL_SEVERITY = new Map(LoggingLevelSchema.options.map((level, index) => [level, index])); - // Is a message with the given level ignored in the log level set for the given session id? - this.isMessageIgnored = (level, sessionId) => { - const currentLevel = this._loggingLevels.get(sessionId); - return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false; - }; - this._capabilities = options?.capabilities ?? {}; - this._instructions = options?.instructions; - this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator(); - this.setRequestHandler(InitializeRequestSchema, request => this._oninitialize(request)); - this.setNotificationHandler(InitializedNotificationSchema, () => this.oninitialized?.()); - if (this._capabilities.logging) { - this.setRequestHandler(SetLevelRequestSchema, async (request, extra) => { - const transportSessionId = extra.sessionId || extra.requestInfo?.headers['mcp-session-id'] || undefined; - const { level } = request.params; - const parseResult = LoggingLevelSchema.safeParse(level); - if (parseResult.success) { - this._loggingLevels.set(transportSessionId, parseResult.data); - } - return {}; - }); - } - } - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental() { - if (!this._experimental) { - this._experimental = { - tasks: new ExperimentalServerTasks(this) - }; - } - return this._experimental; - } - /** - * Registers new capabilities. This can only be called before connecting to a transport. - * - * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). - */ - registerCapabilities(capabilities) { - if (this.transport) { - throw new Error('Cannot register capabilities after connecting to transport'); - } - this._capabilities = mergeCapabilities(this._capabilities, capabilities); - } - /** - * Override request handler registration to enforce server-side validation for tools/call. - */ - setRequestHandler(requestSchema, handler) { - const shape = getObjectShape(requestSchema); - const methodSchema = shape?.method; - if (!methodSchema) { - throw new Error('Schema is missing a method literal'); - } - // Extract literal value using type-safe property access - let methodValue; - if (isZ4Schema(methodSchema)) { - const v4Schema = methodSchema; - const v4Def = v4Schema._zod?.def; - methodValue = v4Def?.value ?? v4Schema.value; - } - else { - const v3Schema = methodSchema; - const legacyDef = v3Schema._def; - methodValue = legacyDef?.value ?? v3Schema.value; - } - if (typeof methodValue !== 'string') { - throw new Error('Schema method literal must be a string'); - } - const method = methodValue; - if (method === 'tools/call') { - const wrappedHandler = async (request, extra) => { - const validatedRequest = safeParse(CallToolRequestSchema, request); - if (!validatedRequest.success) { - const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error); - throw new McpError(ErrorCode.InvalidParams, `Invalid tools/call request: ${errorMessage}`); - } - const { params } = validatedRequest.data; - const result = await Promise.resolve(handler(request, extra)); - // When task creation is requested, validate and return CreateTaskResult - if (params.task) { - const taskValidationResult = safeParse(CreateTaskResultSchema, result); - if (!taskValidationResult.success) { - const errorMessage = taskValidationResult.error instanceof Error - ? taskValidationResult.error.message - : String(taskValidationResult.error); - throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`); - } - return taskValidationResult.data; - } - // For non-task requests, validate against CallToolResultSchema - const validationResult = safeParse(CallToolResultSchema, result); - if (!validationResult.success) { - const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error); - throw new McpError(ErrorCode.InvalidParams, `Invalid tools/call result: ${errorMessage}`); - } - return validationResult.data; - }; - // Install the wrapped handler - return super.setRequestHandler(requestSchema, wrappedHandler); - } - // Other handlers use default behavior - return super.setRequestHandler(requestSchema, handler); - } - assertCapabilityForMethod(method) { - switch (method) { - case 'sampling/createMessage': - if (!this._clientCapabilities?.sampling) { - throw new Error(`Client does not support sampling (required for ${method})`); - } - break; - case 'elicitation/create': - if (!this._clientCapabilities?.elicitation) { - throw new Error(`Client does not support elicitation (required for ${method})`); - } - break; - case 'roots/list': - if (!this._clientCapabilities?.roots) { - throw new Error(`Client does not support listing roots (required for ${method})`); - } - break; - case 'ping': - // No specific capability required for ping - break; - } - } - assertNotificationCapability(method) { - switch (method) { - case 'notifications/message': - if (!this._capabilities.logging) { - throw new Error(`Server does not support logging (required for ${method})`); - } - break; - case 'notifications/resources/updated': - case 'notifications/resources/list_changed': - if (!this._capabilities.resources) { - throw new Error(`Server does not support notifying about resources (required for ${method})`); - } - break; - case 'notifications/tools/list_changed': - if (!this._capabilities.tools) { - throw new Error(`Server does not support notifying of tool list changes (required for ${method})`); - } - break; - case 'notifications/prompts/list_changed': - if (!this._capabilities.prompts) { - throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`); - } - break; - case 'notifications/elicitation/complete': - if (!this._clientCapabilities?.elicitation?.url) { - throw new Error(`Client does not support URL elicitation (required for ${method})`); - } - break; - case 'notifications/cancelled': - // Cancellation notifications are always allowed - break; - case 'notifications/progress': - // Progress notifications are always allowed - break; - } - } - assertRequestHandlerCapability(method) { - // Task handlers are registered in Protocol constructor before _capabilities is initialized - // Skip capability check for task methods during initialization - if (!this._capabilities) { - return; - } - switch (method) { - case 'completion/complete': - if (!this._capabilities.completions) { - throw new Error(`Server does not support completions (required for ${method})`); - } - break; - case 'logging/setLevel': - if (!this._capabilities.logging) { - throw new Error(`Server does not support logging (required for ${method})`); - } - break; - case 'prompts/get': - case 'prompts/list': - if (!this._capabilities.prompts) { - throw new Error(`Server does not support prompts (required for ${method})`); - } - break; - case 'resources/list': - case 'resources/templates/list': - case 'resources/read': - if (!this._capabilities.resources) { - throw new Error(`Server does not support resources (required for ${method})`); - } - break; - case 'tools/call': - case 'tools/list': - if (!this._capabilities.tools) { - throw new Error(`Server does not support tools (required for ${method})`); - } - break; - case 'tasks/get': - case 'tasks/list': - case 'tasks/result': - case 'tasks/cancel': - if (!this._capabilities.tasks) { - throw new Error(`Server does not support tasks capability (required for ${method})`); - } - break; - case 'ping': - case 'initialize': - // No specific capability required for these methods - break; - } - } - assertTaskCapability(method) { - assertClientRequestTaskCapability(this._clientCapabilities?.tasks?.requests, method, 'Client'); - } - assertTaskHandlerCapability(method) { - // Task handlers are registered in Protocol constructor before _capabilities is initialized - // Skip capability check for task methods during initialization - if (!this._capabilities) { - return; - } - assertToolsCallTaskCapability(this._capabilities.tasks?.requests, method, 'Server'); - } - async _oninitialize(request) { - const requestedVersion = request.params.protocolVersion; - this._clientCapabilities = request.params.capabilities; - this._clientVersion = request.params.clientInfo; - const protocolVersion = SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) ? requestedVersion : LATEST_PROTOCOL_VERSION; - return { - protocolVersion, - capabilities: this.getCapabilities(), - serverInfo: this._serverInfo, - ...(this._instructions && { instructions: this._instructions }) - }; - } - /** - * After initialization has completed, this will be populated with the client's reported capabilities. - */ - getClientCapabilities() { - return this._clientCapabilities; - } - /** - * After initialization has completed, this will be populated with information about the client's name and version. - */ - getClientVersion() { - return this._clientVersion; - } - getCapabilities() { - return this._capabilities; - } - async ping() { - return this.request({ method: 'ping' }, EmptyResultSchema); - } - // Implementation - async createMessage(params, options) { - // Capability check - only required when tools/toolChoice are provided - if (params.tools || params.toolChoice) { - if (!this._clientCapabilities?.sampling?.tools) { - throw new Error('Client does not support sampling tools capability.'); - } - } - // Message structure validation - always validate tool_use/tool_result pairs. - // These may appear even without tools/toolChoice in the current request when - // a previous sampling request returned tool_use and this is a follow-up with results. - if (params.messages.length > 0) { - const lastMessage = params.messages[params.messages.length - 1]; - const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content]; - const hasToolResults = lastContent.some(c => c.type === 'tool_result'); - const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined; - const previousContent = previousMessage - ? Array.isArray(previousMessage.content) - ? previousMessage.content - : [previousMessage.content] - : []; - const hasPreviousToolUse = previousContent.some(c => c.type === 'tool_use'); - if (hasToolResults) { - if (lastContent.some(c => c.type !== 'tool_result')) { - throw new Error('The last message must contain only tool_result content if any is present'); - } - if (!hasPreviousToolUse) { - throw new Error('tool_result blocks are not matching any tool_use from the previous message'); - } - } - if (hasPreviousToolUse) { - const toolUseIds = new Set(previousContent.filter(c => c.type === 'tool_use').map(c => c.id)); - const toolResultIds = new Set(lastContent.filter(c => c.type === 'tool_result').map(c => c.toolUseId)); - if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every(id => toolResultIds.has(id))) { - throw new Error('ids of tool_result blocks and tool_use blocks from previous message do not match'); - } - } - } - // Use different schemas based on whether tools are provided - if (params.tools) { - return this.request({ method: 'sampling/createMessage', params }, CreateMessageResultWithToolsSchema, options); - } - return this.request({ method: 'sampling/createMessage', params }, CreateMessageResultSchema, options); - } - /** - * Creates an elicitation request for the given parameters. - * For backwards compatibility, `mode` may be omitted for form requests and will default to `'form'`. - * @param params The parameters for the elicitation request. - * @param options Optional request options. - * @returns The result of the elicitation request. - */ - async elicitInput(params, options) { - const mode = (params.mode ?? 'form'); - switch (mode) { - case 'url': { - if (!this._clientCapabilities?.elicitation?.url) { - throw new Error('Client does not support url elicitation.'); - } - const urlParams = params; - return this.request({ method: 'elicitation/create', params: urlParams }, ElicitResultSchema, options); - } - case 'form': { - if (!this._clientCapabilities?.elicitation?.form) { - throw new Error('Client does not support form elicitation.'); - } - const formParams = params.mode === 'form' ? params : { ...params, mode: 'form' }; - const result = await this.request({ method: 'elicitation/create', params: formParams }, ElicitResultSchema, options); - if (result.action === 'accept' && result.content && formParams.requestedSchema) { - try { - const validator = this._jsonSchemaValidator.getValidator(formParams.requestedSchema); - const validationResult = validator(result.content); - if (!validationResult.valid) { - throw new McpError(ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`); - } - } - catch (error) { - if (error instanceof McpError) { - throw error; - } - throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${error instanceof Error ? error.message : String(error)}`); - } - } - return result; - } - } - } - /** - * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete` - * notification for the specified elicitation ID. - * - * @param elicitationId The ID of the elicitation to mark as complete. - * @param options Optional notification options. Useful when the completion notification should be related to a prior request. - * @returns A function that emits the completion notification when awaited. - */ - createElicitationCompletionNotifier(elicitationId, options) { - if (!this._clientCapabilities?.elicitation?.url) { - throw new Error('Client does not support URL elicitation (required for notifications/elicitation/complete)'); - } - return () => this.notification({ - method: 'notifications/elicitation/complete', - params: { - elicitationId - } - }, options); - } - async listRoots(params, options) { - return this.request({ method: 'roots/list', params }, ListRootsResultSchema, options); - } - /** - * Sends a logging message to the client, if connected. - * Note: You only need to send the parameters object, not the entire JSON RPC message - * @see LoggingMessageNotification - * @param params - * @param sessionId optional for stateless and backward compatibility - */ - async sendLoggingMessage(params, sessionId) { - if (this._capabilities.logging) { - if (!this.isMessageIgnored(params.level, sessionId)) { - return this.notification({ method: 'notifications/message', params }); - } - } - } - async sendResourceUpdated(params) { - return this.notification({ - method: 'notifications/resources/updated', - params - }); - } - async sendResourceListChanged() { - return this.notification({ - method: 'notifications/resources/list_changed' - }); - } - async sendToolListChanged() { - return this.notification({ method: 'notifications/tools/list_changed' }); - } - async sendPromptListChanged() { - return this.notification({ method: 'notifications/prompts/list_changed' }); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map deleted file mode 100644 index bd94351..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAuE,MAAM,uBAAuB,CAAC;AACzI,OAAO,EAIH,yBAAyB,EAEzB,kCAAkC,EAMlC,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EAET,6BAA6B,EAE7B,uBAAuB,EAEvB,uBAAuB,EAEvB,qBAAqB,EAErB,kBAAkB,EAElB,QAAQ,EAMR,qBAAqB,EACrB,2BAA2B,EAG3B,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EAIzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAEH,cAAc,EACd,UAAU,EACV,SAAS,EAIZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AA6CpH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,MAIX,SAAQ,QAA8F;IAapG;;OAEG;IACH,YACY,WAA2B,EACnC,OAAuB;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHP,gBAAW,GAAX,WAAW,CAAgB;QAyCvC,+BAA+B;QACvB,mBAAc,GAAG,IAAI,GAAG,EAAoC,CA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CAAC,uBAAuB;QACzB,OAAO,IAAI,CAAC,YAAY,CAAC;YACrB,MAAM,EAAE,sCAAsC;SACjD,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,mBAAmB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,qBAAqB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts deleted file mode 100644 index 1bc0c68..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts +++ /dev/null @@ -1,364 +0,0 @@ -import { Server, ServerOptions } from './index.js'; -import { AnySchema, AnyObjectSchema, ZodRawShapeCompat, SchemaOutput, ShapeOutput } from './zod-compat.js'; -import { Implementation, CallToolResult, Resource, ListResourcesResult, GetPromptResult, ReadResourceResult, ServerRequest, ServerNotification, ToolAnnotations, LoggingMessageNotification, Result, ToolExecution } from '../types.js'; -import { UriTemplate, Variables } from '../shared/uriTemplate.js'; -import { RequestHandlerExtra } from '../shared/protocol.js'; -import { Transport } from '../shared/transport.js'; -import { ExperimentalMcpServerTasks } from '../experimental/tasks/mcp-server.js'; -import type { ToolTaskHandler } from '../experimental/tasks/interfaces.js'; -/** - * High-level MCP server that provides a simpler API for working with resources, tools, and prompts. - * For advanced usage (like sending notifications or setting custom request handlers), use the underlying - * Server instance available via the `server` property. - */ -export declare class McpServer { - /** - * The underlying Server instance, useful for advanced operations like sending notifications. - */ - readonly server: Server; - private _registeredResources; - private _registeredResourceTemplates; - private _registeredTools; - private _registeredPrompts; - private _experimental?; - constructor(serverInfo: Implementation, options?: ServerOptions); - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental(): { - tasks: ExperimentalMcpServerTasks; - }; - /** - * Attaches to the given transport, starts it, and starts listening for messages. - * - * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. - */ - connect(transport: Transport): Promise; - /** - * Closes the connection. - */ - close(): Promise; - private _toolHandlersInitialized; - private setToolRequestHandlers; - /** - * Creates a tool error result. - * - * @param errorMessage - The error message. - * @returns The tool error result. - */ - private createToolError; - /** - * Validates tool input arguments against the tool's input schema. - */ - private validateToolInput; - /** - * Validates tool output against the tool's output schema. - */ - private validateToolOutput; - /** - * Executes a tool handler (either regular or task-based). - */ - private executeToolHandler; - /** - * Handles automatic task polling for tools with taskSupport 'optional'. - */ - private handleAutomaticTaskPolling; - private _completionHandlerInitialized; - private setCompletionRequestHandler; - private handlePromptCompletion; - private handleResourceCompletion; - private _resourceHandlersInitialized; - private setResourceRequestHandlers; - private _promptHandlersInitialized; - private setPromptRequestHandlers; - /** - * Registers a resource `name` at a fixed URI, which will use the given callback to respond to read requests. - * @deprecated Use `registerResource` instead. - */ - resource(name: string, uri: string, readCallback: ReadResourceCallback): RegisteredResource; - /** - * Registers a resource `name` at a fixed URI with metadata, which will use the given callback to respond to read requests. - * @deprecated Use `registerResource` instead. - */ - resource(name: string, uri: string, metadata: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource; - /** - * Registers a resource `name` with a template pattern, which will use the given callback to respond to read requests. - * @deprecated Use `registerResource` instead. - */ - resource(name: string, template: ResourceTemplate, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; - /** - * Registers a resource `name` with a template pattern and metadata, which will use the given callback to respond to read requests. - * @deprecated Use `registerResource` instead. - */ - resource(name: string, template: ResourceTemplate, metadata: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; - /** - * Registers a resource with a config object and callback. - * For static resources, use a URI string. For dynamic resources, use a ResourceTemplate. - */ - registerResource(name: string, uriOrTemplate: string, config: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource; - registerResource(name: string, uriOrTemplate: ResourceTemplate, config: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; - private _createRegisteredResource; - private _createRegisteredResourceTemplate; - private _createRegisteredPrompt; - private _createRegisteredTool; - /** - * Registers a zero-argument tool `name`, which will run the given function when the client calls it. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, cb: ToolCallback): RegisteredTool; - /** - * Registers a zero-argument tool `name` (with a description) which will run the given function when the client calls it. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, description: string, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool taking either a parameter schema for validation or annotations for additional metadata. - * This unified overload handles both `tool(name, paramsSchema, cb)` and `tool(name, annotations, cb)` cases. - * - * Note: We use a union type for the second parameter because TypeScript cannot reliably disambiguate - * between ToolAnnotations and ZodRawShapeCompat during overload resolution, as both are plain object types. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool `name` (with a description) taking either parameter schema or annotations. - * This unified overload handles both `tool(name, description, paramsSchema, cb)` and - * `tool(name, description, annotations, cb)` cases. - * - * Note: We use a union type for the third parameter because TypeScript cannot reliably disambiguate - * between ToolAnnotations and ZodRawShapeCompat during overload resolution, as both are plain object types. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, description: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool with both parameter schema and annotations. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool with description, parameter schema, and annotations. - * @deprecated Use `registerTool` instead. - */ - tool(name: string, description: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; - /** - * Registers a tool with a config object and callback. - */ - registerTool(name: string, config: { - title?: string; - description?: string; - inputSchema?: InputArgs; - outputSchema?: OutputArgs; - annotations?: ToolAnnotations; - _meta?: Record; - }, cb: ToolCallback): RegisteredTool; - /** - * Registers a zero-argument prompt `name`, which will run the given function when the client calls it. - * @deprecated Use `registerPrompt` instead. - */ - prompt(name: string, cb: PromptCallback): RegisteredPrompt; - /** - * Registers a zero-argument prompt `name` (with a description) which will run the given function when the client calls it. - * @deprecated Use `registerPrompt` instead. - */ - prompt(name: string, description: string, cb: PromptCallback): RegisteredPrompt; - /** - * Registers a prompt `name` accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. - * @deprecated Use `registerPrompt` instead. - */ - prompt(name: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; - /** - * Registers a prompt `name` (with a description) accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. - * @deprecated Use `registerPrompt` instead. - */ - prompt(name: string, description: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; - /** - * Registers a prompt with a config object and callback. - */ - registerPrompt(name: string, config: { - title?: string; - description?: string; - argsSchema?: Args; - }, cb: PromptCallback): RegisteredPrompt; - /** - * Checks if the server is connected to a transport. - * @returns True if the server is connected - */ - isConnected(): boolean; - /** - * Sends a logging message to the client, if connected. - * Note: You only need to send the parameters object, not the entire JSON RPC message - * @see LoggingMessageNotification - * @param params - * @param sessionId optional for stateless and backward compatibility - */ - sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise; - /** - * Sends a resource list changed event to the client, if connected. - */ - sendResourceListChanged(): void; - /** - * Sends a tool list changed event to the client, if connected. - */ - sendToolListChanged(): void; - /** - * Sends a prompt list changed event to the client, if connected. - */ - sendPromptListChanged(): void; -} -/** - * A callback to complete one variable within a resource template's URI template. - */ -export type CompleteResourceTemplateCallback = (value: string, context?: { - arguments?: Record; -}) => string[] | Promise; -/** - * A resource template combines a URI pattern with optional functionality to enumerate - * all resources matching that pattern. - */ -export declare class ResourceTemplate { - private _callbacks; - private _uriTemplate; - constructor(uriTemplate: string | UriTemplate, _callbacks: { - /** - * A callback to list all resources matching this template. This is required to specified, even if `undefined`, to avoid accidentally forgetting resource listing. - */ - list: ListResourcesCallback | undefined; - /** - * An optional callback to autocomplete variables within the URI template. Useful for clients and users to discover possible values. - */ - complete?: { - [variable: string]: CompleteResourceTemplateCallback; - }; - }); - /** - * Gets the URI template pattern. - */ - get uriTemplate(): UriTemplate; - /** - * Gets the list callback, if one was provided. - */ - get listCallback(): ListResourcesCallback | undefined; - /** - * Gets the callback for completing a specific URI template variable, if one was provided. - */ - completeCallback(variable: string): CompleteResourceTemplateCallback | undefined; -} -export type BaseToolCallback, Args extends undefined | ZodRawShapeCompat | AnySchema> = Args extends ZodRawShapeCompat ? (args: ShapeOutput, extra: Extra) => SendResultT | Promise : Args extends AnySchema ? (args: SchemaOutput, extra: Extra) => SendResultT | Promise : (extra: Extra) => SendResultT | Promise; -/** - * Callback for a tool handler registered with Server.tool(). - * - * Parameters will include tool arguments, if applicable, as well as other request handler context. - * - * The callback should return: - * - `structuredContent` if the tool has an outputSchema defined - * - `content` if the tool does not have an outputSchema - * - Both fields are optional but typically one should be provided - */ -export type ToolCallback = BaseToolCallback, Args>; -/** - * Supertype that can handle both regular tools (simple callback) and task-based tools (task handler object). - */ -export type AnyToolHandler = ToolCallback | ToolTaskHandler; -export type RegisteredTool = { - title?: string; - description?: string; - inputSchema?: AnySchema; - outputSchema?: AnySchema; - annotations?: ToolAnnotations; - execution?: ToolExecution; - _meta?: Record; - handler: AnyToolHandler; - enabled: boolean; - enable(): void; - disable(): void; - update(updates: { - name?: string | null; - title?: string; - description?: string; - paramsSchema?: InputArgs; - outputSchema?: OutputArgs; - annotations?: ToolAnnotations; - _meta?: Record; - callback?: ToolCallback; - enabled?: boolean; - }): void; - remove(): void; -}; -/** - * Additional, optional information for annotating a resource. - */ -export type ResourceMetadata = Omit; -/** - * Callback to list all resources matching a given template. - */ -export type ListResourcesCallback = (extra: RequestHandlerExtra) => ListResourcesResult | Promise; -/** - * Callback to read a resource at a given URI. - */ -export type ReadResourceCallback = (uri: URL, extra: RequestHandlerExtra) => ReadResourceResult | Promise; -export type RegisteredResource = { - name: string; - title?: string; - metadata?: ResourceMetadata; - readCallback: ReadResourceCallback; - enabled: boolean; - enable(): void; - disable(): void; - update(updates: { - name?: string; - title?: string; - uri?: string | null; - metadata?: ResourceMetadata; - callback?: ReadResourceCallback; - enabled?: boolean; - }): void; - remove(): void; -}; -/** - * Callback to read a resource at a given URI, following a filled-in URI template. - */ -export type ReadResourceTemplateCallback = (uri: URL, variables: Variables, extra: RequestHandlerExtra) => ReadResourceResult | Promise; -export type RegisteredResourceTemplate = { - resourceTemplate: ResourceTemplate; - title?: string; - metadata?: ResourceMetadata; - readCallback: ReadResourceTemplateCallback; - enabled: boolean; - enable(): void; - disable(): void; - update(updates: { - name?: string | null; - title?: string; - template?: ResourceTemplate; - metadata?: ResourceMetadata; - callback?: ReadResourceTemplateCallback; - enabled?: boolean; - }): void; - remove(): void; -}; -type PromptArgsRawShape = ZodRawShapeCompat; -export type PromptCallback = Args extends PromptArgsRawShape ? (args: ShapeOutput, extra: RequestHandlerExtra) => GetPromptResult | Promise : (extra: RequestHandlerExtra) => GetPromptResult | Promise; -export type RegisteredPrompt = { - title?: string; - description?: string; - argsSchema?: AnyObjectSchema; - callback: PromptCallback; - enabled: boolean; - enable(): void; - disable(): void; - update(updates: { - name?: string | null; - title?: string; - description?: string; - argsSchema?: Args; - callback?: PromptCallback; - enabled?: boolean; - }): void; - remove(): void; -}; -export {}; -//# sourceMappingURL=mcp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts.map deleted file mode 100644 index 0b460bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts.map +++ /dev/null @@ -1 +0,0 @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AC,aAAa,EAAE,kBAAkB,CAAC,KAAK,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEpH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,QAAQ,EAAE,cAAc,CAAC,SAAS,GAAG,kBAAkB,CAAC,CAAC;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,MAAM,CAAC,IAAI,SAAS,kBAAkB,EAAE,OAAO,EAAE;QAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,IAAI,CAAC;QAClB,QAAQ,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,GAAG,IAAI,CAAC;IACT,MAAM,IAAI,IAAI,CAAC;CAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js deleted file mode 100644 index 23639ce..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +++ /dev/null @@ -1,913 +0,0 @@ -import { Server } from './index.js'; -import { normalizeObjectSchema, safeParseAsync, getObjectShape, objectFromShape, getParseErrorMessage, getSchemaDescription, isSchemaOptional, getLiteralValue } from './zod-compat.js'; -import { toJsonSchemaCompat } from './zod-json-schema-compat.js'; -import { McpError, ErrorCode, ListResourceTemplatesRequestSchema, ReadResourceRequestSchema, ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, CompleteRequestSchema, assertCompleteRequestPrompt, assertCompleteRequestResourceTemplate } from '../types.js'; -import { isCompletable, getCompleter } from './completable.js'; -import { UriTemplate } from '../shared/uriTemplate.js'; -import { validateAndWarnToolName } from '../shared/toolNameValidation.js'; -import { ExperimentalMcpServerTasks } from '../experimental/tasks/mcp-server.js'; -import { ZodOptional } from 'zod'; -/** - * High-level MCP server that provides a simpler API for working with resources, tools, and prompts. - * For advanced usage (like sending notifications or setting custom request handlers), use the underlying - * Server instance available via the `server` property. - */ -export class McpServer { - constructor(serverInfo, options) { - this._registeredResources = {}; - this._registeredResourceTemplates = {}; - this._registeredTools = {}; - this._registeredPrompts = {}; - this._toolHandlersInitialized = false; - this._completionHandlerInitialized = false; - this._resourceHandlersInitialized = false; - this._promptHandlersInitialized = false; - this.server = new Server(serverInfo, options); - } - /** - * Access experimental features. - * - * WARNING: These APIs are experimental and may change without notice. - * - * @experimental - */ - get experimental() { - if (!this._experimental) { - this._experimental = { - tasks: new ExperimentalMcpServerTasks(this) - }; - } - return this._experimental; - } - /** - * Attaches to the given transport, starts it, and starts listening for messages. - * - * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. - */ - async connect(transport) { - return await this.server.connect(transport); - } - /** - * Closes the connection. - */ - async close() { - await this.server.close(); - } - setToolRequestHandlers() { - if (this._toolHandlersInitialized) { - return; - } - this.server.assertCanSetRequestHandler(getMethodValue(ListToolsRequestSchema)); - this.server.assertCanSetRequestHandler(getMethodValue(CallToolRequestSchema)); - this.server.registerCapabilities({ - tools: { - listChanged: true - } - }); - this.server.setRequestHandler(ListToolsRequestSchema, () => ({ - tools: Object.entries(this._registeredTools) - .filter(([, tool]) => tool.enabled) - .map(([name, tool]) => { - const toolDefinition = { - name, - title: tool.title, - description: tool.description, - inputSchema: (() => { - const obj = normalizeObjectSchema(tool.inputSchema); - return obj - ? toJsonSchemaCompat(obj, { - strictUnions: true, - pipeStrategy: 'input' - }) - : EMPTY_OBJECT_JSON_SCHEMA; - })(), - annotations: tool.annotations, - execution: tool.execution, - _meta: tool._meta - }; - if (tool.outputSchema) { - const obj = normalizeObjectSchema(tool.outputSchema); - if (obj) { - toolDefinition.outputSchema = toJsonSchemaCompat(obj, { - strictUnions: true, - pipeStrategy: 'output' - }); - } - } - return toolDefinition; - }) - })); - this.server.setRequestHandler(CallToolRequestSchema, async (request, extra) => { - try { - const tool = this._registeredTools[request.params.name]; - if (!tool) { - throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} not found`); - } - if (!tool.enabled) { - throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`); - } - const isTaskRequest = !!request.params.task; - const taskSupport = tool.execution?.taskSupport; - const isTaskHandler = 'createTask' in tool.handler; - // Validate task hint configuration - if ((taskSupport === 'required' || taskSupport === 'optional') && !isTaskHandler) { - throw new McpError(ErrorCode.InternalError, `Tool ${request.params.name} has taskSupport '${taskSupport}' but was not registered with registerToolTask`); - } - // Handle taskSupport 'required' without task augmentation - if (taskSupport === 'required' && !isTaskRequest) { - throw new McpError(ErrorCode.MethodNotFound, `Tool ${request.params.name} requires task augmentation (taskSupport: 'required')`); - } - // Handle taskSupport 'optional' without task augmentation - automatic polling - if (taskSupport === 'optional' && !isTaskRequest && isTaskHandler) { - return await this.handleAutomaticTaskPolling(tool, request, extra); - } - // Normal execution path - const args = await this.validateToolInput(tool, request.params.arguments, request.params.name); - const result = await this.executeToolHandler(tool, args, extra); - // Return CreateTaskResult immediately for task requests - if (isTaskRequest) { - return result; - } - // Validate output schema for non-task requests - await this.validateToolOutput(tool, result, request.params.name); - return result; - } - catch (error) { - if (error instanceof McpError) { - if (error.code === ErrorCode.UrlElicitationRequired) { - throw error; // Return the error to the caller without wrapping in CallToolResult - } - } - return this.createToolError(error instanceof Error ? error.message : String(error)); - } - }); - this._toolHandlersInitialized = true; - } - /** - * Creates a tool error result. - * - * @param errorMessage - The error message. - * @returns The tool error result. - */ - createToolError(errorMessage) { - return { - content: [ - { - type: 'text', - text: errorMessage - } - ], - isError: true - }; - } - /** - * Validates tool input arguments against the tool's input schema. - */ - async validateToolInput(tool, args, toolName) { - if (!tool.inputSchema) { - return undefined; - } - // Try to normalize to object schema first (for raw shapes and object schemas) - // If that fails, use the schema directly (for union/intersection/etc) - const inputObj = normalizeObjectSchema(tool.inputSchema); - const schemaToParse = inputObj ?? tool.inputSchema; - const parseResult = await safeParseAsync(schemaToParse, args); - if (!parseResult.success) { - const error = 'error' in parseResult ? parseResult.error : 'Unknown error'; - const errorMessage = getParseErrorMessage(error); - throw new McpError(ErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${errorMessage}`); - } - return parseResult.data; - } - /** - * Validates tool output against the tool's output schema. - */ - async validateToolOutput(tool, result, toolName) { - if (!tool.outputSchema) { - return; - } - // Only validate CallToolResult, not CreateTaskResult - if (!('content' in result)) { - return; - } - if (result.isError) { - return; - } - if (!result.structuredContent) { - throw new McpError(ErrorCode.InvalidParams, `Output validation error: Tool ${toolName} has an output schema but no structured content was provided`); - } - // if the tool has an output schema, validate structured content - const outputObj = normalizeObjectSchema(tool.outputSchema); - const parseResult = await safeParseAsync(outputObj, result.structuredContent); - if (!parseResult.success) { - const error = 'error' in parseResult ? parseResult.error : 'Unknown error'; - const errorMessage = getParseErrorMessage(error); - throw new McpError(ErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${errorMessage}`); - } - } - /** - * Executes a tool handler (either regular or task-based). - */ - async executeToolHandler(tool, args, extra) { - const handler = tool.handler; - const isTaskHandler = 'createTask' in handler; - if (isTaskHandler) { - if (!extra.taskStore) { - throw new Error('No task store provided.'); - } - const taskExtra = { ...extra, taskStore: extra.taskStore }; - if (tool.inputSchema) { - const typedHandler = handler; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(typedHandler.createTask(args, taskExtra)); - } - else { - const typedHandler = handler; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(typedHandler.createTask(taskExtra)); - } - } - if (tool.inputSchema) { - const typedHandler = handler; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(typedHandler(args, extra)); - } - else { - const typedHandler = handler; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(typedHandler(extra)); - } - } - /** - * Handles automatic task polling for tools with taskSupport 'optional'. - */ - async handleAutomaticTaskPolling(tool, request, extra) { - if (!extra.taskStore) { - throw new Error('No task store provided for task-capable tool.'); - } - // Validate input and create task - const args = await this.validateToolInput(tool, request.params.arguments, request.params.name); - const handler = tool.handler; - const taskExtra = { ...extra, taskStore: extra.taskStore }; - const createTaskResult = args // undefined only if tool.inputSchema is undefined - ? await Promise.resolve(handler.createTask(args, taskExtra)) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - await Promise.resolve(handler.createTask(taskExtra)); - // Poll until completion - const taskId = createTaskResult.task.taskId; - let task = createTaskResult.task; - const pollInterval = task.pollInterval ?? 5000; - while (task.status !== 'completed' && task.status !== 'failed' && task.status !== 'cancelled') { - await new Promise(resolve => setTimeout(resolve, pollInterval)); - const updatedTask = await extra.taskStore.getTask(taskId); - if (!updatedTask) { - throw new McpError(ErrorCode.InternalError, `Task ${taskId} not found during polling`); - } - task = updatedTask; - } - // Return the final result - return (await extra.taskStore.getTaskResult(taskId)); - } - setCompletionRequestHandler() { - if (this._completionHandlerInitialized) { - return; - } - this.server.assertCanSetRequestHandler(getMethodValue(CompleteRequestSchema)); - this.server.registerCapabilities({ - completions: {} - }); - this.server.setRequestHandler(CompleteRequestSchema, async (request) => { - switch (request.params.ref.type) { - case 'ref/prompt': - assertCompleteRequestPrompt(request); - return this.handlePromptCompletion(request, request.params.ref); - case 'ref/resource': - assertCompleteRequestResourceTemplate(request); - return this.handleResourceCompletion(request, request.params.ref); - default: - throw new McpError(ErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`); - } - }); - this._completionHandlerInitialized = true; - } - async handlePromptCompletion(request, ref) { - const prompt = this._registeredPrompts[ref.name]; - if (!prompt) { - throw new McpError(ErrorCode.InvalidParams, `Prompt ${ref.name} not found`); - } - if (!prompt.enabled) { - throw new McpError(ErrorCode.InvalidParams, `Prompt ${ref.name} disabled`); - } - if (!prompt.argsSchema) { - return EMPTY_COMPLETION_RESULT; - } - const promptShape = getObjectShape(prompt.argsSchema); - const field = promptShape?.[request.params.argument.name]; - if (!isCompletable(field)) { - return EMPTY_COMPLETION_RESULT; - } - const completer = getCompleter(field); - if (!completer) { - return EMPTY_COMPLETION_RESULT; - } - const suggestions = await completer(request.params.argument.value, request.params.context); - return createCompletionResult(suggestions); - } - async handleResourceCompletion(request, ref) { - const template = Object.values(this._registeredResourceTemplates).find(t => t.resourceTemplate.uriTemplate.toString() === ref.uri); - if (!template) { - if (this._registeredResources[ref.uri]) { - // Attempting to autocomplete a fixed resource URI is not an error in the spec (but probably should be). - return EMPTY_COMPLETION_RESULT; - } - throw new McpError(ErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`); - } - const completer = template.resourceTemplate.completeCallback(request.params.argument.name); - if (!completer) { - return EMPTY_COMPLETION_RESULT; - } - const suggestions = await completer(request.params.argument.value, request.params.context); - return createCompletionResult(suggestions); - } - setResourceRequestHandlers() { - if (this._resourceHandlersInitialized) { - return; - } - this.server.assertCanSetRequestHandler(getMethodValue(ListResourcesRequestSchema)); - this.server.assertCanSetRequestHandler(getMethodValue(ListResourceTemplatesRequestSchema)); - this.server.assertCanSetRequestHandler(getMethodValue(ReadResourceRequestSchema)); - this.server.registerCapabilities({ - resources: { - listChanged: true - } - }); - this.server.setRequestHandler(ListResourcesRequestSchema, async (request, extra) => { - const resources = Object.entries(this._registeredResources) - .filter(([_, resource]) => resource.enabled) - .map(([uri, resource]) => ({ - uri, - name: resource.name, - ...resource.metadata - })); - const templateResources = []; - for (const template of Object.values(this._registeredResourceTemplates)) { - if (!template.resourceTemplate.listCallback) { - continue; - } - const result = await template.resourceTemplate.listCallback(extra); - for (const resource of result.resources) { - templateResources.push({ - ...template.metadata, - // the defined resource metadata should override the template metadata if present - ...resource - }); - } - } - return { resources: [...resources, ...templateResources] }; - }); - this.server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => { - const resourceTemplates = Object.entries(this._registeredResourceTemplates).map(([name, template]) => ({ - name, - uriTemplate: template.resourceTemplate.uriTemplate.toString(), - ...template.metadata - })); - return { resourceTemplates }; - }); - this.server.setRequestHandler(ReadResourceRequestSchema, async (request, extra) => { - const uri = new URL(request.params.uri); - // First check for exact resource match - const resource = this._registeredResources[uri.toString()]; - if (resource) { - if (!resource.enabled) { - throw new McpError(ErrorCode.InvalidParams, `Resource ${uri} disabled`); - } - return resource.readCallback(uri, extra); - } - // Then check templates - for (const template of Object.values(this._registeredResourceTemplates)) { - const variables = template.resourceTemplate.uriTemplate.match(uri.toString()); - if (variables) { - return template.readCallback(uri, variables, extra); - } - } - throw new McpError(ErrorCode.InvalidParams, `Resource ${uri} not found`); - }); - this._resourceHandlersInitialized = true; - } - setPromptRequestHandlers() { - if (this._promptHandlersInitialized) { - return; - } - this.server.assertCanSetRequestHandler(getMethodValue(ListPromptsRequestSchema)); - this.server.assertCanSetRequestHandler(getMethodValue(GetPromptRequestSchema)); - this.server.registerCapabilities({ - prompts: { - listChanged: true - } - }); - this.server.setRequestHandler(ListPromptsRequestSchema, () => ({ - prompts: Object.entries(this._registeredPrompts) - .filter(([, prompt]) => prompt.enabled) - .map(([name, prompt]) => { - return { - name, - title: prompt.title, - description: prompt.description, - arguments: prompt.argsSchema ? promptArgumentsFromSchema(prompt.argsSchema) : undefined - }; - }) - })); - this.server.setRequestHandler(GetPromptRequestSchema, async (request, extra) => { - const prompt = this._registeredPrompts[request.params.name]; - if (!prompt) { - throw new McpError(ErrorCode.InvalidParams, `Prompt ${request.params.name} not found`); - } - if (!prompt.enabled) { - throw new McpError(ErrorCode.InvalidParams, `Prompt ${request.params.name} disabled`); - } - if (prompt.argsSchema) { - const argsObj = normalizeObjectSchema(prompt.argsSchema); - const parseResult = await safeParseAsync(argsObj, request.params.arguments); - if (!parseResult.success) { - const error = 'error' in parseResult ? parseResult.error : 'Unknown error'; - const errorMessage = getParseErrorMessage(error); - throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for prompt ${request.params.name}: ${errorMessage}`); - } - const args = parseResult.data; - const cb = prompt.callback; - return await Promise.resolve(cb(args, extra)); - } - else { - const cb = prompt.callback; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return await Promise.resolve(cb(extra)); - } - }); - this._promptHandlersInitialized = true; - } - resource(name, uriOrTemplate, ...rest) { - let metadata; - if (typeof rest[0] === 'object') { - metadata = rest.shift(); - } - const readCallback = rest[0]; - if (typeof uriOrTemplate === 'string') { - if (this._registeredResources[uriOrTemplate]) { - throw new Error(`Resource ${uriOrTemplate} is already registered`); - } - const registeredResource = this._createRegisteredResource(name, undefined, uriOrTemplate, metadata, readCallback); - this.setResourceRequestHandlers(); - this.sendResourceListChanged(); - return registeredResource; - } - else { - if (this._registeredResourceTemplates[name]) { - throw new Error(`Resource template ${name} is already registered`); - } - const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, undefined, uriOrTemplate, metadata, readCallback); - this.setResourceRequestHandlers(); - this.sendResourceListChanged(); - return registeredResourceTemplate; - } - } - registerResource(name, uriOrTemplate, config, readCallback) { - if (typeof uriOrTemplate === 'string') { - if (this._registeredResources[uriOrTemplate]) { - throw new Error(`Resource ${uriOrTemplate} is already registered`); - } - const registeredResource = this._createRegisteredResource(name, config.title, uriOrTemplate, config, readCallback); - this.setResourceRequestHandlers(); - this.sendResourceListChanged(); - return registeredResource; - } - else { - if (this._registeredResourceTemplates[name]) { - throw new Error(`Resource template ${name} is already registered`); - } - const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config.title, uriOrTemplate, config, readCallback); - this.setResourceRequestHandlers(); - this.sendResourceListChanged(); - return registeredResourceTemplate; - } - } - _createRegisteredResource(name, title, uri, metadata, readCallback) { - const registeredResource = { - name, - title, - metadata, - readCallback, - enabled: true, - disable: () => registeredResource.update({ enabled: false }), - enable: () => registeredResource.update({ enabled: true }), - remove: () => registeredResource.update({ uri: null }), - update: updates => { - if (typeof updates.uri !== 'undefined' && updates.uri !== uri) { - delete this._registeredResources[uri]; - if (updates.uri) - this._registeredResources[updates.uri] = registeredResource; - } - if (typeof updates.name !== 'undefined') - registeredResource.name = updates.name; - if (typeof updates.title !== 'undefined') - registeredResource.title = updates.title; - if (typeof updates.metadata !== 'undefined') - registeredResource.metadata = updates.metadata; - if (typeof updates.callback !== 'undefined') - registeredResource.readCallback = updates.callback; - if (typeof updates.enabled !== 'undefined') - registeredResource.enabled = updates.enabled; - this.sendResourceListChanged(); - } - }; - this._registeredResources[uri] = registeredResource; - return registeredResource; - } - _createRegisteredResourceTemplate(name, title, template, metadata, readCallback) { - const registeredResourceTemplate = { - resourceTemplate: template, - title, - metadata, - readCallback, - enabled: true, - disable: () => registeredResourceTemplate.update({ enabled: false }), - enable: () => registeredResourceTemplate.update({ enabled: true }), - remove: () => registeredResourceTemplate.update({ name: null }), - update: updates => { - if (typeof updates.name !== 'undefined' && updates.name !== name) { - delete this._registeredResourceTemplates[name]; - if (updates.name) - this._registeredResourceTemplates[updates.name] = registeredResourceTemplate; - } - if (typeof updates.title !== 'undefined') - registeredResourceTemplate.title = updates.title; - if (typeof updates.template !== 'undefined') - registeredResourceTemplate.resourceTemplate = updates.template; - if (typeof updates.metadata !== 'undefined') - registeredResourceTemplate.metadata = updates.metadata; - if (typeof updates.callback !== 'undefined') - registeredResourceTemplate.readCallback = updates.callback; - if (typeof updates.enabled !== 'undefined') - registeredResourceTemplate.enabled = updates.enabled; - this.sendResourceListChanged(); - } - }; - this._registeredResourceTemplates[name] = registeredResourceTemplate; - // If the resource template has any completion callbacks, enable completions capability - const variableNames = template.uriTemplate.variableNames; - const hasCompleter = Array.isArray(variableNames) && variableNames.some(v => !!template.completeCallback(v)); - if (hasCompleter) { - this.setCompletionRequestHandler(); - } - return registeredResourceTemplate; - } - _createRegisteredPrompt(name, title, description, argsSchema, callback) { - const registeredPrompt = { - title, - description, - argsSchema: argsSchema === undefined ? undefined : objectFromShape(argsSchema), - callback, - enabled: true, - disable: () => registeredPrompt.update({ enabled: false }), - enable: () => registeredPrompt.update({ enabled: true }), - remove: () => registeredPrompt.update({ name: null }), - update: updates => { - if (typeof updates.name !== 'undefined' && updates.name !== name) { - delete this._registeredPrompts[name]; - if (updates.name) - this._registeredPrompts[updates.name] = registeredPrompt; - } - if (typeof updates.title !== 'undefined') - registeredPrompt.title = updates.title; - if (typeof updates.description !== 'undefined') - registeredPrompt.description = updates.description; - if (typeof updates.argsSchema !== 'undefined') - registeredPrompt.argsSchema = objectFromShape(updates.argsSchema); - if (typeof updates.callback !== 'undefined') - registeredPrompt.callback = updates.callback; - if (typeof updates.enabled !== 'undefined') - registeredPrompt.enabled = updates.enabled; - this.sendPromptListChanged(); - } - }; - this._registeredPrompts[name] = registeredPrompt; - // If any argument uses a Completable schema, enable completions capability - if (argsSchema) { - const hasCompletable = Object.values(argsSchema).some(field => { - const inner = field instanceof ZodOptional ? field._def?.innerType : field; - return isCompletable(inner); - }); - if (hasCompletable) { - this.setCompletionRequestHandler(); - } - } - return registeredPrompt; - } - _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, execution, _meta, handler) { - // Validate tool name according to SEP specification - validateAndWarnToolName(name); - const registeredTool = { - title, - description, - inputSchema: getZodSchemaObject(inputSchema), - outputSchema: getZodSchemaObject(outputSchema), - annotations, - execution, - _meta, - handler: handler, - enabled: true, - disable: () => registeredTool.update({ enabled: false }), - enable: () => registeredTool.update({ enabled: true }), - remove: () => registeredTool.update({ name: null }), - update: updates => { - if (typeof updates.name !== 'undefined' && updates.name !== name) { - if (typeof updates.name === 'string') { - validateAndWarnToolName(updates.name); - } - delete this._registeredTools[name]; - if (updates.name) - this._registeredTools[updates.name] = registeredTool; - } - if (typeof updates.title !== 'undefined') - registeredTool.title = updates.title; - if (typeof updates.description !== 'undefined') - registeredTool.description = updates.description; - if (typeof updates.paramsSchema !== 'undefined') - registeredTool.inputSchema = objectFromShape(updates.paramsSchema); - if (typeof updates.outputSchema !== 'undefined') - registeredTool.outputSchema = objectFromShape(updates.outputSchema); - if (typeof updates.callback !== 'undefined') - registeredTool.handler = updates.callback; - if (typeof updates.annotations !== 'undefined') - registeredTool.annotations = updates.annotations; - if (typeof updates._meta !== 'undefined') - registeredTool._meta = updates._meta; - if (typeof updates.enabled !== 'undefined') - registeredTool.enabled = updates.enabled; - this.sendToolListChanged(); - } - }; - this._registeredTools[name] = registeredTool; - this.setToolRequestHandlers(); - this.sendToolListChanged(); - return registeredTool; - } - /** - * tool() implementation. Parses arguments passed to overrides defined above. - */ - tool(name, ...rest) { - if (this._registeredTools[name]) { - throw new Error(`Tool ${name} is already registered`); - } - let description; - let inputSchema; - let outputSchema; - let annotations; - // Tool properties are passed as separate arguments, with omissions allowed. - // Support for this style is frozen as of protocol version 2025-03-26. Future additions - // to tool definition should *NOT* be added. - if (typeof rest[0] === 'string') { - description = rest.shift(); - } - // Handle the different overload combinations - if (rest.length > 1) { - // We have at least one more arg before the callback - const firstArg = rest[0]; - if (isZodRawShapeCompat(firstArg)) { - // We have a params schema as the first arg - inputSchema = rest.shift(); - // Check if the next arg is potentially annotations - if (rest.length > 1 && typeof rest[0] === 'object' && rest[0] !== null && !isZodRawShapeCompat(rest[0])) { - // Case: tool(name, paramsSchema, annotations, cb) - // Or: tool(name, description, paramsSchema, annotations, cb) - annotations = rest.shift(); - } - } - else if (typeof firstArg === 'object' && firstArg !== null) { - // Not a ZodRawShapeCompat, so must be annotations in this position - // Case: tool(name, annotations, cb) - // Or: tool(name, description, annotations, cb) - annotations = rest.shift(); - } - } - const callback = rest[0]; - return this._createRegisteredTool(name, undefined, description, inputSchema, outputSchema, annotations, { taskSupport: 'forbidden' }, undefined, callback); - } - /** - * Registers a tool with a config object and callback. - */ - registerTool(name, config, cb) { - if (this._registeredTools[name]) { - throw new Error(`Tool ${name} is already registered`); - } - const { title, description, inputSchema, outputSchema, annotations, _meta } = config; - return this._createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, { taskSupport: 'forbidden' }, _meta, cb); - } - prompt(name, ...rest) { - if (this._registeredPrompts[name]) { - throw new Error(`Prompt ${name} is already registered`); - } - let description; - if (typeof rest[0] === 'string') { - description = rest.shift(); - } - let argsSchema; - if (rest.length > 1) { - argsSchema = rest.shift(); - } - const cb = rest[0]; - const registeredPrompt = this._createRegisteredPrompt(name, undefined, description, argsSchema, cb); - this.setPromptRequestHandlers(); - this.sendPromptListChanged(); - return registeredPrompt; - } - /** - * Registers a prompt with a config object and callback. - */ - registerPrompt(name, config, cb) { - if (this._registeredPrompts[name]) { - throw new Error(`Prompt ${name} is already registered`); - } - const { title, description, argsSchema } = config; - const registeredPrompt = this._createRegisteredPrompt(name, title, description, argsSchema, cb); - this.setPromptRequestHandlers(); - this.sendPromptListChanged(); - return registeredPrompt; - } - /** - * Checks if the server is connected to a transport. - * @returns True if the server is connected - */ - isConnected() { - return this.server.transport !== undefined; - } - /** - * Sends a logging message to the client, if connected. - * Note: You only need to send the parameters object, not the entire JSON RPC message - * @see LoggingMessageNotification - * @param params - * @param sessionId optional for stateless and backward compatibility - */ - async sendLoggingMessage(params, sessionId) { - return this.server.sendLoggingMessage(params, sessionId); - } - /** - * Sends a resource list changed event to the client, if connected. - */ - sendResourceListChanged() { - if (this.isConnected()) { - this.server.sendResourceListChanged(); - } - } - /** - * Sends a tool list changed event to the client, if connected. - */ - sendToolListChanged() { - if (this.isConnected()) { - this.server.sendToolListChanged(); - } - } - /** - * Sends a prompt list changed event to the client, if connected. - */ - sendPromptListChanged() { - if (this.isConnected()) { - this.server.sendPromptListChanged(); - } - } -} -/** - * A resource template combines a URI pattern with optional functionality to enumerate - * all resources matching that pattern. - */ -export class ResourceTemplate { - constructor(uriTemplate, _callbacks) { - this._callbacks = _callbacks; - this._uriTemplate = typeof uriTemplate === 'string' ? new UriTemplate(uriTemplate) : uriTemplate; - } - /** - * Gets the URI template pattern. - */ - get uriTemplate() { - return this._uriTemplate; - } - /** - * Gets the list callback, if one was provided. - */ - get listCallback() { - return this._callbacks.list; - } - /** - * Gets the callback for completing a specific URI template variable, if one was provided. - */ - completeCallback(variable) { - return this._callbacks.complete?.[variable]; - } -} -const EMPTY_OBJECT_JSON_SCHEMA = { - type: 'object', - properties: {} -}; -/** - * Checks if a value looks like a Zod schema by checking for parse/safeParse methods. - */ -function isZodTypeLike(value) { - return (value !== null && - typeof value === 'object' && - 'parse' in value && - typeof value.parse === 'function' && - 'safeParse' in value && - typeof value.safeParse === 'function'); -} -/** - * Checks if an object is a Zod schema instance (v3 or v4). - * - * Zod schemas have internal markers: - * - v3: `_def` property - * - v4: `_zod` property - * - * This includes transformed schemas like z.preprocess(), z.transform(), z.pipe(). - */ -function isZodSchemaInstance(obj) { - return '_def' in obj || '_zod' in obj || isZodTypeLike(obj); -} -/** - * Checks if an object is a "raw shape" - a plain object where values are Zod schemas. - * - * Raw shapes are used as shorthand: `{ name: z.string() }` instead of `z.object({ name: z.string() })`. - * - * IMPORTANT: This must NOT match actual Zod schema instances (like z.preprocess, z.pipe), - * which have internal properties that could be mistaken for schema values. - */ -function isZodRawShapeCompat(obj) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - // If it's already a Zod schema instance, it's NOT a raw shape - if (isZodSchemaInstance(obj)) { - return false; - } - // Empty objects are valid raw shapes (tools with no parameters) - if (Object.keys(obj).length === 0) { - return true; - } - // A raw shape has at least one property that is a Zod schema - return Object.values(obj).some(isZodTypeLike); -} -/** - * Converts a provided Zod schema to a Zod object if it is a ZodRawShapeCompat, - * otherwise returns the schema as is. - */ -function getZodSchemaObject(schema) { - if (!schema) { - return undefined; - } - if (isZodRawShapeCompat(schema)) { - return objectFromShape(schema); - } - return schema; -} -function promptArgumentsFromSchema(schema) { - const shape = getObjectShape(schema); - if (!shape) - return []; - return Object.entries(shape).map(([name, field]) => { - // Get description - works for both v3 and v4 - const description = getSchemaDescription(field); - // Check if optional - works for both v3 and v4 - const isOptional = isSchemaOptional(field); - return { - name, - description, - required: !isOptional - }; - }); -} -function getMethodValue(schema) { - const shape = getObjectShape(schema); - const methodSchema = shape?.method; - if (!methodSchema) { - throw new Error('Schema is missing a method literal'); - } - // Extract literal value - works for both v3 and v4 - const value = getLiteralValue(methodSchema); - if (typeof value === 'string') { - return value; - } - throw new Error('Schema method literal must be a string'); -} -function createCompletionResult(suggestions) { - return { - completion: { - values: suggestions.slice(0, 100), - total: suggestions.length, - hasMore: suggestions.length > 100 - } - }; -} -const EMPTY_COMPLETION_RESULT = { - completion: { - values: [], - hasMore: false - } -}; -//# sourceMappingURL=mcp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map deleted file mode 100644 index 162f7e2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/server/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,YAAY,CAAC;AACnD,OAAO,EAMH,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAKH,QAAQ,EACR,SAAS,EAOT,kCAAkC,EAClC,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EAcrB,2BAA2B,EAC3B,qCAAqC,EAGxC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,WAAW,EA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AE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,sBAAsB,CAAC,WAAqB;IACjD,OAAO;QACH,UAAU,EAAE;YACR,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;YACjC,KAAK,EAAE,WAAW,CAAC,MAAM;YACzB,OAAO,EAAE,WAAW,CAAC,MAAM,GAAG,GAAG;SACpC;KACJ,CAAC;AACN,CAAC;AAED,MAAM,uBAAuB,GAAmB;IAC5C,UAAU,EAAE;QACR,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,KAAK;KACjB;CACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.d.ts deleted file mode 100644 index cb526d8..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { RequestHandler } from 'express'; -/** - * Express middleware for DNS rebinding protection. - * Validates Host header hostname (port-agnostic) against an allowed list. - * - * This is particularly important for servers without authorization or HTTPS, - * such as localhost servers or development servers. DNS rebinding attacks can - * bypass same-origin policy by manipulating DNS to point a domain to a - * localhost address, allowing malicious websites to access your local server. - * - * @param allowedHostnames - List of allowed hostnames (without ports). - * For IPv6, provide the address with brackets (e.g., '[::1]'). - * @returns Express middleware function - * - * @example - * ```typescript - * const middleware = hostHeaderValidation(['localhost', '127.0.0.1', '[::1]']); - * app.use(middleware); - * ``` - */ -export declare function hostHeaderValidation(allowedHostnames: string[]): RequestHandler; -/** - * Convenience middleware for localhost DNS rebinding protection. - * Allows only localhost, 127.0.0.1, and [::1] (IPv6 localhost) hostnames. - * - * @example - * ```typescript - * app.use(localhostHostValidation()); - * ``` - */ -export declare function localhostHostValidation(): RequestHandler; -//# sourceMappingURL=hostHeaderValidation.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.d.ts.map deleted file mode 100644 index c550324..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hostHeaderValidation.d.ts","sourceRoot":"","sources":["../../../../src/server/middleware/hostHeaderValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,cAAc,EAAE,MAAM,SAAS,CAAC;AAE1E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,cAAc,CA4C/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,IAAI,cAAc,CAExD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.js deleted file mode 100644 index 79922a2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Express middleware for DNS rebinding protection. - * Validates Host header hostname (port-agnostic) against an allowed list. - * - * This is particularly important for servers without authorization or HTTPS, - * such as localhost servers or development servers. DNS rebinding attacks can - * bypass same-origin policy by manipulating DNS to point a domain to a - * localhost address, allowing malicious websites to access your local server. - * - * @param allowedHostnames - List of allowed hostnames (without ports). - * For IPv6, provide the address with brackets (e.g., '[::1]'). - * @returns Express middleware function - * - * @example - * ```typescript - * const middleware = hostHeaderValidation(['localhost', '127.0.0.1', '[::1]']); - * app.use(middleware); - * ``` - */ -export function hostHeaderValidation(allowedHostnames) { - return (req, res, next) => { - const hostHeader = req.headers.host; - if (!hostHeader) { - res.status(403).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Missing Host header' - }, - id: null - }); - return; - } - // Use URL API to parse hostname (handles IPv4, IPv6, and regular hostnames) - let hostname; - try { - hostname = new URL(`http://${hostHeader}`).hostname; - } - catch { - res.status(403).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: `Invalid Host header: ${hostHeader}` - }, - id: null - }); - return; - } - if (!allowedHostnames.includes(hostname)) { - res.status(403).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: `Invalid Host: ${hostname}` - }, - id: null - }); - return; - } - next(); - }; -} -/** - * Convenience middleware for localhost DNS rebinding protection. - * Allows only localhost, 127.0.0.1, and [::1] (IPv6 localhost) hostnames. - * - * @example - * ```typescript - * app.use(localhostHostValidation()); - * ``` - */ -export function localhostHostValidation() { - return hostHeaderValidation(['localhost', '127.0.0.1', '[::1]']); -} -//# sourceMappingURL=hostHeaderValidation.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.js.map deleted file mode 100644 index f04fdfd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hostHeaderValidation.js","sourceRoot":"","sources":["../../../../src/server/middleware/hostHeaderValidation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,oBAAoB,CAAC,gBAA0B;IAC3D,OAAO,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;QACvD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACH,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,qBAAqB;iBACjC;gBACD,EAAE,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACX,CAAC;QAED,4EAA4E;QAC5E,IAAI,QAAgB,CAAC;QACrB,IAAI,CAAC;YACD,QAAQ,GAAG,IAAI,GAAG,CAAC,UAAU,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC;QACxD,CAAC;QAAC,MAAM,CAAC;YACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACH,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,wBAAwB,UAAU,EAAE;iBAChD;gBACD,EAAE,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACX,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACH,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,iBAAiB,QAAQ,EAAE;iBACvC;gBACD,EAAE,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO;QACX,CAAC;QACD,IAAI,EAAE,CAAC;IACX,CAAC,CAAC;AACN,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB;IACnC,OAAO,oBAAoB,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.d.ts deleted file mode 100644 index 7fa42a5..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { IncomingMessage, ServerResponse } from 'node:http'; -import { Transport } from '../shared/transport.js'; -import { JSONRPCMessage, MessageExtraInfo } from '../types.js'; -import { AuthInfo } from './auth/types.js'; -/** - * Configuration options for SSEServerTransport. - */ -export interface SSEServerTransportOptions { - /** - * List of allowed host header values for DNS rebinding protection. - * If not specified, host validation is disabled. - * @deprecated Use the `hostHeaderValidation` middleware from `@modelcontextprotocol/sdk/server/middleware/hostHeaderValidation.js` instead, - * or use `createMcpExpressApp` from `@modelcontextprotocol/sdk/server/express.js` which includes localhost protection by default. - */ - allowedHosts?: string[]; - /** - * List of allowed origin header values for DNS rebinding protection. - * If not specified, origin validation is disabled. - * @deprecated Use the `hostHeaderValidation` middleware from `@modelcontextprotocol/sdk/server/middleware/hostHeaderValidation.js` instead, - * or use `createMcpExpressApp` from `@modelcontextprotocol/sdk/server/express.js` which includes localhost protection by default. - */ - allowedOrigins?: string[]; - /** - * Enable DNS rebinding protection (requires allowedHosts and/or allowedOrigins to be configured). - * Default is false for backwards compatibility. - * @deprecated Use the `hostHeaderValidation` middleware from `@modelcontextprotocol/sdk/server/middleware/hostHeaderValidation.js` instead, - * or use `createMcpExpressApp` from `@modelcontextprotocol/sdk/server/express.js` which includes localhost protection by default. - */ - enableDnsRebindingProtection?: boolean; -} -/** - * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. - * - * This transport is only available in Node.js environments. - * @deprecated SSEServerTransport is deprecated. Use StreamableHTTPServerTransport instead. - */ -export declare class SSEServerTransport implements Transport { - private _endpoint; - private res; - private _sseResponse?; - private _sessionId; - private _options; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage, extra?: MessageExtraInfo) => void; - /** - * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. - */ - constructor(_endpoint: string, res: ServerResponse, options?: SSEServerTransportOptions); - /** - * Validates request headers for DNS rebinding protection. - * @returns Error message if validation fails, undefined if validation passes. - */ - private validateRequestHeaders; - /** - * Handles the initial SSE connection request. - * - * This should be called when a GET request is made to establish the SSE stream. - */ - start(): Promise; - /** - * Handles incoming POST messages. - * - * This should be called when a POST request is made to send a message to the server. - */ - handlePostMessage(req: IncomingMessage & { - auth?: AuthInfo; - }, res: ServerResponse, parsedBody?: unknown): Promise; - /** - * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. - */ - handleMessage(message: unknown, extra?: MessageExtraInfo): Promise; - close(): Promise; - send(message: JSONRPCMessage): Promise; - /** - * Returns the session ID for this transport. - * - * This can be used to route incoming POST requests. - */ - get sessionId(): string; -} -//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.d.ts.map deleted file mode 100644 index c94a521..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/server/sse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,gBAAgB,EAAe,MAAM,aAAa,CAAC;AAGlG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;;OAKG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAY5C,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,GAAG;IAZf,OAAO,CAAC,YAAY,CAAC,CAAiB;IACtC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAExE;;OAEG;gBAES,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,cAAc,EAC3B,OAAO,CAAC,EAAE,yBAAyB;IAMvC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAyB9B;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA8B5B;;;;OAIG;IACG,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA+C7H;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYxE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAQlD;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js deleted file mode 100644 index 5d0cd8d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js +++ /dev/null @@ -1,158 +0,0 @@ -import { randomUUID } from 'node:crypto'; -import { JSONRPCMessageSchema } from '../types.js'; -import getRawBody from 'raw-body'; -import contentType from 'content-type'; -import { URL } from 'node:url'; -const MAXIMUM_MESSAGE_SIZE = '4mb'; -/** - * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. - * - * This transport is only available in Node.js environments. - * @deprecated SSEServerTransport is deprecated. Use StreamableHTTPServerTransport instead. - */ -export class SSEServerTransport { - /** - * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. - */ - constructor(_endpoint, res, options) { - this._endpoint = _endpoint; - this.res = res; - this._sessionId = randomUUID(); - this._options = options || { enableDnsRebindingProtection: false }; - } - /** - * Validates request headers for DNS rebinding protection. - * @returns Error message if validation fails, undefined if validation passes. - */ - validateRequestHeaders(req) { - // Skip validation if protection is not enabled - if (!this._options.enableDnsRebindingProtection) { - return undefined; - } - // Validate Host header if allowedHosts is configured - if (this._options.allowedHosts && this._options.allowedHosts.length > 0) { - const hostHeader = req.headers.host; - if (!hostHeader || !this._options.allowedHosts.includes(hostHeader)) { - return `Invalid Host header: ${hostHeader}`; - } - } - // Validate Origin header if allowedOrigins is configured - if (this._options.allowedOrigins && this._options.allowedOrigins.length > 0) { - const originHeader = req.headers.origin; - if (originHeader && !this._options.allowedOrigins.includes(originHeader)) { - return `Invalid Origin header: ${originHeader}`; - } - } - return undefined; - } - /** - * Handles the initial SSE connection request. - * - * This should be called when a GET request is made to establish the SSE stream. - */ - async start() { - if (this._sseResponse) { - throw new Error('SSEServerTransport already started! If using Server class, note that connect() calls start() automatically.'); - } - this.res.writeHead(200, { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache, no-transform', - Connection: 'keep-alive' - }); - // Send the endpoint event - // Use a dummy base URL because this._endpoint is relative. - // This allows using URL/URLSearchParams for robust parameter handling. - const dummyBase = 'http://localhost'; // Any valid base works - const endpointUrl = new URL(this._endpoint, dummyBase); - endpointUrl.searchParams.set('sessionId', this._sessionId); - // Reconstruct the relative URL string (pathname + search + hash) - const relativeUrlWithSession = endpointUrl.pathname + endpointUrl.search + endpointUrl.hash; - this.res.write(`event: endpoint\ndata: ${relativeUrlWithSession}\n\n`); - this._sseResponse = this.res; - this.res.on('close', () => { - this._sseResponse = undefined; - this.onclose?.(); - }); - } - /** - * Handles incoming POST messages. - * - * This should be called when a POST request is made to send a message to the server. - */ - async handlePostMessage(req, res, parsedBody) { - if (!this._sseResponse) { - const message = 'SSE connection not established'; - res.writeHead(500).end(message); - throw new Error(message); - } - // Validate request headers for DNS rebinding protection - const validationError = this.validateRequestHeaders(req); - if (validationError) { - res.writeHead(403).end(validationError); - this.onerror?.(new Error(validationError)); - return; - } - const authInfo = req.auth; - const requestInfo = { headers: req.headers }; - let body; - try { - const ct = contentType.parse(req.headers['content-type'] ?? ''); - if (ct.type !== 'application/json') { - throw new Error(`Unsupported content-type: ${ct.type}`); - } - body = - parsedBody ?? - (await getRawBody(req, { - limit: MAXIMUM_MESSAGE_SIZE, - encoding: ct.parameters.charset ?? 'utf-8' - })); - } - catch (error) { - res.writeHead(400).end(String(error)); - this.onerror?.(error); - return; - } - try { - await this.handleMessage(typeof body === 'string' ? JSON.parse(body) : body, { requestInfo, authInfo }); - } - catch { - res.writeHead(400).end(`Invalid message: ${body}`); - return; - } - res.writeHead(202).end('Accepted'); - } - /** - * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. - */ - async handleMessage(message, extra) { - let parsedMessage; - try { - parsedMessage = JSONRPCMessageSchema.parse(message); - } - catch (error) { - this.onerror?.(error); - throw error; - } - this.onmessage?.(parsedMessage, extra); - } - async close() { - this._sseResponse?.end(); - this._sseResponse = undefined; - this.onclose?.(); - } - async send(message) { - if (!this._sseResponse) { - throw new Error('Not connected'); - } - this._sseResponse.write(`event: message\ndata: ${JSON.stringify(message)}\n\n`); - } - /** - * Returns the session ID for this transport. - * - * This can be used to route incoming POST requests. - */ - get sessionId() { - return this._sessionId; - } -} -//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js.map deleted file mode 100644 index 55ad8aa..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../../src/server/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAkB,oBAAoB,EAAiC,MAAM,aAAa,CAAC;AAClG,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,oBAAoB,GAAG,KAAK,CAAC;AA+BnC;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAQ3B;;OAEG;IACH,YACY,SAAiB,EACjB,GAAmB,EAC3B,OAAmC;QAF3B,cAAS,GAAT,SAAS,CAAQ;QACjB,QAAG,GAAH,GAAG,CAAgB;QAG3B,IAAI,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,CAAC;IACvE,CAAC;IAED;;;OAGG;IACK,sBAAsB,CAAC,GAAoB;QAC/C,+CAA+C;QAC/C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE,CAAC;YAC9C,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,qDAAqD;QACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtE,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;YACpC,IAAI,CAAC,UAAU,IAAI,CAAC,IAA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AAS,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;QAC9B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpF,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts deleted file mode 100644 index 83af572..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Readable, Writable } from 'node:stream'; -import { JSONRPCMessage } from '../types.js'; -import { Transport } from '../shared/transport.js'; -/** - * Server transport for stdio: this communicates with an MCP client by reading from the current process' stdin and writing to stdout. - * - * This transport is only available in Node.js environments. - */ -export declare class StdioServerTransport implements Transport { - private _stdin; - private _stdout; - private _readBuffer; - private _started; - constructor(_stdin?: Readable, _stdout?: Writable); - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage) => void; - _ondata: (chunk: Buffer) => void; - _onerror: (error: Error) => void; - /** - * Starts listening for messages on stdin. - */ - start(): Promise; - private processReadBuffer; - close(): Promise; - send(message: JSONRPCMessage): Promise; -} -//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts.map deleted file mode 100644 index fdd2dfe..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/server/stdio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IAK9C,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IALnB,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAGb,MAAM,GAAE,QAAwB,EAChC,OAAO,GAAE,QAAyB;IAG9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAG9C,OAAO,UAAW,MAAM,UAGtB;IACF,QAAQ,UAAW,KAAK,UAEtB;IAEF;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAY5B,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAU/C"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js deleted file mode 100644 index 727fe70..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +++ /dev/null @@ -1,75 +0,0 @@ -import process from 'node:process'; -import { ReadBuffer, serializeMessage } from '../shared/stdio.js'; -/** - * Server transport for stdio: this communicates with an MCP client by reading from the current process' stdin and writing to stdout. - * - * This transport is only available in Node.js environments. - */ -export class StdioServerTransport { - constructor(_stdin = process.stdin, _stdout = process.stdout) { - this._stdin = _stdin; - this._stdout = _stdout; - this._readBuffer = new ReadBuffer(); - this._started = false; - // Arrow functions to bind `this` properly, while maintaining function identity. - this._ondata = (chunk) => { - this._readBuffer.append(chunk); - this.processReadBuffer(); - }; - this._onerror = (error) => { - this.onerror?.(error); - }; - } - /** - * Starts listening for messages on stdin. - */ - async start() { - if (this._started) { - throw new Error('StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.'); - } - this._started = true; - this._stdin.on('data', this._ondata); - this._stdin.on('error', this._onerror); - } - processReadBuffer() { - while (true) { - try { - const message = this._readBuffer.readMessage(); - if (message === null) { - break; - } - this.onmessage?.(message); - } - catch (error) { - this.onerror?.(error); - } - } - } - async close() { - // Remove our event listeners first - this._stdin.off('data', this._ondata); - this._stdin.off('error', this._onerror); - // Check if we were the only data listener - const remainingDataListeners = this._stdin.listenerCount('data'); - if (remainingDataListeners === 0) { - // Only pause stdin if we were the only listener - // This prevents interfering with other parts of the application that might be using stdin - this._stdin.pause(); - } - // Clear the buffer and notify closure - this._readBuffer.clear(); - this.onclose?.(); - } - send(message) { - return new Promise(resolve => { - const json = serializeMessage(message); - if (this._stdout.write(json)) { - resolve(); - } - else { - this._stdout.once('drain', resolve); - } - }); - } -} -//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map deleted file mode 100644 index 307a744..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"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/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.d.ts deleted file mode 100644 index 5d5564b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Node.js HTTP Streamable HTTP Server Transport - * - * This is a thin wrapper around `WebStandardStreamableHTTPServerTransport` that provides - * compatibility with Node.js HTTP server (IncomingMessage/ServerResponse). - * - * For web-standard environments (Cloudflare Workers, Deno, Bun), use `WebStandardStreamableHTTPServerTransport` directly. - */ -import { IncomingMessage, ServerResponse } from 'node:http'; -import { Transport } from '../shared/transport.js'; -import { AuthInfo } from './auth/types.js'; -import { MessageExtraInfo, JSONRPCMessage, RequestId } from '../types.js'; -import { WebStandardStreamableHTTPServerTransportOptions, EventStore, StreamId, EventId } from './webStandardStreamableHttp.js'; -export type { EventStore, StreamId, EventId }; -/** - * Configuration options for StreamableHTTPServerTransport - * - * This is an alias for WebStandardStreamableHTTPServerTransportOptions for backward compatibility. - */ -export type StreamableHTTPServerTransportOptions = WebStandardStreamableHTTPServerTransportOptions; -/** - * Server transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. - * It supports both SSE streaming and direct HTTP responses. - * - * This is a wrapper around `WebStandardStreamableHTTPServerTransport` that provides Node.js HTTP compatibility. - * It uses the `@hono/node-server` library to convert between Node.js HTTP and Web Standard APIs. - * - * Usage example: - * - * ```typescript - * // Stateful mode - server sets the session ID - * const statefulTransport = new StreamableHTTPServerTransport({ - * sessionIdGenerator: () => randomUUID(), - * }); - * - * // Stateless mode - explicitly set session ID to undefined - * const statelessTransport = new StreamableHTTPServerTransport({ - * sessionIdGenerator: undefined, - * }); - * - * // Using with pre-parsed request body - * app.post('/mcp', (req, res) => { - * transport.handleRequest(req, res, req.body); - * }); - * ``` - * - * In stateful mode: - * - Session ID is generated and included in response headers - * - Session ID is always included in initialization responses - * - Requests with invalid session IDs are rejected with 404 Not Found - * - Non-initialization requests without a session ID are rejected with 400 Bad Request - * - State is maintained in-memory (connections, message history) - * - * In stateless mode: - * - No Session ID is included in any responses - * - No session validation is performed - */ -export declare class StreamableHTTPServerTransport implements Transport { - private _webStandardTransport; - private _requestListener; - private _requestContext; - constructor(options?: StreamableHTTPServerTransportOptions); - /** - * Gets the session ID for this transport instance. - */ - get sessionId(): string | undefined; - /** - * Sets callback for when the transport is closed. - */ - set onclose(handler: (() => void) | undefined); - get onclose(): (() => void) | undefined; - /** - * Sets callback for transport errors. - */ - set onerror(handler: ((error: Error) => void) | undefined); - get onerror(): ((error: Error) => void) | undefined; - /** - * Sets callback for incoming messages. - */ - set onmessage(handler: ((message: JSONRPCMessage, extra?: MessageExtraInfo) => void) | undefined); - get onmessage(): ((message: JSONRPCMessage, extra?: MessageExtraInfo) => void) | undefined; - /** - * Starts the transport. This is required by the Transport interface but is a no-op - * for the Streamable HTTP transport as connections are managed per-request. - */ - start(): Promise; - /** - * Closes the transport and all active connections. - */ - close(): Promise; - /** - * Sends a JSON-RPC message through the transport. - */ - send(message: JSONRPCMessage, options?: { - relatedRequestId?: RequestId; - }): Promise; - /** - * Handles an incoming HTTP request, whether GET or POST. - * - * This method converts Node.js HTTP objects to Web Standard Request/Response - * and delegates to the underlying WebStandardStreamableHTTPServerTransport. - * - * @param req - Node.js IncomingMessage, optionally with auth property from middleware - * @param res - Node.js ServerResponse - * @param parsedBody - Optional pre-parsed body from body-parser middleware - */ - handleRequest(req: IncomingMessage & { - auth?: AuthInfo; - }, res: ServerResponse, parsedBody?: unknown): Promise; - /** - * Close an SSE stream for a specific request, triggering client reconnection. - * Use this to implement polling behavior during long-running operations - - * client will reconnect after the retry interval specified in the priming event. - */ - closeSSEStream(requestId: RequestId): void; - /** - * Close the standalone GET SSE stream, triggering client reconnection. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream(): void; -} -//# sourceMappingURL=streamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.d.ts.map deleted file mode 100644 index f9e54b4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../../src/server/streamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAEH,+CAA+C,EAC/C,UAAU,EACV,QAAQ,EACR,OAAO,EACV,MAAM,gCAAgC,CAAC;AAGxC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,oCAAoC,GAAG,+CAA+C,CAAC;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,6BAA8B,YAAW,SAAS;IAC3D,OAAO,CAAC,qBAAqB,CAA2C;IACxE,OAAO,CAAC,gBAAgB,CAAwC;IAEhE,OAAO,CAAC,eAAe,CAAkF;gBAE7F,OAAO,GAAE,oCAAyC;IAoB9D;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED;;OAEG;IACH,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,EAE5C;IAED,IAAI,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAEtC;IAED;;OAEG;IACH,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,EAExD;IAED,IAAI,OAAO,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAElD;IAED;;OAEG;IACH,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC,GAAG,SAAS,EAE/F;IAED,IAAI,SAAS,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC,GAAG,SAAS,CAEzF;IAED;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9F;;;;;;;;;OASG;IACG,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBzH;;;;OAIG;IACH,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAI1C;;;OAGG;IACH,wBAAwB,IAAI,IAAI;CAGnC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js deleted file mode 100644 index 143ee17..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Node.js HTTP Streamable HTTP Server Transport - * - * This is a thin wrapper around `WebStandardStreamableHTTPServerTransport` that provides - * compatibility with Node.js HTTP server (IncomingMessage/ServerResponse). - * - * For web-standard environments (Cloudflare Workers, Deno, Bun), use `WebStandardStreamableHTTPServerTransport` directly. - */ -import { getRequestListener } from '@hono/node-server'; -import { WebStandardStreamableHTTPServerTransport } from './webStandardStreamableHttp.js'; -/** - * Server transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. - * It supports both SSE streaming and direct HTTP responses. - * - * This is a wrapper around `WebStandardStreamableHTTPServerTransport` that provides Node.js HTTP compatibility. - * It uses the `@hono/node-server` library to convert between Node.js HTTP and Web Standard APIs. - * - * Usage example: - * - * ```typescript - * // Stateful mode - server sets the session ID - * const statefulTransport = new StreamableHTTPServerTransport({ - * sessionIdGenerator: () => randomUUID(), - * }); - * - * // Stateless mode - explicitly set session ID to undefined - * const statelessTransport = new StreamableHTTPServerTransport({ - * sessionIdGenerator: undefined, - * }); - * - * // Using with pre-parsed request body - * app.post('/mcp', (req, res) => { - * transport.handleRequest(req, res, req.body); - * }); - * ``` - * - * In stateful mode: - * - Session ID is generated and included in response headers - * - Session ID is always included in initialization responses - * - Requests with invalid session IDs are rejected with 404 Not Found - * - Non-initialization requests without a session ID are rejected with 400 Bad Request - * - State is maintained in-memory (connections, message history) - * - * In stateless mode: - * - No Session ID is included in any responses - * - No session validation is performed - */ -export class StreamableHTTPServerTransport { - constructor(options = {}) { - // Store auth and parsedBody per request for passing through to handleRequest - this._requestContext = new WeakMap(); - this._webStandardTransport = new WebStandardStreamableHTTPServerTransport(options); - // Create a request listener that wraps the web standard transport - // getRequestListener converts Node.js HTTP to Web Standard and properly handles SSE streaming - // overrideGlobalObjects: false prevents Hono from overwriting global Response, which would - // break frameworks like Next.js whose response classes extend the native Response - this._requestListener = getRequestListener(async (webRequest) => { - // Get context if available (set during handleRequest) - const context = this._requestContext.get(webRequest); - return this._webStandardTransport.handleRequest(webRequest, { - authInfo: context?.authInfo, - parsedBody: context?.parsedBody - }); - }, { overrideGlobalObjects: false }); - } - /** - * Gets the session ID for this transport instance. - */ - get sessionId() { - return this._webStandardTransport.sessionId; - } - /** - * Sets callback for when the transport is closed. - */ - set onclose(handler) { - this._webStandardTransport.onclose = handler; - } - get onclose() { - return this._webStandardTransport.onclose; - } - /** - * Sets callback for transport errors. - */ - set onerror(handler) { - this._webStandardTransport.onerror = handler; - } - get onerror() { - return this._webStandardTransport.onerror; - } - /** - * Sets callback for incoming messages. - */ - set onmessage(handler) { - this._webStandardTransport.onmessage = handler; - } - get onmessage() { - return this._webStandardTransport.onmessage; - } - /** - * Starts the transport. This is required by the Transport interface but is a no-op - * for the Streamable HTTP transport as connections are managed per-request. - */ - async start() { - return this._webStandardTransport.start(); - } - /** - * Closes the transport and all active connections. - */ - async close() { - return this._webStandardTransport.close(); - } - /** - * Sends a JSON-RPC message through the transport. - */ - async send(message, options) { - return this._webStandardTransport.send(message, options); - } - /** - * Handles an incoming HTTP request, whether GET or POST. - * - * This method converts Node.js HTTP objects to Web Standard Request/Response - * and delegates to the underlying WebStandardStreamableHTTPServerTransport. - * - * @param req - Node.js IncomingMessage, optionally with auth property from middleware - * @param res - Node.js ServerResponse - * @param parsedBody - Optional pre-parsed body from body-parser middleware - */ - async handleRequest(req, res, parsedBody) { - // Store context for this request to pass through auth and parsedBody - // We need to intercept the request creation to attach this context - const authInfo = req.auth; - // Create a custom handler that includes our context - // overrideGlobalObjects: false prevents Hono from overwriting global Response, which would - // break frameworks like Next.js whose response classes extend the native Response - const handler = getRequestListener(async (webRequest) => { - return this._webStandardTransport.handleRequest(webRequest, { - authInfo, - parsedBody - }); - }, { overrideGlobalObjects: false }); - // Delegate to the request listener which handles all the Node.js <-> Web Standard conversion - // including proper SSE streaming support - await handler(req, res); - } - /** - * Close an SSE stream for a specific request, triggering client reconnection. - * Use this to implement polling behavior during long-running operations - - * client will reconnect after the retry interval specified in the priming event. - */ - closeSSEStream(requestId) { - this._webStandardTransport.closeSSEStream(requestId); - } - /** - * Close the standalone GET SSE stream, triggering client reconnection. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream() { - this._webStandardTransport.closeStandaloneSSEStream(); - } -} -//# sourceMappingURL=streamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js.map deleted file mode 100644 index b03f1f2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamableHttp.js","sourceRoot":"","sources":["../../../src/server/streamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAIvD,OAAO,EACH,wCAAwC,EAK3C,MAAM,gCAAgC,CAAC;AAYxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,OAAO,6BAA6B;IAMtC,YAAY,UAAgD,EAAE;QAH9D,6EAA6E;QACrE,oBAAe,GAAoE,IAAI,OAAO,EAAE,CAAC;QAGrG,IAAI,CAAC,qBAAqB,GAAG,IAAI,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAEnF,kEAAkE;QAClE,8FAA8F;QAC9F,2FAA2F;QAC3F,kFAAkF;QAClF,IAAI,CAAC,gBAAgB,GAAG,kBAAkB,CACtC,KAAK,EAAE,UAAmB,EAAE,EAAE;YAC1B,sDAAsD;YACtD,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACrD,OAAO,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,UAAU,EAAE;gBACxD,QAAQ,EAAE,OAAO,EAAE,QAAQ;gBAC3B,UAAU,EAAE,OAAO,EAAE,UAAU;aAClC,CAAC,CAAC;QACP,CAAC,EACD,EAAE,qBAAqB,EAAE,KAAK,EAAE,CACnC,CAAC;IACN,CAAC;IAED;;OAEG;IAC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O,GAAG,kBAAkB,CAC9B,KAAK,EAAE,UAAmB,EAAE,EAAE;YAC1B,OAAO,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,UAAU,EAAE;gBACxD,QAAQ;gBACR,UAAU;aACb,CAAC,CAAC;QACP,CAAC,EACD,EAAE,qBAAqB,EAAE,KAAK,EAAE,CACnC,CAAC;QAEF,6FAA6F;QAC7F,yCAAyC;QACzC,MAAM,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,SAAoB;QAC/B,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED;;;OAGG;IACH,wBAAwB;QACpB,IAAI,CAAC,qBAAqB,CAAC,wBAAwB,EAAE,CAAC;IAC1D,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts deleted file mode 100644 index 11bb0eb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts +++ /dev/null @@ -1,268 +0,0 @@ -/** - * Web Standards Streamable HTTP Server Transport - * - * This is the core transport implementation using Web Standard APIs (Request, Response, ReadableStream). - * It can run on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc. - * - * For Node.js Express/HTTP compatibility, use `StreamableHTTPServerTransport` which wraps this transport. - */ -import { Transport } from '../shared/transport.js'; -import { AuthInfo } from './auth/types.js'; -import { MessageExtraInfo, JSONRPCMessage, RequestId } from '../types.js'; -export type StreamId = string; -export type EventId = string; -/** - * Interface for resumability support via event storage - */ -export interface EventStore { - /** - * Stores an event for later retrieval - * @param streamId ID of the stream the event belongs to - * @param message The JSON-RPC message to store - * @returns The generated event ID for the stored event - */ - storeEvent(streamId: StreamId, message: JSONRPCMessage): Promise; - /** - * Get the stream ID associated with a given event ID. - * @param eventId The event ID to look up - * @returns The stream ID, or undefined if not found - * - * Optional: If not provided, the SDK will use the streamId returned by - * replayEventsAfter for stream mapping. - */ - getStreamIdForEventId?(eventId: EventId): Promise; - replayEventsAfter(lastEventId: EventId, { send }: { - send: (eventId: EventId, message: JSONRPCMessage) => Promise; - }): Promise; -} -/** - * Configuration options for WebStandardStreamableHTTPServerTransport - */ -export interface WebStandardStreamableHTTPServerTransportOptions { - /** - * Function that generates a session ID for the transport. - * The session ID SHOULD be globally unique and cryptographically secure (e.g., a securely generated UUID, a JWT, or a cryptographic hash) - * - * If not provided, session management is disabled (stateless mode). - */ - sessionIdGenerator?: () => string; - /** - * A callback for session initialization events - * This is called when the server initializes a new session. - * Useful in cases when you need to register multiple mcp sessions - * and need to keep track of them. - * @param sessionId The generated session ID - */ - onsessioninitialized?: (sessionId: string) => void | Promise; - /** - * A callback for session close events - * This is called when the server closes a session due to a DELETE request. - * Useful in cases when you need to clean up resources associated with the session. - * Note that this is different from the transport closing, if you are handling - * HTTP requests from multiple nodes you might want to close each - * WebStandardStreamableHTTPServerTransport after a request is completed while still keeping the - * session open/running. - * @param sessionId The session ID that was closed - */ - onsessionclosed?: (sessionId: string) => void | Promise; - /** - * If true, the server will return JSON responses instead of starting an SSE stream. - * This can be useful for simple request/response scenarios without streaming. - * Default is false (SSE streams are preferred). - */ - enableJsonResponse?: boolean; - /** - * Event store for resumability support - * If provided, resumability will be enabled, allowing clients to reconnect and resume messages - */ - eventStore?: EventStore; - /** - * List of allowed host header values for DNS rebinding protection. - * If not specified, host validation is disabled. - * @deprecated Use external middleware for host validation instead. - */ - allowedHosts?: string[]; - /** - * List of allowed origin header values for DNS rebinding protection. - * If not specified, origin validation is disabled. - * @deprecated Use external middleware for origin validation instead. - */ - allowedOrigins?: string[]; - /** - * Enable DNS rebinding protection (requires allowedHosts and/or allowedOrigins to be configured). - * Default is false for backwards compatibility. - * @deprecated Use external middleware for DNS rebinding protection instead. - */ - enableDnsRebindingProtection?: boolean; - /** - * Retry interval in milliseconds to suggest to clients in SSE retry field. - * When set, the server will send a retry field in SSE priming events to control - * client reconnection timing for polling behavior. - */ - retryInterval?: number; -} -/** - * Options for handling a request - */ -export interface HandleRequestOptions { - /** - * Pre-parsed request body. If provided, the transport will use this instead of parsing req.json(). - * Useful when using body-parser middleware that has already parsed the body. - */ - parsedBody?: unknown; - /** - * Authentication info from middleware. If provided, will be passed to message handlers. - */ - authInfo?: AuthInfo; -} -/** - * Server transport for Web Standards Streamable HTTP: this implements the MCP Streamable HTTP transport specification - * using Web Standard APIs (Request, Response, ReadableStream). - * - * This transport works on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc. - * - * Usage example: - * - * ```typescript - * // Stateful mode - server sets the session ID - * const statefulTransport = new WebStandardStreamableHTTPServerTransport({ - * sessionIdGenerator: () => crypto.randomUUID(), - * }); - * - * // Stateless mode - explicitly set session ID to undefined - * const statelessTransport = new WebStandardStreamableHTTPServerTransport({ - * sessionIdGenerator: undefined, - * }); - * - * // Hono.js usage - * app.all('/mcp', async (c) => { - * return transport.handleRequest(c.req.raw); - * }); - * - * // Cloudflare Workers usage - * export default { - * async fetch(request: Request): Promise { - * return transport.handleRequest(request); - * } - * }; - * ``` - * - * In stateful mode: - * - Session ID is generated and included in response headers - * - Session ID is always included in initialization responses - * - Requests with invalid session IDs are rejected with 404 Not Found - * - Non-initialization requests without a session ID are rejected with 400 Bad Request - * - State is maintained in-memory (connections, message history) - * - * In stateless mode: - * - No Session ID is included in any responses - * - No session validation is performed - */ -export declare class WebStandardStreamableHTTPServerTransport implements Transport { - private sessionIdGenerator; - private _started; - private _hasHandledRequest; - private _streamMapping; - private _requestToStreamMapping; - private _requestResponseMap; - private _initialized; - private _enableJsonResponse; - private _standaloneSseStreamId; - private _eventStore?; - private _onsessioninitialized?; - private _onsessionclosed?; - private _allowedHosts?; - private _allowedOrigins?; - private _enableDnsRebindingProtection; - private _retryInterval?; - sessionId?: string; - onclose?: () => void; - onerror?: (error: Error) => void; - onmessage?: (message: JSONRPCMessage, extra?: MessageExtraInfo) => void; - constructor(options?: WebStandardStreamableHTTPServerTransportOptions); - /** - * Starts the transport. This is required by the Transport interface but is a no-op - * for the Streamable HTTP transport as connections are managed per-request. - */ - start(): Promise; - /** - * Helper to create a JSON error response - */ - private createJsonErrorResponse; - /** - * Validates request headers for DNS rebinding protection. - * @returns Error response if validation fails, undefined if validation passes. - */ - private validateRequestHeaders; - /** - * Handles an incoming HTTP request, whether GET, POST, or DELETE - * Returns a Response object (Web Standard) - */ - handleRequest(req: Request, options?: HandleRequestOptions): Promise; - /** - * Writes a priming event to establish resumption capability. - * Only sends if eventStore is configured (opt-in for resumability) and - * the client's protocol version supports empty SSE data (>= 2025-11-25). - */ - private writePrimingEvent; - /** - * Handles GET requests for SSE stream - */ - private handleGetRequest; - /** - * Replays events that would have been sent after the specified event ID - * Only used when resumability is enabled - */ - private replayEvents; - /** - * Writes an event to an SSE stream via controller with proper formatting - */ - private writeSSEEvent; - /** - * Handles unsupported requests (PUT, PATCH, etc.) - */ - private handleUnsupportedRequest; - /** - * Handles POST requests containing JSON-RPC messages - */ - private handlePostRequest; - /** - * Handles DELETE requests to terminate sessions - */ - private handleDeleteRequest; - /** - * Validates session ID for non-initialization requests. - * Returns Response error if invalid, undefined otherwise - */ - private validateSession; - /** - * Validates the MCP-Protocol-Version header on incoming requests. - * - * For initialization: Version negotiation handles unknown versions gracefully - * (server responds with its supported version). - * - * For subsequent requests with MCP-Protocol-Version header: - * - Accept if in supported list - * - 400 if unsupported - * - * For HTTP requests without the MCP-Protocol-Version header: - * - Accept and default to the version negotiated at initialization - */ - private validateProtocolVersion; - close(): Promise; - /** - * Close an SSE stream for a specific request, triggering client reconnection. - * Use this to implement polling behavior during long-running operations - - * client will reconnect after the retry interval specified in the priming event. - */ - closeSSEStream(requestId: RequestId): void; - /** - * Close the standalone GET SSE stream, triggering client reconnection. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream(): void; - send(message: JSONRPCMessage, options?: { - relatedRequestId?: RequestId; - }): Promise; -} -//# sourceMappingURL=webStandardStreamableHttp.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts.map deleted file mode 100644 index 92a0e9b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webStandardStreamableHttp.d.ts","sourceRoot":"","sources":["../../../src/server/webStandardStreamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACH,gBAAgB,EAMhB,cAAc,EAEd,SAAS,EAGZ,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1E;;;;;;;OAOG;IACH,qBAAqB,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IAExE,iBAAiB,CACb,WAAW,EAAE,OAAO,EACpB,EACI,IAAI,EACP,EAAE;QACC,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACtE,GACF,OAAO,CAAC,QAAQ,CAAC,CAAC;CACxB;AAgBD;;GAEG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AAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAiGjG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js deleted file mode 100644 index 9f8a1de..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js +++ /dev/null @@ -1,732 +0,0 @@ -/** - * Web Standards Streamable HTTP Server Transport - * - * This is the core transport implementation using Web Standard APIs (Request, Response, ReadableStream). - * It can run on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc. - * - * For Node.js Express/HTTP compatibility, use `StreamableHTTPServerTransport` which wraps this transport. - */ -import { isInitializeRequest, isJSONRPCErrorResponse, isJSONRPCRequest, isJSONRPCResultResponse, JSONRPCMessageSchema, SUPPORTED_PROTOCOL_VERSIONS, DEFAULT_NEGOTIATED_PROTOCOL_VERSION } from '../types.js'; -/** - * Server transport for Web Standards Streamable HTTP: this implements the MCP Streamable HTTP transport specification - * using Web Standard APIs (Request, Response, ReadableStream). - * - * This transport works on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc. - * - * Usage example: - * - * ```typescript - * // Stateful mode - server sets the session ID - * const statefulTransport = new WebStandardStreamableHTTPServerTransport({ - * sessionIdGenerator: () => crypto.randomUUID(), - * }); - * - * // Stateless mode - explicitly set session ID to undefined - * const statelessTransport = new WebStandardStreamableHTTPServerTransport({ - * sessionIdGenerator: undefined, - * }); - * - * // Hono.js usage - * app.all('/mcp', async (c) => { - * return transport.handleRequest(c.req.raw); - * }); - * - * // Cloudflare Workers usage - * export default { - * async fetch(request: Request): Promise { - * return transport.handleRequest(request); - * } - * }; - * ``` - * - * In stateful mode: - * - Session ID is generated and included in response headers - * - Session ID is always included in initialization responses - * - Requests with invalid session IDs are rejected with 404 Not Found - * - Non-initialization requests without a session ID are rejected with 400 Bad Request - * - State is maintained in-memory (connections, message history) - * - * In stateless mode: - * - No Session ID is included in any responses - * - No session validation is performed - */ -export class WebStandardStreamableHTTPServerTransport { - constructor(options = {}) { - this._started = false; - this._hasHandledRequest = false; - this._streamMapping = new Map(); - this._requestToStreamMapping = new Map(); - this._requestResponseMap = new Map(); - this._initialized = false; - this._enableJsonResponse = false; - this._standaloneSseStreamId = '_GET_stream'; - this.sessionIdGenerator = options.sessionIdGenerator; - this._enableJsonResponse = options.enableJsonResponse ?? false; - this._eventStore = options.eventStore; - this._onsessioninitialized = options.onsessioninitialized; - this._onsessionclosed = options.onsessionclosed; - this._allowedHosts = options.allowedHosts; - this._allowedOrigins = options.allowedOrigins; - this._enableDnsRebindingProtection = options.enableDnsRebindingProtection ?? false; - this._retryInterval = options.retryInterval; - } - /** - * Starts the transport. This is required by the Transport interface but is a no-op - * for the Streamable HTTP transport as connections are managed per-request. - */ - async start() { - if (this._started) { - throw new Error('Transport already started'); - } - this._started = true; - } - /** - * Helper to create a JSON error response - */ - createJsonErrorResponse(status, code, message, options) { - const error = { code, message }; - if (options?.data !== undefined) { - error.data = options.data; - } - return new Response(JSON.stringify({ - jsonrpc: '2.0', - error, - id: null - }), { - status, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - /** - * Validates request headers for DNS rebinding protection. - * @returns Error response if validation fails, undefined if validation passes. - */ - validateRequestHeaders(req) { - // Skip validation if protection is not enabled - if (!this._enableDnsRebindingProtection) { - return undefined; - } - // Validate Host header if allowedHosts is configured - if (this._allowedHosts && this._allowedHosts.length > 0) { - const hostHeader = req.headers.get('host'); - if (!hostHeader || !this._allowedHosts.includes(hostHeader)) { - const error = `Invalid Host header: ${hostHeader}`; - this.onerror?.(new Error(error)); - return this.createJsonErrorResponse(403, -32000, error); - } - } - // Validate Origin header if allowedOrigins is configured - if (this._allowedOrigins && this._allowedOrigins.length > 0) { - const originHeader = req.headers.get('origin'); - if (originHeader && !this._allowedOrigins.includes(originHeader)) { - const error = `Invalid Origin header: ${originHeader}`; - this.onerror?.(new Error(error)); - return this.createJsonErrorResponse(403, -32000, error); - } - } - return undefined; - } - /** - * Handles an incoming HTTP request, whether GET, POST, or DELETE - * Returns a Response object (Web Standard) - */ - async handleRequest(req, options) { - // In stateless mode (no sessionIdGenerator), each request must use a fresh transport. - // Reusing a stateless transport causes message ID collisions between clients. - if (!this.sessionIdGenerator && this._hasHandledRequest) { - throw new Error('Stateless transport cannot be reused across requests. Create a new transport per request.'); - } - this._hasHandledRequest = true; - // Validate request headers for DNS rebinding protection - const validationError = this.validateRequestHeaders(req); - if (validationError) { - return validationError; - } - switch (req.method) { - case 'POST': - return this.handlePostRequest(req, options); - case 'GET': - return this.handleGetRequest(req); - case 'DELETE': - return this.handleDeleteRequest(req); - default: - return this.handleUnsupportedRequest(); - } - } - /** - * Writes a priming event to establish resumption capability. - * Only sends if eventStore is configured (opt-in for resumability) and - * the client's protocol version supports empty SSE data (>= 2025-11-25). - */ - async writePrimingEvent(controller, encoder, streamId, protocolVersion) { - if (!this._eventStore) { - return; - } - // Priming events have empty data which older clients cannot handle. - // Only send priming events to clients with protocol version >= 2025-11-25 - // which includes the fix for handling empty SSE data. - if (protocolVersion < '2025-11-25') { - return; - } - const primingEventId = await this._eventStore.storeEvent(streamId, {}); - let primingEvent = `id: ${primingEventId}\ndata: \n\n`; - if (this._retryInterval !== undefined) { - primingEvent = `id: ${primingEventId}\nretry: ${this._retryInterval}\ndata: \n\n`; - } - controller.enqueue(encoder.encode(primingEvent)); - } - /** - * Handles GET requests for SSE stream - */ - async handleGetRequest(req) { - // The client MUST include an Accept header, listing text/event-stream as a supported content type. - const acceptHeader = req.headers.get('accept'); - if (!acceptHeader?.includes('text/event-stream')) { - return this.createJsonErrorResponse(406, -32000, 'Not Acceptable: Client must accept text/event-stream'); - } - // If an Mcp-Session-Id is returned by the server during initialization, - // clients using the Streamable HTTP transport MUST include it - // in the Mcp-Session-Id header on all of their subsequent HTTP requests. - const sessionError = this.validateSession(req); - if (sessionError) { - return sessionError; - } - const protocolError = this.validateProtocolVersion(req); - if (protocolError) { - return protocolError; - } - // Handle resumability: check for Last-Event-ID header - if (this._eventStore) { - const lastEventId = req.headers.get('last-event-id'); - if (lastEventId) { - return this.replayEvents(lastEventId); - } - } - // Check if there's already an active standalone SSE stream for this session - if (this._streamMapping.get(this._standaloneSseStreamId) !== undefined) { - // Only one GET SSE stream is allowed per session - return this.createJsonErrorResponse(409, -32000, 'Conflict: Only one SSE stream is allowed per session'); - } - const encoder = new TextEncoder(); - let streamController; - // Create a ReadableStream with a controller we can use to push SSE events - const readable = new ReadableStream({ - start: controller => { - streamController = controller; - }, - cancel: () => { - // Stream was cancelled by client - this._streamMapping.delete(this._standaloneSseStreamId); - } - }); - const headers = { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache, no-transform', - Connection: 'keep-alive' - }; - // After initialization, always include the session ID if we have one - if (this.sessionId !== undefined) { - headers['mcp-session-id'] = this.sessionId; - } - // Store the stream mapping with the controller for pushing data - this._streamMapping.set(this._standaloneSseStreamId, { - controller: streamController, - encoder, - cleanup: () => { - this._streamMapping.delete(this._standaloneSseStreamId); - try { - streamController.close(); - } - catch { - // Controller might already be closed - } - } - }); - return new Response(readable, { headers }); - } - /** - * Replays events that would have been sent after the specified event ID - * Only used when resumability is enabled - */ - async replayEvents(lastEventId) { - if (!this._eventStore) { - return this.createJsonErrorResponse(400, -32000, 'Event store not configured'); - } - try { - // If getStreamIdForEventId is available, use it for conflict checking - let streamId; - if (this._eventStore.getStreamIdForEventId) { - streamId = await this._eventStore.getStreamIdForEventId(lastEventId); - if (!streamId) { - return this.createJsonErrorResponse(400, -32000, 'Invalid event ID format'); - } - // Check conflict with the SAME streamId we'll use for mapping - if (this._streamMapping.get(streamId) !== undefined) { - return this.createJsonErrorResponse(409, -32000, 'Conflict: Stream already has an active connection'); - } - } - const headers = { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache, no-transform', - Connection: 'keep-alive' - }; - if (this.sessionId !== undefined) { - headers['mcp-session-id'] = this.sessionId; - } - // Create a ReadableStream with controller for SSE - const encoder = new TextEncoder(); - let streamController; - const readable = new ReadableStream({ - start: controller => { - streamController = controller; - }, - cancel: () => { - // Stream was cancelled by client - // Cleanup will be handled by the mapping - } - }); - // Replay events - returns the streamId for backwards compatibility - const replayedStreamId = await this._eventStore.replayEventsAfter(lastEventId, { - send: async (eventId, message) => { - const success = this.writeSSEEvent(streamController, encoder, message, eventId); - if (!success) { - this.onerror?.(new Error('Failed replay events')); - try { - streamController.close(); - } - catch { - // Controller might already be closed - } - } - } - }); - this._streamMapping.set(replayedStreamId, { - controller: streamController, - encoder, - cleanup: () => { - this._streamMapping.delete(replayedStreamId); - try { - streamController.close(); - } - catch { - // Controller might already be closed - } - } - }); - return new Response(readable, { headers }); - } - catch (error) { - this.onerror?.(error); - return this.createJsonErrorResponse(500, -32000, 'Error replaying events'); - } - } - /** - * Writes an event to an SSE stream via controller with proper formatting - */ - writeSSEEvent(controller, encoder, message, eventId) { - try { - let eventData = `event: message\n`; - // Include event ID if provided - this is important for resumability - if (eventId) { - eventData += `id: ${eventId}\n`; - } - eventData += `data: ${JSON.stringify(message)}\n\n`; - controller.enqueue(encoder.encode(eventData)); - return true; - } - catch { - return false; - } - } - /** - * Handles unsupported requests (PUT, PATCH, etc.) - */ - handleUnsupportedRequest() { - return new Response(JSON.stringify({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Method not allowed.' - }, - id: null - }), { - status: 405, - headers: { - Allow: 'GET, POST, DELETE', - 'Content-Type': 'application/json' - } - }); - } - /** - * Handles POST requests containing JSON-RPC messages - */ - async handlePostRequest(req, options) { - try { - // Validate the Accept header - const acceptHeader = req.headers.get('accept'); - // The client MUST include an Accept header, listing both application/json and text/event-stream as supported content types. - if (!acceptHeader?.includes('application/json') || !acceptHeader.includes('text/event-stream')) { - return this.createJsonErrorResponse(406, -32000, 'Not Acceptable: Client must accept both application/json and text/event-stream'); - } - const ct = req.headers.get('content-type'); - if (!ct || !ct.includes('application/json')) { - return this.createJsonErrorResponse(415, -32000, 'Unsupported Media Type: Content-Type must be application/json'); - } - // Build request info from headers - const requestInfo = { - headers: Object.fromEntries(req.headers.entries()) - }; - let rawMessage; - if (options?.parsedBody !== undefined) { - rawMessage = options.parsedBody; - } - else { - try { - rawMessage = await req.json(); - } - catch { - return this.createJsonErrorResponse(400, -32700, 'Parse error: Invalid JSON'); - } - } - let messages; - // handle batch and single messages - try { - if (Array.isArray(rawMessage)) { - messages = rawMessage.map(msg => JSONRPCMessageSchema.parse(msg)); - } - else { - messages = [JSONRPCMessageSchema.parse(rawMessage)]; - } - } - catch { - return this.createJsonErrorResponse(400, -32700, 'Parse error: Invalid JSON-RPC message'); - } - // Check if this is an initialization request - // https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/lifecycle/ - const isInitializationRequest = messages.some(isInitializeRequest); - if (isInitializationRequest) { - // If it's a server with session management and the session ID is already set we should reject the request - // to avoid re-initialization. - if (this._initialized && this.sessionId !== undefined) { - return this.createJsonErrorResponse(400, -32600, 'Invalid Request: Server already initialized'); - } - if (messages.length > 1) { - return this.createJsonErrorResponse(400, -32600, 'Invalid Request: Only one initialization request is allowed'); - } - this.sessionId = this.sessionIdGenerator?.(); - this._initialized = true; - // If we have a session ID and an onsessioninitialized handler, call it immediately - // This is needed in cases where the server needs to keep track of multiple sessions - if (this.sessionId && this._onsessioninitialized) { - await Promise.resolve(this._onsessioninitialized(this.sessionId)); - } - } - if (!isInitializationRequest) { - // If an Mcp-Session-Id is returned by the server during initialization, - // clients using the Streamable HTTP transport MUST include it - // in the Mcp-Session-Id header on all of their subsequent HTTP requests. - const sessionError = this.validateSession(req); - if (sessionError) { - return sessionError; - } - // Mcp-Protocol-Version header is required for all requests after initialization. - const protocolError = this.validateProtocolVersion(req); - if (protocolError) { - return protocolError; - } - } - // check if it contains requests - const hasRequests = messages.some(isJSONRPCRequest); - if (!hasRequests) { - // if it only contains notifications or responses, return 202 - for (const message of messages) { - this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo }); - } - return new Response(null, { status: 202 }); - } - // The default behavior is to use SSE streaming - // but in some cases server will return JSON responses - const streamId = crypto.randomUUID(); - // Extract protocol version for priming event decision. - // For initialize requests, get from request params. - // For other requests, get from header (already validated). - const initRequest = messages.find(m => isInitializeRequest(m)); - const clientProtocolVersion = initRequest - ? initRequest.params.protocolVersion - : (req.headers.get('mcp-protocol-version') ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION); - if (this._enableJsonResponse) { - // For JSON response mode, return a Promise that resolves when all responses are ready - return new Promise(resolve => { - this._streamMapping.set(streamId, { - resolveJson: resolve, - cleanup: () => { - this._streamMapping.delete(streamId); - } - }); - for (const message of messages) { - if (isJSONRPCRequest(message)) { - this._requestToStreamMapping.set(message.id, streamId); - } - } - for (const message of messages) { - this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo }); - } - }); - } - // SSE streaming mode - use ReadableStream with controller for more reliable data pushing - const encoder = new TextEncoder(); - let streamController; - const readable = new ReadableStream({ - start: controller => { - streamController = controller; - }, - cancel: () => { - // Stream was cancelled by client - this._streamMapping.delete(streamId); - } - }); - const headers = { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache', - Connection: 'keep-alive' - }; - // After initialization, always include the session ID if we have one - if (this.sessionId !== undefined) { - headers['mcp-session-id'] = this.sessionId; - } - // Store the response for this request to send messages back through this connection - // We need to track by request ID to maintain the connection - for (const message of messages) { - if (isJSONRPCRequest(message)) { - this._streamMapping.set(streamId, { - controller: streamController, - encoder, - cleanup: () => { - this._streamMapping.delete(streamId); - try { - streamController.close(); - } - catch { - // Controller might already be closed - } - } - }); - this._requestToStreamMapping.set(message.id, streamId); - } - } - // Write priming event if event store is configured (after mapping is set up) - await this.writePrimingEvent(streamController, encoder, streamId, clientProtocolVersion); - // handle each message - for (const message of messages) { - // Build closeSSEStream callback for requests when eventStore is configured - // AND client supports resumability (protocol version >= 2025-11-25). - // Old clients can't resume if the stream is closed early because they - // didn't receive a priming event with an event ID. - let closeSSEStream; - let closeStandaloneSSEStream; - if (isJSONRPCRequest(message) && this._eventStore && clientProtocolVersion >= '2025-11-25') { - closeSSEStream = () => { - this.closeSSEStream(message.id); - }; - closeStandaloneSSEStream = () => { - this.closeStandaloneSSEStream(); - }; - } - this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo, closeSSEStream, closeStandaloneSSEStream }); - } - // The server SHOULD NOT close the SSE stream before sending all JSON-RPC responses - // This will be handled by the send() method when responses are ready - return new Response(readable, { status: 200, headers }); - } - catch (error) { - // return JSON-RPC formatted error - this.onerror?.(error); - return this.createJsonErrorResponse(400, -32700, 'Parse error', { data: String(error) }); - } - } - /** - * Handles DELETE requests to terminate sessions - */ - async handleDeleteRequest(req) { - const sessionError = this.validateSession(req); - if (sessionError) { - return sessionError; - } - const protocolError = this.validateProtocolVersion(req); - if (protocolError) { - return protocolError; - } - await Promise.resolve(this._onsessionclosed?.(this.sessionId)); - await this.close(); - return new Response(null, { status: 200 }); - } - /** - * Validates session ID for non-initialization requests. - * Returns Response error if invalid, undefined otherwise - */ - validateSession(req) { - if (this.sessionIdGenerator === undefined) { - // If the sessionIdGenerator ID is not set, the session management is disabled - // and we don't need to validate the session ID - return undefined; - } - if (!this._initialized) { - // If the server has not been initialized yet, reject all requests - return this.createJsonErrorResponse(400, -32000, 'Bad Request: Server not initialized'); - } - const sessionId = req.headers.get('mcp-session-id'); - if (!sessionId) { - // Non-initialization requests without a session ID should return 400 Bad Request - return this.createJsonErrorResponse(400, -32000, 'Bad Request: Mcp-Session-Id header is required'); - } - if (sessionId !== this.sessionId) { - // Reject requests with invalid session ID with 404 Not Found - return this.createJsonErrorResponse(404, -32001, 'Session not found'); - } - return undefined; - } - /** - * Validates the MCP-Protocol-Version header on incoming requests. - * - * For initialization: Version negotiation handles unknown versions gracefully - * (server responds with its supported version). - * - * For subsequent requests with MCP-Protocol-Version header: - * - Accept if in supported list - * - 400 if unsupported - * - * For HTTP requests without the MCP-Protocol-Version header: - * - Accept and default to the version negotiated at initialization - */ - validateProtocolVersion(req) { - const protocolVersion = req.headers.get('mcp-protocol-version'); - if (protocolVersion !== null && !SUPPORTED_PROTOCOL_VERSIONS.includes(protocolVersion)) { - return this.createJsonErrorResponse(400, -32000, `Bad Request: Unsupported protocol version: ${protocolVersion} (supported versions: ${SUPPORTED_PROTOCOL_VERSIONS.join(', ')})`); - } - return undefined; - } - async close() { - // Close all SSE connections - this._streamMapping.forEach(({ cleanup }) => { - cleanup(); - }); - this._streamMapping.clear(); - // Clear any pending responses - this._requestResponseMap.clear(); - this.onclose?.(); - } - /** - * Close an SSE stream for a specific request, triggering client reconnection. - * Use this to implement polling behavior during long-running operations - - * client will reconnect after the retry interval specified in the priming event. - */ - closeSSEStream(requestId) { - const streamId = this._requestToStreamMapping.get(requestId); - if (!streamId) - return; - const stream = this._streamMapping.get(streamId); - if (stream) { - stream.cleanup(); - } - } - /** - * Close the standalone GET SSE stream, triggering client reconnection. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream() { - const stream = this._streamMapping.get(this._standaloneSseStreamId); - if (stream) { - stream.cleanup(); - } - } - async send(message, options) { - let requestId = options?.relatedRequestId; - if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) { - // If the message is a response, use the request ID from the message - requestId = message.id; - } - // Check if this message should be sent on the standalone SSE stream (no request ID) - // Ignore notifications from tools (which have relatedRequestId set) - // Those will be sent via dedicated response SSE streams - if (requestId === undefined) { - // For standalone SSE streams, we can only send requests and notifications - if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) { - throw new Error('Cannot send a response on a standalone SSE stream unless resuming a previous client request'); - } - // Generate and store event ID if event store is provided - // Store even if stream is disconnected so events can be replayed on reconnect - let eventId; - if (this._eventStore) { - // Stores the event and gets the generated event ID - eventId = await this._eventStore.storeEvent(this._standaloneSseStreamId, message); - } - const standaloneSse = this._streamMapping.get(this._standaloneSseStreamId); - if (standaloneSse === undefined) { - // Stream is disconnected - event is stored for replay, nothing more to do - return; - } - // Send the message to the standalone SSE stream - if (standaloneSse.controller && standaloneSse.encoder) { - this.writeSSEEvent(standaloneSse.controller, standaloneSse.encoder, message, eventId); - } - return; - } - // Get the response for this request - const streamId = this._requestToStreamMapping.get(requestId); - if (!streamId) { - throw new Error(`No connection established for request ID: ${String(requestId)}`); - } - const stream = this._streamMapping.get(streamId); - if (!this._enableJsonResponse && stream?.controller && stream?.encoder) { - // For SSE responses, generate event ID if event store is provided - let eventId; - if (this._eventStore) { - eventId = await this._eventStore.storeEvent(streamId, message); - } - // Write the event to the response stream - this.writeSSEEvent(stream.controller, stream.encoder, message, eventId); - } - if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) { - this._requestResponseMap.set(requestId, message); - const relatedIds = Array.from(this._requestToStreamMapping.entries()) - .filter(([_, sid]) => sid === streamId) - .map(([id]) => id); - // Check if we have responses for all requests using this connection - const allResponsesReady = relatedIds.every(id => this._requestResponseMap.has(id)); - if (allResponsesReady) { - if (!stream) { - throw new Error(`No connection established for request ID: ${String(requestId)}`); - } - if (this._enableJsonResponse && stream.resolveJson) { - // All responses ready, send as JSON - const headers = { - 'Content-Type': 'application/json' - }; - if (this.sessionId !== undefined) { - headers['mcp-session-id'] = this.sessionId; - } - const responses = relatedIds.map(id => this._requestResponseMap.get(id)); - if (responses.length === 1) { - stream.resolveJson(new Response(JSON.stringify(responses[0]), { status: 200, headers })); - } - else { - stream.resolveJson(new Response(JSON.stringify(responses), { status: 200, headers })); - } - } - else { - // End the SSE stream - stream.cleanup(); - } - // Clean up - for (const id of relatedIds) { - this._requestResponseMap.delete(id); - this._requestToStreamMapping.delete(id); - } - } - } - } -} -//# sourceMappingURL=webStandardStreamableHttp.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js.map deleted file mode 100644 index bee6df1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webStandardStreamableHttp.js","sourceRoot":"","sources":["../../../src/server/webStandardStreamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAGH,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EAEvB,oBAAoB,EAEpB,2BAA2B,EAC3B,mCAAmC,EACtC,MAAM,aAAa,CAAC;AA8IrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,OAAO,wCAAwC;IAwBjD,YAAY,UAA2D,EAAE;QArBjE,aAAQ,GAAY,KAAK,CAAC;QAC1B,uBAAkB,GAAY,KAAK,CAAC;QACpC,mBAAc,GAA+B,IAAI,GAAG,EAAE,CAAC;QACvD,4BAAuB,GAA2B,IAAI,GAAG,EAAE,CAAC;QAC5D,wBAAmB,GAAmC,IAAI,GAAG,EAAE,CAAC;QAChE,iBAAY,GAAY,KAAK,CAAC;QAC9B,wBAAmB,GAAY,KAAK,CAAC;QACrC,2BAAsB,GAAW,aAAa,CAAC;QAenD,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,IAAI,KAAK,CAAC;QAC/D,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;QAC1D,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;QAChD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;QAC1C,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;QAC9C,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AC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAC5C,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts deleted file mode 100644 index c3a5b60..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type * as z3 from 'zod/v3'; -import type * as z4 from 'zod/v4/core'; -export type AnySchema = z3.ZodTypeAny | z4.$ZodType; -export type AnyObjectSchema = z3.AnyZodObject | z4.$ZodObject | AnySchema; -export type ZodRawShapeCompat = Record; -export interface ZodV3Internal { - _def?: { - typeName?: string; - value?: unknown; - values?: unknown[]; - shape?: Record | (() => Record); - description?: string; - }; - shape?: Record | (() => Record); - value?: unknown; -} -export interface ZodV4Internal { - _zod?: { - def?: { - type?: string; - value?: unknown; - values?: unknown[]; - shape?: Record | (() => Record); - }; - }; - value?: unknown; -} -export type SchemaOutput = S extends z3.ZodTypeAny ? z3.infer : S extends z4.$ZodType ? z4.output : never; -export type SchemaInput = S extends z3.ZodTypeAny ? z3.input : S extends z4.$ZodType ? z4.input : never; -/** - * Infers the output type from a ZodRawShapeCompat (raw shape object). - * Maps over each key in the shape and infers the output type from each schema. - */ -export type ShapeOutput = { - [K in keyof Shape]: SchemaOutput; -}; -export declare function isZ4Schema(s: AnySchema): s is z4.$ZodType; -export declare function objectFromShape(shape: ZodRawShapeCompat): AnyObjectSchema; -export declare function safeParse(schema: S, data: unknown): { - success: true; - data: SchemaOutput; -} | { - success: false; - error: unknown; -}; -export declare function safeParseAsync(schema: S, data: unknown): Promise<{ - success: true; - data: SchemaOutput; -} | { - success: false; - error: unknown; -}>; -export declare function getObjectShape(schema: AnyObjectSchema | undefined): Record | undefined; -/** - * Normalizes a schema to an object schema. Handles both: - * - Already-constructed object schemas (v3 or v4) - * - Raw shapes that need to be wrapped into object schemas - */ -export declare function normalizeObjectSchema(schema: AnySchema | ZodRawShapeCompat | undefined): AnyObjectSchema | undefined; -/** - * Safely extracts an error message from a parse result error. - * Zod errors can have different structures, so we handle various cases. - */ -export declare function getParseErrorMessage(error: unknown): string; -/** - * Gets the description from a schema, if available. - * Works with both Zod v3 and v4. - * - * Both versions expose a `.description` getter that returns the description - * from their respective internal storage (v3: _def, v4: globalRegistry). - */ -export declare function getSchemaDescription(schema: AnySchema): string | undefined; -/** - * Checks if a schema is optional. - * Works with both Zod v3 and v4. - */ -export declare function isSchemaOptional(schema: AnySchema): boolean; -/** - * Gets the literal value from a schema, if it's a literal schema. - * Works with both Zod v3 and v4. - * Returns undefined if the schema is not a literal or the value cannot be determined. - */ -export declare function getLiteralValue(schema: AnySchema): unknown; -//# sourceMappingURL=zod-compat.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts.map deleted file mode 100644 index a2ccd51..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-compat.d.ts","sourceRoot":"","sources":["../../../src/server/zod-compat.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAMvC,MAAM,MAAM,SAAS,GAAG,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,QAAQ,CAAC;AACpD,MAAM,MAAM,eAAe,GAAG,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,UAAU,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAI1D,MAAM,WAAW,aAAa;IAC1B,IAAI,CAAC,EAAE;QACH,Q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C,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE1E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAW3D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAwB1D"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js deleted file mode 100644 index be30a22..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +++ /dev/null @@ -1,209 +0,0 @@ -// zod-compat.ts -// ---------------------------------------------------- -// Unified types + helpers to accept Zod v3 and v4 (Mini) -// ---------------------------------------------------- -import * as z3rt from 'zod/v3'; -import * as z4mini from 'zod/v4-mini'; -// --- Runtime detection --- -export function isZ4Schema(s) { - // Present on Zod 4 (Classic & Mini) schemas; absent on Zod 3 - const schema = s; - return !!schema._zod; -} -// --- Schema construction --- -export function objectFromShape(shape) { - const values = Object.values(shape); - if (values.length === 0) - return z4mini.object({}); // default to v4 Mini - const allV4 = values.every(isZ4Schema); - const allV3 = values.every(s => !isZ4Schema(s)); - if (allV4) - return z4mini.object(shape); - if (allV3) - return z3rt.object(shape); - throw new Error('Mixed Zod versions detected in object shape.'); -} -// --- Unified parsing --- -export function safeParse(schema, data) { - if (isZ4Schema(schema)) { - // Mini exposes top-level safeParse - const result = z4mini.safeParse(schema, data); - return result; - } - const v3Schema = schema; - const result = v3Schema.safeParse(data); - return result; -} -export async function safeParseAsync(schema, data) { - if (isZ4Schema(schema)) { - // Mini exposes top-level safeParseAsync - const result = await z4mini.safeParseAsync(schema, data); - return result; - } - const v3Schema = schema; - const result = await v3Schema.safeParseAsync(data); - return result; -} -// --- Shape extraction --- -export function getObjectShape(schema) { - if (!schema) - return undefined; - // Zod v3 exposes `.shape`; Zod v4 keeps the shape on `_zod.def.shape` - let rawShape; - if (isZ4Schema(schema)) { - const v4Schema = schema; - rawShape = v4Schema._zod?.def?.shape; - } - else { - const v3Schema = schema; - rawShape = v3Schema.shape; - } - if (!rawShape) - return undefined; - if (typeof rawShape === 'function') { - try { - return rawShape(); - } - catch { - return undefined; - } - } - return rawShape; -} -// --- Schema normalization --- -/** - * Normalizes a schema to an object schema. Handles both: - * - Already-constructed object schemas (v3 or v4) - * - Raw shapes that need to be wrapped into object schemas - */ -export function normalizeObjectSchema(schema) { - if (!schema) - return undefined; - // First check if it's a raw shape (Record) - // Raw shapes don't have _def or _zod properties and aren't schemas themselves - if (typeof schema === 'object') { - // Check if it's actually a ZodRawShapeCompat (not a schema instance) - // by checking if it lacks schema-like internal properties - const asV3 = schema; - const asV4 = schema; - // If it's not a schema instance (no _def or _zod), it might be a raw shape - if (!asV3._def && !asV4._zod) { - // Check if all values are schemas (heuristic to confirm it's a raw shape) - const values = Object.values(schema); - if (values.length > 0 && - values.every(v => typeof v === 'object' && - v !== null && - (v._def !== undefined || - v._zod !== undefined || - typeof v.parse === 'function'))) { - return objectFromShape(schema); - } - } - } - // If we get here, it should be an AnySchema (not a raw shape) - // Check if it's already an object schema - if (isZ4Schema(schema)) { - // Check if it's a v4 object - const v4Schema = schema; - const def = v4Schema._zod?.def; - if (def && (def.type === 'object' || def.shape !== undefined)) { - return schema; - } - } - else { - // Check if it's a v3 object - const v3Schema = schema; - if (v3Schema.shape !== undefined) { - return schema; - } - } - return undefined; -} -// --- Error message extraction --- -/** - * Safely extracts an error message from a parse result error. - * Zod errors can have different structures, so we handle various cases. - */ -export function getParseErrorMessage(error) { - if (error && typeof error === 'object') { - // Try common error structures - if ('message' in error && typeof error.message === 'string') { - return error.message; - } - if ('issues' in error && Array.isArray(error.issues) && error.issues.length > 0) { - const firstIssue = error.issues[0]; - if (firstIssue && typeof firstIssue === 'object' && 'message' in firstIssue) { - return String(firstIssue.message); - } - } - // Fallback: try to stringify the error - try { - return JSON.stringify(error); - } - catch { - return String(error); - } - } - return String(error); -} -// --- Schema metadata access --- -/** - * Gets the description from a schema, if available. - * Works with both Zod v3 and v4. - * - * Both versions expose a `.description` getter that returns the description - * from their respective internal storage (v3: _def, v4: globalRegistry). - */ -export function getSchemaDescription(schema) { - return schema.description; -} -/** - * Checks if a schema is optional. - * Works with both Zod v3 and v4. - */ -export function isSchemaOptional(schema) { - if (isZ4Schema(schema)) { - const v4Schema = schema; - return v4Schema._zod?.def?.type === 'optional'; - } - const v3Schema = schema; - // v3 has isOptional() method - if (typeof schema.isOptional === 'function') { - return schema.isOptional(); - } - return v3Schema._def?.typeName === 'ZodOptional'; -} -/** - * Gets the literal value from a schema, if it's a literal schema. - * Works with both Zod v3 and v4. - * Returns undefined if the schema is not a literal or the value cannot be determined. - */ -export function getLiteralValue(schema) { - if (isZ4Schema(schema)) { - const v4Schema = schema; - const def = v4Schema._zod?.def; - if (def) { - // Try various ways to get the literal value - if (def.value !== undefined) - return def.value; - if (Array.isArray(def.values) && def.values.length > 0) { - return def.values[0]; - } - } - } - const v3Schema = schema; - const def = v3Schema._def; - if (def) { - if (def.value !== undefined) - return def.value; - if (Array.isArray(def.values) && def.values.length > 0) { - return def.values[0]; - } - } - // Fallback: check for direct value property (some Zod versions) - const directValue = schema.value; - if (directValue !== undefined) - return directValue; - return undefined; -} -//# sourceMappingURL=zod-compat.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map deleted file mode 100644 index 42b83f9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-compat.js","sourceRoot":"","sources":["../../../src/server/zod-compat.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,uDAAuD;AACvD,yDAAyD;AACzD,uDAAuD;AAKvD,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,M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AAI,WAAW,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAClD,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.d.ts deleted file mode 100644 index 3a04452..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AnySchema, AnyObjectSchema } from './zod-compat.js'; -type JsonSchema = Record; -type CommonOpts = { - strictUnions?: boolean; - pipeStrategy?: 'input' | 'output'; - target?: 'jsonSchema7' | 'draft-7' | 'jsonSchema2019-09' | 'draft-2020-12'; -}; -export declare function toJsonSchemaCompat(schema: AnyObjectSchema, opts?: CommonOpts): JsonSchema; -export declare function getMethodLiteral(schema: AnyObjectSchema): string; -export declare function parseWithCompat(schema: AnySchema, data: unknown): unknown; -export {}; -//# sourceMappingURL=zod-json-schema-compat.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.d.ts.map deleted file mode 100644 index 0b851bf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-json-schema-compat.d.ts","sourceRoot":"","sources":["../../../src/server/zod-json-schema-compat.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAE,eAAe,EAA0D,MAAM,iBAAiB,CAAC;AAGrH,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAG1C,KAAK,UAAU,GAAG;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,mBAAmB,GAAG,eAAe,CAAC;CAC9E,CAAC;AASF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAczF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAahE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAMzE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js deleted file mode 100644 index 62f7fd0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +++ /dev/null @@ -1,51 +0,0 @@ -// zod-json-schema-compat.ts -// ---------------------------------------------------- -// JSON Schema conversion for both Zod v3 and Zod v4 (Mini) -// v3 uses your vendored converter; v4 uses Mini's toJSONSchema -// ---------------------------------------------------- -import * as z4mini from 'zod/v4-mini'; -import { getObjectShape, safeParse, isZ4Schema, getLiteralValue } from './zod-compat.js'; -import { zodToJsonSchema } from 'zod-to-json-schema'; -function mapMiniTarget(t) { - if (!t) - return 'draft-7'; - if (t === 'jsonSchema7' || t === 'draft-7') - return 'draft-7'; - if (t === 'jsonSchema2019-09' || t === 'draft-2020-12') - return 'draft-2020-12'; - return 'draft-7'; // fallback -} -export function toJsonSchemaCompat(schema, opts) { - if (isZ4Schema(schema)) { - // v4 branch — use Mini's built-in toJSONSchema - return z4mini.toJSONSchema(schema, { - target: mapMiniTarget(opts?.target), - io: opts?.pipeStrategy ?? 'input' - }); - } - // v3 branch — use vendored converter - return zodToJsonSchema(schema, { - strictUnions: opts?.strictUnions ?? true, - pipeStrategy: opts?.pipeStrategy ?? 'input' - }); -} -export function getMethodLiteral(schema) { - const shape = getObjectShape(schema); - const methodSchema = shape?.method; - if (!methodSchema) { - throw new Error('Schema is missing a method literal'); - } - const value = getLiteralValue(methodSchema); - if (typeof value !== 'string') { - throw new Error('Schema method literal must be a string'); - } - return value; -} -export function parseWithCompat(schema, data) { - const result = safeParse(schema, data); - if (!result.success) { - throw result.error; - } - return result.data; -} -//# sourceMappingURL=zod-json-schema-compat.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map deleted file mode 100644 index 70169ff..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"zod-json-schema-compat.js","sourceRoot":"","sources":["../../../src/server/zod-json-schema-compat.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,uDAAuD;AACvD,2DAA2D;AAC3D,+DAA+D;AAC/D,uDAAuD;AAKvD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAA8B,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACrH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAWrD,SAAS,aAAa,CAAC,CAAmC;IACtD,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACzB,IAAI,CAAC,KAAK,aAAa,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC7D,IAAI,CAAC,KAAK,mBAAmB,IAAI,CAAC,KAAK,eAAe;QAAE,OAAO,eAAe,CAAC;IAC/E,OAAO,SAAS,CAAC,CAAC,WAAW;AACjC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAuB,EAAE,IAAiB;IACzE,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,+CAA+C;QAC/C,OAAO,MAAM,CAAC,YAAY,CAAC,MAAsB,EAAE;YAC/C,MAAM,EAAE,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC;YACnC,EAAE,EAAE,IAAI,EAAE,YAAY,IAAI,OAAO;SACpC,CAAe,CAAC;IACrB,CAAC;IAED,qCAAqC;IACrC,OAAO,eAAe,CAAC,MAAuB,EAAE;QAC5C,YAAY,EAAE,IAAI,EAAE,YAAY,IAAI,IAAI;QACxC,YAAY,EAAE,IAAI,EAAE,YAAY,IAAI,OAAO;KAC9C,CAAe,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAuB;IACpD,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,KAAK,EAAE,MAA+B,CAAC;IAC5D,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,KAAK,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAiB,EAAE,IAAa;IAC5D,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,MAAM,CAAC,KAAK,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.d.ts deleted file mode 100644 index c966e30..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Utilities for handling OAuth resource URIs. - */ -/** - * Converts a server URL to a resource URL by removing the fragment. - * RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component". - * Keeps everything else unchanged (scheme, domain, port, path, query). - */ -export declare function resourceUrlFromServerUrl(url: URL | string): URL; -/** - * Checks if a requested resource URL matches a configured resource URL. - * A requested resource matches if it has the same scheme, domain, port, - * and its path starts with the configured resource's path. - * - * @param requestedResource The resource URL being requested - * @param configuredResource The resource URL that has been configured - * @returns true if the requested resource matches the configured resource, false otherwise - */ -export declare function checkResourceAllowed({ requestedResource, configuredResource }: { - requestedResource: URL | string; - configuredResource: URL | string; -}): boolean; -//# sourceMappingURL=auth-utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.d.ts.map deleted file mode 100644 index 30873de..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth-utils.d.ts","sourceRoot":"","sources":["../../../src/shared/auth-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,GAAG,CAI/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,iBAAiB,EACjB,kBAAkB,EACrB,EAAE;IACC,iBAAiB,EAAE,GAAG,GAAG,MAAM,CAAC;IAChC,kBAAkB,EAAE,GAAG,GAAG,MAAM,CAAC;CACpC,GAAG,OAAO,CAwBV"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js deleted file mode 100644 index 1883885..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Utilities for handling OAuth resource URIs. - */ -/** - * Converts a server URL to a resource URL by removing the fragment. - * RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component". - * Keeps everything else unchanged (scheme, domain, port, path, query). - */ -export function resourceUrlFromServerUrl(url) { - const resourceURL = typeof url === 'string' ? new URL(url) : new URL(url.href); - resourceURL.hash = ''; // Remove fragment - return resourceURL; -} -/** - * Checks if a requested resource URL matches a configured resource URL. - * A requested resource matches if it has the same scheme, domain, port, - * and its path starts with the configured resource's path. - * - * @param requestedResource The resource URL being requested - * @param configuredResource The resource URL that has been configured - * @returns true if the requested resource matches the configured resource, false otherwise - */ -export function checkResourceAllowed({ requestedResource, configuredResource }) { - const requested = typeof requestedResource === 'string' ? new URL(requestedResource) : new URL(requestedResource.href); - const configured = typeof configuredResource === 'string' ? new URL(configuredResource) : new URL(configuredResource.href); - // Compare the origin (scheme, domain, and port) - if (requested.origin !== configured.origin) { - return false; - } - // Handle cases like requested=/foo and configured=/foo/ - if (requested.pathname.length < configured.pathname.length) { - return false; - } - // Check if the requested path starts with the configured path - // Ensure both paths end with / for proper comparison - // This ensures that if we have paths like "/api" and "/api/users", - // we properly detect that "/api/users" is a subpath of "/api" - // By adding a trailing slash if missing, we avoid false positives - // where paths like "/api123" would incorrectly match "/api" - const requestedPath = requested.pathname.endsWith('/') ? requested.pathname : requested.pathname + '/'; - const configuredPath = configured.pathname.endsWith('/') ? configured.pathname : configured.pathname + '/'; - return requestedPath.startsWith(configuredPath); -} -//# sourceMappingURL=auth-utils.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js.map deleted file mode 100644 index 3ced5af..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth-utils.js","sourceRoot":"","sources":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AS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,GAAG,GAAG,CAAC;IACvG,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC;IAE3G,OAAO,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACpD,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts deleted file mode 100644 index 4e47be1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -import * as z from 'zod/v4'; -/** - * Reusable URL validation that disallows javascript: scheme - */ -export declare const SafeUrlSchema: z.ZodURL; -/** - * RFC 9728 OAuth Protected Resource Metadata - */ -export declare const OAuthProtectedResourceMetadataSchema: z.ZodObject<{ - resource: z.ZodString; - authorization_servers: z.ZodOptional>; - jwks_uri: z.ZodOptional; - scopes_supported: z.ZodOptional>; - bearer_methods_supported: z.ZodOptional>; - resource_signing_alg_values_supported: z.ZodOptional>; - resource_name: z.ZodOptional; - resource_documentation: z.ZodOptional; - resource_policy_uri: z.ZodOptional; - resource_tos_uri: z.ZodOptional; - tls_client_certificate_bound_access_tokens: z.ZodOptional; - authorization_details_types_supported: z.ZodOptional>; - dpop_signing_alg_values_supported: z.ZodOptional>; - dpop_bound_access_tokens_required: z.ZodOptional; -}, z.core.$loose>; -/** - * RFC 8414 OAuth 2.0 Authorization Server Metadata - */ -export declare const OAuthMetadataSchema: z.ZodObject<{ - issuer: z.ZodString; - authorization_endpoint: z.ZodURL; - token_endpoint: z.ZodURL; - registration_endpoint: z.ZodOptional; - scopes_supported: z.ZodOptional>; - response_types_supported: z.ZodArray; - response_modes_supported: z.ZodOptional>; - grant_types_supported: z.ZodOptional>; - token_endpoint_auth_methods_supported: z.ZodOptional>; - token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - service_documentation: z.ZodOptional; - revocation_endpoint: z.ZodOptional; - revocation_endpoint_auth_methods_supported: z.ZodOptional>; - revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - introspection_endpoint: z.ZodOptional; - introspection_endpoint_auth_methods_supported: z.ZodOptional>; - introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - code_challenge_methods_supported: z.ZodOptional>; - client_id_metadata_document_supported: z.ZodOptional; -}, z.core.$loose>; -/** - * OpenID Connect Discovery 1.0 Provider Metadata - * see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata - */ -export declare const OpenIdProviderMetadataSchema: z.ZodObject<{ - issuer: z.ZodString; - authorization_endpoint: z.ZodURL; - token_endpoint: z.ZodURL; - userinfo_endpoint: z.ZodOptional; - jwks_uri: z.ZodURL; - registration_endpoint: z.ZodOptional; - scopes_supported: z.ZodOptional>; - response_types_supported: z.ZodArray; - response_modes_supported: z.ZodOptional>; - grant_types_supported: z.ZodOptional>; - acr_values_supported: z.ZodOptional>; - subject_types_supported: z.ZodArray; - id_token_signing_alg_values_supported: z.ZodArray; - id_token_encryption_alg_values_supported: z.ZodOptional>; - id_token_encryption_enc_values_supported: z.ZodOptional>; - userinfo_signing_alg_values_supported: z.ZodOptional>; - userinfo_encryption_alg_values_supported: z.ZodOptional>; - userinfo_encryption_enc_values_supported: z.ZodOptional>; - request_object_signing_alg_values_supported: z.ZodOptional>; - request_object_encryption_alg_values_supported: z.ZodOptional>; - request_object_encryption_enc_values_supported: z.ZodOptional>; - token_endpoint_auth_methods_supported: z.ZodOptional>; - token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - display_values_supported: z.ZodOptional>; - claim_types_supported: z.ZodOptional>; - claims_supported: z.ZodOptional>; - service_documentation: z.ZodOptional; - claims_locales_supported: z.ZodOptional>; - ui_locales_supported: z.ZodOptional>; - claims_parameter_supported: z.ZodOptional; - request_parameter_supported: z.ZodOptional; - request_uri_parameter_supported: z.ZodOptional; - require_request_uri_registration: z.ZodOptional; - op_policy_uri: z.ZodOptional; - op_tos_uri: z.ZodOptional; - client_id_metadata_document_supported: z.ZodOptional; -}, z.core.$loose>; -/** - * OpenID Connect Discovery metadata that may include OAuth 2.0 fields - * This schema represents the real-world scenario where OIDC providers - * return a mix of OpenID Connect and OAuth 2.0 metadata fields - */ -export declare const OpenIdProviderDiscoveryMetadataSchema: z.ZodObject<{ - code_challenge_methods_supported: z.ZodOptional>; - issuer: z.ZodString; - authorization_endpoint: z.ZodURL; - token_endpoint: z.ZodURL; - userinfo_endpoint: z.ZodOptional; - jwks_uri: z.ZodURL; - registration_endpoint: z.ZodOptional; - scopes_supported: z.ZodOptional>; - response_types_supported: z.ZodArray; - response_modes_supported: z.ZodOptional>; - grant_types_supported: z.ZodOptional>; - acr_values_supported: z.ZodOptional>; - subject_types_supported: z.ZodArray; - id_token_signing_alg_values_supported: z.ZodArray; - id_token_encryption_alg_values_supported: z.ZodOptional>; - id_token_encryption_enc_values_supported: z.ZodOptional>; - userinfo_signing_alg_values_supported: z.ZodOptional>; - userinfo_encryption_alg_values_supported: z.ZodOptional>; - userinfo_encryption_enc_values_supported: z.ZodOptional>; - request_object_signing_alg_values_supported: z.ZodOptional>; - request_object_encryption_alg_values_supported: z.ZodOptional>; - request_object_encryption_enc_values_supported: z.ZodOptional>; - token_endpoint_auth_methods_supported: z.ZodOptional>; - token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; - display_values_supported: z.ZodOptional>; - claim_types_supported: z.ZodOptional>; - claims_supported: z.ZodOptional>; - service_documentation: z.ZodOptional; - claims_locales_supported: z.ZodOptional>; - ui_locales_supported: z.ZodOptional>; - claims_parameter_supported: z.ZodOptional; - request_parameter_supported: z.ZodOptional; - request_uri_parameter_supported: z.ZodOptional; - require_request_uri_registration: z.ZodOptional; - op_policy_uri: z.ZodOptional; - op_tos_uri: z.ZodOptional; - client_id_metadata_document_supported: z.ZodOptional; -}, z.core.$strip>; -/** - * OAuth 2.1 token response - */ -export declare const OAuthTokensSchema: z.ZodObject<{ - access_token: z.ZodString; - id_token: z.ZodOptional; - token_type: z.ZodString; - expires_in: z.ZodOptional>; - scope: z.ZodOptional; - refresh_token: z.ZodOptional; -}, z.core.$strip>; -/** - * OAuth 2.1 error response - */ -export declare const OAuthErrorResponseSchema: z.ZodObject<{ - error: z.ZodString; - error_description: z.ZodOptional; - error_uri: z.ZodOptional; -}, z.core.$strip>; -/** - * Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri - */ -export declare const OptionalSafeUrlSchema: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata - */ -export declare const OAuthClientMetadataSchema: z.ZodObject<{ - redirect_uris: z.ZodArray; - token_endpoint_auth_method: z.ZodOptional; - grant_types: z.ZodOptional>; - response_types: z.ZodOptional>; - client_name: z.ZodOptional; - client_uri: z.ZodOptional; - logo_uri: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; - scope: z.ZodOptional; - contacts: z.ZodOptional>; - tos_uri: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; - policy_uri: z.ZodOptional; - jwks_uri: z.ZodOptional; - jwks: z.ZodOptional; - software_id: z.ZodOptional; - software_version: z.ZodOptional; - software_statement: z.ZodOptional; -}, z.core.$strip>; -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration client information - */ -export declare const OAuthClientInformationSchema: z.ZodObject<{ - client_id: z.ZodString; - client_secret: z.ZodOptional; - client_id_issued_at: z.ZodOptional; - client_secret_expires_at: z.ZodOptional; -}, z.core.$strip>; -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata) - */ -export declare const OAuthClientInformationFullSchema: z.ZodObject<{ - redirect_uris: z.ZodArray; - token_endpoint_auth_method: z.ZodOptional; - grant_types: z.ZodOptional>; - response_types: z.ZodOptional>; - client_name: z.ZodOptional; - client_uri: z.ZodOptional; - logo_uri: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; - scope: z.ZodOptional; - contacts: z.ZodOptional>; - tos_uri: z.ZodUnion<[z.ZodOptional, z.ZodPipe, z.ZodTransform>]>; - policy_uri: z.ZodOptional; - jwks_uri: z.ZodOptional; - jwks: z.ZodOptional; - software_id: z.ZodOptional; - software_version: z.ZodOptional; - software_statement: z.ZodOptional; - client_id: z.ZodString; - client_secret: z.ZodOptional; - client_id_issued_at: z.ZodOptional; - client_secret_expires_at: z.ZodOptional; -}, z.core.$strip>; -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration error response - */ -export declare const OAuthClientRegistrationErrorSchema: z.ZodObject<{ - error: z.ZodString; - error_description: z.ZodOptional; -}, z.core.$strip>; -/** - * RFC 7009 OAuth 2.0 Token Revocation request - */ -export declare const OAuthTokenRevocationRequestSchema: z.ZodObject<{ - token: z.ZodString; - token_type_hint: z.ZodOptional; -}, z.core.$strip>; -export type OAuthMetadata = z.infer; -export type OpenIdProviderMetadata = z.infer; -export type OpenIdProviderDiscoveryMetadata = z.infer; -export type OAuthTokens = z.infer; -export type OAuthErrorResponse = z.infer; -export type OAuthClientMetadata = z.infer; -export type OAuthClientInformation = z.infer; -export type OAuthClientInformationFull = z.infer; -export type OAuthClientInformationMixed = OAuthClientInformation | OAuthClientInformationFull; -export type OAuthClientRegistrationError = z.infer; -export type OAuthTokenRevocationRequest = z.infer; -export type OAuthProtectedResourceMetadata = z.infer; -export type AuthorizationServerMetadata = OAuthMetadata | OpenIdProviderDiscoveryMetadata; -//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts.map deleted file mode 100644 index 031a88f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,aAAa,UAmBrB,CAAC;AAEN;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;iBAe/C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;iBAoB9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKhD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;iBASlB,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB,mGAAwE,CAAC;AAE3G;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;iBAmB1B,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;iBAO7B,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;iBAAgE,CAAC;AAE9G;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;iBAKnC,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;iBAKlC,CAAC;AAEb,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,2BAA2B,GAAG,sBAAsB,GAAG,0BAA0B,CAAC;AAC9F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAGlG,MAAM,MAAM,2BAA2B,GAAG,aAAa,GAAG,+BAA+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js deleted file mode 100644 index 04f38eb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +++ /dev/null @@ -1,198 +0,0 @@ -import * as z from 'zod/v4'; -/** - * Reusable URL validation that disallows javascript: scheme - */ -export const SafeUrlSchema = z - .url() - .superRefine((val, ctx) => { - if (!URL.canParse(val)) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - message: 'URL must be parseable', - fatal: true - }); - return z.NEVER; - } -}) - .refine(url => { - const u = new URL(url); - return u.protocol !== 'javascript:' && u.protocol !== 'data:' && u.protocol !== 'vbscript:'; -}, { message: 'URL cannot use javascript:, data:, or vbscript: scheme' }); -/** - * RFC 9728 OAuth Protected Resource Metadata - */ -export const OAuthProtectedResourceMetadataSchema = z.looseObject({ - resource: z.string().url(), - authorization_servers: z.array(SafeUrlSchema).optional(), - jwks_uri: z.string().url().optional(), - scopes_supported: z.array(z.string()).optional(), - bearer_methods_supported: z.array(z.string()).optional(), - resource_signing_alg_values_supported: z.array(z.string()).optional(), - resource_name: z.string().optional(), - resource_documentation: z.string().optional(), - resource_policy_uri: z.string().url().optional(), - resource_tos_uri: z.string().url().optional(), - tls_client_certificate_bound_access_tokens: z.boolean().optional(), - authorization_details_types_supported: z.array(z.string()).optional(), - dpop_signing_alg_values_supported: z.array(z.string()).optional(), - dpop_bound_access_tokens_required: z.boolean().optional() -}); -/** - * RFC 8414 OAuth 2.0 Authorization Server Metadata - */ -export const OAuthMetadataSchema = z.looseObject({ - issuer: z.string(), - authorization_endpoint: SafeUrlSchema, - token_endpoint: SafeUrlSchema, - registration_endpoint: SafeUrlSchema.optional(), - scopes_supported: z.array(z.string()).optional(), - response_types_supported: z.array(z.string()), - response_modes_supported: z.array(z.string()).optional(), - grant_types_supported: z.array(z.string()).optional(), - token_endpoint_auth_methods_supported: z.array(z.string()).optional(), - token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(), - service_documentation: SafeUrlSchema.optional(), - revocation_endpoint: SafeUrlSchema.optional(), - revocation_endpoint_auth_methods_supported: z.array(z.string()).optional(), - revocation_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(), - introspection_endpoint: z.string().optional(), - introspection_endpoint_auth_methods_supported: z.array(z.string()).optional(), - introspection_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(), - code_challenge_methods_supported: z.array(z.string()).optional(), - client_id_metadata_document_supported: z.boolean().optional() -}); -/** - * OpenID Connect Discovery 1.0 Provider Metadata - * see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata - */ -export const OpenIdProviderMetadataSchema = z.looseObject({ - issuer: z.string(), - authorization_endpoint: SafeUrlSchema, - token_endpoint: SafeUrlSchema, - userinfo_endpoint: SafeUrlSchema.optional(), - jwks_uri: SafeUrlSchema, - registration_endpoint: SafeUrlSchema.optional(), - scopes_supported: z.array(z.string()).optional(), - response_types_supported: z.array(z.string()), - response_modes_supported: z.array(z.string()).optional(), - grant_types_supported: z.array(z.string()).optional(), - acr_values_supported: z.array(z.string()).optional(), - subject_types_supported: z.array(z.string()), - id_token_signing_alg_values_supported: z.array(z.string()), - id_token_encryption_alg_values_supported: z.array(z.string()).optional(), - id_token_encryption_enc_values_supported: z.array(z.string()).optional(), - userinfo_signing_alg_values_supported: z.array(z.string()).optional(), - userinfo_encryption_alg_values_supported: z.array(z.string()).optional(), - userinfo_encryption_enc_values_supported: z.array(z.string()).optional(), - request_object_signing_alg_values_supported: z.array(z.string()).optional(), - request_object_encryption_alg_values_supported: z.array(z.string()).optional(), - request_object_encryption_enc_values_supported: z.array(z.string()).optional(), - token_endpoint_auth_methods_supported: z.array(z.string()).optional(), - token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(), - display_values_supported: z.array(z.string()).optional(), - claim_types_supported: z.array(z.string()).optional(), - claims_supported: z.array(z.string()).optional(), - service_documentation: z.string().optional(), - claims_locales_supported: z.array(z.string()).optional(), - ui_locales_supported: z.array(z.string()).optional(), - claims_parameter_supported: z.boolean().optional(), - request_parameter_supported: z.boolean().optional(), - request_uri_parameter_supported: z.boolean().optional(), - require_request_uri_registration: z.boolean().optional(), - op_policy_uri: SafeUrlSchema.optional(), - op_tos_uri: SafeUrlSchema.optional(), - client_id_metadata_document_supported: z.boolean().optional() -}); -/** - * OpenID Connect Discovery metadata that may include OAuth 2.0 fields - * This schema represents the real-world scenario where OIDC providers - * return a mix of OpenID Connect and OAuth 2.0 metadata fields - */ -export const OpenIdProviderDiscoveryMetadataSchema = z.object({ - ...OpenIdProviderMetadataSchema.shape, - ...OAuthMetadataSchema.pick({ - code_challenge_methods_supported: true - }).shape -}); -/** - * OAuth 2.1 token response - */ -export const OAuthTokensSchema = z - .object({ - access_token: z.string(), - id_token: z.string().optional(), // Optional for OAuth 2.1, but necessary in OpenID Connect - token_type: z.string(), - expires_in: z.coerce.number().optional(), - scope: z.string().optional(), - refresh_token: z.string().optional() -}) - .strip(); -/** - * OAuth 2.1 error response - */ -export const OAuthErrorResponseSchema = z.object({ - error: z.string(), - error_description: z.string().optional(), - error_uri: z.string().optional() -}); -/** - * Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri - */ -export const OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z.literal('').transform(() => undefined)); -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata - */ -export const OAuthClientMetadataSchema = z - .object({ - redirect_uris: z.array(SafeUrlSchema), - token_endpoint_auth_method: z.string().optional(), - grant_types: z.array(z.string()).optional(), - response_types: z.array(z.string()).optional(), - client_name: z.string().optional(), - client_uri: SafeUrlSchema.optional(), - logo_uri: OptionalSafeUrlSchema, - scope: z.string().optional(), - contacts: z.array(z.string()).optional(), - tos_uri: OptionalSafeUrlSchema, - policy_uri: z.string().optional(), - jwks_uri: SafeUrlSchema.optional(), - jwks: z.any().optional(), - software_id: z.string().optional(), - software_version: z.string().optional(), - software_statement: z.string().optional() -}) - .strip(); -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration client information - */ -export const OAuthClientInformationSchema = z - .object({ - client_id: z.string(), - client_secret: z.string().optional(), - client_id_issued_at: z.number().optional(), - client_secret_expires_at: z.number().optional() -}) - .strip(); -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata) - */ -export const OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema); -/** - * RFC 7591 OAuth 2.0 Dynamic Client Registration error response - */ -export const OAuthClientRegistrationErrorSchema = z - .object({ - error: z.string(), - error_description: z.string().optional() -}) - .strip(); -/** - * RFC 7009 OAuth 2.0 Token Revocation request - */ -export const OAuthTokenRevocationRequestSchema = z - .object({ - token: z.string(), - token_type_hint: z.string().optional() -}) - .strip(); -//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js.map deleted file mode 100644 index d529c24..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KACzB,GAAG,EAAE;KACL,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACtB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,GAAG,CAAC,QAAQ,CAAC;YACT,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,uBAAuB;YAChC,KAAK,EAAE,IAAI;SACd,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC,KAAK,CAAC;IACnB,CAAC;AACL,CAAC,CAAC;KACD,MAAM,CACH,GAAG,CAAC,EAAE;IACF,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,OAAO,CAAC,CAAC,QAAQ,KAAK,aAAa,IAAI,CAAC,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,QAAQ,KAAK,WAAW,CAAC;AAChG,CAAC,EACD,EAAE,OAAO,EAAE,wDAAwD,EAAE,CACxE,CAAC;AAEN;;GAEG;AACH,MAAM,CAAC,MAAM,oC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esm/shared/metadataUtils.d.ts deleted file mode 100644 index 9dff76d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { BaseMetadata } from '../types.js'; -/** - * Utilities for working with BaseMetadata objects. - */ -/** - * Gets the display name for an object with BaseMetadata. - * For tools, the precedence is: title → annotations.title → name - * For other objects: title → name - * This implements the spec requirement: "if no title is provided, name should be used for display purposes" - */ -export declare function getDisplayName(metadata: BaseMetadata | (BaseMetadata & { - annotations?: { - title?: string; - }; -})): string; -//# sourceMappingURL=metadataUtils.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.d.ts.map deleted file mode 100644 index 9d9929c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadataUtils.d.ts","sourceRoot":"","sources":["../../../src/shared/metadataUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AAEH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG;IAAE,WAAW,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,GAAG,MAAM,CAarH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.js deleted file mode 100644 index 6d450c0..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Utilities for working with BaseMetadata objects. - */ -/** - * Gets the display name for an object with BaseMetadata. - * For tools, the precedence is: title → annotations.title → name - * For other objects: title → name - * This implements the spec requirement: "if no title is provided, name should be used for display purposes" - */ -export function getDisplayName(metadata) { - // First check for title (not undefined and not empty string) - if (metadata.title !== undefined && metadata.title !== '') { - return metadata.title; - } - // Then check for annotations.title (only present in Tool objects) - if ('annotations' in metadata && metadata.annotations?.title) { - return metadata.annotations.title; - } - // Finally fall back to name - return metadata.name; -} -//# sourceMappingURL=metadataUtils.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.js.map deleted file mode 100644 index d78868e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadataUtils.js","sourceRoot":"","sources":["../../../src/shared/metadataUtils.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,QAA8E;IACzG,6DAA6D;IAC7D,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,QAAQ,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC;QACxD,OAAO,QAAQ,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,kEAAkE;IAClE,IAAI,aAAa,IAAI,QAAQ,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC;QAC3D,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC;IACtC,CAAC;IAED,4BAA4B;IAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.d.ts deleted file mode 100644 index 808bfed..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.d.ts +++ /dev/null @@ -1,443 +0,0 @@ -import { AnySchema, AnyObjectSchema, SchemaOutput } from '../server/zod-compat.js'; -import { ClientCapabilities, GetTaskRequest, GetTaskPayloadRequest, ListTasksResultSchema, CancelTaskResultSchema, JSONRPCRequest, Progress, RequestId, Result, ServerCapabilities, RequestMeta, RequestInfo, GetTaskResult, TaskCreationParams, RelatedTaskMetadata, Task, Request, Notification } from '../types.js'; -import { Transport, TransportSendOptions } from './transport.js'; -import { AuthInfo } from '../server/auth/types.js'; -import { TaskStore, TaskMessageQueue, CreateTaskOptions } from '../experimental/tasks/interfaces.js'; -import { ResponseMessage } from './responseMessage.js'; -/** - * Callback for progress notifications. - */ -export type ProgressCallback = (progress: Progress) => void; -/** - * Additional initialization options. - */ -export type ProtocolOptions = { - /** - * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities. - * - * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those. - * - * Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true. - */ - enforceStrictCapabilities?: boolean; - /** - * An array of notification method names that should be automatically debounced. - * Any notifications with a method in this list will be coalesced if they - * occur in the same tick of the event loop. - * e.g., ['notifications/tools/list_changed'] - */ - debouncedNotificationMethods?: string[]; - /** - * Optional task storage implementation. If provided, enables task-related request handlers - * and provides task storage capabilities to request handlers. - */ - taskStore?: TaskStore; - /** - * Optional task message queue implementation for managing server-initiated messages - * that will be delivered through the tasks/result response stream. - */ - taskMessageQueue?: TaskMessageQueue; - /** - * Default polling interval (in milliseconds) for task status checks when no pollInterval - * is provided by the server. Defaults to 5000ms if not specified. - */ - defaultTaskPollInterval?: number; - /** - * Maximum number of messages that can be queued per task for side-channel delivery. - * If undefined, the queue size is unbounded. - * When the limit is exceeded, the TaskMessageQueue implementation's enqueue() method - * will throw an error. It's the implementation's responsibility to handle overflow - * appropriately (e.g., by failing the task, dropping messages, etc.). - */ - maxTaskQueueSize?: number; -}; -/** - * The default request timeout, in miliseconds. - */ -export declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; -/** - * Options that can be given per request. - */ -export type RequestOptions = { - /** - * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked. - * - * For task-augmented requests: progress notifications continue after CreateTaskResult is returned and stop automatically when the task reaches a terminal status. - */ - onprogress?: ProgressCallback; - /** - * Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request(). - */ - signal?: AbortSignal; - /** - * A timeout (in milliseconds) for this request. If exceeded, an McpError with code `RequestTimeout` will be raised from request(). - * - * If not specified, `DEFAULT_REQUEST_TIMEOUT_MSEC` will be used as the timeout. - */ - timeout?: number; - /** - * If true, receiving a progress notification will reset the request timeout. - * This is useful for long-running operations that send periodic progress updates. - * Default: false - */ - resetTimeoutOnProgress?: boolean; - /** - * Maximum total time (in milliseconds) to wait for a response. - * If exceeded, an McpError with code `RequestTimeout` will be raised, regardless of progress notifications. - * If not specified, there is no maximum total timeout. - */ - maxTotalTimeout?: number; - /** - * If provided, augments the request with task creation parameters to enable call-now, fetch-later execution patterns. - */ - task?: TaskCreationParams; - /** - * If provided, associates this request with a related task. - */ - relatedTask?: RelatedTaskMetadata; -} & TransportSendOptions; -/** - * Options that can be given per notification. - */ -export type NotificationOptions = { - /** - * May be used to indicate to the transport which incoming request to associate this outgoing notification with. - */ - relatedRequestId?: RequestId; - /** - * If provided, associates this notification with a related task. - */ - relatedTask?: RelatedTaskMetadata; -}; -/** - * Options that can be given per request. - */ -export type TaskRequestOptions = Omit; -/** - * Request-scoped TaskStore interface. - */ -export interface RequestTaskStore { - /** - * Creates a new task with the given creation parameters. - * The implementation generates a unique taskId and createdAt timestamp. - * - * @param taskParams - The task creation parameters from the request - * @returns The created task object - */ - createTask(taskParams: CreateTaskOptions): Promise; - /** - * Gets the current status of a task. - * - * @param taskId - The task identifier - * @returns The task object - * @throws If the task does not exist - */ - getTask(taskId: string): Promise; - /** - * Stores the result of a task and sets its final status. - * - * @param taskId - The task identifier - * @param status - The final status: 'completed' for success, 'failed' for errors - * @param result - The result to store - */ - storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result): Promise; - /** - * Retrieves the stored result of a task. - * - * @param taskId - The task identifier - * @returns The stored result - */ - getTaskResult(taskId: string): Promise; - /** - * Updates a task's status (e.g., to 'cancelled', 'failed', 'completed'). - * - * @param taskId - The task identifier - * @param status - The new status - * @param statusMessage - Optional diagnostic message for failed tasks or other status information - */ - updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string): Promise; - /** - * Lists tasks, optionally starting from a pagination cursor. - * - * @param cursor - Optional cursor for pagination - * @returns An object containing the tasks array and an optional nextCursor - */ - listTasks(cursor?: string): Promise<{ - tasks: Task[]; - nextCursor?: string; - }>; -} -/** - * Extra data given to request handlers. - */ -export type RequestHandlerExtra = { - /** - * An abort signal used to communicate if the request was cancelled from the sender's side. - */ - signal: AbortSignal; - /** - * Information about a validated access token, provided to request handlers. - */ - authInfo?: AuthInfo; - /** - * The session ID from the transport, if available. - */ - sessionId?: string; - /** - * Metadata from the original request. - */ - _meta?: RequestMeta; - /** - * The JSON-RPC ID of the request being handled. - * This can be useful for tracking or logging purposes. - */ - requestId: RequestId; - taskId?: string; - taskStore?: RequestTaskStore; - taskRequestedTtl?: number | null; - /** - * The original HTTP request. - */ - requestInfo?: RequestInfo; - /** - * Sends a notification that relates to the current request being handled. - * - * This is used by certain transports to correctly associate related messages. - */ - sendNotification: (notification: SendNotificationT) => Promise; - /** - * Sends a request that relates to the current request being handled. - * - * This is used by certain transports to correctly associate related messages. - */ - sendRequest: (request: SendRequestT, resultSchema: U, options?: TaskRequestOptions) => Promise>; - /** - * Closes the SSE stream for this request, triggering client reconnection. - * Only available when using StreamableHTTPServerTransport with eventStore configured. - * Use this to implement polling behavior during long-running operations. - */ - closeSSEStream?: () => void; - /** - * Closes the standalone GET SSE stream, triggering client reconnection. - * Only available when using StreamableHTTPServerTransport with eventStore configured. - * Use this to implement polling behavior for server-initiated notifications. - */ - closeStandaloneSSEStream?: () => void; -}; -/** - * Implements MCP protocol framing on top of a pluggable transport, including - * features like request/response linking, notifications, and progress. - */ -export declare abstract class Protocol { - private _options?; - private _transport?; - private _requestMessageId; - private _requestHandlers; - private _requestHandlerAbortControllers; - private _notificationHandlers; - private _responseHandlers; - private _progressHandlers; - private _timeoutInfo; - private _pendingDebouncedNotifications; - private _taskProgressTokens; - private _taskStore?; - private _taskMessageQueue?; - private _requestResolvers; - /** - * Callback for when the connection is closed for any reason. - * - * This is invoked when close() is called as well. - */ - onclose?: () => void; - /** - * Callback for when an error occurs. - * - * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. - */ - onerror?: (error: Error) => void; - /** - * A handler to invoke for any request types that do not have their own handler installed. - */ - fallbackRequestHandler?: (request: JSONRPCRequest, extra: RequestHandlerExtra) => Promise; - /** - * A handler to invoke for any notification types that do not have their own handler installed. - */ - fallbackNotificationHandler?: (notification: Notification) => Promise; - constructor(_options?: ProtocolOptions | undefined); - private _oncancel; - private _setupTimeout; - private _resetTimeout; - private _cleanupTimeout; - /** - * Attaches to the given transport, starts it, and starts listening for messages. - * - * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. - */ - connect(transport: Transport): Promise; - private _onclose; - private _onerror; - private _onnotification; - private _onrequest; - private _onprogress; - private _onresponse; - get transport(): Transport | undefined; - /** - * Closes the connection. - */ - close(): Promise; - /** - * A method to check if a capability is supported by the remote side, for the given method to be called. - * - * This should be implemented by subclasses. - */ - protected abstract assertCapabilityForMethod(method: SendRequestT['method']): void; - /** - * A method to check if a notification is supported by the local side, for the given method to be sent. - * - * This should be implemented by subclasses. - */ - protected abstract assertNotificationCapability(method: SendNotificationT['method']): void; - /** - * A method to check if a request handler is supported by the local side, for the given method to be handled. - * - * This should be implemented by subclasses. - */ - protected abstract assertRequestHandlerCapability(method: string): void; - /** - * A method to check if task creation is supported for the given request method. - * - * This should be implemented by subclasses. - */ - protected abstract assertTaskCapability(method: string): void; - /** - * A method to check if task handler is supported by the local side, for the given method to be handled. - * - * This should be implemented by subclasses. - */ - protected abstract assertTaskHandlerCapability(method: string): void; - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * @example - * ```typescript - * const stream = protocol.requestStream(request, resultSchema, options); - * for await (const message of stream) { - * switch (message.type) { - * case 'taskCreated': - * console.log('Task created:', message.task.taskId); - * break; - * case 'taskStatus': - * console.log('Task status:', message.task.status); - * break; - * case 'result': - * console.log('Final result:', message.result); - * break; - * case 'error': - * console.error('Error:', message.error); - * break; - * } - * } - * ``` - * - * @experimental Use `client.experimental.tasks.requestStream()` to access this method. - */ - protected requestStream(request: SendRequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>; - /** - * Sends a request and waits for a response. - * - * Do not use this method to emit notifications! Use notification() instead. - */ - request(request: SendRequestT, resultSchema: T, options?: RequestOptions): Promise>; - /** - * Gets the current status of a task. - * - * @experimental Use `client.experimental.tasks.getTask()` to access this method. - */ - protected getTask(params: GetTaskRequest['params'], options?: RequestOptions): Promise; - /** - * Retrieves the result of a completed task. - * - * @experimental Use `client.experimental.tasks.getTaskResult()` to access this method. - */ - protected getTaskResult(params: GetTaskPayloadRequest['params'], resultSchema: T, options?: RequestOptions): Promise>; - /** - * Lists tasks, optionally starting from a pagination cursor. - * - * @experimental Use `client.experimental.tasks.listTasks()` to access this method. - */ - protected listTasks(params?: { - cursor?: string; - }, options?: RequestOptions): Promise>; - /** - * Cancels a specific task. - * - * @experimental Use `client.experimental.tasks.cancelTask()` to access this method. - */ - protected cancelTask(params: { - taskId: string; - }, options?: RequestOptions): Promise>; - /** - * Emits a notification, which is a one-way message that does not expect a response. - */ - notification(notification: SendNotificationT, options?: NotificationOptions): Promise; - /** - * Registers a handler to invoke when this protocol object receives a request with the given method. - * - * Note that this will replace any previous request handler for the same method. - */ - setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => SendResultT | Promise): void; - /** - * Removes the request handler for the given method. - */ - removeRequestHandler(method: string): void; - /** - * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed. - */ - assertCanSetRequestHandler(method: string): void; - /** - * Registers a handler to invoke when this protocol object receives a notification with the given method. - * - * Note that this will replace any previous notification handler for the same method. - */ - setNotificationHandler(notificationSchema: T, handler: (notification: SchemaOutput) => void | Promise): void; - /** - * Removes the notification handler for the given method. - */ - removeNotificationHandler(method: string): void; - /** - * Cleans up the progress handler associated with a task. - * This should be called when a task reaches a terminal status. - */ - private _cleanupTaskProgressHandler; - /** - * Enqueues a task-related message for side-channel delivery via tasks/result. - * @param taskId The task ID to associate the message with - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @throws Error if taskStore is not configured or if enqueue fails (e.g., queue overflow) - * - * Note: If enqueue fails, it's the TaskMessageQueue implementation's responsibility to handle - * the error appropriately (e.g., by failing the task, logging, etc.). The Protocol layer - * simply propagates the error. - */ - private _enqueueTaskMessage; - /** - * Clears the message queue for a task and rejects any pending request resolvers. - * @param taskId The task ID whose queue should be cleared - * @param sessionId Optional session ID for binding the operation to a specific session - */ - private _clearTaskQueue; - /** - * Waits for a task update (new messages or status change) with abort signal support. - * Uses polling to check for updates at the task's configured poll interval. - * @param taskId The task ID to wait for - * @param signal Abort signal to cancel the wait - * @returns Promise that resolves when an update occurs or rejects if aborted - */ - private _waitForTaskUpdate; - private requestTaskStore; -} -export declare function mergeCapabilities(base: ServerCapabilities, additional: Partial): ServerCapabilities; -export declare function mergeCapabilities(base: ClientCapabilities, additional: Partial): ClientCapabilities; -//# sourceMappingURL=protocol.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.d.ts.map deleted file mode 100644 index e9e32c2..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"protocol.d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,GAAG,IAAI;IAI/C;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAQnC;;;;;;;;;;OAUG;YACW,mBAAmB;IAUjC;;;;OAIG;YACW,eAAe;IAqB7B;;;;;;OAMG;YACW,kBAAkB;IAiChC,OAAO,CAAC,gBAAgB;CAwF3B;AAMD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;AACzH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js deleted file mode 100644 index 5740ba1..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +++ /dev/null @@ -1,1099 +0,0 @@ -import { safeParse } from '../server/zod-compat.js'; -import { CancelledNotificationSchema, CreateTaskResultSchema, ErrorCode, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, isJSONRPCErrorResponse, isJSONRPCRequest, isJSONRPCResultResponse, isJSONRPCNotification, McpError, PingRequestSchema, ProgressNotificationSchema, RELATED_TASK_META_KEY, TaskStatusNotificationSchema, isTaskAugmentedRequestParams } from '../types.js'; -import { isTerminal } from '../experimental/tasks/interfaces.js'; -import { getMethodLiteral, parseWithCompat } from '../server/zod-json-schema-compat.js'; -/** - * The default request timeout, in miliseconds. - */ -export const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; -/** - * Implements MCP protocol framing on top of a pluggable transport, including - * features like request/response linking, notifications, and progress. - */ -export class Protocol { - constructor(_options) { - this._options = _options; - this._requestMessageId = 0; - this._requestHandlers = new Map(); - this._requestHandlerAbortControllers = new Map(); - this._notificationHandlers = new Map(); - this._responseHandlers = new Map(); - this._progressHandlers = new Map(); - this._timeoutInfo = new Map(); - this._pendingDebouncedNotifications = new Set(); - // Maps task IDs to progress tokens to keep handlers alive after CreateTaskResult - this._taskProgressTokens = new Map(); - this._requestResolvers = new Map(); - this.setNotificationHandler(CancelledNotificationSchema, notification => { - this._oncancel(notification); - }); - this.setNotificationHandler(ProgressNotificationSchema, notification => { - this._onprogress(notification); - }); - this.setRequestHandler(PingRequestSchema, - // Automatic pong by default. - _request => ({})); - // Install task handlers if TaskStore is provided - this._taskStore = _options?.taskStore; - this._taskMessageQueue = _options?.taskMessageQueue; - if (this._taskStore) { - this.setRequestHandler(GetTaskRequestSchema, async (request, extra) => { - const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId); - if (!task) { - throw new McpError(ErrorCode.InvalidParams, 'Failed to retrieve task: Task not found'); - } - // Per spec: tasks/get responses SHALL NOT include related-task metadata - // as the taskId parameter is the source of truth - // @ts-expect-error SendResultT cannot contain GetTaskResult, but we include it in our derived types everywhere else - return { - ...task - }; - }); - this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => { - const handleTaskResult = async () => { - const taskId = request.params.taskId; - // Deliver queued messages - if (this._taskMessageQueue) { - let queuedMessage; - while ((queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId))) { - // Handle response and error messages by routing them to the appropriate resolver - if (queuedMessage.type === 'response' || queuedMessage.type === 'error') { - const message = queuedMessage.message; - const requestId = message.id; - // Lookup resolver in _requestResolvers map - const resolver = this._requestResolvers.get(requestId); - if (resolver) { - // Remove resolver from map after invocation - this._requestResolvers.delete(requestId); - // Invoke resolver with response or error - if (queuedMessage.type === 'response') { - resolver(message); - } - else { - // Convert JSONRPCError to McpError - const errorMessage = message; - const error = new McpError(errorMessage.error.code, errorMessage.error.message, errorMessage.error.data); - resolver(error); - } - } - else { - // Handle missing resolver gracefully with error logging - const messageType = queuedMessage.type === 'response' ? 'Response' : 'Error'; - this._onerror(new Error(`${messageType} handler missing for request ${requestId}`)); - } - // Continue to next message - continue; - } - // Send the message on the response stream by passing the relatedRequestId - // This tells the transport to write the message to the tasks/result response stream - await this._transport?.send(queuedMessage.message, { relatedRequestId: extra.requestId }); - } - } - // Now check task status - const task = await this._taskStore.getTask(taskId, extra.sessionId); - if (!task) { - throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`); - } - // Block if task is not terminal (we've already delivered all queued messages above) - if (!isTerminal(task.status)) { - // Wait for status change or new messages - await this._waitForTaskUpdate(taskId, extra.signal); - // After waking up, recursively call to deliver any new messages or result - return await handleTaskResult(); - } - // If task is terminal, return the result - if (isTerminal(task.status)) { - const result = await this._taskStore.getTaskResult(taskId, extra.sessionId); - this._clearTaskQueue(taskId); - return { - ...result, - _meta: { - ...result._meta, - [RELATED_TASK_META_KEY]: { - taskId: taskId - } - } - }; - } - return await handleTaskResult(); - }; - return await handleTaskResult(); - }); - this.setRequestHandler(ListTasksRequestSchema, async (request, extra) => { - try { - const { tasks, nextCursor } = await this._taskStore.listTasks(request.params?.cursor, extra.sessionId); - // @ts-expect-error SendResultT cannot contain ListTasksResult, but we include it in our derived types everywhere else - return { - tasks, - nextCursor, - _meta: {} - }; - } - catch (error) { - throw new McpError(ErrorCode.InvalidParams, `Failed to list tasks: ${error instanceof Error ? error.message : String(error)}`); - } - }); - this.setRequestHandler(CancelTaskRequestSchema, async (request, extra) => { - try { - // Get the current task to check if it's in a terminal state, in case the implementation is not atomic - const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId); - if (!task) { - throw new McpError(ErrorCode.InvalidParams, `Task not found: ${request.params.taskId}`); - } - // Reject cancellation of terminal tasks - if (isTerminal(task.status)) { - throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`); - } - await this._taskStore.updateTaskStatus(request.params.taskId, 'cancelled', 'Client cancelled task execution.', extra.sessionId); - this._clearTaskQueue(request.params.taskId); - const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId); - if (!cancelledTask) { - // Task was deleted during cancellation (e.g., cleanup happened) - throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`); - } - return { - _meta: {}, - ...cancelledTask - }; - } - catch (error) { - // Re-throw McpError as-is - if (error instanceof McpError) { - throw error; - } - throw new McpError(ErrorCode.InvalidRequest, `Failed to cancel task: ${error instanceof Error ? error.message : String(error)}`); - } - }); - } - } - async _oncancel(notification) { - if (!notification.params.requestId) { - return; - } - // Handle request cancellation - const controller = this._requestHandlerAbortControllers.get(notification.params.requestId); - controller?.abort(notification.params.reason); - } - _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) { - this._timeoutInfo.set(messageId, { - timeoutId: setTimeout(onTimeout, timeout), - startTime: Date.now(), - timeout, - maxTotalTimeout, - resetTimeoutOnProgress, - onTimeout - }); - } - _resetTimeout(messageId) { - const info = this._timeoutInfo.get(messageId); - if (!info) - return false; - const totalElapsed = Date.now() - info.startTime; - if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) { - this._timeoutInfo.delete(messageId); - throw McpError.fromError(ErrorCode.RequestTimeout, 'Maximum total timeout exceeded', { - maxTotalTimeout: info.maxTotalTimeout, - totalElapsed - }); - } - clearTimeout(info.timeoutId); - info.timeoutId = setTimeout(info.onTimeout, info.timeout); - return true; - } - _cleanupTimeout(messageId) { - const info = this._timeoutInfo.get(messageId); - if (info) { - clearTimeout(info.timeoutId); - this._timeoutInfo.delete(messageId); - } - } - /** - * Attaches to the given transport, starts it, and starts listening for messages. - * - * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. - */ - async connect(transport) { - if (this._transport) { - throw new Error('Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.'); - } - this._transport = transport; - const _onclose = this.transport?.onclose; - this._transport.onclose = () => { - _onclose?.(); - this._onclose(); - }; - const _onerror = this.transport?.onerror; - this._transport.onerror = (error) => { - _onerror?.(error); - this._onerror(error); - }; - const _onmessage = this._transport?.onmessage; - this._transport.onmessage = (message, extra) => { - _onmessage?.(message, extra); - if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) { - this._onresponse(message); - } - else if (isJSONRPCRequest(message)) { - this._onrequest(message, extra); - } - else if (isJSONRPCNotification(message)) { - this._onnotification(message); - } - else { - this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`)); - } - }; - await this._transport.start(); - } - _onclose() { - const responseHandlers = this._responseHandlers; - this._responseHandlers = new Map(); - this._progressHandlers.clear(); - this._taskProgressTokens.clear(); - this._pendingDebouncedNotifications.clear(); - // Abort all in-flight request handlers so they stop sending messages - for (const controller of this._requestHandlerAbortControllers.values()) { - controller.abort(); - } - this._requestHandlerAbortControllers.clear(); - const error = McpError.fromError(ErrorCode.ConnectionClosed, 'Connection closed'); - this._transport = undefined; - this.onclose?.(); - for (const handler of responseHandlers.values()) { - handler(error); - } - } - _onerror(error) { - this.onerror?.(error); - } - _onnotification(notification) { - const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler; - // Ignore notifications not being subscribed to. - if (handler === undefined) { - return; - } - // Starting with Promise.resolve() puts any synchronous errors into the monad as well. - Promise.resolve() - .then(() => handler(notification)) - .catch(error => this._onerror(new Error(`Uncaught error in notification handler: ${error}`))); - } - _onrequest(request, extra) { - const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler; - // Capture the current transport at request time to ensure responses go to the correct client - const capturedTransport = this._transport; - // Extract taskId from request metadata if present (needed early for method not found case) - const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId; - if (handler === undefined) { - const errorResponse = { - jsonrpc: '2.0', - id: request.id, - error: { - code: ErrorCode.MethodNotFound, - message: 'Method not found' - } - }; - // Queue or send the error response based on whether this is a task-related request - if (relatedTaskId && this._taskMessageQueue) { - this._enqueueTaskMessage(relatedTaskId, { - type: 'error', - message: errorResponse, - timestamp: Date.now() - }, capturedTransport?.sessionId).catch(error => this._onerror(new Error(`Failed to enqueue error response: ${error}`))); - } - else { - capturedTransport - ?.send(errorResponse) - .catch(error => this._onerror(new Error(`Failed to send an error response: ${error}`))); - } - return; - } - const abortController = new AbortController(); - this._requestHandlerAbortControllers.set(request.id, abortController); - const taskCreationParams = isTaskAugmentedRequestParams(request.params) ? request.params.task : undefined; - const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport?.sessionId) : undefined; - const fullExtra = { - signal: abortController.signal, - sessionId: capturedTransport?.sessionId, - _meta: request.params?._meta, - sendNotification: async (notification) => { - if (abortController.signal.aborted) - return; - // Include related-task metadata if this request is part of a task - const notificationOptions = { relatedRequestId: request.id }; - if (relatedTaskId) { - notificationOptions.relatedTask = { taskId: relatedTaskId }; - } - await this.notification(notification, notificationOptions); - }, - sendRequest: async (r, resultSchema, options) => { - if (abortController.signal.aborted) { - throw new McpError(ErrorCode.ConnectionClosed, 'Request was cancelled'); - } - // Include related-task metadata if this request is part of a task - const requestOptions = { ...options, relatedRequestId: request.id }; - if (relatedTaskId && !requestOptions.relatedTask) { - requestOptions.relatedTask = { taskId: relatedTaskId }; - } - // Set task status to input_required when sending a request within a task context - // Use the taskId from options (explicit) or fall back to relatedTaskId (inherited) - const effectiveTaskId = requestOptions.relatedTask?.taskId ?? relatedTaskId; - if (effectiveTaskId && taskStore) { - await taskStore.updateTaskStatus(effectiveTaskId, 'input_required'); - } - return await this.request(r, resultSchema, requestOptions); - }, - authInfo: extra?.authInfo, - requestId: request.id, - requestInfo: extra?.requestInfo, - taskId: relatedTaskId, - taskStore: taskStore, - taskRequestedTtl: taskCreationParams?.ttl, - closeSSEStream: extra?.closeSSEStream, - closeStandaloneSSEStream: extra?.closeStandaloneSSEStream - }; - // Starting with Promise.resolve() puts any synchronous errors into the monad as well. - Promise.resolve() - .then(() => { - // If this request asked for task creation, check capability first - if (taskCreationParams) { - // Check if the request method supports task creation - this.assertTaskHandlerCapability(request.method); - } - }) - .then(() => handler(request, fullExtra)) - .then(async (result) => { - if (abortController.signal.aborted) { - // Request was cancelled - return; - } - const response = { - result, - jsonrpc: '2.0', - id: request.id - }; - // Queue or send the response based on whether this is a task-related request - if (relatedTaskId && this._taskMessageQueue) { - await this._enqueueTaskMessage(relatedTaskId, { - type: 'response', - message: response, - timestamp: Date.now() - }, capturedTransport?.sessionId); - } - else { - await capturedTransport?.send(response); - } - }, async (error) => { - if (abortController.signal.aborted) { - // Request was cancelled - return; - } - const errorResponse = { - jsonrpc: '2.0', - id: request.id, - error: { - code: Number.isSafeInteger(error['code']) ? error['code'] : ErrorCode.InternalError, - message: error.message ?? 'Internal error', - ...(error['data'] !== undefined && { data: error['data'] }) - } - }; - // Queue or send the error response based on whether this is a task-related request - if (relatedTaskId && this._taskMessageQueue) { - await this._enqueueTaskMessage(relatedTaskId, { - type: 'error', - message: errorResponse, - timestamp: Date.now() - }, capturedTransport?.sessionId); - } - else { - await capturedTransport?.send(errorResponse); - } - }) - .catch(error => this._onerror(new Error(`Failed to send response: ${error}`))) - .finally(() => { - this._requestHandlerAbortControllers.delete(request.id); - }); - } - _onprogress(notification) { - const { progressToken, ...params } = notification.params; - const messageId = Number(progressToken); - const handler = this._progressHandlers.get(messageId); - if (!handler) { - this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`)); - return; - } - const responseHandler = this._responseHandlers.get(messageId); - const timeoutInfo = this._timeoutInfo.get(messageId); - if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) { - try { - this._resetTimeout(messageId); - } - catch (error) { - // Clean up if maxTotalTimeout was exceeded - this._responseHandlers.delete(messageId); - this._progressHandlers.delete(messageId); - this._cleanupTimeout(messageId); - responseHandler(error); - return; - } - } - handler(params); - } - _onresponse(response) { - const messageId = Number(response.id); - // Check if this is a response to a queued request - const resolver = this._requestResolvers.get(messageId); - if (resolver) { - this._requestResolvers.delete(messageId); - if (isJSONRPCResultResponse(response)) { - resolver(response); - } - else { - const error = new McpError(response.error.code, response.error.message, response.error.data); - resolver(error); - } - return; - } - const handler = this._responseHandlers.get(messageId); - if (handler === undefined) { - this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`)); - return; - } - this._responseHandlers.delete(messageId); - this._cleanupTimeout(messageId); - // Keep progress handler alive for CreateTaskResult responses - let isTaskResponse = false; - if (isJSONRPCResultResponse(response) && response.result && typeof response.result === 'object') { - const result = response.result; - if (result.task && typeof result.task === 'object') { - const task = result.task; - if (typeof task.taskId === 'string') { - isTaskResponse = true; - this._taskProgressTokens.set(task.taskId, messageId); - } - } - } - if (!isTaskResponse) { - this._progressHandlers.delete(messageId); - } - if (isJSONRPCResultResponse(response)) { - handler(response); - } - else { - const error = McpError.fromError(response.error.code, response.error.message, response.error.data); - handler(error); - } - } - get transport() { - return this._transport; - } - /** - * Closes the connection. - */ - async close() { - await this._transport?.close(); - } - /** - * Sends a request and returns an AsyncGenerator that yields response messages. - * The generator is guaranteed to end with either a 'result' or 'error' message. - * - * @example - * ```typescript - * const stream = protocol.requestStream(request, resultSchema, options); - * for await (const message of stream) { - * switch (message.type) { - * case 'taskCreated': - * console.log('Task created:', message.task.taskId); - * break; - * case 'taskStatus': - * console.log('Task status:', message.task.status); - * break; - * case 'result': - * console.log('Final result:', message.result); - * break; - * case 'error': - * console.error('Error:', message.error); - * break; - * } - * } - * ``` - * - * @experimental Use `client.experimental.tasks.requestStream()` to access this method. - */ - async *requestStream(request, resultSchema, options) { - const { task } = options ?? {}; - // For non-task requests, just yield the result - if (!task) { - try { - const result = await this.request(request, resultSchema, options); - yield { type: 'result', result }; - } - catch (error) { - yield { - type: 'error', - error: error instanceof McpError ? error : new McpError(ErrorCode.InternalError, String(error)) - }; - } - return; - } - // For task-augmented requests, we need to poll for status - // First, make the request to create the task - let taskId; - try { - // Send the request and get the CreateTaskResult - const createResult = await this.request(request, CreateTaskResultSchema, options); - // Extract taskId from the result - if (createResult.task) { - taskId = createResult.task.taskId; - yield { type: 'taskCreated', task: createResult.task }; - } - else { - throw new McpError(ErrorCode.InternalError, 'Task creation did not return a task'); - } - // Poll for task completion - while (true) { - // Get current task status - const task = await this.getTask({ taskId }, options); - yield { type: 'taskStatus', task }; - // Check if task is terminal - if (isTerminal(task.status)) { - if (task.status === 'completed') { - // Get the final result - const result = await this.getTaskResult({ taskId }, resultSchema, options); - yield { type: 'result', result }; - } - else if (task.status === 'failed') { - yield { - type: 'error', - error: new McpError(ErrorCode.InternalError, `Task ${taskId} failed`) - }; - } - else if (task.status === 'cancelled') { - yield { - type: 'error', - error: new McpError(ErrorCode.InternalError, `Task ${taskId} was cancelled`) - }; - } - return; - } - // When input_required, call tasks/result to deliver queued messages - // (elicitation, sampling) via SSE and block until terminal - if (task.status === 'input_required') { - const result = await this.getTaskResult({ taskId }, resultSchema, options); - yield { type: 'result', result }; - return; - } - // Wait before polling again - const pollInterval = task.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1000; - await new Promise(resolve => setTimeout(resolve, pollInterval)); - // Check if cancelled - options?.signal?.throwIfAborted(); - } - } - catch (error) { - yield { - type: 'error', - error: error instanceof McpError ? error : new McpError(ErrorCode.InternalError, String(error)) - }; - } - } - /** - * Sends a request and waits for a response. - * - * Do not use this method to emit notifications! Use notification() instead. - */ - request(request, resultSchema, options) { - const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {}; - // Send the request - return new Promise((resolve, reject) => { - const earlyReject = (error) => { - reject(error); - }; - if (!this._transport) { - earlyReject(new Error('Not connected')); - return; - } - if (this._options?.enforceStrictCapabilities === true) { - try { - this.assertCapabilityForMethod(request.method); - // If task creation is requested, also check task capabilities - if (task) { - this.assertTaskCapability(request.method); - } - } - catch (e) { - earlyReject(e); - return; - } - } - options?.signal?.throwIfAborted(); - const messageId = this._requestMessageId++; - const jsonrpcRequest = { - ...request, - jsonrpc: '2.0', - id: messageId - }; - if (options?.onprogress) { - this._progressHandlers.set(messageId, options.onprogress); - jsonrpcRequest.params = { - ...request.params, - _meta: { - ...(request.params?._meta || {}), - progressToken: messageId - } - }; - } - // Augment with task creation parameters if provided - if (task) { - jsonrpcRequest.params = { - ...jsonrpcRequest.params, - task: task - }; - } - // Augment with related task metadata if relatedTask is provided - if (relatedTask) { - jsonrpcRequest.params = { - ...jsonrpcRequest.params, - _meta: { - ...(jsonrpcRequest.params?._meta || {}), - [RELATED_TASK_META_KEY]: relatedTask - } - }; - } - const cancel = (reason) => { - this._responseHandlers.delete(messageId); - this._progressHandlers.delete(messageId); - this._cleanupTimeout(messageId); - this._transport - ?.send({ - jsonrpc: '2.0', - method: 'notifications/cancelled', - params: { - requestId: messageId, - reason: String(reason) - } - }, { relatedRequestId, resumptionToken, onresumptiontoken }) - .catch(error => this._onerror(new Error(`Failed to send cancellation: ${error}`))); - // Wrap the reason in an McpError if it isn't already - const error = reason instanceof McpError ? reason : new McpError(ErrorCode.RequestTimeout, String(reason)); - reject(error); - }; - this._responseHandlers.set(messageId, response => { - if (options?.signal?.aborted) { - return; - } - if (response instanceof Error) { - return reject(response); - } - try { - const parseResult = safeParse(resultSchema, response.result); - if (!parseResult.success) { - // Type guard: if success is false, error is guaranteed to exist - reject(parseResult.error); - } - else { - resolve(parseResult.data); - } - } - catch (error) { - reject(error); - } - }); - options?.signal?.addEventListener('abort', () => { - cancel(options?.signal?.reason); - }); - const timeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC; - const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, 'Request timed out', { timeout })); - this._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false); - // Queue request if related to a task - const relatedTaskId = relatedTask?.taskId; - if (relatedTaskId) { - // Store the response resolver for this request so responses can be routed back - const responseResolver = (response) => { - const handler = this._responseHandlers.get(messageId); - if (handler) { - handler(response); - } - else { - // Log error when resolver is missing, but don't fail - this._onerror(new Error(`Response handler missing for side-channeled request ${messageId}`)); - } - }; - this._requestResolvers.set(messageId, responseResolver); - this._enqueueTaskMessage(relatedTaskId, { - type: 'request', - message: jsonrpcRequest, - timestamp: Date.now() - }).catch(error => { - this._cleanupTimeout(messageId); - reject(error); - }); - // Don't send through transport - queued messages are delivered via tasks/result only - // This prevents duplicate delivery for bidirectional transports - } - else { - // No related task - send through transport normally - this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch(error => { - this._cleanupTimeout(messageId); - reject(error); - }); - } - }); - } - /** - * Gets the current status of a task. - * - * @experimental Use `client.experimental.tasks.getTask()` to access this method. - */ - async getTask(params, options) { - // @ts-expect-error SendRequestT cannot directly contain GetTaskRequest, but we ensure all type instantiations contain it anyways - return this.request({ method: 'tasks/get', params }, GetTaskResultSchema, options); - } - /** - * Retrieves the result of a completed task. - * - * @experimental Use `client.experimental.tasks.getTaskResult()` to access this method. - */ - async getTaskResult(params, resultSchema, options) { - // @ts-expect-error SendRequestT cannot directly contain GetTaskPayloadRequest, but we ensure all type instantiations contain it anyways - return this.request({ method: 'tasks/result', params }, resultSchema, options); - } - /** - * Lists tasks, optionally starting from a pagination cursor. - * - * @experimental Use `client.experimental.tasks.listTasks()` to access this method. - */ - async listTasks(params, options) { - // @ts-expect-error SendRequestT cannot directly contain ListTasksRequest, but we ensure all type instantiations contain it anyways - return this.request({ method: 'tasks/list', params }, ListTasksResultSchema, options); - } - /** - * Cancels a specific task. - * - * @experimental Use `client.experimental.tasks.cancelTask()` to access this method. - */ - async cancelTask(params, options) { - // @ts-expect-error SendRequestT cannot directly contain CancelTaskRequest, but we ensure all type instantiations contain it anyways - return this.request({ method: 'tasks/cancel', params }, CancelTaskResultSchema, options); - } - /** - * Emits a notification, which is a one-way message that does not expect a response. - */ - async notification(notification, options) { - if (!this._transport) { - throw new Error('Not connected'); - } - this.assertNotificationCapability(notification.method); - // Queue notification if related to a task - const relatedTaskId = options?.relatedTask?.taskId; - if (relatedTaskId) { - // Build the JSONRPC notification with metadata - const jsonrpcNotification = { - ...notification, - jsonrpc: '2.0', - params: { - ...notification.params, - _meta: { - ...(notification.params?._meta || {}), - [RELATED_TASK_META_KEY]: options.relatedTask - } - } - }; - await this._enqueueTaskMessage(relatedTaskId, { - type: 'notification', - message: jsonrpcNotification, - timestamp: Date.now() - }); - // Don't send through transport - queued messages are delivered via tasks/result only - // This prevents duplicate delivery for bidirectional transports - return; - } - const debouncedMethods = this._options?.debouncedNotificationMethods ?? []; - // A notification can only be debounced if it's in the list AND it's "simple" - // (i.e., has no parameters and no related request ID or related task that could be lost). - const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !options?.relatedRequestId && !options?.relatedTask; - if (canDebounce) { - // If a notification of this type is already scheduled, do nothing. - if (this._pendingDebouncedNotifications.has(notification.method)) { - return; - } - // Mark this notification type as pending. - this._pendingDebouncedNotifications.add(notification.method); - // Schedule the actual send to happen in the next microtask. - // This allows all synchronous calls in the current event loop tick to be coalesced. - Promise.resolve().then(() => { - // Un-mark the notification so the next one can be scheduled. - this._pendingDebouncedNotifications.delete(notification.method); - // SAFETY CHECK: If the connection was closed while this was pending, abort. - if (!this._transport) { - return; - } - let jsonrpcNotification = { - ...notification, - jsonrpc: '2.0' - }; - // Augment with related task metadata if relatedTask is provided - if (options?.relatedTask) { - jsonrpcNotification = { - ...jsonrpcNotification, - params: { - ...jsonrpcNotification.params, - _meta: { - ...(jsonrpcNotification.params?._meta || {}), - [RELATED_TASK_META_KEY]: options.relatedTask - } - } - }; - } - // Send the notification, but don't await it here to avoid blocking. - // Handle potential errors with a .catch(). - this._transport?.send(jsonrpcNotification, options).catch(error => this._onerror(error)); - }); - // Return immediately. - return; - } - let jsonrpcNotification = { - ...notification, - jsonrpc: '2.0' - }; - // Augment with related task metadata if relatedTask is provided - if (options?.relatedTask) { - jsonrpcNotification = { - ...jsonrpcNotification, - params: { - ...jsonrpcNotification.params, - _meta: { - ...(jsonrpcNotification.params?._meta || {}), - [RELATED_TASK_META_KEY]: options.relatedTask - } - } - }; - } - await this._transport.send(jsonrpcNotification, options); - } - /** - * Registers a handler to invoke when this protocol object receives a request with the given method. - * - * Note that this will replace any previous request handler for the same method. - */ - setRequestHandler(requestSchema, handler) { - const method = getMethodLiteral(requestSchema); - this.assertRequestHandlerCapability(method); - this._requestHandlers.set(method, (request, extra) => { - const parsed = parseWithCompat(requestSchema, request); - return Promise.resolve(handler(parsed, extra)); - }); - } - /** - * Removes the request handler for the given method. - */ - removeRequestHandler(method) { - this._requestHandlers.delete(method); - } - /** - * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed. - */ - assertCanSetRequestHandler(method) { - if (this._requestHandlers.has(method)) { - throw new Error(`A request handler for ${method} already exists, which would be overridden`); - } - } - /** - * Registers a handler to invoke when this protocol object receives a notification with the given method. - * - * Note that this will replace any previous notification handler for the same method. - */ - setNotificationHandler(notificationSchema, handler) { - const method = getMethodLiteral(notificationSchema); - this._notificationHandlers.set(method, notification => { - const parsed = parseWithCompat(notificationSchema, notification); - return Promise.resolve(handler(parsed)); - }); - } - /** - * Removes the notification handler for the given method. - */ - removeNotificationHandler(method) { - this._notificationHandlers.delete(method); - } - /** - * Cleans up the progress handler associated with a task. - * This should be called when a task reaches a terminal status. - */ - _cleanupTaskProgressHandler(taskId) { - const progressToken = this._taskProgressTokens.get(taskId); - if (progressToken !== undefined) { - this._progressHandlers.delete(progressToken); - this._taskProgressTokens.delete(taskId); - } - } - /** - * Enqueues a task-related message for side-channel delivery via tasks/result. - * @param taskId The task ID to associate the message with - * @param message The message to enqueue - * @param sessionId Optional session ID for binding the operation to a specific session - * @throws Error if taskStore is not configured or if enqueue fails (e.g., queue overflow) - * - * Note: If enqueue fails, it's the TaskMessageQueue implementation's responsibility to handle - * the error appropriately (e.g., by failing the task, logging, etc.). The Protocol layer - * simply propagates the error. - */ - async _enqueueTaskMessage(taskId, message, sessionId) { - // Task message queues are only used when taskStore is configured - if (!this._taskStore || !this._taskMessageQueue) { - throw new Error('Cannot enqueue task message: taskStore and taskMessageQueue are not configured'); - } - const maxQueueSize = this._options?.maxTaskQueueSize; - await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize); - } - /** - * Clears the message queue for a task and rejects any pending request resolvers. - * @param taskId The task ID whose queue should be cleared - * @param sessionId Optional session ID for binding the operation to a specific session - */ - async _clearTaskQueue(taskId, sessionId) { - if (this._taskMessageQueue) { - // Reject any pending request resolvers - const messages = await this._taskMessageQueue.dequeueAll(taskId, sessionId); - for (const message of messages) { - if (message.type === 'request' && isJSONRPCRequest(message.message)) { - // Extract request ID from the message - const requestId = message.message.id; - const resolver = this._requestResolvers.get(requestId); - if (resolver) { - resolver(new McpError(ErrorCode.InternalError, 'Task cancelled or completed')); - this._requestResolvers.delete(requestId); - } - else { - // Log error when resolver is missing during cleanup for better observability - this._onerror(new Error(`Resolver missing for request ${requestId} during task ${taskId} cleanup`)); - } - } - } - } - } - /** - * Waits for a task update (new messages or status change) with abort signal support. - * Uses polling to check for updates at the task's configured poll interval. - * @param taskId The task ID to wait for - * @param signal Abort signal to cancel the wait - * @returns Promise that resolves when an update occurs or rejects if aborted - */ - async _waitForTaskUpdate(taskId, signal) { - // Get the task's poll interval, falling back to default - let interval = this._options?.defaultTaskPollInterval ?? 1000; - try { - const task = await this._taskStore?.getTask(taskId); - if (task?.pollInterval) { - interval = task.pollInterval; - } - } - catch { - // Use default interval if task lookup fails - } - return new Promise((resolve, reject) => { - if (signal.aborted) { - reject(new McpError(ErrorCode.InvalidRequest, 'Request cancelled')); - return; - } - // Wait for the poll interval, then resolve so caller can check for updates - const timeoutId = setTimeout(resolve, interval); - // Clean up timeout and reject if aborted - signal.addEventListener('abort', () => { - clearTimeout(timeoutId); - reject(new McpError(ErrorCode.InvalidRequest, 'Request cancelled')); - }, { once: true }); - }); - } - requestTaskStore(request, sessionId) { - const taskStore = this._taskStore; - if (!taskStore) { - throw new Error('No task store configured'); - } - return { - createTask: async (taskParams) => { - if (!request) { - throw new Error('No request provided'); - } - return await taskStore.createTask(taskParams, request.id, { - method: request.method, - params: request.params - }, sessionId); - }, - getTask: async (taskId) => { - const task = await taskStore.getTask(taskId, sessionId); - if (!task) { - throw new McpError(ErrorCode.InvalidParams, 'Failed to retrieve task: Task not found'); - } - return task; - }, - storeTaskResult: async (taskId, status, result) => { - await taskStore.storeTaskResult(taskId, status, result, sessionId); - // Get updated task state and send notification - const task = await taskStore.getTask(taskId, sessionId); - if (task) { - const notification = TaskStatusNotificationSchema.parse({ - method: 'notifications/tasks/status', - params: task - }); - await this.notification(notification); - if (isTerminal(task.status)) { - this._cleanupTaskProgressHandler(taskId); - // Don't clear queue here - it will be cleared after delivery via tasks/result - } - } - }, - getTaskResult: taskId => { - return taskStore.getTaskResult(taskId, sessionId); - }, - updateTaskStatus: async (taskId, status, statusMessage) => { - // Check if task exists - const task = await taskStore.getTask(taskId, sessionId); - if (!task) { - throw new McpError(ErrorCode.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`); - } - // Don't allow transitions from terminal states - if (isTerminal(task.status)) { - throw new McpError(ErrorCode.InvalidParams, `Cannot update task "${taskId}" from terminal status "${task.status}" to "${status}". Terminal states (completed, failed, cancelled) cannot transition to other states.`); - } - await taskStore.updateTaskStatus(taskId, status, statusMessage, sessionId); - // Get updated task state and send notification - const updatedTask = await taskStore.getTask(taskId, sessionId); - if (updatedTask) { - const notification = TaskStatusNotificationSchema.parse({ - method: 'notifications/tasks/status', - params: updatedTask - }); - await this.notification(notification); - if (isTerminal(updatedTask.status)) { - this._cleanupTaskProgressHandler(taskId); - // Don't clear queue here - it will be cleared after delivery via tasks/result - } - } - }, - listTasks: cursor => { - return taskStore.listTasks(cursor, sessionId); - } - }; - } -} -function isPlainObject(value) { - return value !== null && typeof value === 'object' && !Array.isArray(value); -} -export function mergeCapabilities(base, additional) { - const result = { ...base }; - for (const key in additional) { - const k = key; - const addValue = additional[k]; - if (addValue === undefined) - continue; - const baseValue = result[k]; - if (isPlainObject(baseValue) && isPlainObject(addValue)) { - result[k] = { ...baseValue, ...addValue }; - } - else { - result[k] = addValue; - } - } - return result; -} -//# sourceMappingURL=protocol.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map deleted file mode 100644 index 70e490b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/shared/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EACH,2BAA2B,EAE3B,sBAAsB,EACtB,SAAS,EAET,oBAAoB,EACpB,mBAAmB,EAEnB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EAKrB,QAAQ,EACR,iBAAiB,EAGjB,0BAA0B,EAC1B,qBAAqB,EAarB,4BAA4B,EAI5B,4BAA4B,EAC/B,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,UAAU,EAAiE,MAAM,qCAAqC,CAAC;AAChI,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAoDxF;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAkNlD;;;GAGG;AACH,MAAM,OAAgB,QAAQ;IA8C1B,YAAoB,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;QA5CtC,sBAAiB,GAAG,CAAC,CAAC;QACtB,qBAAgB,GAGpB,IAAI,GAAG,EAAE,CAAC;QACN,oCAA+B,GAAoC,IAAI,GAAG,EAAE,CAAC;QAC7E,0BAAqB,GAAsE,IAAI,GAAG,EAAE,CAAC;QACrG,sBAAiB,GAAmE,IAAI,GAAG,EAAE,CAAC;QAC9F,sBAAiB,GAAkC,IAAI,GAAG,EAAE,CAAC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E,CAAC;QAC3B,MAAM,CAAC,GAAG,GAAc,CAAC;QACzB,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,QAAQ,KAAK,SAAS;YAAE,SAAS;QACrC,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,aAAa,CAAC,SAAS,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtD,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,GAAI,SAAqC,EAAE,GAAI,QAAoC,EAAiB,CAAC;QACvH,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,CAAC,CAAC,GAAG,QAAuB,CAAC;QACxC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.d.ts deleted file mode 100644 index 84354bd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Result, Task, McpError } from '../types.js'; -/** - * Base message type - */ -export interface BaseResponseMessage { - type: string; -} -/** - * Task status update message - */ -export interface TaskStatusMessage extends BaseResponseMessage { - type: 'taskStatus'; - task: Task; -} -/** - * Task created message (first message for task-augmented requests) - */ -export interface TaskCreatedMessage extends BaseResponseMessage { - type: 'taskCreated'; - task: Task; -} -/** - * Final result message (terminal) - */ -export interface ResultMessage extends BaseResponseMessage { - type: 'result'; - result: T; -} -/** - * Error message (terminal) - */ -export interface ErrorMessage extends BaseResponseMessage { - type: 'error'; - error: McpError; -} -/** - * Union type representing all possible messages that can be yielded during request processing. - * Note: Progress notifications are handled through the existing onprogress callback mechanism. - * Side-channeled messages (server requests/notifications) are handled through registered handlers. - */ -export type ResponseMessage = TaskStatusMessage | TaskCreatedMessage | ResultMessage | ErrorMessage; -export type AsyncGeneratorValue = T extends AsyncGenerator ? U : never; -export declare function toArrayAsync>(it: T): Promise[]>; -export declare function takeResult>>(it: U): Promise; -//# sourceMappingURL=responseMessage.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.d.ts.map deleted file mode 100644 index 65d93bb..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responseMessage.d.ts","sourceRoot":"","sources":["../../../src/shared/responseMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC1D,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC3D,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,mBAAmB;IACxE,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,CAAC,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,mBAAmB;IACrD,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,QAAQ,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,IAAI,iBAAiB,GAAG,kBAAkB,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC;AAEzH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEnF,wBAAsB,YAAY,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,CAO9G;AAED,wBAAsB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAUlH"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.js deleted file mode 100644 index d29e8a4..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.js +++ /dev/null @@ -1,19 +0,0 @@ -export async function toArrayAsync(it) { - const arr = []; - for await (const o of it) { - arr.push(o); - } - return arr; -} -export async function takeResult(it) { - for await (const o of it) { - if (o.type === 'result') { - return o.result; - } - else if (o.type === 'error') { - throw o.error; - } - } - throw new Error('No result in stream.'); -} -//# sourceMappingURL=responseMessage.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.js.map deleted file mode 100644 index eca1cec..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responseMessage.js","sourceRoot":"","sources":["../../../src/shared/responseMessage.ts"],"names":[],"mappings":"AAkDA,MAAM,CAAC,KAAK,UAAU,YAAY,CAAoC,EAAK;IACvE,MAAM,GAAG,GAA6B,EAAE,CAAC;IACzC,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACvB,GAAG,CAAC,IAAI,CAAC,CAA2B,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAiE,EAAK;IAClG,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,OAAO,CAAC,CAAC,MAAM,CAAC;QACpB,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC5B,MAAM,CAAC,CAAC,KAAK,CAAC;QAClB,CAAC;IACL,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts deleted file mode 100644 index 0830a48..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JSONRPCMessage } from '../types.js'; -/** - * Buffers a continuous stdio stream into discrete JSON-RPC messages. - */ -export declare class ReadBuffer { - private _buffer?; - append(chunk: Buffer): void; - readMessage(): JSONRPCMessage | null; - clear(): void; -} -export declare function deserializeMessage(line: string): JSONRPCMessage; -export declare function serializeMessage(message: JSONRPCMessage): string; -//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts.map deleted file mode 100644 index 8f97f2a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI3B,WAAW,IAAI,cAAc,GAAG,IAAI;IAepC,KAAK,IAAI,IAAI;CAGhB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAEhE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js deleted file mode 100644 index 30f299f..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +++ /dev/null @@ -1,31 +0,0 @@ -import { JSONRPCMessageSchema } from '../types.js'; -/** - * Buffers a continuous stdio stream into discrete JSON-RPC messages. - */ -export class ReadBuffer { - append(chunk) { - this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk; - } - readMessage() { - if (!this._buffer) { - return null; - } - const index = this._buffer.indexOf('\n'); - if (index === -1) { - return null; - } - const line = this._buffer.toString('utf8', 0, index).replace(/\r$/, ''); - this._buffer = this._buffer.subarray(index + 1); - return deserializeMessage(line); - } - clear() { - this._buffer = undefined; - } -} -export function deserializeMessage(line) { - return JSONRPCMessageSchema.parse(JSON.parse(line)); -} -export function serializeMessage(message) { - return JSON.stringify(message) + '\n'; -} -//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map deleted file mode 100644 index 19fdf08..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":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\ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.d.ts deleted file mode 100644 index 3cf94bf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Tool name validation utilities according to SEP: Specify Format for Tool Names - * - * Tool names SHOULD be between 1 and 128 characters in length (inclusive). - * Tool names are case-sensitive. - * Allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits - * (0-9), underscore (_), dash (-), and dot (.). - * Tool names SHOULD NOT contain spaces, commas, or other special characters. - */ -/** - * Validates a tool name according to the SEP specification - * @param name - The tool name to validate - * @returns An object containing validation result and any warnings - */ -export declare function validateToolName(name: string): { - isValid: boolean; - warnings: string[]; -}; -/** - * Issues warnings for non-conforming tool names - * @param name - The tool name that triggered the warnings - * @param warnings - Array of warning messages - */ -export declare function issueToolNameWarning(name: string, warnings: string[]): void; -/** - * Validates a tool name and issues warnings for non-conforming names - * @param name - The tool name to validate - * @returns true if the name is valid, false otherwise - */ -export declare function validateAndWarnToolName(name: string): boolean; -//# sourceMappingURL=toolNameValidation.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.d.ts.map deleted file mode 100644 index d81f015..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"toolNameValidation.d.ts","sourceRoot":"","sources":["../../../src/shared/toolNameValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CA0DA;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAY3E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAO7D"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js deleted file mode 100644 index 34b6d19..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Tool name validation utilities according to SEP: Specify Format for Tool Names - * - * Tool names SHOULD be between 1 and 128 characters in length (inclusive). - * Tool names are case-sensitive. - * Allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits - * (0-9), underscore (_), dash (-), and dot (.). - * Tool names SHOULD NOT contain spaces, commas, or other special characters. - */ -/** - * Regular expression for valid tool names according to SEP-986 specification - */ -const TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/; -/** - * Validates a tool name according to the SEP specification - * @param name - The tool name to validate - * @returns An object containing validation result and any warnings - */ -export function validateToolName(name) { - const warnings = []; - // Check length - if (name.length === 0) { - return { - isValid: false, - warnings: ['Tool name cannot be empty'] - }; - } - if (name.length > 128) { - return { - isValid: false, - warnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`] - }; - } - // Check for specific problematic patterns (these are warnings, not validation failures) - if (name.includes(' ')) { - warnings.push('Tool name contains spaces, which may cause parsing issues'); - } - if (name.includes(',')) { - warnings.push('Tool name contains commas, which may cause parsing issues'); - } - // Check for potentially confusing patterns (leading/trailing dashes, dots, slashes) - if (name.startsWith('-') || name.endsWith('-')) { - warnings.push('Tool name starts or ends with a dash, which may cause parsing issues in some contexts'); - } - if (name.startsWith('.') || name.endsWith('.')) { - warnings.push('Tool name starts or ends with a dot, which may cause parsing issues in some contexts'); - } - // Check for invalid characters - if (!TOOL_NAME_REGEX.test(name)) { - const invalidChars = name - .split('') - .filter(char => !/[A-Za-z0-9._-]/.test(char)) - .filter((char, index, arr) => arr.indexOf(char) === index); // Remove duplicates - warnings.push(`Tool name contains invalid characters: ${invalidChars.map(c => `"${c}"`).join(', ')}`, 'Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)'); - return { - isValid: false, - warnings - }; - } - return { - isValid: true, - warnings - }; -} -/** - * Issues warnings for non-conforming tool names - * @param name - The tool name that triggered the warnings - * @param warnings - Array of warning messages - */ -export function issueToolNameWarning(name, warnings) { - if (warnings.length > 0) { - console.warn(`Tool name validation warning for "${name}":`); - for (const warning of warnings) { - console.warn(` - ${warning}`); - } - console.warn('Tool registration will proceed, but this may cause compatibility issues.'); - console.warn('Consider updating the tool name to conform to the MCP tool naming standard.'); - console.warn('See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.'); - } -} -/** - * Validates a tool name and issues warnings for non-conforming names - * @param name - The tool name to validate - * @returns true if the name is valid, false otherwise - */ -export function validateAndWarnToolName(name) { - const result = validateToolName(name); - // Always issue warnings for any validation issues (both invalid names and warnings) - issueToolNameWarning(name, result.warnings); - return result.isValid; -} -//# sourceMappingURL=toolNameValidation.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map deleted file mode 100644 index 9fdfcea..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"toolNameValidation.js","sourceRoot":"","sources":["../../../src/shared/toolNameValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAElD;;;;GAIG;A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modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts deleted file mode 100644 index 1bd95ef..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { JSONRPCMessage, MessageExtraInfo, RequestId } from '../types.js'; -export type FetchLike = (url: string | URL, init?: RequestInit) => Promise; -/** - * Normalizes HeadersInit to a plain Record for manipulation. - * Handles Headers objects, arrays of tuples, and plain objects. - */ -export declare function normalizeHeaders(headers: HeadersInit | undefined): Record; -/** - * Creates a fetch function that includes base RequestInit options. - * This ensures requests inherit settings like credentials, mode, headers, etc. from the base init. - * - * @param baseFetch - The base fetch function to wrap (defaults to global fetch) - * @param baseInit - The base RequestInit to merge with each request - * @returns A wrapped fetch function that merges base options with call-specific options - */ -export declare function createFetchWithInit(baseFetch?: FetchLike, baseInit?: RequestInit): FetchLike; -/** - * Options for sending a JSON-RPC message. - */ -export type TransportSendOptions = { - /** - * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. - */ - relatedRequestId?: RequestId; - /** - * The resumption token used to continue long-running requests that were interrupted. - * - * This allows clients to reconnect and continue from where they left off, if supported by the transport. - */ - resumptionToken?: string; - /** - * A callback that is invoked when the resumption token changes, if supported by the transport. - * - * This allows clients to persist the latest token for potential reconnection. - */ - onresumptiontoken?: (token: string) => void; -}; -/** - * Describes the minimal contract for an MCP transport that a client or server can communicate over. - */ -export interface Transport { - /** - * Starts processing messages on the transport, including any connection steps that might need to be taken. - * - * This method should only be called after callbacks are installed, or else messages may be lost. - * - * NOTE: This method should not be called explicitly when using Client, Server, or Protocol classes, as they will implicitly call start(). - */ - start(): Promise; - /** - * Sends a JSON-RPC message (request or response). - * - * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. - */ - send(message: JSONRPCMessage, options?: TransportSendOptions): Promise; - /** - * Closes the connection. - */ - close(): Promise; - /** - * Callback for when the connection is closed for any reason. - * - * This should be invoked when close() is called as well. - */ - onclose?: () => void; - /** - * Callback for when an error occurs. - * - * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. - */ - onerror?: (error: Error) => void; - /** - * Callback for when a message (request or response) is received over the connection. - * - * Includes the requestInfo and authInfo if the transport is authenticated. - * - * The requestInfo can be used to get the original request information (headers, etc.) - */ - onmessage?: (message: T, extra?: MessageExtraInfo) => void; - /** - * The session ID generated for this connection. - */ - sessionId?: string; - /** - * Sets the protocol version used for the connection (called when the initialize response is received). - */ - setProtocolVersion?: (version: string) => void; -} -//# sourceMappingURL=transport.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts.map deleted file mode 100644 index 7a3d837..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1E,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAErF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYzF;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,GAAE,SAAiB,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,SAAS,CAenG;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAE7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C,CAAC;AACF;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7E;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,cAAc,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAErF;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js deleted file mode 100644 index ce25e23..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Normalizes HeadersInit to a plain Record for manipulation. - * Handles Headers objects, arrays of tuples, and plain objects. - */ -export function normalizeHeaders(headers) { - if (!headers) - return {}; - if (headers instanceof Headers) { - return Object.fromEntries(headers.entries()); - } - if (Array.isArray(headers)) { - return Object.fromEntries(headers); - } - return { ...headers }; -} -/** - * Creates a fetch function that includes base RequestInit options. - * This ensures requests inherit settings like credentials, mode, headers, etc. from the base init. - * - * @param baseFetch - The base fetch function to wrap (defaults to global fetch) - * @param baseInit - The base RequestInit to merge with each request - * @returns A wrapped fetch function that merges base options with call-specific options - */ -export function createFetchWithInit(baseFetch = fetch, baseInit) { - if (!baseInit) { - return baseFetch; - } - // Return a wrapped fetch that merges base RequestInit with call-specific init - return async (url, init) => { - const mergedInit = { - ...baseInit, - ...init, - // Headers need special handling - merge instead of replace - headers: init?.headers ? { ...normalizeHeaders(baseInit.headers), ...normalizeHeaders(init.headers) } : baseInit.headers - }; - return baseFetch(url, mergedInit); - }; -} -//# sourceMappingURL=transport.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js.map deleted file mode 100644 index 790e11d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgC;IAC7D,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,IAAI,OAAO,YAAY,OAAO,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,EAAE,GAAI,OAAkC,EAAE,CAAC;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAAuB,KAAK,EAAE,QAAsB;IACpF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,8EAA8E;IAC9E,OAAO,KAAK,EAAE,GAAiB,EAAE,IAAkB,EAAqB,EAAE;QACtE,MAAM,UAAU,GAAgB;YAC5B,GAAG,QAAQ;YACX,GAAG,IAAI;YACP,2DAA2D;YAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO;SAC3H,CAAC;QACF,OAAO,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACtC,CAAC,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.d.ts deleted file mode 100644 index 175e329..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type Variables = Record; -export declare class UriTemplate { - /** - * Returns true if the given string contains any URI template expressions. - * A template expression is a sequence of characters enclosed in curly braces, - * like {foo} or {?bar}. - */ - static isTemplate(str: string): boolean; - private static validateLength; - private readonly template; - private readonly parts; - get variableNames(): string[]; - constructor(template: string); - toString(): string; - private parse; - private getOperator; - private getNames; - private encodeValue; - private expandPart; - expand(variables: Variables): string; - private escapeRegExp; - private partToRegExp; - match(uri: string): Variables | null; -} -//# sourceMappingURL=uriTemplate.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.d.ts.map deleted file mode 100644 index 052e918..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uriTemplate.d.ts","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAO1D,qBAAa,WAAW;IACpB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAMvC,OAAO,CAAC,MAAM,CAAC,cAAc;IAK7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyF;IAE/G,IAAI,aAAa,IAAI,MAAM,EAAE,CAE5B;gBAEW,QAAQ,EAAE,MAAM;IAM5B,QAAQ,IAAI,MAAM;IAIlB,OAAO,CAAC,KAAK;IA8Cb,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,UAAU;IAsDlB,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IA4BpC,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAkDpB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;CAuCvC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js deleted file mode 100644 index 8247f63..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js +++ /dev/null @@ -1,239 +0,0 @@ -// Claude-authored implementation of RFC 6570 URI Templates -const MAX_TEMPLATE_LENGTH = 1000000; // 1MB -const MAX_VARIABLE_LENGTH = 1000000; // 1MB -const MAX_TEMPLATE_EXPRESSIONS = 10000; -const MAX_REGEX_LENGTH = 1000000; // 1MB -export class UriTemplate { - /** - * Returns true if the given string contains any URI template expressions. - * A template expression is a sequence of characters enclosed in curly braces, - * like {foo} or {?bar}. - */ - static isTemplate(str) { - // Look for any sequence of characters between curly braces - // that isn't just whitespace - return /\{[^}\s]+\}/.test(str); - } - static validateLength(str, max, context) { - if (str.length > max) { - throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`); - } - } - get variableNames() { - return this.parts.flatMap(part => (typeof part === 'string' ? [] : part.names)); - } - constructor(template) { - UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, 'Template'); - this.template = template; - this.parts = this.parse(template); - } - toString() { - return this.template; - } - parse(template) { - const parts = []; - let currentText = ''; - let i = 0; - let expressionCount = 0; - while (i < template.length) { - if (template[i] === '{') { - if (currentText) { - parts.push(currentText); - currentText = ''; - } - const end = template.indexOf('}', i); - if (end === -1) - throw new Error('Unclosed template expression'); - expressionCount++; - if (expressionCount > MAX_TEMPLATE_EXPRESSIONS) { - throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`); - } - const expr = template.slice(i + 1, end); - const operator = this.getOperator(expr); - const exploded = expr.includes('*'); - const names = this.getNames(expr); - const name = names[0]; - // Validate variable name length - for (const name of names) { - UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name'); - } - parts.push({ name, operator, names, exploded }); - i = end + 1; - } - else { - currentText += template[i]; - i++; - } - } - if (currentText) { - parts.push(currentText); - } - return parts; - } - getOperator(expr) { - const operators = ['+', '#', '.', '/', '?', '&']; - return operators.find(op => expr.startsWith(op)) || ''; - } - getNames(expr) { - const operator = this.getOperator(expr); - return expr - .slice(operator.length) - .split(',') - .map(name => name.replace('*', '').trim()) - .filter(name => name.length > 0); - } - encodeValue(value, operator) { - UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, 'Variable value'); - if (operator === '+' || operator === '#') { - return encodeURI(value); - } - return encodeURIComponent(value); - } - expandPart(part, variables) { - if (part.operator === '?' || part.operator === '&') { - const pairs = part.names - .map(name => { - const value = variables[name]; - if (value === undefined) - return ''; - const encoded = Array.isArray(value) - ? value.map(v => this.encodeValue(v, part.operator)).join(',') - : this.encodeValue(value.toString(), part.operator); - return `${name}=${encoded}`; - }) - .filter(pair => pair.length > 0); - if (pairs.length === 0) - return ''; - const separator = part.operator === '?' ? '?' : '&'; - return separator + pairs.join('&'); - } - if (part.names.length > 1) { - const values = part.names.map(name => variables[name]).filter(v => v !== undefined); - if (values.length === 0) - return ''; - return values.map(v => (Array.isArray(v) ? v[0] : v)).join(','); - } - const value = variables[part.name]; - if (value === undefined) - return ''; - const values = Array.isArray(value) ? value : [value]; - const encoded = values.map(v => this.encodeValue(v, part.operator)); - switch (part.operator) { - case '': - return encoded.join(','); - case '+': - return encoded.join(','); - case '#': - return '#' + encoded.join(','); - case '.': - return '.' + encoded.join('.'); - case '/': - return '/' + encoded.join('/'); - default: - return encoded.join(','); - } - } - expand(variables) { - let result = ''; - let hasQueryParam = false; - for (const part of this.parts) { - if (typeof part === 'string') { - result += part; - continue; - } - const expanded = this.expandPart(part, variables); - if (!expanded) - continue; - // Convert ? to & if we already have a query parameter - if ((part.operator === '?' || part.operator === '&') && hasQueryParam) { - result += expanded.replace('?', '&'); - } - else { - result += expanded; - } - if (part.operator === '?' || part.operator === '&') { - hasQueryParam = true; - } - } - return result; - } - escapeRegExp(str) { - return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - } - partToRegExp(part) { - const patterns = []; - // Validate variable name length for matching - for (const name of part.names) { - UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name'); - } - if (part.operator === '?' || part.operator === '&') { - for (let i = 0; i < part.names.length; i++) { - const name = part.names[i]; - const prefix = i === 0 ? '\\' + part.operator : '&'; - patterns.push({ - pattern: prefix + this.escapeRegExp(name) + '=([^&]+)', - name - }); - } - return patterns; - } - let pattern; - const name = part.name; - switch (part.operator) { - case '': - pattern = part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)'; - break; - case '+': - case '#': - pattern = '(.+)'; - break; - case '.': - pattern = '\\.([^/,]+)'; - break; - case '/': - pattern = '/' + (part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)'); - break; - default: - pattern = '([^/]+)'; - } - patterns.push({ pattern, name }); - return patterns; - } - match(uri) { - UriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, 'URI'); - let pattern = '^'; - const names = []; - for (const part of this.parts) { - if (typeof part === 'string') { - pattern += this.escapeRegExp(part); - } - else { - const patterns = this.partToRegExp(part); - for (const { pattern: partPattern, name } of patterns) { - pattern += partPattern; - names.push({ name, exploded: part.exploded }); - } - } - } - pattern += '$'; - UriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, 'Generated regex pattern'); - const regex = new RegExp(pattern); - const match = uri.match(regex); - if (!match) - return null; - const result = {}; - for (let i = 0; i < names.length; i++) { - const { name, exploded } = names[i]; - const value = match[i + 1]; - const cleanName = name.replace('*', ''); - if (exploded && value.includes(',')) { - result[cleanName] = value.split(','); - } - else { - result[cleanName] = value; - } - } - return result; - } -} -//# sourceMappingURL=uriTemplate.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js.map deleted file mode 100644 index d47e01b..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uriTemplate.js","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAI3D,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,MAAM;AAC3C,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,MAAM;AAC3C,MAAM,wBAAwB,GAAG,KAAK,CAAC;AACvC,MAAM,gBAAgB,GAAG,OAAO,CAAC,CAAC,MAAM;AAExC,MAAM,OAAO,WAAW;IACpB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAW;QACzB,2DAA2D;QAC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GAAG,CAAC,CAAC;YACzC,CAAC;iBAAM,CAAC;gBACJ,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;YAC9B,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.d.ts deleted file mode 100644 index f94e3cf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.d.ts +++ /dev/null @@ -1,2299 +0,0 @@ -/** - * This file is automatically generated from the Model Context Protocol specification. - * - * Source: https://github.com/modelcontextprotocol/modelcontextprotocol - * Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts - * Last updated from commit: 35fa160caf287a9c48696e3ae452c0645c713669 - * - * DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates. - * To update this file, run: npm run fetch:spec-types - */ -/** - * Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent. - * - * @category JSON-RPC - */ -export type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResponse; -/** @internal */ -export declare const LATEST_PROTOCOL_VERSION = "DRAFT-2026-v1"; -/** @internal */ -export declare const JSONRPC_VERSION = "2.0"; -/** - * A progress token, used to associate progress notifications with the original request. - * - * @category Common Types - */ -export type ProgressToken = string | number; -/** - * An opaque token used to represent a cursor for pagination. - * - * @category Common Types - */ -export type Cursor = string; -/** - * Common params for any task-augmented request. - * - * @internal - */ -export interface TaskAugmentedRequestParams extends RequestParams { - /** - * If specified, the caller is requesting task-augmented execution for this request. - * The request will return a CreateTaskResult immediately, and the actual result can be - * retrieved later via tasks/result. - * - * Task augmentation is subject to capability negotiation - receivers MUST declare support - * for task augmentation of specific request types in their capabilities. - */ - task?: TaskMetadata; -} -/** - * Common params for any request. - * - * @internal - */ -export interface RequestParams { - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - /** - * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. - */ - progressToken?: ProgressToken; - [key: string]: unknown; - }; -} -/** @internal */ -export interface Request { - method: string; - params?: { - [key: string]: any; - }; -} -/** @internal */ -export interface NotificationParams { - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** @internal */ -export interface Notification { - method: string; - params?: { - [key: string]: any; - }; -} -/** - * @category Common Types - */ -export interface Result { - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; - [key: string]: unknown; -} -/** - * @category Common Types - */ -export interface Error { - /** - * The error type that occurred. - */ - code: number; - /** - * A short description of the error. The message SHOULD be limited to a concise single sentence. - */ - message: string; - /** - * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). - */ - data?: unknown; -} -/** - * A uniquely identifying ID for a request in JSON-RPC. - * - * @category Common Types - */ -export type RequestId = string | number; -/** - * A request that expects a response. - * - * @category JSON-RPC - */ -export interface JSONRPCRequest extends Request { - jsonrpc: typeof JSONRPC_VERSION; - id: RequestId; -} -/** - * A notification which does not expect a response. - * - * @category JSON-RPC - */ -export interface JSONRPCNotification extends Notification { - jsonrpc: typeof JSONRPC_VERSION; -} -/** - * A successful (non-error) response to a request. - * - * @category JSON-RPC - */ -export interface JSONRPCResultResponse { - jsonrpc: typeof JSONRPC_VERSION; - id: RequestId; - result: Result; -} -/** - * A response to a request that indicates an error occurred. - * - * @category JSON-RPC - */ -export interface JSONRPCErrorResponse { - jsonrpc: typeof JSONRPC_VERSION; - id?: RequestId; - error: Error; -} -/** - * A response to a request, containing either the result or error. - */ -export type JSONRPCResponse = JSONRPCResultResponse | JSONRPCErrorResponse; -export declare const PARSE_ERROR = -32700; -export declare const INVALID_REQUEST = -32600; -export declare const METHOD_NOT_FOUND = -32601; -export declare const INVALID_PARAMS = -32602; -export declare const INTERNAL_ERROR = -32603; -/** @internal */ -export declare const URL_ELICITATION_REQUIRED = -32042; -/** - * An error response that indicates that the server requires the client to provide additional information via an elicitation request. - * - * @internal - */ -export interface URLElicitationRequiredError extends Omit { - error: Error & { - code: typeof URL_ELICITATION_REQUIRED; - data: { - elicitations: ElicitRequestURLParams[]; - [key: string]: unknown; - }; - }; -} -/** - * A response that indicates success but carries no data. - * - * @category Common Types - */ -export type EmptyResult = Result; -/** - * Parameters for a `notifications/cancelled` notification. - * - * @category `notifications/cancelled` - */ -export interface CancelledNotificationParams extends NotificationParams { - /** - * The ID of the request to cancel. - * - * This MUST correspond to the ID of a request previously issued in the same direction. - * This MUST be provided for cancelling non-task requests. - * This MUST NOT be used for cancelling tasks (use the `tasks/cancel` request instead). - */ - requestId?: RequestId; - /** - * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. - */ - reason?: string; -} -/** - * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. - * - * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. - * - * This notification indicates that the result will be unused, so any associated processing SHOULD cease. - * - * A client MUST NOT attempt to cancel its `initialize` request. - * - * For task cancellation, use the `tasks/cancel` request instead of this notification. - * - * @category `notifications/cancelled` - */ -export interface CancelledNotification extends JSONRPCNotification { - method: "notifications/cancelled"; - params: CancelledNotificationParams; -} -/** - * Parameters for an `initialize` request. - * - * @category `initialize` - */ -export interface InitializeRequestParams extends RequestParams { - /** - * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. - */ - protocolVersion: string; - capabilities: ClientCapabilities; - clientInfo: Implementation; -} -/** - * This request is sent from the client to the server when it first connects, asking it to begin initialization. - * - * @category `initialize` - */ -export interface InitializeRequest extends JSONRPCRequest { - method: "initialize"; - params: InitializeRequestParams; -} -/** - * After receiving an initialize request from the client, the server sends this response. - * - * @category `initialize` - */ -export interface InitializeResult extends Result { - /** - * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. - */ - protocolVersion: string; - capabilities: ServerCapabilities; - serverInfo: Implementation; - /** - * Instructions describing how to use the server and its features. - * - * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. - */ - instructions?: string; -} -/** - * This notification is sent from the client to the server after initialization has finished. - * - * @category `notifications/initialized` - */ -export interface InitializedNotification extends JSONRPCNotification { - method: "notifications/initialized"; - params?: NotificationParams; -} -/** - * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. - * - * @category `initialize` - */ -export interface ClientCapabilities { - /** - * Experimental, non-standard capabilities that the client supports. - */ - experimental?: { - [key: string]: object; - }; - /** - * Present if the client supports listing roots. - */ - roots?: { - /** - * Whether the client supports notifications for changes to the roots list. - */ - listChanged?: boolean; - }; - /** - * Present if the client supports sampling from an LLM. - */ - sampling?: { - /** - * Whether the client supports context inclusion via includeContext parameter. - * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it). - */ - context?: object; - /** - * Whether the client supports tool use via tools and toolChoice parameters. - */ - tools?: object; - }; - /** - * Present if the client supports elicitation from the server. - */ - elicitation?: { - form?: object; - url?: object; - }; - /** - * Present if the client supports task-augmented requests. - */ - tasks?: { - /** - * Whether this client supports tasks/list. - */ - list?: object; - /** - * Whether this client supports tasks/cancel. - */ - cancel?: object; - /** - * Specifies which request types can be augmented with tasks. - */ - requests?: { - /** - * Task support for sampling-related requests. - */ - sampling?: { - /** - * Whether the client supports task-augmented sampling/createMessage requests. - */ - createMessage?: object; - }; - /** - * Task support for elicitation-related requests. - */ - elicitation?: { - /** - * Whether the client supports task-augmented elicitation/create requests. - */ - create?: object; - }; - }; - }; -} -/** - * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. - * - * @category `initialize` - */ -export interface ServerCapabilities { - /** - * Experimental, non-standard capabilities that the server supports. - */ - experimental?: { - [key: string]: object; - }; - /** - * Present if the server supports sending log messages to the client. - */ - logging?: object; - /** - * Present if the server supports argument autocompletion suggestions. - */ - completions?: object; - /** - * Present if the server offers any prompt templates. - */ - prompts?: { - /** - * Whether this server supports notifications for changes to the prompt list. - */ - listChanged?: boolean; - }; - /** - * Present if the server offers any resources to read. - */ - resources?: { - /** - * Whether this server supports subscribing to resource updates. - */ - subscribe?: boolean; - /** - * Whether this server supports notifications for changes to the resource list. - */ - listChanged?: boolean; - }; - /** - * Present if the server offers any tools to call. - */ - tools?: { - /** - * Whether this server supports notifications for changes to the tool list. - */ - listChanged?: boolean; - }; - /** - * Present if the server supports task-augmented requests. - */ - tasks?: { - /** - * Whether this server supports tasks/list. - */ - list?: object; - /** - * Whether this server supports tasks/cancel. - */ - cancel?: object; - /** - * Specifies which request types can be augmented with tasks. - */ - requests?: { - /** - * Task support for tool-related requests. - */ - tools?: { - /** - * Whether the server supports task-augmented tools/call requests. - */ - call?: object; - }; - }; - }; -} -/** - * An optionally-sized icon that can be displayed in a user interface. - * - * @category Common Types - */ -export interface Icon { - /** - * A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a - * `data:` URI with Base64-encoded image data. - * - * Consumers SHOULD takes steps to ensure URLs serving icons are from the - * same domain as the client/server or a trusted domain. - * - * Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain - * executable JavaScript. - * - * @format uri - */ - src: string; - /** - * Optional MIME type override if the source MIME type is missing or generic. - * For example: `"image/png"`, `"image/jpeg"`, or `"image/svg+xml"`. - */ - mimeType?: string; - /** - * Optional array of strings that specify sizes at which the icon can be used. - * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG. - * - * If not provided, the client should assume that the icon can be used at any size. - */ - sizes?: string[]; - /** - * Optional specifier for the theme this icon is designed for. `light` indicates - * the icon is designed to be used with a light background, and `dark` indicates - * the icon is designed to be used with a dark background. - * - * If not provided, the client should assume the icon can be used with any theme. - */ - theme?: "light" | "dark"; -} -/** - * Base interface to add `icons` property. - * - * @internal - */ -export interface Icons { - /** - * Optional set of sized icons that the client can display in a user interface. - * - * Clients that support rendering icons MUST support at least the following MIME types: - * - `image/png` - PNG images (safe, universal compatibility) - * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility) - * - * Clients that support rendering icons SHOULD also support: - * - `image/svg+xml` - SVG images (scalable but requires security precautions) - * - `image/webp` - WebP images (modern, efficient format) - */ - icons?: Icon[]; -} -/** - * Base interface for metadata with name (identifier) and title (display name) properties. - * - * @internal - */ -export interface BaseMetadata { - /** - * Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present). - */ - name: string; - /** - * Intended for UI and end-user contexts — optimized to be human-readable and easily understood, - * even by those unfamiliar with domain-specific terminology. - * - * If not provided, the name should be used for display (except for Tool, - * where `annotations.title` should be given precedence over using `name`, - * if present). - */ - title?: string; -} -/** - * Describes the MCP implementation. - * - * @category `initialize` - */ -export interface Implementation extends BaseMetadata, Icons { - version: string; - /** - * An optional human-readable description of what this implementation does. - * - * This can be used by clients or servers to provide context about their purpose - * and capabilities. For example, a server might describe the types of resources - * or tools it provides, while a client might describe its intended use case. - */ - description?: string; - /** - * An optional URL of the website for this implementation. - * - * @format uri - */ - websiteUrl?: string; -} -/** - * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. - * - * @category `ping` - */ -export interface PingRequest extends JSONRPCRequest { - method: "ping"; - params?: RequestParams; -} -/** - * Parameters for a `notifications/progress` notification. - * - * @category `notifications/progress` - */ -export interface ProgressNotificationParams extends NotificationParams { - /** - * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. - */ - progressToken: ProgressToken; - /** - * The progress thus far. This should increase every time progress is made, even if the total is unknown. - * - * @TJS-type number - */ - progress: number; - /** - * Total number of items to process (or total progress required), if known. - * - * @TJS-type number - */ - total?: number; - /** - * An optional message describing the current progress. - */ - message?: string; -} -/** - * An out-of-band notification used to inform the receiver of a progress update for a long-running request. - * - * @category `notifications/progress` - */ -export interface ProgressNotification extends JSONRPCNotification { - method: "notifications/progress"; - params: ProgressNotificationParams; -} -/** - * Common parameters for paginated requests. - * - * @internal - */ -export interface PaginatedRequestParams extends RequestParams { - /** - * An opaque token representing the current pagination position. - * If provided, the server should return results starting after this cursor. - */ - cursor?: Cursor; -} -/** @internal */ -export interface PaginatedRequest extends JSONRPCRequest { - params?: PaginatedRequestParams; -} -/** @internal */ -export interface PaginatedResult extends Result { - /** - * An opaque token representing the pagination position after the last returned result. - * If present, there may be more results available. - */ - nextCursor?: Cursor; -} -/** - * Sent from the client to request a list of resources the server has. - * - * @category `resources/list` - */ -export interface ListResourcesRequest extends PaginatedRequest { - method: "resources/list"; -} -/** - * The server's response to a resources/list request from the client. - * - * @category `resources/list` - */ -export interface ListResourcesResult extends PaginatedResult { - resources: Resource[]; -} -/** - * Sent from the client to request a list of resource templates the server has. - * - * @category `resources/templates/list` - */ -export interface ListResourceTemplatesRequest extends PaginatedRequest { - method: "resources/templates/list"; -} -/** - * The server's response to a resources/templates/list request from the client. - * - * @category `resources/templates/list` - */ -export interface ListResourceTemplatesResult extends PaginatedResult { - resourceTemplates: ResourceTemplate[]; -} -/** - * Common parameters when working with resources. - * - * @internal - */ -export interface ResourceRequestParams extends RequestParams { - /** - * The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it. - * - * @format uri - */ - uri: string; -} -/** - * Parameters for a `resources/read` request. - * - * @category `resources/read` - */ -export interface ReadResourceRequestParams extends ResourceRequestParams { -} -/** - * Sent from the client to the server, to read a specific resource URI. - * - * @category `resources/read` - */ -export interface ReadResourceRequest extends JSONRPCRequest { - method: "resources/read"; - params: ReadResourceRequestParams; -} -/** - * The server's response to a resources/read request from the client. - * - * @category `resources/read` - */ -export interface ReadResourceResult extends Result { - contents: (TextResourceContents | BlobResourceContents)[]; -} -/** - * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. - * - * @category `notifications/resources/list_changed` - */ -export interface ResourceListChangedNotification extends JSONRPCNotification { - method: "notifications/resources/list_changed"; - params?: NotificationParams; -} -/** - * Parameters for a `resources/subscribe` request. - * - * @category `resources/subscribe` - */ -export interface SubscribeRequestParams extends ResourceRequestParams { -} -/** - * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. - * - * @category `resources/subscribe` - */ -export interface SubscribeRequest extends JSONRPCRequest { - method: "resources/subscribe"; - params: SubscribeRequestParams; -} -/** - * Parameters for a `resources/unsubscribe` request. - * - * @category `resources/unsubscribe` - */ -export interface UnsubscribeRequestParams extends ResourceRequestParams { -} -/** - * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. - * - * @category `resources/unsubscribe` - */ -export interface UnsubscribeRequest extends JSONRPCRequest { - method: "resources/unsubscribe"; - params: UnsubscribeRequestParams; -} -/** - * Parameters for a `notifications/resources/updated` notification. - * - * @category `notifications/resources/updated` - */ -export interface ResourceUpdatedNotificationParams extends NotificationParams { - /** - * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. - * - * @format uri - */ - uri: string; -} -/** - * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. - * - * @category `notifications/resources/updated` - */ -export interface ResourceUpdatedNotification extends JSONRPCNotification { - method: "notifications/resources/updated"; - params: ResourceUpdatedNotificationParams; -} -/** - * A known resource that the server is capable of reading. - * - * @category `resources/list` - */ -export interface Resource extends BaseMetadata, Icons { - /** - * The URI of this resource. - * - * @format uri - */ - uri: string; - /** - * A description of what this resource represents. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description?: string; - /** - * The MIME type of this resource, if known. - */ - mimeType?: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known. - * - * This can be used by Hosts to display file sizes and estimate context window usage. - */ - size?: number; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * A template description for resources available on the server. - * - * @category `resources/templates/list` - */ -export interface ResourceTemplate extends BaseMetadata, Icons { - /** - * A URI template (according to RFC 6570) that can be used to construct resource URIs. - * - * @format uri-template - */ - uriTemplate: string; - /** - * A description of what this template is for. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description?: string; - /** - * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. - */ - mimeType?: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * The contents of a specific resource or sub-resource. - * - * @internal - */ -export interface ResourceContents { - /** - * The URI of this resource. - * - * @format uri - */ - uri: string; - /** - * The MIME type of this resource, if known. - */ - mimeType?: string; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * @category Content - */ -export interface TextResourceContents extends ResourceContents { - /** - * The text of the item. This must only be set if the item can actually be represented as text (not binary data). - */ - text: string; -} -/** - * @category Content - */ -export interface BlobResourceContents extends ResourceContents { - /** - * A base64-encoded string representing the binary data of the item. - * - * @format byte - */ - blob: string; -} -/** - * Sent from the client to request a list of prompts and prompt templates the server has. - * - * @category `prompts/list` - */ -export interface ListPromptsRequest extends PaginatedRequest { - method: "prompts/list"; -} -/** - * The server's response to a prompts/list request from the client. - * - * @category `prompts/list` - */ -export interface ListPromptsResult extends PaginatedResult { - prompts: Prompt[]; -} -/** - * Parameters for a `prompts/get` request. - * - * @category `prompts/get` - */ -export interface GetPromptRequestParams extends RequestParams { - /** - * The name of the prompt or prompt template. - */ - name: string; - /** - * Arguments to use for templating the prompt. - */ - arguments?: { - [key: string]: string; - }; -} -/** - * Used by the client to get a prompt provided by the server. - * - * @category `prompts/get` - */ -export interface GetPromptRequest extends JSONRPCRequest { - method: "prompts/get"; - params: GetPromptRequestParams; -} -/** - * The server's response to a prompts/get request from the client. - * - * @category `prompts/get` - */ -export interface GetPromptResult extends Result { - /** - * An optional description for the prompt. - */ - description?: string; - messages: PromptMessage[]; -} -/** - * A prompt or prompt template that the server offers. - * - * @category `prompts/list` - */ -export interface Prompt extends BaseMetadata, Icons { - /** - * An optional description of what this prompt provides - */ - description?: string; - /** - * A list of arguments to use for templating the prompt. - */ - arguments?: PromptArgument[]; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * Describes an argument that a prompt can accept. - * - * @category `prompts/list` - */ -export interface PromptArgument extends BaseMetadata { - /** - * A human-readable description of the argument. - */ - description?: string; - /** - * Whether this argument must be provided. - */ - required?: boolean; -} -/** - * The sender or recipient of messages and data in a conversation. - * - * @category Common Types - */ -export type Role = "user" | "assistant"; -/** - * Describes a message returned as part of a prompt. - * - * This is similar to `SamplingMessage`, but also supports the embedding of - * resources from the MCP server. - * - * @category `prompts/get` - */ -export interface PromptMessage { - role: Role; - content: ContentBlock; -} -/** - * A resource that the server is capable of reading, included in a prompt or tool call result. - * - * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. - * - * @category Content - */ -export interface ResourceLink extends Resource { - type: "resource_link"; -} -/** - * The contents of a resource, embedded into a prompt or tool call result. - * - * It is up to the client how best to render embedded resources for the benefit - * of the LLM and/or the user. - * - * @category Content - */ -export interface EmbeddedResource { - type: "resource"; - resource: TextResourceContents | BlobResourceContents; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. - * - * @category `notifications/prompts/list_changed` - */ -export interface PromptListChangedNotification extends JSONRPCNotification { - method: "notifications/prompts/list_changed"; - params?: NotificationParams; -} -/** - * Sent from the client to request a list of tools the server has. - * - * @category `tools/list` - */ -export interface ListToolsRequest extends PaginatedRequest { - method: "tools/list"; -} -/** - * The server's response to a tools/list request from the client. - * - * @category `tools/list` - */ -export interface ListToolsResult extends PaginatedResult { - tools: Tool[]; -} -/** - * The server's response to a tool call. - * - * @category `tools/call` - */ -export interface CallToolResult extends Result { - /** - * A list of content objects that represent the unstructured result of the tool call. - */ - content: ContentBlock[]; - /** - * An optional JSON object that represents the structured result of the tool call. - */ - structuredContent?: { - [key: string]: unknown; - }; - /** - * Whether the tool call ended in an error. - * - * If not set, this is assumed to be false (the call was successful). - * - * Any errors that originate from the tool SHOULD be reported inside the result - * object, with `isError` set to true, _not_ as an MCP protocol-level error - * response. Otherwise, the LLM would not be able to see that an error occurred - * and self-correct. - * - * However, any errors in _finding_ the tool, an error indicating that the - * server does not support tool calls, or any other exceptional conditions, - * should be reported as an MCP error response. - */ - isError?: boolean; -} -/** - * Parameters for a `tools/call` request. - * - * @category `tools/call` - */ -export interface CallToolRequestParams extends TaskAugmentedRequestParams { - /** - * The name of the tool. - */ - name: string; - /** - * Arguments to use for the tool call. - */ - arguments?: { - [key: string]: unknown; - }; -} -/** - * Used by the client to invoke a tool provided by the server. - * - * @category `tools/call` - */ -export interface CallToolRequest extends JSONRPCRequest { - method: "tools/call"; - params: CallToolRequestParams; -} -/** - * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. - * - * @category `notifications/tools/list_changed` - */ -export interface ToolListChangedNotification extends JSONRPCNotification { - method: "notifications/tools/list_changed"; - params?: NotificationParams; -} -/** - * Additional properties describing a Tool to clients. - * - * NOTE: all properties in ToolAnnotations are **hints**. - * They are not guaranteed to provide a faithful description of - * tool behavior (including descriptive properties like `title`). - * - * Clients should never make tool use decisions based on ToolAnnotations - * received from untrusted servers. - * - * @category `tools/list` - */ -export interface ToolAnnotations { - /** - * A human-readable title for the tool. - */ - title?: string; - /** - * If true, the tool does not modify its environment. - * - * Default: false - */ - readOnlyHint?: boolean; - /** - * If true, the tool may perform destructive updates to its environment. - * If false, the tool performs only additive updates. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: true - */ - destructiveHint?: boolean; - /** - * If true, calling the tool repeatedly with the same arguments - * will have no additional effect on its environment. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: false - */ - idempotentHint?: boolean; - /** - * If true, this tool may interact with an "open world" of external - * entities. If false, the tool's domain of interaction is closed. - * For example, the world of a web search tool is open, whereas that - * of a memory tool is not. - * - * Default: true - */ - openWorldHint?: boolean; -} -/** - * Execution-related properties for a tool. - * - * @category `tools/list` - */ -export interface ToolExecution { - /** - * Indicates whether this tool supports task-augmented execution. - * This allows clients to handle long-running operations through polling - * the task system. - * - * - "forbidden": Tool does not support task-augmented execution (default when absent) - * - "optional": Tool may support task-augmented execution - * - "required": Tool requires task-augmented execution - * - * Default: "forbidden" - */ - taskSupport?: "forbidden" | "optional" | "required"; -} -/** - * Definition for a tool the client can call. - * - * @category `tools/list` - */ -export interface Tool extends BaseMetadata, Icons { - /** - * A human-readable description of the tool. - * - * This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model. - */ - description?: string; - /** - * A JSON Schema object defining the expected parameters for the tool. - */ - inputSchema: { - $schema?: string; - type: "object"; - properties?: { - [key: string]: object; - }; - required?: string[]; - }; - /** - * Execution-related properties for this tool. - */ - execution?: ToolExecution; - /** - * An optional JSON Schema object defining the structure of the tool's output returned in - * the structuredContent field of a CallToolResult. - * - * Defaults to JSON Schema 2020-12 when no explicit $schema is provided. - * Currently restricted to type: "object" at the root level. - */ - outputSchema?: { - $schema?: string; - type: "object"; - properties?: { - [key: string]: object; - }; - required?: string[]; - }; - /** - * Optional additional tool information. - * - * Display name precedence order is: title, annotations.title, then name. - */ - annotations?: ToolAnnotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * The status of a task. - * - * @category `tasks` - */ -export type TaskStatus = "working" | "input_required" | "completed" | "failed" | "cancelled"; -/** - * Metadata for augmenting a request with task execution. - * Include this in the `task` field of the request parameters. - * - * @category `tasks` - */ -export interface TaskMetadata { - /** - * Requested duration in milliseconds to retain task from creation. - */ - ttl?: number; -} -/** - * Metadata for associating messages with a task. - * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`. - * - * @category `tasks` - */ -export interface RelatedTaskMetadata { - /** - * The task identifier this message is associated with. - */ - taskId: string; -} -/** - * Data associated with a task. - * - * @category `tasks` - */ -export interface Task { - /** - * The task identifier. - */ - taskId: string; - /** - * Current task state. - */ - status: TaskStatus; - /** - * Optional human-readable message describing the current task state. - * This can provide context for any status, including: - * - Reasons for "cancelled" status - * - Summaries for "completed" status - * - Diagnostic information for "failed" status (e.g., error details, what went wrong) - */ - statusMessage?: string; - /** - * ISO 8601 timestamp when the task was created. - */ - createdAt: string; - /** - * ISO 8601 timestamp when the task was last updated. - */ - lastUpdatedAt: string; - /** - * Actual retention duration from creation in milliseconds, null for unlimited. - */ - ttl: number | null; - /** - * Suggested polling interval in milliseconds. - */ - pollInterval?: number; -} -/** - * A response to a task-augmented request. - * - * @category `tasks` - */ -export interface CreateTaskResult extends Result { - task: Task; -} -/** - * A request to retrieve the state of a task. - * - * @category `tasks/get` - */ -export interface GetTaskRequest extends JSONRPCRequest { - method: "tasks/get"; - params: { - /** - * The task identifier to query. - */ - taskId: string; - }; -} -/** - * The response to a tasks/get request. - * - * @category `tasks/get` - */ -export type GetTaskResult = Result & Task; -/** - * A request to retrieve the result of a completed task. - * - * @category `tasks/result` - */ -export interface GetTaskPayloadRequest extends JSONRPCRequest { - method: "tasks/result"; - params: { - /** - * The task identifier to retrieve results for. - */ - taskId: string; - }; -} -/** - * The response to a tasks/result request. - * The structure matches the result type of the original request. - * For example, a tools/call task would return the CallToolResult structure. - * - * @category `tasks/result` - */ -export interface GetTaskPayloadResult extends Result { - [key: string]: unknown; -} -/** - * A request to cancel a task. - * - * @category `tasks/cancel` - */ -export interface CancelTaskRequest extends JSONRPCRequest { - method: "tasks/cancel"; - params: { - /** - * The task identifier to cancel. - */ - taskId: string; - }; -} -/** - * The response to a tasks/cancel request. - * - * @category `tasks/cancel` - */ -export type CancelTaskResult = Result & Task; -/** - * A request to retrieve a list of tasks. - * - * @category `tasks/list` - */ -export interface ListTasksRequest extends PaginatedRequest { - method: "tasks/list"; -} -/** - * The response to a tasks/list request. - * - * @category `tasks/list` - */ -export interface ListTasksResult extends PaginatedResult { - tasks: Task[]; -} -/** - * Parameters for a `notifications/tasks/status` notification. - * - * @category `notifications/tasks/status` - */ -export type TaskStatusNotificationParams = NotificationParams & Task; -/** - * An optional notification from the receiver to the requestor, informing them that a task's status has changed. Receivers are not required to send these notifications. - * - * @category `notifications/tasks/status` - */ -export interface TaskStatusNotification extends JSONRPCNotification { - method: "notifications/tasks/status"; - params: TaskStatusNotificationParams; -} -/** - * Parameters for a `logging/setLevel` request. - * - * @category `logging/setLevel` - */ -export interface SetLevelRequestParams extends RequestParams { - /** - * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message. - */ - level: LoggingLevel; -} -/** - * A request from the client to the server, to enable or adjust logging. - * - * @category `logging/setLevel` - */ -export interface SetLevelRequest extends JSONRPCRequest { - method: "logging/setLevel"; - params: SetLevelRequestParams; -} -/** - * Parameters for a `notifications/message` notification. - * - * @category `notifications/message` - */ -export interface LoggingMessageNotificationParams extends NotificationParams { - /** - * The severity of this log message. - */ - level: LoggingLevel; - /** - * An optional name of the logger issuing this message. - */ - logger?: string; - /** - * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. - */ - data: unknown; -} -/** - * JSONRPCNotification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. - * - * @category `notifications/message` - */ -export interface LoggingMessageNotification extends JSONRPCNotification { - method: "notifications/message"; - params: LoggingMessageNotificationParams; -} -/** - * The severity of a log message. - * - * These map to syslog message severities, as specified in RFC-5424: - * https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1 - * - * @category Common Types - */ -export type LoggingLevel = "debug" | "info" | "notice" | "warning" | "error" | "critical" | "alert" | "emergency"; -/** - * Parameters for a `sampling/createMessage` request. - * - * @category `sampling/createMessage` - */ -export interface CreateMessageRequestParams extends TaskAugmentedRequestParams { - messages: SamplingMessage[]; - /** - * The server's preferences for which model to select. The client MAY ignore these preferences. - */ - modelPreferences?: ModelPreferences; - /** - * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. - */ - systemPrompt?: string; - /** - * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. - * The client MAY ignore this request. - * - * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client - * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases. - */ - includeContext?: "none" | "thisServer" | "allServers"; - /** - * @TJS-type number - */ - temperature?: number; - /** - * The requested maximum number of tokens to sample (to prevent runaway completions). - * - * The client MAY choose to sample fewer tokens than the requested maximum. - */ - maxTokens: number; - stopSequences?: string[]; - /** - * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. - */ - metadata?: object; - /** - * Tools that the model may use during generation. - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. - */ - tools?: Tool[]; - /** - * Controls how the model uses tools. - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. - * Default is `{ mode: "auto" }`. - */ - toolChoice?: ToolChoice; -} -/** - * Controls tool selection behavior for sampling requests. - * - * @category `sampling/createMessage` - */ -export interface ToolChoice { - /** - * Controls the tool use ability of the model: - * - "auto": Model decides whether to use tools (default) - * - "required": Model MUST use at least one tool before completing - * - "none": Model MUST NOT use any tools - */ - mode?: "auto" | "required" | "none"; -} -/** - * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. - * - * @category `sampling/createMessage` - */ -export interface CreateMessageRequest extends JSONRPCRequest { - method: "sampling/createMessage"; - params: CreateMessageRequestParams; -} -/** - * The client's response to a sampling/createMessage request from the server. - * The client should inform the user before returning the sampled message, to allow them - * to inspect the response (human in the loop) and decide whether to allow the server to see it. - * - * @category `sampling/createMessage` - */ -export interface CreateMessageResult extends Result, SamplingMessage { - /** - * The name of the model that generated the message. - */ - model: string; - /** - * The reason why sampling stopped, if known. - * - * Standard values: - * - "endTurn": Natural end of the assistant's turn - * - "stopSequence": A stop sequence was encountered - * - "maxTokens": Maximum token limit was reached - * - "toolUse": The model wants to use one or more tools - * - * This field is an open string to allow for provider-specific stop reasons. - */ - stopReason?: "endTurn" | "stopSequence" | "maxTokens" | "toolUse" | string; -} -/** - * Describes a message issued to or received from an LLM API. - * - * @category `sampling/createMessage` - */ -export interface SamplingMessage { - role: Role; - content: SamplingMessageContentBlock | SamplingMessageContentBlock[]; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -export type SamplingMessageContentBlock = TextContent | ImageContent | AudioContent | ToolUseContent | ToolResultContent; -/** - * Optional annotations for the client. The client can use annotations to inform how objects are used or displayed - * - * @category Common Types - */ -export interface Annotations { - /** - * Describes who the intended audience of this object or data is. - * - * It can include multiple entries to indicate content useful for multiple audiences (e.g., `["user", "assistant"]`). - */ - audience?: Role[]; - /** - * Describes how important this data is for operating the server. - * - * A value of 1 means "most important," and indicates that the data is - * effectively required, while 0 means "least important," and indicates that - * the data is entirely optional. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - priority?: number; - /** - * The moment the resource was last modified, as an ISO 8601 formatted string. - * - * Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z"). - * - * Examples: last activity timestamp in an open file, timestamp when the resource - * was attached, etc. - */ - lastModified?: string; -} -/** - * @category Content - */ -export type ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource; -/** - * Text provided to or from an LLM. - * - * @category Content - */ -export interface TextContent { - type: "text"; - /** - * The text content of the message. - */ - text: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * An image provided to or from an LLM. - * - * @category Content - */ -export interface ImageContent { - type: "image"; - /** - * The base64-encoded image data. - * - * @format byte - */ - data: string; - /** - * The MIME type of the image. Different providers may support different image types. - */ - mimeType: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * Audio provided to or from an LLM. - * - * @category Content - */ -export interface AudioContent { - type: "audio"; - /** - * The base64-encoded audio data. - * - * @format byte - */ - data: string; - /** - * The MIME type of the audio. Different providers may support different audio types. - */ - mimeType: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * A request from the assistant to call a tool. - * - * @category `sampling/createMessage` - */ -export interface ToolUseContent { - type: "tool_use"; - /** - * A unique identifier for this tool use. - * - * This ID is used to match tool results to their corresponding tool uses. - */ - id: string; - /** - * The name of the tool to call. - */ - name: string; - /** - * The arguments to pass to the tool, conforming to the tool's input schema. - */ - input: { - [key: string]: unknown; - }; - /** - * Optional metadata about the tool use. Clients SHOULD preserve this field when - * including tool uses in subsequent sampling requests to enable caching optimizations. - * - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * The result of a tool use, provided by the user back to the assistant. - * - * @category `sampling/createMessage` - */ -export interface ToolResultContent { - type: "tool_result"; - /** - * The ID of the tool use this result corresponds to. - * - * This MUST match the ID from a previous ToolUseContent. - */ - toolUseId: string; - /** - * The unstructured result content of the tool use. - * - * This has the same format as CallToolResult.content and can include text, images, - * audio, resource links, and embedded resources. - */ - content: ContentBlock[]; - /** - * An optional structured result object. - * - * If the tool defined an outputSchema, this SHOULD conform to that schema. - */ - structuredContent?: { - [key: string]: unknown; - }; - /** - * Whether the tool use resulted in an error. - * - * If true, the content typically describes the error that occurred. - * Default: false - */ - isError?: boolean; - /** - * Optional metadata about the tool result. Clients SHOULD preserve this field when - * including tool results in subsequent sampling requests to enable caching optimizations. - * - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * The server's preferences for model selection, requested of the client during sampling. - * - * Because LLMs can vary along multiple dimensions, choosing the "best" model is - * rarely straightforward. Different models excel in different areas—some are - * faster but less capable, others are more capable but more expensive, and so - * on. This interface allows servers to express their priorities across multiple - * dimensions to help clients make an appropriate selection for their use case. - * - * These preferences are always advisory. The client MAY ignore them. It is also - * up to the client to decide how to interpret these preferences and how to - * balance them against other considerations. - * - * @category `sampling/createMessage` - */ -export interface ModelPreferences { - /** - * Optional hints to use for model selection. - * - * If multiple hints are specified, the client MUST evaluate them in order - * (such that the first match is taken). - * - * The client SHOULD prioritize these hints over the numeric priorities, but - * MAY still use the priorities to select from ambiguous matches. - */ - hints?: ModelHint[]; - /** - * How much to prioritize cost when selecting a model. A value of 0 means cost - * is not important, while a value of 1 means cost is the most important - * factor. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - costPriority?: number; - /** - * How much to prioritize sampling speed (latency) when selecting a model. A - * value of 0 means speed is not important, while a value of 1 means speed is - * the most important factor. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - speedPriority?: number; - /** - * How much to prioritize intelligence and capabilities when selecting a - * model. A value of 0 means intelligence is not important, while a value of 1 - * means intelligence is the most important factor. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - intelligencePriority?: number; -} -/** - * Hints to use for model selection. - * - * Keys not declared here are currently left unspecified by the spec and are up - * to the client to interpret. - * - * @category `sampling/createMessage` - */ -export interface ModelHint { - /** - * A hint for a model name. - * - * The client SHOULD treat this as a substring of a model name; for example: - * - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022` - * - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc. - * - `claude` should match any Claude model - * - * The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example: - * - `gemini-1.5-flash` could match `claude-3-haiku-20240307` - */ - name?: string; -} -/** - * Parameters for a `completion/complete` request. - * - * @category `completion/complete` - */ -export interface CompleteRequestParams extends RequestParams { - ref: PromptReference | ResourceTemplateReference; - /** - * The argument's information - */ - argument: { - /** - * The name of the argument - */ - name: string; - /** - * The value of the argument to use for completion matching. - */ - value: string; - }; - /** - * Additional, optional context for completions - */ - context?: { - /** - * Previously-resolved variables in a URI template or prompt. - */ - arguments?: { - [key: string]: string; - }; - }; -} -/** - * A request from the client to the server, to ask for completion options. - * - * @category `completion/complete` - */ -export interface CompleteRequest extends JSONRPCRequest { - method: "completion/complete"; - params: CompleteRequestParams; -} -/** - * The server's response to a completion/complete request - * - * @category `completion/complete` - */ -export interface CompleteResult extends Result { - completion: { - /** - * An array of completion values. Must not exceed 100 items. - */ - values: string[]; - /** - * The total number of completion options available. This can exceed the number of values actually sent in the response. - */ - total?: number; - /** - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. - */ - hasMore?: boolean; - }; -} -/** - * A reference to a resource or resource template definition. - * - * @category `completion/complete` - */ -export interface ResourceTemplateReference { - type: "ref/resource"; - /** - * The URI or URI template of the resource. - * - * @format uri-template - */ - uri: string; -} -/** - * Identifies a prompt. - * - * @category `completion/complete` - */ -export interface PromptReference extends BaseMetadata { - type: "ref/prompt"; -} -/** - * Sent from the server to request a list of root URIs from the client. Roots allow - * servers to ask for specific directories or files to operate on. A common example - * for roots is providing a set of repositories or directories a server should operate - * on. - * - * This request is typically used when the server needs to understand the file system - * structure or access specific locations that the client has permission to read from. - * - * @category `roots/list` - */ -export interface ListRootsRequest extends JSONRPCRequest { - method: "roots/list"; - params?: RequestParams; -} -/** - * The client's response to a roots/list request from the server. - * This result contains an array of Root objects, each representing a root directory - * or file that the server can operate on. - * - * @category `roots/list` - */ -export interface ListRootsResult extends Result { - roots: Root[]; -} -/** - * Represents a root directory or file that the server can operate on. - * - * @category `roots/list` - */ -export interface Root { - /** - * The URI identifying the root. This *must* start with file:// for now. - * This restriction may be relaxed in future versions of the protocol to allow - * other URI schemes. - * - * @format uri - */ - uri: string; - /** - * An optional name for the root. This can be used to provide a human-readable - * identifier for the root, which may be useful for display purposes or for - * referencing the root in other parts of the application. - */ - name?: string; - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta?: { - [key: string]: unknown; - }; -} -/** - * A notification from the client to the server, informing it that the list of roots has changed. - * This notification should be sent whenever the client adds, removes, or modifies any root. - * The server should then request an updated list of roots using the ListRootsRequest. - * - * @category `notifications/roots/list_changed` - */ -export interface RootsListChangedNotification extends JSONRPCNotification { - method: "notifications/roots/list_changed"; - params?: NotificationParams; -} -/** - * The parameters for a request to elicit non-sensitive information from the user via a form in the client. - * - * @category `elicitation/create` - */ -export interface ElicitRequestFormParams extends TaskAugmentedRequestParams { - /** - * The elicitation mode. - */ - mode?: "form"; - /** - * The message to present to the user describing what information is being requested. - */ - message: string; - /** - * A restricted subset of JSON Schema. - * Only top-level properties are allowed, without nesting. - */ - requestedSchema: { - $schema?: string; - type: "object"; - properties: { - [key: string]: PrimitiveSchemaDefinition; - }; - required?: string[]; - }; -} -/** - * The parameters for a request to elicit information from the user via a URL in the client. - * - * @category `elicitation/create` - */ -export interface ElicitRequestURLParams extends TaskAugmentedRequestParams { - /** - * The elicitation mode. - */ - mode: "url"; - /** - * The message to present to the user explaining why the interaction is needed. - */ - message: string; - /** - * The ID of the elicitation, which must be unique within the context of the server. - * The client MUST treat this ID as an opaque value. - */ - elicitationId: string; - /** - * The URL that the user should navigate to. - * - * @format uri - */ - url: string; -} -/** - * The parameters for a request to elicit additional information from the user via the client. - * - * @category `elicitation/create` - */ -export type ElicitRequestParams = ElicitRequestFormParams | ElicitRequestURLParams; -/** - * A request from the server to elicit additional information from the user via the client. - * - * @category `elicitation/create` - */ -export interface ElicitRequest extends JSONRPCRequest { - method: "elicitation/create"; - params: ElicitRequestParams; -} -/** - * Restricted schema definitions that only allow primitive types - * without nested objects or arrays. - * - * @category `elicitation/create` - */ -export type PrimitiveSchemaDefinition = StringSchema | NumberSchema | BooleanSchema | EnumSchema; -/** - * @category `elicitation/create` - */ -export interface StringSchema { - type: "string"; - title?: string; - description?: string; - minLength?: number; - maxLength?: number; - format?: "email" | "uri" | "date" | "date-time"; - default?: string; -} -/** - * @category `elicitation/create` - */ -export interface NumberSchema { - type: "number" | "integer"; - title?: string; - description?: string; - minimum?: number; - maximum?: number; - default?: number; -} -/** - * @category `elicitation/create` - */ -export interface BooleanSchema { - type: "boolean"; - title?: string; - description?: string; - default?: boolean; -} -/** - * Schema for single-selection enumeration without display titles for options. - * - * @category `elicitation/create` - */ -export interface UntitledSingleSelectEnumSchema { - type: "string"; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Array of enum values to choose from. - */ - enum: string[]; - /** - * Optional default value. - */ - default?: string; -} -/** - * Schema for single-selection enumeration with display titles for each option. - * - * @category `elicitation/create` - */ -export interface TitledSingleSelectEnumSchema { - type: "string"; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Array of enum options with values and display labels. - */ - oneOf: Array<{ - /** - * The enum value. - */ - const: string; - /** - * Display label for this option. - */ - title: string; - }>; - /** - * Optional default value. - */ - default?: string; -} -/** - * @category `elicitation/create` - */ -export type SingleSelectEnumSchema = UntitledSingleSelectEnumSchema | TitledSingleSelectEnumSchema; -/** - * Schema for multiple-selection enumeration without display titles for options. - * - * @category `elicitation/create` - */ -export interface UntitledMultiSelectEnumSchema { - type: "array"; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Minimum number of items to select. - */ - minItems?: number; - /** - * Maximum number of items to select. - */ - maxItems?: number; - /** - * Schema for the array items. - */ - items: { - type: "string"; - /** - * Array of enum values to choose from. - */ - enum: string[]; - }; - /** - * Optional default value. - */ - default?: string[]; -} -/** - * Schema for multiple-selection enumeration with display titles for each option. - * - * @category `elicitation/create` - */ -export interface TitledMultiSelectEnumSchema { - type: "array"; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Minimum number of items to select. - */ - minItems?: number; - /** - * Maximum number of items to select. - */ - maxItems?: number; - /** - * Schema for array items with enum options and display labels. - */ - items: { - /** - * Array of enum options with values and display labels. - */ - anyOf: Array<{ - /** - * The constant enum value. - */ - const: string; - /** - * Display title for this option. - */ - title: string; - }>; - }; - /** - * Optional default value. - */ - default?: string[]; -} -/** - * @category `elicitation/create` - */ -export type MultiSelectEnumSchema = UntitledMultiSelectEnumSchema | TitledMultiSelectEnumSchema; -/** - * Use TitledSingleSelectEnumSchema instead. - * This interface will be removed in a future version. - * - * @category `elicitation/create` - */ -export interface LegacyTitledEnumSchema { - type: "string"; - title?: string; - description?: string; - enum: string[]; - /** - * (Legacy) Display names for enum values. - * Non-standard according to JSON schema 2020-12. - */ - enumNames?: string[]; - default?: string; -} -/** - * @category `elicitation/create` - */ -export type EnumSchema = SingleSelectEnumSchema | MultiSelectEnumSchema | LegacyTitledEnumSchema; -/** - * The client's response to an elicitation request. - * - * @category `elicitation/create` - */ -export interface ElicitResult extends Result { - /** - * The user action in response to the elicitation. - * - "accept": User submitted the form/confirmed the action - * - "decline": User explicitly decline the action - * - "cancel": User dismissed without making an explicit choice - */ - action: "accept" | "decline" | "cancel"; - /** - * The submitted form data, only present when action is "accept" and mode was "form". - * Contains values matching the requested schema. - * Omitted for out-of-band mode responses. - */ - content?: { - [key: string]: string | number | boolean | string[]; - }; -} -/** - * An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request. - * - * @category `notifications/elicitation/complete` - */ -export interface ElicitationCompleteNotification extends JSONRPCNotification { - method: "notifications/elicitation/complete"; - params: { - /** - * The ID of the elicitation that completed. - */ - elicitationId: string; - }; -} -/** @internal */ -export type ClientRequest = PingRequest | InitializeRequest | CompleteRequest | SetLevelRequest | GetPromptRequest | ListPromptsRequest | ListResourcesRequest | ListResourceTemplatesRequest | ReadResourceRequest | SubscribeRequest | UnsubscribeRequest | CallToolRequest | ListToolsRequest | GetTaskRequest | GetTaskPayloadRequest | ListTasksRequest | CancelTaskRequest; -/** @internal */ -export type ClientNotification = CancelledNotification | ProgressNotification | InitializedNotification | RootsListChangedNotification | TaskStatusNotification; -/** @internal */ -export type ClientResult = EmptyResult | CreateMessageResult | ListRootsResult | ElicitResult | GetTaskResult | GetTaskPayloadResult | ListTasksResult | CancelTaskResult; -/** @internal */ -export type ServerRequest = PingRequest | CreateMessageRequest | ListRootsRequest | ElicitRequest | GetTaskRequest | GetTaskPayloadRequest | ListTasksRequest | CancelTaskRequest; -/** @internal */ -export type ServerNotification = CancelledNotification | ProgressNotification | LoggingMessageNotification | ResourceUpdatedNotification | ResourceListChangedNotification | ToolListChangedNotification | PromptListChangedNotification | ElicitationCompleteNotification | TaskStatusNotification; -/** @internal */ -export type ServerResult = EmptyResult | InitializeResult | CompleteResult | GetPromptResult | ListPromptsResult | ListResourceTemplatesResult | ListResourcesResult | ReadResourceResult | CallToolResult | ListToolsResult | GetTaskResult | GetTaskPayloadResult | ListTasksResult | CancelTaskResult; -//# sourceMappingURL=spec.types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.d.ts.map deleted file mode 100644 index 7e4fb0e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"spec.types.d.ts","sourceRoot":"","sources":["../../src/spec.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GACtB,cAAc,GACd,mBAAmB,GACnB,eAAe,CAAC;AAEpB,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AACvD,gBAAgB;AAChB,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B;;;;GAIG;AACH,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AACD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE;QACN;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAED,gBAAgB;AAChB,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACjC;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACpC;AAED,gBAAgB;AAChB,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA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B,GACpB,4BAA4B,GAC5B,mBAAmB,GACnB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,qBAAqB,GACrB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,gBAAgB;AAChB,MAAM,MAAM,kBAAkB,GAC1B,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GACvB,4BAA4B,GAC5B,sBAAsB,CAAC;AAE3B,gBAAgB;AAChB,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,mBAAmB,GACnB,eAAe,GACf,YAAY,GACZ,aAAa,GACb,oBAAoB,GACpB,eAAe,GACf,gBAAgB,CAAC;AAGrB,gBAAgB;AAChB,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,oBAAoB,GACpB,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,qBAAqB,GACrB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,gBAAgB;AAChB,MAAM,MAAM,kBAAkB,GAC1B,qBAAqB,GACrB,oBAAoB,GACpB,0BAA0B,GAC1B,2BAA2B,GAC3B,+BAA+B,GAC/B,2BAA2B,GAC3B,6BAA6B,GAC7B,+BAA+B,GAC/B,sBAAsB,CAAC;AAE3B,gBAAgB;AAChB,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,2BAA2B,GAC3B,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,aAAa,GACb,oBAAoB,GACpB,eAAe,GACf,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.js deleted file mode 100644 index 7d0bd05..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file is automatically generated from the Model Context Protocol specification. - * - * Source: https://github.com/modelcontextprotocol/modelcontextprotocol - * Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts - * Last updated from commit: 35fa160caf287a9c48696e3ae452c0645c713669 - * - * DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates. - * To update this file, run: npm run fetch:spec-types - */ /* JSON-RPC types */ -/** @internal */ -export const LATEST_PROTOCOL_VERSION = "DRAFT-2026-v1"; -/** @internal */ -export const JSONRPC_VERSION = "2.0"; -// Standard JSON-RPC error codes -export const PARSE_ERROR = -32700; -export const INVALID_REQUEST = -32600; -export const METHOD_NOT_FOUND = -32601; -export const INVALID_PARAMS = -32602; -export const INTERNAL_ERROR = -32603; -// Implementation-specific JSON-RPC error codes [-32000, -32099] -/** @internal */ -export const URL_ELICITATION_REQUIRED = -32042; -//# sourceMappingURL=spec.types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.js.map deleted file mode 100644 index 02dadb9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"spec.types.js","sourceRoot":"","sources":["../../src/spec.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG,CAAA,oBAAoB;AAYvB,gBAAgB;AAChB,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC;AACvD,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AA4JrC,gCAAgC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAK,CAAC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,CAAC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,CAAC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,CAAC;AAErC,gEAAgE;AAChE,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/types.d.ts deleted file mode 100644 index 55f087e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/types.d.ts +++ /dev/null @@ -1,8133 +0,0 @@ -import * as z from 'zod/v4'; -import { AuthInfo } from './server/auth/types.js'; -export declare const LATEST_PROTOCOL_VERSION = "2025-11-25"; -export declare const DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26"; -export declare const SUPPORTED_PROTOCOL_VERSIONS: string[]; -export declare const RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task"; -export declare const JSONRPC_VERSION = "2.0"; -/** - * Utility types - */ -type ExpandRecursively = T extends object ? (T extends infer O ? { - [K in keyof O]: ExpandRecursively; -} : never) : T; -/** - * A progress token, used to associate progress notifications with the original request. - */ -export declare const ProgressTokenSchema: z.ZodUnion; -/** - * An opaque token used to represent a cursor for pagination. - */ -export declare const CursorSchema: z.ZodString; -/** - * Task creation parameters, used to ask that the server create a task to represent a request. - */ -export declare const TaskCreationParamsSchema: z.ZodObject<{ - /** - * Time in milliseconds to keep task results available after completion. - * If null, the task has unlimited lifetime until manually cleaned up. - */ - ttl: z.ZodOptional>; - /** - * Time in milliseconds to wait between task status requests. - */ - pollInterval: z.ZodOptional; -}, z.core.$loose>; -export declare const TaskMetadataSchema: z.ZodObject<{ - ttl: z.ZodOptional; -}, z.core.$strip>; -/** - * Metadata for associating messages with a task. - * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`. - */ -export declare const RelatedTaskMetadataSchema: z.ZodObject<{ - taskId: z.ZodString; -}, z.core.$strip>; -declare const RequestMetaSchema: z.ZodObject<{ - /** - * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. - */ - progressToken: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; -}, z.core.$loose>; -/** - * Common params for any request. - */ -declare const BaseRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strip>; -/** - * Common params for any task-augmented request. - */ -export declare const TaskAugmentedRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * Checks if a value is a valid TaskAugmentedRequestParams. - * @param value - The value to check. - * - * @returns True if the value is a valid TaskAugmentedRequestParams, false otherwise. - */ -export declare const isTaskAugmentedRequestParams: (value: unknown) => value is TaskAugmentedRequestParams; -export declare const RequestSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$strip>; -declare const NotificationsParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strip>; -export declare const NotificationSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$strip>; -export declare const ResultSchema: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$loose>; -/** - * A uniquely identifying ID for a request in JSON-RPC. - */ -export declare const RequestIdSchema: z.ZodUnion; -/** - * A request that expects a response. - */ -export declare const JSONRPCRequestSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodUnion; -}, z.core.$strict>; -export declare const isJSONRPCRequest: (value: unknown) => value is JSONRPCRequest; -/** - * A notification which does not expect a response. - */ -export declare const JSONRPCNotificationSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - jsonrpc: z.ZodLiteral<"2.0">; -}, z.core.$strict>; -export declare const isJSONRPCNotification: (value: unknown) => value is JSONRPCNotification; -/** - * A successful (non-error) response to a request. - */ -export declare const JSONRPCResultResponseSchema: z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodUnion; - result: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>; -}, z.core.$strict>; -/** - * Checks if a value is a valid JSONRPCResultResponse. - * @param value - The value to check. - * - * @returns True if the value is a valid JSONRPCResultResponse, false otherwise. - */ -export declare const isJSONRPCResultResponse: (value: unknown) => value is JSONRPCResultResponse; -/** - * @deprecated Use {@link isJSONRPCResultResponse} instead. - * - * Please note that {@link JSONRPCResponse} is a union of {@link JSONRPCResultResponse} and {@link JSONRPCErrorResponse} as per the updated JSON-RPC specification. (was previously just {@link JSONRPCResultResponse}) - */ -export declare const isJSONRPCResponse: (value: unknown) => value is JSONRPCResultResponse; -/** - * Error codes defined by the JSON-RPC specification. - */ -export declare enum ErrorCode { - ConnectionClosed = -32000, - RequestTimeout = -32001, - ParseError = -32700, - InvalidRequest = -32600, - MethodNotFound = -32601, - InvalidParams = -32602, - InternalError = -32603, - UrlElicitationRequired = -32042 -} -/** - * A response to a request that indicates an error occurred. - */ -export declare const JSONRPCErrorResponseSchema: z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodOptional>; - error: z.ZodObject<{ - code: z.ZodNumber; - message: z.ZodString; - data: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strict>; -/** - * @deprecated Use {@link JSONRPCErrorResponseSchema} instead. - */ -export declare const JSONRPCErrorSchema: z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodOptional>; - error: z.ZodObject<{ - code: z.ZodNumber; - message: z.ZodString; - data: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strict>; -/** - * Checks if a value is a valid JSONRPCErrorResponse. - * @param value - The value to check. - * - * @returns True if the value is a valid JSONRPCErrorResponse, false otherwise. - */ -export declare const isJSONRPCErrorResponse: (value: unknown) => value is JSONRPCErrorResponse; -/** - * @deprecated Use {@link isJSONRPCErrorResponse} instead. - */ -export declare const isJSONRPCError: (value: unknown) => value is JSONRPCErrorResponse; -export declare const JSONRPCMessageSchema: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodUnion; -}, z.core.$strict>, z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - jsonrpc: z.ZodLiteral<"2.0">; -}, z.core.$strict>, z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodUnion; - result: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>; -}, z.core.$strict>, z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodOptional>; - error: z.ZodObject<{ - code: z.ZodNumber; - message: z.ZodString; - data: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strict>]>; -export declare const JSONRPCResponseSchema: z.ZodUnion; - id: z.ZodUnion; - result: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>; -}, z.core.$strict>, z.ZodObject<{ - jsonrpc: z.ZodLiteral<"2.0">; - id: z.ZodOptional>; - error: z.ZodObject<{ - code: z.ZodNumber; - message: z.ZodString; - data: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strict>]>; -/** - * A response that indicates success but carries no data. - */ -export declare const EmptyResultSchema: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strict>; -export declare const CancelledNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - requestId: z.ZodOptional>; - reason: z.ZodOptional; -}, z.core.$strip>; -/** - * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. - * - * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. - * - * This notification indicates that the result will be unused, so any associated processing SHOULD cease. - * - * A client MUST NOT attempt to cancel its `initialize` request. - */ -export declare const CancelledNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/cancelled">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - requestId: z.ZodOptional>; - reason: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Icon schema for use in tools, prompts, resources, and implementations. - */ -export declare const IconSchema: z.ZodObject<{ - src: z.ZodString; - mimeType: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; -}, z.core.$strip>; -/** - * Base schema to add `icons` property. - * - */ -export declare const IconsSchema: z.ZodObject<{ - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; -}, z.core.$strip>; -/** - * Base metadata interface for common properties across resources, tools, prompts, and implementations. - */ -export declare const BaseMetadataSchema: z.ZodObject<{ - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Describes the name and version of an MCP implementation. - */ -export declare const ImplementationSchema: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Task capabilities for clients, indicating which request types support task creation. - */ -export declare const ClientTasksCapabilitySchema: z.ZodObject<{ - /** - * Present if the client supports listing tasks. - */ - list: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$loose>; -/** - * Task capabilities for servers, indicating which request types support task creation. - */ -export declare const ServerTasksCapabilitySchema: z.ZodObject<{ - /** - * Present if the server supports listing tasks. - */ - list: z.ZodOptional>; - /** - * Present if the server supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$loose>; -/** - * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. - */ -export declare const ClientCapabilitiesSchema: z.ZodObject<{ - experimental: z.ZodOptional>>; - sampling: z.ZodOptional>; - tools: z.ZodOptional>; - }, z.core.$strip>>; - elicitation: z.ZodOptional, z.ZodIntersection; - }, z.core.$strip>, z.ZodRecord>>; - url: z.ZodOptional>; - }, z.core.$strip>, z.ZodOptional>>>>; - roots: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$strip>; -export declare const InitializeRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - sampling: z.ZodOptional>; - tools: z.ZodOptional>; - }, z.core.$strip>>; - elicitation: z.ZodOptional, z.ZodIntersection; - }, z.core.$strip>, z.ZodRecord>>; - url: z.ZodOptional>; - }, z.core.$strip>, z.ZodOptional>>>>; - roots: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - clientInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * This request is sent from the client to the server when it first connects, asking it to begin initialization. - */ -export declare const InitializeRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"initialize">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - sampling: z.ZodOptional>; - tools: z.ZodOptional>; - }, z.core.$strip>>; - elicitation: z.ZodOptional, z.ZodIntersection; - }, z.core.$strip>, z.ZodRecord>>; - url: z.ZodOptional>; - }, z.core.$strip>, z.ZodOptional>>>>; - roots: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - clientInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const isInitializeRequest: (value: unknown) => value is InitializeRequest; -/** - * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. - */ -export declare const ServerCapabilitiesSchema: z.ZodObject<{ - experimental: z.ZodOptional>>; - logging: z.ZodOptional>; - completions: z.ZodOptional>; - prompts: z.ZodOptional; - }, z.core.$strip>>; - resources: z.ZodOptional; - listChanged: z.ZodOptional; - }, z.core.$strip>>; - tools: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the server supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; -}, z.core.$strip>; -/** - * After receiving an initialize request from the client, the server sends this response. - */ -export declare const InitializeResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - logging: z.ZodOptional>; - completions: z.ZodOptional>; - prompts: z.ZodOptional; - }, z.core.$strip>>; - resources: z.ZodOptional; - listChanged: z.ZodOptional; - }, z.core.$strip>>; - tools: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the server supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - serverInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; - instructions: z.ZodOptional; -}, z.core.$loose>; -/** - * This notification is sent from the client to the server after initialization has finished. - */ -export declare const InitializedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/initialized">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const isInitializedNotification: (value: unknown) => value is InitializedNotification; -/** - * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. - */ -export declare const PingRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"ping">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const ProgressSchema: z.ZodObject<{ - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; -}, z.core.$strip>; -export declare const ProgressNotificationParamsSchema: z.ZodObject<{ - progressToken: z.ZodUnion; - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strip>; -/** - * An out-of-band notification used to inform the receiver of a progress update for a long-running request. - * - * @category notifications/progress - */ -export declare const ProgressNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/progress">; - params: z.ZodObject<{ - progressToken: z.ZodUnion; - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const PaginatedRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; -}, z.core.$strip>; -export declare const PaginatedRequestSchema: z.ZodObject<{ - method: z.ZodString; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const PaginatedResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; -}, z.core.$loose>; -/** - * The status of a task. - * */ -export declare const TaskStatusSchema: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; -}>; -/** - * A pollable state object associated with a request. - */ -export declare const TaskSchema: z.ZodObject<{ - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>; -/** - * Result returned when a task is created, containing the task data wrapped in a task field. - */ -export declare const CreateTaskResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodObject<{ - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$loose>; -/** - * Parameters for task status notification. - */ -export declare const TaskStatusNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>; -/** - * A notification sent when a task's status changes. - */ -export declare const TaskStatusNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/tasks/status">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * A request to get the state of a specific task. - */ -export declare const GetTaskRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"tasks/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The response to a tasks/get request. - */ -export declare const GetTaskResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>; -/** - * A request to get the result of a specific task. - */ -export declare const GetTaskPayloadRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"tasks/result">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The response to a tasks/result request. - * The structure matches the result type of the original request. - * For example, a tools/call task would return the CallToolResult structure. - * - */ -export declare const GetTaskPayloadResultSchema: z.ZodObject<{ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$loose>; -/** - * A request to list tasks. - */ -export declare const ListTasksRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tasks/list">; -}, z.core.$strip>; -/** - * The response to a tasks/list request. - */ -export declare const ListTasksResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tasks: z.ZodArray; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * A request to cancel a specific task. - */ -export declare const CancelTaskRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"tasks/cancel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The response to a tasks/cancel request. - */ -export declare const CancelTaskResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>; -/** - * The contents of a specific resource or sub-resource. - */ -export declare const ResourceContentsSchema: z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; -}, z.core.$strip>; -export declare const TextResourceContentsSchema: z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - text: z.ZodString; -}, z.core.$strip>; -export declare const BlobResourceContentsSchema: z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; -}, z.core.$strip>; -/** - * The sender or recipient of messages and data in a conversation. - */ -export declare const RoleSchema: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; -}>; -/** - * Optional annotations providing clients additional context about a resource. - */ -export declare const AnnotationsSchema: z.ZodObject<{ - audience: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; -}, z.core.$strip>; -/** - * A known resource that the server is capable of reading. - */ -export declare const ResourceSchema: z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * A template description for resources available on the server. - */ -export declare const ResourceTemplateSchema: z.ZodObject<{ - uriTemplate: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Sent from the client to request a list of resources the server has. - */ -export declare const ListResourcesRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"resources/list">; -}, z.core.$strip>; -/** - * The server's response to a resources/list request from the client. - */ -export declare const ListResourcesResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - resources: z.ZodArray; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * Sent from the client to request a list of resource templates the server has. - */ -export declare const ListResourceTemplatesRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"resources/templates/list">; -}, z.core.$strip>; -/** - * The server's response to a resources/templates/list request from the client. - */ -export declare const ListResourceTemplatesResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - resourceTemplates: z.ZodArray; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -export declare const ResourceRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Parameters for a `resources/read` request. - */ -export declare const ReadResourceRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Sent from the client to the server, to read a specific resource URI. - */ -export declare const ReadResourceRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"resources/read">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The server's response to a resources/read request from the client. - */ -export declare const ReadResourceResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - contents: z.ZodArray; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>>; -}, z.core.$loose>; -/** - * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. - */ -export declare const ResourceListChangedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/resources/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const SubscribeRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. - */ -export declare const SubscribeRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"resources/subscribe">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -export declare const UnsubscribeRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. - */ -export declare const UnsubscribeRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"resources/unsubscribe">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Parameters for a `notifications/resources/updated` notification. - */ -export declare const ResourceUpdatedNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; -}, z.core.$strip>; -/** - * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. - */ -export declare const ResourceUpdatedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/resources/updated">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Describes an argument that a prompt can accept. - */ -export declare const PromptArgumentSchema: z.ZodObject<{ - name: z.ZodString; - description: z.ZodOptional; - required: z.ZodOptional; -}, z.core.$strip>; -/** - * A prompt or prompt template that the server offers. - */ -export declare const PromptSchema: z.ZodObject<{ - description: z.ZodOptional; - arguments: z.ZodOptional; - required: z.ZodOptional; - }, z.core.$strip>>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Sent from the client to request a list of prompts and prompt templates the server has. - */ -export declare const ListPromptsRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"prompts/list">; -}, z.core.$strip>; -/** - * The server's response to a prompts/list request from the client. - */ -export declare const ListPromptsResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - prompts: z.ZodArray; - arguments: z.ZodOptional; - required: z.ZodOptional; - }, z.core.$strip>>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * Parameters for a `prompts/get` request. - */ -export declare const GetPromptRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - name: z.ZodString; - arguments: z.ZodOptional>; -}, z.core.$strip>; -/** - * Used by the client to get a prompt provided by the server. - */ -export declare const GetPromptRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"prompts/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - name: z.ZodString; - arguments: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Text provided to or from an LLM. - */ -export declare const TextContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * An image provided to or from an LLM. - */ -export declare const ImageContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * An Audio provided to or from an LLM. - */ -export declare const AudioContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * A tool call request from an assistant (LLM). - * Represents the assistant's request to use a tool. - */ -export declare const ToolUseContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * The contents of a resource, embedded into a prompt or tool call result. - */ -export declare const EmbeddedResourceSchema: z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * A resource that the server is capable of reading, included in a prompt or tool call result. - * - * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. - */ -export declare const ResourceLinkSchema: z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; -}, z.core.$strip>; -/** - * A content block that can be used in prompts and tool results. - */ -export declare const ContentBlockSchema: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>]>; -/** - * Describes a message returned as part of a prompt. - */ -export declare const PromptMessageSchema: z.ZodObject<{ - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; -}, z.core.$strip>; -/** - * The server's response to a prompts/get request from the client. - */ -export declare const GetPromptResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - description: z.ZodOptional; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. - */ -export declare const PromptListChangedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/prompts/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * Additional properties describing a Tool to clients. - * - * NOTE: all properties in ToolAnnotations are **hints**. - * They are not guaranteed to provide a faithful description of - * tool behavior (including descriptive properties like `title`). - * - * Clients should never make tool use decisions based on ToolAnnotations - * received from untrusted servers. - */ -export declare const ToolAnnotationsSchema: z.ZodObject<{ - title: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; -}, z.core.$strip>; -/** - * Execution-related properties for a tool. - */ -export declare const ToolExecutionSchema: z.ZodObject<{ - taskSupport: z.ZodOptional>; -}, z.core.$strip>; -/** - * Definition for a tool the client can call. - */ -export declare const ToolSchema: z.ZodObject<{ - description: z.ZodOptional; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; -}, z.core.$strip>; -/** - * Sent from the client to request a list of tools the server has. - */ -export declare const ListToolsRequestSchema: z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tools/list">; -}, z.core.$strip>; -/** - * The server's response to a tools/list request from the client. - */ -export declare const ListToolsResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tools: z.ZodArray; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * The server's response to a tool call. - */ -export declare const CallToolResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; -}, z.core.$loose>; -/** - * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. - */ -export declare const CompatibilityCallToolResultSchema: z.ZodUnion<[z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - toolResult: z.ZodUnknown; -}, z.core.$loose>]>; -/** - * Parameters for a `tools/call` request. - */ -export declare const CallToolRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - name: z.ZodString; - arguments: z.ZodOptional>; -}, z.core.$strip>; -/** - * Used by the client to invoke a tool provided by the server. - */ -export declare const CallToolRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"tools/call">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - name: z.ZodString; - arguments: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. - */ -export declare const ToolListChangedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/tools/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * Callback type for list changed notifications. - */ -export type ListChangedCallback = (error: Error | null, items: T[] | null) => void; -/** - * Base schema for list changed subscription options (without callback). - * Used internally for Zod validation of autoRefresh and debounceMs. - */ -export declare const ListChangedOptionsBaseSchema: z.ZodObject<{ - autoRefresh: z.ZodDefault; - debounceMs: z.ZodDefault; -}, z.core.$strip>; -/** - * Options for subscribing to list changed notifications. - * - * @typeParam T - The type of items in the list (Tool, Prompt, or Resource) - */ -export type ListChangedOptions = { - /** - * If true, the list will be refreshed automatically when a list changed notification is received. - * @default true - */ - autoRefresh?: boolean; - /** - * Debounce time in milliseconds. Set to 0 to disable. - * @default 300 - */ - debounceMs?: number; - /** - * Callback invoked when the list changes. - * - * If autoRefresh is true, items contains the updated list. - * If autoRefresh is false, items is null (caller should refresh manually). - */ - onChanged: ListChangedCallback; -}; -/** - * Configuration for list changed notification handlers. - * - * Use this to configure handlers for tools, prompts, and resources list changes - * when creating a client. - * - * Note: Handlers are only activated if the server advertises the corresponding - * `listChanged` capability (e.g., `tools.listChanged: true`). If the server - * doesn't advertise this capability, the handler will not be set up. - */ -export type ListChangedHandlers = { - /** - * Handler for tool list changes. - */ - tools?: ListChangedOptions; - /** - * Handler for prompt list changes. - */ - prompts?: ListChangedOptions; - /** - * Handler for resource list changes. - */ - resources?: ListChangedOptions; -}; -/** - * The severity of a log message. - */ -export declare const LoggingLevelSchema: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; -}>; -/** - * Parameters for a `logging/setLevel` request. - */ -export declare const SetLevelRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; -}, z.core.$strip>; -/** - * A request from the client to the server, to enable or adjust logging. - */ -export declare const SetLevelRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"logging/setLevel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Parameters for a `notifications/message` notification. - */ -export declare const LoggingMessageNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - logger: z.ZodOptional; - data: z.ZodUnknown; -}, z.core.$strip>; -/** - * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. - */ -export declare const LoggingMessageNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/message">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - logger: z.ZodOptional; - data: z.ZodUnknown; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Hints to use for model selection. - */ -export declare const ModelHintSchema: z.ZodObject<{ - name: z.ZodOptional; -}, z.core.$strip>; -/** - * The server's preferences for model selection, requested of the client during sampling. - */ -export declare const ModelPreferencesSchema: z.ZodObject<{ - hints: z.ZodOptional; - }, z.core.$strip>>>; - costPriority: z.ZodOptional; - speedPriority: z.ZodOptional; - intelligencePriority: z.ZodOptional; -}, z.core.$strip>; -/** - * Controls tool usage behavior in sampling requests. - */ -export declare const ToolChoiceSchema: z.ZodObject<{ - mode: z.ZodOptional>; -}, z.core.$strip>; -/** - * The result of a tool execution, provided by the user (server). - * Represents the outcome of invoking a tool requested via ToolUseContent. - */ -export declare const ToolResultContentSchema: z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * Basic content types for sampling responses (without tool use). - * Used for backwards-compatible CreateMessageResult when tools are not used. - */ -export declare const SamplingContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>]>; -/** - * Content block types allowed in sampling messages. - * This includes text, image, audio, tool use requests, and tool results. - */ -export declare const SamplingMessageContentBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; -}, z.core.$strip>]>; -/** - * Describes a message issued to or received from an LLM API. - */ -export declare const SamplingMessageSchema: z.ZodObject<{ - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * Parameters for a `sampling/createMessage` request. - */ -export declare const CreateMessageRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; - _meta: z.ZodOptional>; - }, z.core.$strip>>; - modelPreferences: z.ZodOptional; - }, z.core.$strip>>>; - costPriority: z.ZodOptional; - speedPriority: z.ZodOptional; - intelligencePriority: z.ZodOptional; - }, z.core.$strip>>; - systemPrompt: z.ZodOptional; - includeContext: z.ZodOptional>; - temperature: z.ZodOptional; - maxTokens: z.ZodNumber; - stopSequences: z.ZodOptional>; - metadata: z.ZodOptional>; - tools: z.ZodOptional; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>>; - toolChoice: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. - */ -export declare const CreateMessageRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"sampling/createMessage">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; - _meta: z.ZodOptional>; - }, z.core.$strip>>; - modelPreferences: z.ZodOptional; - }, z.core.$strip>>>; - costPriority: z.ZodOptional; - speedPriority: z.ZodOptional; - intelligencePriority: z.ZodOptional; - }, z.core.$strip>>; - systemPrompt: z.ZodOptional; - includeContext: z.ZodOptional>; - temperature: z.ZodOptional; - maxTokens: z.ZodNumber; - stopSequences: z.ZodOptional>; - metadata: z.ZodOptional>; - tools: z.ZodOptional; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>>; - toolChoice: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The client's response to a sampling/create_message request from the server. - * This is the backwards-compatible version that returns single content (no arrays). - * Used when the request does not include tools. - */ -export declare const CreateMessageResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - model: z.ZodString; - stopReason: z.ZodOptional, z.ZodString]>>; - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodDiscriminatedUnion<[z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; -}, z.core.$loose>; -/** - * The client's response to a sampling/create_message request when tools were provided. - * This version supports array content for tool use flows. - */ -export declare const CreateMessageResultWithToolsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - model: z.ZodString; - stopReason: z.ZodOptional, z.ZodString]>>; - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; -}, z.core.$loose>; -/** - * Primitive schema definition for boolean fields. - */ -export declare const BooleanSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Primitive schema definition for string fields. - */ -export declare const StringSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Primitive schema definition for number fields. - */ -export declare const NumberSchemaSchema: z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Schema for single-selection enumeration without display titles for options. - */ -export declare const UntitledSingleSelectEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Schema for single-selection enumeration with display titles for each option. - */ -export declare const TitledSingleSelectEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; -}, z.core.$strip>; -/** - * Use TitledSingleSelectEnumSchema instead. - * This interface will be removed in a future version. - */ -export declare const LegacyTitledEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>; -export declare const SingleSelectEnumSchemaSchema: z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; -}, z.core.$strip>]>; -/** - * Schema for multiple-selection enumeration without display titles for options. - */ -export declare const UntitledMultiSelectEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>; -/** - * Schema for multiple-selection enumeration with display titles for each option. - */ -export declare const TitledMultiSelectEnumSchemaSchema: z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>; -/** - * Combined schema for multiple-selection enumeration - */ -export declare const MultiSelectEnumSchemaSchema: z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>]>; -/** - * Primitive schema definition for enum fields. - */ -export declare const EnumSchemaSchema: z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; -}, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>]>]>; -/** - * Union of all primitive schema definitions. - */ -export declare const PrimitiveSchemaDefinitionSchema: z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; -}, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; -}, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; -}, z.core.$strip>]>; -/** - * Parameters for an `elicitation/create` request for form-based elicitation. - */ -export declare const ElicitRequestFormParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodOptional>; - message: z.ZodString; - requestedSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodRecord; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; - }, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>]>>; - required: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * Parameters for an `elicitation/create` request for URL-based elicitation. - */ -export declare const ElicitRequestURLParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodLiteral<"url">; - message: z.ZodString; - elicitationId: z.ZodString; - url: z.ZodString; -}, z.core.$strip>; -/** - * The parameters for a request to elicit additional information from the user via the client. - */ -export declare const ElicitRequestParamsSchema: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodOptional>; - message: z.ZodString; - requestedSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodRecord; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; - }, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>]>>; - required: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodLiteral<"url">; - message: z.ZodString; - elicitationId: z.ZodString; - url: z.ZodString; -}, z.core.$strip>]>; -/** - * A request from the server to elicit user input via the client. - * The client should present the message and form fields to the user (form mode) - * or navigate to a URL (URL mode). - */ -export declare const ElicitRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"elicitation/create">; - params: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodOptional>; - message: z.ZodString; - requestedSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodRecord; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; - }, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>]>>; - required: z.ZodOptional>; - }, z.core.$strip>; - }, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodLiteral<"url">; - message: z.ZodString; - elicitationId: z.ZodString; - url: z.ZodString; - }, z.core.$strip>]>; -}, z.core.$strip>; -/** - * Parameters for a `notifications/elicitation/complete` notification. - * - * @category notifications/elicitation/complete - */ -export declare const ElicitationCompleteNotificationParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - elicitationId: z.ZodString; -}, z.core.$strip>; -/** - * A notification from the server to the client, informing it of a completion of an out-of-band elicitation request. - * - * @category notifications/elicitation/complete - */ -export declare const ElicitationCompleteNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/elicitation/complete">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - elicitationId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -/** - * The client's response to an elicitation/create request from the server. - */ -export declare const ElicitResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - action: z.ZodEnum<{ - cancel: "cancel"; - accept: "accept"; - decline: "decline"; - }>; - content: z.ZodPipe, z.ZodOptional]>>>>; -}, z.core.$loose>; -/** - * A reference to a resource or resource template definition. - */ -export declare const ResourceTemplateReferenceSchema: z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; -}, z.core.$strip>; -/** - * @deprecated Use ResourceTemplateReferenceSchema instead - */ -export declare const ResourceReferenceSchema: z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; -}, z.core.$strip>; -/** - * Identifies a prompt. - */ -export declare const PromptReferenceSchema: z.ZodObject<{ - type: z.ZodLiteral<"ref/prompt">; - name: z.ZodString; -}, z.core.$strip>; -/** - * Parameters for a `completion/complete` request. - */ -export declare const CompleteRequestParamsSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - ref: z.ZodUnion; - name: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; - }, z.core.$strip>]>; - argument: z.ZodObject<{ - name: z.ZodString; - value: z.ZodString; - }, z.core.$strip>; - context: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * A request from the client to the server, to ask for completion options. - */ -export declare const CompleteRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"completion/complete">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - ref: z.ZodUnion; - name: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; - }, z.core.$strip>]>; - argument: z.ZodObject<{ - name: z.ZodString; - value: z.ZodString; - }, z.core.$strip>; - context: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; -}, z.core.$strip>; -export declare function assertCompleteRequestPrompt(request: CompleteRequest): asserts request is CompleteRequestPrompt; -export declare function assertCompleteRequestResourceTemplate(request: CompleteRequest): asserts request is CompleteRequestResourceTemplate; -/** - * The server's response to a completion/complete request - */ -export declare const CompleteResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - completion: z.ZodObject<{ - /** - * An array of completion values. Must not exceed 100 items. - */ - values: z.ZodArray; - /** - * The total number of completion options available. This can exceed the number of values actually sent in the response. - */ - total: z.ZodOptional; - /** - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. - */ - hasMore: z.ZodOptional; - }, z.core.$loose>; -}, z.core.$loose>; -/** - * Represents a root directory or file that the server can operate on. - */ -export declare const RootSchema: z.ZodObject<{ - uri: z.ZodString; - name: z.ZodOptional; - _meta: z.ZodOptional>; -}, z.core.$strip>; -/** - * Sent from the server to request a list of root URIs from the client. - */ -export declare const ListRootsRequestSchema: z.ZodObject<{ - method: z.ZodLiteral<"roots/list">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -/** - * The client's response to a roots/list request from the server. - */ -export declare const ListRootsResultSchema: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - roots: z.ZodArray; - _meta: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$loose>; -/** - * A notification from the client to the server, informing it that the list of roots has changed. - */ -export declare const RootsListChangedNotificationSchema: z.ZodObject<{ - method: z.ZodLiteral<"notifications/roots/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>; -export declare const ClientRequestSchema: z.ZodUnion; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"initialize">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - sampling: z.ZodOptional>; - tools: z.ZodOptional>; - }, z.core.$strip>>; - elicitation: z.ZodOptional, z.ZodIntersection; - }, z.core.$strip>, z.ZodRecord>>; - url: z.ZodOptional>; - }, z.core.$strip>, z.ZodOptional>>>>; - roots: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the client supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - /** - * Task support for elicitation requests. - */ - elicitation: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - clientInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"completion/complete">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - ref: z.ZodUnion; - name: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"ref/resource">; - uri: z.ZodString; - }, z.core.$strip>]>; - argument: z.ZodObject<{ - name: z.ZodString; - value: z.ZodString; - }, z.core.$strip>; - context: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"logging/setLevel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"prompts/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - name: z.ZodString; - arguments: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"prompts/list">; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"resources/list">; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"resources/templates/list">; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"resources/read">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"resources/subscribe">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"resources/unsubscribe">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tools/call">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - name: z.ZodString; - arguments: z.ZodOptional>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tools/list">; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/result">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tasks/list">; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/cancel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>]>; -export declare const ClientNotificationSchema: z.ZodUnion; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - requestId: z.ZodOptional>; - reason: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/progress">; - params: z.ZodObject<{ - progressToken: z.ZodUnion; - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/initialized">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/roots/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/tasks/status">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>]>; -export declare const ClientResultSchema: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strict>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - model: z.ZodString; - stopReason: z.ZodOptional, z.ZodString]>>; - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodDiscriminatedUnion<[z.ZodObject<{ - type: z.ZodLiteral<"text">; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - model: z.ZodString; - stopReason: z.ZodOptional, z.ZodString]>>; - role: z.ZodEnum<{ - user: "user"; - assistant: "assistant"; - }>; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - action: z.ZodEnum<{ - cancel: "cancel"; - accept: "accept"; - decline: "decline"; - }>; - content: z.ZodPipe, z.ZodOptional]>>>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - roots: z.ZodArray; - _meta: z.ZodOptional>; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tasks: z.ZodArray; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodObject<{ - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$loose>]>; -export declare const ServerRequestSchema: z.ZodUnion; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"sampling/createMessage">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>, z.ZodArray; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_use">; - name: z.ZodString; - id: z.ZodString; - input: z.ZodRecord; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"tool_result">; - toolUseId: z.ZodString; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>]>; - _meta: z.ZodOptional>; - }, z.core.$strip>>; - modelPreferences: z.ZodOptional; - }, z.core.$strip>>>; - costPriority: z.ZodOptional; - speedPriority: z.ZodOptional; - intelligencePriority: z.ZodOptional; - }, z.core.$strip>>; - systemPrompt: z.ZodOptional; - includeContext: z.ZodOptional>; - temperature: z.ZodOptional; - maxTokens: z.ZodNumber; - stopSequences: z.ZodOptional>; - metadata: z.ZodOptional>; - tools: z.ZodOptional; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>>; - toolChoice: z.ZodOptional>; - }, z.core.$strip>>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"elicitation/create">; - params: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodOptional>; - message: z.ZodString; - requestedSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodRecord; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - enumNames: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - enum: z.ZodArray; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - oneOf: z.ZodArray>; - default: z.ZodOptional; - }, z.core.$strip>]>, z.ZodUnion; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - type: z.ZodLiteral<"string">; - enum: z.ZodArray; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"array">; - title: z.ZodOptional; - description: z.ZodOptional; - minItems: z.ZodOptional; - maxItems: z.ZodOptional; - items: z.ZodObject<{ - anyOf: z.ZodArray>; - }, z.core.$strip>; - default: z.ZodOptional>; - }, z.core.$strip>]>]>, z.ZodObject<{ - type: z.ZodLiteral<"boolean">; - title: z.ZodOptional; - description: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"string">; - title: z.ZodOptional; - description: z.ZodOptional; - minLength: z.ZodOptional; - maxLength: z.ZodOptional; - format: z.ZodOptional>; - default: z.ZodOptional; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodEnum<{ - number: "number"; - integer: "integer"; - }>; - title: z.ZodOptional; - description: z.ZodOptional; - minimum: z.ZodOptional; - maximum: z.ZodOptional; - default: z.ZodOptional; - }, z.core.$strip>]>>; - required: z.ZodOptional>; - }, z.core.$strip>; - }, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodOptional; - }, z.core.$strip>>; - mode: z.ZodLiteral<"url">; - message: z.ZodString; - elicitationId: z.ZodString; - url: z.ZodString; - }, z.core.$strip>]>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"roots/list">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/get">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/result">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - cursor: z.ZodOptional; - }, z.core.$strip>>; - method: z.ZodLiteral<"tasks/list">; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"tasks/cancel">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>]>; -export declare const ServerNotificationSchema: z.ZodUnion; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - requestId: z.ZodOptional>; - reason: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/progress">; - params: z.ZodObject<{ - progressToken: z.ZodUnion; - progress: z.ZodNumber; - total: z.ZodOptional; - message: z.ZodOptional; - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/message">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - level: z.ZodEnum<{ - error: "error"; - debug: "debug"; - info: "info"; - notice: "notice"; - warning: "warning"; - critical: "critical"; - alert: "alert"; - emergency: "emergency"; - }>; - logger: z.ZodOptional; - data: z.ZodUnknown; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/resources/updated">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - uri: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/resources/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/tools/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/prompts/list_changed">; - params: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$strip>>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/tasks/status">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>, z.ZodObject<{ - method: z.ZodLiteral<"notifications/elicitation/complete">; - params: z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - elicitationId: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>]>; -export declare const ServerResultSchema: z.ZodUnion>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; -}, z.core.$strict>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - protocolVersion: z.ZodString; - capabilities: z.ZodObject<{ - experimental: z.ZodOptional>>; - logging: z.ZodOptional>; - completions: z.ZodOptional>; - prompts: z.ZodOptional; - }, z.core.$strip>>; - resources: z.ZodOptional; - listChanged: z.ZodOptional; - }, z.core.$strip>>; - tools: z.ZodOptional; - }, z.core.$strip>>; - tasks: z.ZodOptional>; - /** - * Present if the server supports cancelling tasks. - */ - cancel: z.ZodOptional>; - /** - * Capabilities for task creation on specific request types. - */ - requests: z.ZodOptional>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$loose>>; - }, z.core.$strip>; - serverInfo: z.ZodObject<{ - version: z.ZodString; - websiteUrl: z.ZodOptional; - description: z.ZodOptional; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>; - instructions: z.ZodOptional; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - completion: z.ZodObject<{ - /** - * An array of completion values. Must not exceed 100 items. - */ - values: z.ZodArray; - /** - * The total number of completion options available. This can exceed the number of values actually sent in the response. - */ - total: z.ZodOptional; - /** - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. - */ - hasMore: z.ZodOptional; - }, z.core.$loose>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - description: z.ZodOptional; - messages: z.ZodArray; - content: z.ZodUnion; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - prompts: z.ZodArray; - arguments: z.ZodOptional; - required: z.ZodOptional; - }, z.core.$strip>>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - resources: z.ZodArray; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - resourceTemplates: z.ZodArray; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - contents: z.ZodArray; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - content: z.ZodDefault; - text: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"image">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"audio">; - data: z.ZodString; - mimeType: z.ZodString; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - description: z.ZodOptional; - mimeType: z.ZodOptional; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - type: z.ZodLiteral<"resource_link">; - }, z.core.$strip>, z.ZodObject<{ - type: z.ZodLiteral<"resource">; - resource: z.ZodUnion; - _meta: z.ZodOptional>; - text: z.ZodString; - }, z.core.$strip>, z.ZodObject<{ - uri: z.ZodString; - mimeType: z.ZodOptional; - _meta: z.ZodOptional>; - blob: z.ZodString; - }, z.core.$strip>]>; - annotations: z.ZodOptional>>; - priority: z.ZodOptional; - lastModified: z.ZodOptional; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - }, z.core.$strip>]>>>; - structuredContent: z.ZodOptional>; - isError: z.ZodOptional; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tools: z.ZodArray; - inputSchema: z.ZodObject<{ - type: z.ZodLiteral<"object">; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>; - outputSchema: z.ZodOptional; - properties: z.ZodOptional>>; - required: z.ZodOptional>; - }, z.core.$catchall>>; - annotations: z.ZodOptional; - readOnlyHint: z.ZodOptional; - destructiveHint: z.ZodOptional; - idempotentHint: z.ZodOptional; - openWorldHint: z.ZodOptional; - }, z.core.$strip>>; - execution: z.ZodOptional>; - }, z.core.$strip>>; - _meta: z.ZodOptional>; - icons: z.ZodOptional; - sizes: z.ZodOptional>; - theme: z.ZodOptional>; - }, z.core.$strip>>>; - name: z.ZodString; - title: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; -}, z.core.$strip>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - nextCursor: z.ZodOptional; - tasks: z.ZodArray; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$loose>, z.ZodObject<{ - _meta: z.ZodOptional>; - /** - * If specified, this request is related to the provided task. - */ - "io.modelcontextprotocol/related-task": z.ZodOptional>; - }, z.core.$loose>>; - task: z.ZodObject<{ - taskId: z.ZodString; - status: z.ZodEnum<{ - working: "working"; - input_required: "input_required"; - completed: "completed"; - failed: "failed"; - cancelled: "cancelled"; - }>; - ttl: z.ZodUnion; - createdAt: z.ZodString; - lastUpdatedAt: z.ZodString; - pollInterval: z.ZodOptional; - statusMessage: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$loose>]>; -export declare class McpError extends Error { - readonly code: number; - readonly data?: unknown; - constructor(code: number, message: string, data?: unknown); - /** - * Factory method to create the appropriate error type based on the error code and data - */ - static fromError(code: number, message: string, data?: unknown): McpError; -} -/** - * Specialized error type when a tool requires a URL mode elicitation. - * This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against. - */ -export declare class UrlElicitationRequiredError extends McpError { - constructor(elicitations: ElicitRequestURLParams[], message?: string); - get elicitations(): ElicitRequestURLParams[]; -} -type Primitive = string | number | boolean | bigint | null | undefined; -type Flatten = T extends Primitive ? T : T extends Array ? Array> : T extends Set ? Set> : T extends Map ? Map, Flatten> : T extends object ? { - [K in keyof T]: Flatten; -} : T; -type Infer = Flatten>; -/** - * Headers that are compatible with both Node.js and the browser. - */ -export type IsomorphicHeaders = Record; -/** - * Information about the incoming request. - */ -export interface RequestInfo { - /** - * The headers of the request. - */ - headers: IsomorphicHeaders; -} -/** - * Extra information about a message. - */ -export interface MessageExtraInfo { - /** - * The request information. - */ - requestInfo?: RequestInfo; - /** - * The authentication information. - */ - authInfo?: AuthInfo; - /** - * Callback to close the SSE stream for this request, triggering client reconnection. - * Only available when using StreamableHTTPServerTransport with eventStore configured. - */ - closeSSEStream?: () => void; - /** - * Callback to close the standalone GET SSE stream, triggering client reconnection. - * Only available when using StreamableHTTPServerTransport with eventStore configured. - */ - closeStandaloneSSEStream?: () => void; -} -export type ProgressToken = Infer; -export type Cursor = Infer; -export type Request = Infer; -export type TaskAugmentedRequestParams = Infer; -export type RequestMeta = Infer; -export type Notification = Infer; -export type Result = Infer; -export type RequestId = Infer; -export type JSONRPCRequest = Infer; -export type JSONRPCNotification = Infer; -export type JSONRPCResponse = Infer; -export type JSONRPCErrorResponse = Infer; -/** - * @deprecated Use {@link JSONRPCErrorResponse} instead. - * - * Please note that spec types have renamed {@link JSONRPCError} to {@link JSONRPCErrorResponse} as per the updated JSON-RPC specification. (was previously just {@link JSONRPCError}) and future versions will remove {@link JSONRPCError}. - */ -export type JSONRPCError = JSONRPCErrorResponse; -export type JSONRPCResultResponse = Infer; -export type JSONRPCMessage = Infer; -export type RequestParams = Infer; -export type NotificationParams = Infer; -export type EmptyResult = Infer; -export type CancelledNotificationParams = Infer; -export type CancelledNotification = Infer; -export type Icon = Infer; -export type Icons = Infer; -export type BaseMetadata = Infer; -export type Annotations = Infer; -export type Role = Infer; -export type Implementation = Infer; -export type ClientCapabilities = Infer; -export type InitializeRequestParams = Infer; -export type InitializeRequest = Infer; -export type ServerCapabilities = Infer; -export type InitializeResult = Infer; -export type InitializedNotification = Infer; -export type PingRequest = Infer; -export type Progress = Infer; -export type ProgressNotificationParams = Infer; -export type ProgressNotification = Infer; -export type Task = Infer; -export type TaskStatus = Infer; -export type TaskCreationParams = Infer; -export type TaskMetadata = Infer; -export type RelatedTaskMetadata = Infer; -export type CreateTaskResult = Infer; -export type TaskStatusNotificationParams = Infer; -export type TaskStatusNotification = Infer; -export type GetTaskRequest = Infer; -export type GetTaskResult = Infer; -export type GetTaskPayloadRequest = Infer; -export type ListTasksRequest = Infer; -export type ListTasksResult = Infer; -export type CancelTaskRequest = Infer; -export type CancelTaskResult = Infer; -export type GetTaskPayloadResult = Infer; -export type PaginatedRequestParams = Infer; -export type PaginatedRequest = Infer; -export type PaginatedResult = Infer; -export type ResourceContents = Infer; -export type TextResourceContents = Infer; -export type BlobResourceContents = Infer; -export type Resource = Infer; -export type ResourceTemplate = Infer; -export type ListResourcesRequest = Infer; -export type ListResourcesResult = Infer; -export type ListResourceTemplatesRequest = Infer; -export type ListResourceTemplatesResult = Infer; -export type ResourceRequestParams = Infer; -export type ReadResourceRequestParams = Infer; -export type ReadResourceRequest = Infer; -export type ReadResourceResult = Infer; -export type ResourceListChangedNotification = Infer; -export type SubscribeRequestParams = Infer; -export type SubscribeRequest = Infer; -export type UnsubscribeRequestParams = Infer; -export type UnsubscribeRequest = Infer; -export type ResourceUpdatedNotificationParams = Infer; -export type ResourceUpdatedNotification = Infer; -export type PromptArgument = Infer; -export type Prompt = Infer; -export type ListPromptsRequest = Infer; -export type ListPromptsResult = Infer; -export type GetPromptRequestParams = Infer; -export type GetPromptRequest = Infer; -export type TextContent = Infer; -export type ImageContent = Infer; -export type AudioContent = Infer; -export type ToolUseContent = Infer; -export type ToolResultContent = Infer; -export type EmbeddedResource = Infer; -export type ResourceLink = Infer; -export type ContentBlock = Infer; -export type PromptMessage = Infer; -export type GetPromptResult = Infer; -export type PromptListChangedNotification = Infer; -export type ToolAnnotations = Infer; -export type ToolExecution = Infer; -export type Tool = Infer; -export type ListToolsRequest = Infer; -export type ListToolsResult = Infer; -export type CallToolRequestParams = Infer; -export type CallToolResult = Infer; -export type CompatibilityCallToolResult = Infer; -export type CallToolRequest = Infer; -export type ToolListChangedNotification = Infer; -export type LoggingLevel = Infer; -export type SetLevelRequestParams = Infer; -export type SetLevelRequest = Infer; -export type LoggingMessageNotificationParams = Infer; -export type LoggingMessageNotification = Infer; -export type ToolChoice = Infer; -export type ModelHint = Infer; -export type ModelPreferences = Infer; -export type SamplingContent = Infer; -export type SamplingMessageContentBlock = Infer; -export type SamplingMessage = Infer; -export type CreateMessageRequestParams = Infer; -export type CreateMessageRequest = Infer; -export type CreateMessageResult = Infer; -export type CreateMessageResultWithTools = Infer; -/** - * CreateMessageRequestParams without tools - for backwards-compatible overload. - * Excludes tools/toolChoice to indicate they should not be provided. - */ -export type CreateMessageRequestParamsBase = Omit; -/** - * CreateMessageRequestParams with required tools - for tool-enabled overload. - */ -export interface CreateMessageRequestParamsWithTools extends CreateMessageRequestParams { - tools: Tool[]; -} -export type BooleanSchema = Infer; -export type StringSchema = Infer; -export type NumberSchema = Infer; -export type EnumSchema = Infer; -export type UntitledSingleSelectEnumSchema = Infer; -export type TitledSingleSelectEnumSchema = Infer; -export type LegacyTitledEnumSchema = Infer; -export type UntitledMultiSelectEnumSchema = Infer; -export type TitledMultiSelectEnumSchema = Infer; -export type SingleSelectEnumSchema = Infer; -export type MultiSelectEnumSchema = Infer; -export type PrimitiveSchemaDefinition = Infer; -export type ElicitRequestParams = Infer; -export type ElicitRequestFormParams = Infer; -export type ElicitRequestURLParams = Infer; -export type ElicitRequest = Infer; -export type ElicitationCompleteNotificationParams = Infer; -export type ElicitationCompleteNotification = Infer; -export type ElicitResult = Infer; -export type ResourceTemplateReference = Infer; -/** - * @deprecated Use ResourceTemplateReference instead - */ -export type ResourceReference = ResourceTemplateReference; -export type PromptReference = Infer; -export type CompleteRequestParams = Infer; -export type CompleteRequest = Infer; -export type CompleteRequestResourceTemplate = ExpandRecursively; -export type CompleteRequestPrompt = ExpandRecursively; -export type CompleteResult = Infer; -export type Root = Infer; -export type ListRootsRequest = Infer; -export type ListRootsResult = Infer; -export type RootsListChangedNotification = Infer; -export type ClientRequest = Infer; -export type ClientNotification = Infer; -export type ClientResult = Infer; -export type ServerRequest = Infer; -export type ServerNotification = Infer; -export type ServerResult = Infer; -export {}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/types.d.ts.map deleted file mode 100644 index 4745081..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,mCAAmC,eAAe,CAAC;AAChE,eAAO,MAAM,2BAA2B,UAAoF,CAAC;AAE7H,eAAO,MAAM,qBAAqB,yCAAyC,CAAC;AAG5E,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;GAEG;AACH,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,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AAkC,CAAC,CAAC;AAG5F,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG5D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js deleted file mode 100644 index 8edb88e..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +++ /dev/null @@ -1,2052 +0,0 @@ -import * as z from 'zod/v4'; -export const LATEST_PROTOCOL_VERSION = '2025-11-25'; -export const DEFAULT_NEGOTIATED_PROTOCOL_VERSION = '2025-03-26'; -export const SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, '2025-06-18', '2025-03-26', '2024-11-05', '2024-10-07']; -export const RELATED_TASK_META_KEY = 'io.modelcontextprotocol/related-task'; -/* JSON-RPC types */ -export const JSONRPC_VERSION = '2.0'; -/** - * Assert 'object' type schema. - * - * @internal - */ -const AssertObjectSchema = z.custom((v) => v !== null && (typeof v === 'object' || typeof v === 'function')); -/** - * A progress token, used to associate progress notifications with the original request. - */ -export const ProgressTokenSchema = z.union([z.string(), z.number().int()]); -/** - * An opaque token used to represent a cursor for pagination. - */ -export const CursorSchema = z.string(); -/** - * Task creation parameters, used to ask that the server create a task to represent a request. - */ -export const TaskCreationParamsSchema = z.looseObject({ - /** - * Time in milliseconds to keep task results available after completion. - * If null, the task has unlimited lifetime until manually cleaned up. - */ - ttl: z.union([z.number(), z.null()]).optional(), - /** - * Time in milliseconds to wait between task status requests. - */ - pollInterval: z.number().optional() -}); -export const TaskMetadataSchema = z.object({ - ttl: z.number().optional() -}); -/** - * Metadata for associating messages with a task. - * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`. - */ -export const RelatedTaskMetadataSchema = z.object({ - taskId: z.string() -}); -const RequestMetaSchema = z.looseObject({ - /** - * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. - */ - progressToken: ProgressTokenSchema.optional(), - /** - * If specified, this request is related to the provided task. - */ - [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional() -}); -/** - * Common params for any request. - */ -const BaseRequestParamsSchema = z.object({ - /** - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage. - */ - _meta: RequestMetaSchema.optional() -}); -/** - * Common params for any task-augmented request. - */ -export const TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * If specified, the caller is requesting task-augmented execution for this request. - * The request will return a CreateTaskResult immediately, and the actual result can be - * retrieved later via tasks/result. - * - * Task augmentation is subject to capability negotiation - receivers MUST declare support - * for task augmentation of specific request types in their capabilities. - */ - task: TaskMetadataSchema.optional() -}); -/** - * Checks if a value is a valid TaskAugmentedRequestParams. - * @param value - The value to check. - * - * @returns True if the value is a valid TaskAugmentedRequestParams, false otherwise. - */ -export const isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success; -export const RequestSchema = z.object({ - method: z.string(), - params: BaseRequestParamsSchema.loose().optional() -}); -const NotificationsParamsSchema = z.object({ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: RequestMetaSchema.optional() -}); -export const NotificationSchema = z.object({ - method: z.string(), - params: NotificationsParamsSchema.loose().optional() -}); -export const ResultSchema = z.looseObject({ - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: RequestMetaSchema.optional() -}); -/** - * A uniquely identifying ID for a request in JSON-RPC. - */ -export const RequestIdSchema = z.union([z.string(), z.number().int()]); -/** - * A request that expects a response. - */ -export const JSONRPCRequestSchema = z - .object({ - jsonrpc: z.literal(JSONRPC_VERSION), - id: RequestIdSchema, - ...RequestSchema.shape -}) - .strict(); -export const isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success; -/** - * A notification which does not expect a response. - */ -export const JSONRPCNotificationSchema = z - .object({ - jsonrpc: z.literal(JSONRPC_VERSION), - ...NotificationSchema.shape -}) - .strict(); -export const isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success; -/** - * A successful (non-error) response to a request. - */ -export const JSONRPCResultResponseSchema = z - .object({ - jsonrpc: z.literal(JSONRPC_VERSION), - id: RequestIdSchema, - result: ResultSchema -}) - .strict(); -/** - * Checks if a value is a valid JSONRPCResultResponse. - * @param value - The value to check. - * - * @returns True if the value is a valid JSONRPCResultResponse, false otherwise. - */ -export const isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success; -/** - * @deprecated Use {@link isJSONRPCResultResponse} instead. - * - * Please note that {@link JSONRPCResponse} is a union of {@link JSONRPCResultResponse} and {@link JSONRPCErrorResponse} as per the updated JSON-RPC specification. (was previously just {@link JSONRPCResultResponse}) - */ -export const isJSONRPCResponse = isJSONRPCResultResponse; -/** - * Error codes defined by the JSON-RPC specification. - */ -export var ErrorCode; -(function (ErrorCode) { - // SDK error codes - ErrorCode[ErrorCode["ConnectionClosed"] = -32000] = "ConnectionClosed"; - ErrorCode[ErrorCode["RequestTimeout"] = -32001] = "RequestTimeout"; - // Standard JSON-RPC error codes - ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError"; - ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest"; - ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound"; - ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams"; - ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError"; - // MCP-specific error codes - ErrorCode[ErrorCode["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired"; -})(ErrorCode || (ErrorCode = {})); -/** - * A response to a request that indicates an error occurred. - */ -export const JSONRPCErrorResponseSchema = z - .object({ - jsonrpc: z.literal(JSONRPC_VERSION), - id: RequestIdSchema.optional(), - error: z.object({ - /** - * The error type that occurred. - */ - code: z.number().int(), - /** - * A short description of the error. The message SHOULD be limited to a concise single sentence. - */ - message: z.string(), - /** - * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). - */ - data: z.unknown().optional() - }) -}) - .strict(); -/** - * @deprecated Use {@link JSONRPCErrorResponseSchema} instead. - */ -export const JSONRPCErrorSchema = JSONRPCErrorResponseSchema; -/** - * Checks if a value is a valid JSONRPCErrorResponse. - * @param value - The value to check. - * - * @returns True if the value is a valid JSONRPCErrorResponse, false otherwise. - */ -export const isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success; -/** - * @deprecated Use {@link isJSONRPCErrorResponse} instead. - */ -export const isJSONRPCError = isJSONRPCErrorResponse; -export const JSONRPCMessageSchema = z.union([ - JSONRPCRequestSchema, - JSONRPCNotificationSchema, - JSONRPCResultResponseSchema, - JSONRPCErrorResponseSchema -]); -export const JSONRPCResponseSchema = z.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]); -/* Empty result */ -/** - * A response that indicates success but carries no data. - */ -export const EmptyResultSchema = ResultSchema.strict(); -export const CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({ - /** - * The ID of the request to cancel. - * - * This MUST correspond to the ID of a request previously issued in the same direction. - */ - requestId: RequestIdSchema.optional(), - /** - * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. - */ - reason: z.string().optional() -}); -/* Cancellation */ -/** - * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. - * - * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. - * - * This notification indicates that the result will be unused, so any associated processing SHOULD cease. - * - * A client MUST NOT attempt to cancel its `initialize` request. - */ -export const CancelledNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/cancelled'), - params: CancelledNotificationParamsSchema -}); -/* Base Metadata */ -/** - * Icon schema for use in tools, prompts, resources, and implementations. - */ -export const IconSchema = z.object({ - /** - * URL or data URI for the icon. - */ - src: z.string(), - /** - * Optional MIME type for the icon. - */ - mimeType: z.string().optional(), - /** - * Optional array of strings that specify sizes at which the icon can be used. - * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG. - * - * If not provided, the client should assume that the icon can be used at any size. - */ - sizes: z.array(z.string()).optional(), - /** - * Optional specifier for the theme this icon is designed for. `light` indicates - * the icon is designed to be used with a light background, and `dark` indicates - * the icon is designed to be used with a dark background. - * - * If not provided, the client should assume the icon can be used with any theme. - */ - theme: z.enum(['light', 'dark']).optional() -}); -/** - * Base schema to add `icons` property. - * - */ -export const IconsSchema = z.object({ - /** - * Optional set of sized icons that the client can display in a user interface. - * - * Clients that support rendering icons MUST support at least the following MIME types: - * - `image/png` - PNG images (safe, universal compatibility) - * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility) - * - * Clients that support rendering icons SHOULD also support: - * - `image/svg+xml` - SVG images (scalable but requires security precautions) - * - `image/webp` - WebP images (modern, efficient format) - */ - icons: z.array(IconSchema).optional() -}); -/** - * Base metadata interface for common properties across resources, tools, prompts, and implementations. - */ -export const BaseMetadataSchema = z.object({ - /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */ - name: z.string(), - /** - * Intended for UI and end-user contexts — optimized to be human-readable and easily understood, - * even by those unfamiliar with domain-specific terminology. - * - * If not provided, the name should be used for display (except for Tool, - * where `annotations.title` should be given precedence over using `name`, - * if present). - */ - title: z.string().optional() -}); -/* Initialization */ -/** - * Describes the name and version of an MCP implementation. - */ -export const ImplementationSchema = BaseMetadataSchema.extend({ - ...BaseMetadataSchema.shape, - ...IconsSchema.shape, - version: z.string(), - /** - * An optional URL of the website for this implementation. - */ - websiteUrl: z.string().optional(), - /** - * An optional human-readable description of what this implementation does. - * - * This can be used by clients or servers to provide context about their purpose - * and capabilities. For example, a server might describe the types of resources - * or tools it provides, while a client might describe its intended use case. - */ - description: z.string().optional() -}); -const FormElicitationCapabilitySchema = z.intersection(z.object({ - applyDefaults: z.boolean().optional() -}), z.record(z.string(), z.unknown())); -const ElicitationCapabilitySchema = z.preprocess(value => { - if (value && typeof value === 'object' && !Array.isArray(value)) { - if (Object.keys(value).length === 0) { - return { form: {} }; - } - } - return value; -}, z.intersection(z.object({ - form: FormElicitationCapabilitySchema.optional(), - url: AssertObjectSchema.optional() -}), z.record(z.string(), z.unknown()).optional())); -/** - * Task capabilities for clients, indicating which request types support task creation. - */ -export const ClientTasksCapabilitySchema = z.looseObject({ - /** - * Present if the client supports listing tasks. - */ - list: AssertObjectSchema.optional(), - /** - * Present if the client supports cancelling tasks. - */ - cancel: AssertObjectSchema.optional(), - /** - * Capabilities for task creation on specific request types. - */ - requests: z - .looseObject({ - /** - * Task support for sampling requests. - */ - sampling: z - .looseObject({ - createMessage: AssertObjectSchema.optional() - }) - .optional(), - /** - * Task support for elicitation requests. - */ - elicitation: z - .looseObject({ - create: AssertObjectSchema.optional() - }) - .optional() - }) - .optional() -}); -/** - * Task capabilities for servers, indicating which request types support task creation. - */ -export const ServerTasksCapabilitySchema = z.looseObject({ - /** - * Present if the server supports listing tasks. - */ - list: AssertObjectSchema.optional(), - /** - * Present if the server supports cancelling tasks. - */ - cancel: AssertObjectSchema.optional(), - /** - * Capabilities for task creation on specific request types. - */ - requests: z - .looseObject({ - /** - * Task support for tool requests. - */ - tools: z - .looseObject({ - call: AssertObjectSchema.optional() - }) - .optional() - }) - .optional() -}); -/** - * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. - */ -export const ClientCapabilitiesSchema = z.object({ - /** - * Experimental, non-standard capabilities that the client supports. - */ - experimental: z.record(z.string(), AssertObjectSchema).optional(), - /** - * Present if the client supports sampling from an LLM. - */ - sampling: z - .object({ - /** - * Present if the client supports context inclusion via includeContext parameter. - * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it). - */ - context: AssertObjectSchema.optional(), - /** - * Present if the client supports tool use via tools and toolChoice parameters. - */ - tools: AssertObjectSchema.optional() - }) - .optional(), - /** - * Present if the client supports eliciting user input. - */ - elicitation: ElicitationCapabilitySchema.optional(), - /** - * Present if the client supports listing roots. - */ - roots: z - .object({ - /** - * Whether the client supports issuing notifications for changes to the roots list. - */ - listChanged: z.boolean().optional() - }) - .optional(), - /** - * Present if the client supports task creation. - */ - tasks: ClientTasksCapabilitySchema.optional() -}); -export const InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. - */ - protocolVersion: z.string(), - capabilities: ClientCapabilitiesSchema, - clientInfo: ImplementationSchema -}); -/** - * This request is sent from the client to the server when it first connects, asking it to begin initialization. - */ -export const InitializeRequestSchema = RequestSchema.extend({ - method: z.literal('initialize'), - params: InitializeRequestParamsSchema -}); -export const isInitializeRequest = (value) => InitializeRequestSchema.safeParse(value).success; -/** - * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. - */ -export const ServerCapabilitiesSchema = z.object({ - /** - * Experimental, non-standard capabilities that the server supports. - */ - experimental: z.record(z.string(), AssertObjectSchema).optional(), - /** - * Present if the server supports sending log messages to the client. - */ - logging: AssertObjectSchema.optional(), - /** - * Present if the server supports sending completions to the client. - */ - completions: AssertObjectSchema.optional(), - /** - * Present if the server offers any prompt templates. - */ - prompts: z - .object({ - /** - * Whether this server supports issuing notifications for changes to the prompt list. - */ - listChanged: z.boolean().optional() - }) - .optional(), - /** - * Present if the server offers any resources to read. - */ - resources: z - .object({ - /** - * Whether this server supports clients subscribing to resource updates. - */ - subscribe: z.boolean().optional(), - /** - * Whether this server supports issuing notifications for changes to the resource list. - */ - listChanged: z.boolean().optional() - }) - .optional(), - /** - * Present if the server offers any tools to call. - */ - tools: z - .object({ - /** - * Whether this server supports issuing notifications for changes to the tool list. - */ - listChanged: z.boolean().optional() - }) - .optional(), - /** - * Present if the server supports task creation. - */ - tasks: ServerTasksCapabilitySchema.optional() -}); -/** - * After receiving an initialize request from the client, the server sends this response. - */ -export const InitializeResultSchema = ResultSchema.extend({ - /** - * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. - */ - protocolVersion: z.string(), - capabilities: ServerCapabilitiesSchema, - serverInfo: ImplementationSchema, - /** - * Instructions describing how to use the server and its features. - * - * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. - */ - instructions: z.string().optional() -}); -/** - * This notification is sent from the client to the server after initialization has finished. - */ -export const InitializedNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/initialized'), - params: NotificationsParamsSchema.optional() -}); -export const isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success; -/* Ping */ -/** - * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. - */ -export const PingRequestSchema = RequestSchema.extend({ - method: z.literal('ping'), - params: BaseRequestParamsSchema.optional() -}); -/* Progress notifications */ -export const ProgressSchema = z.object({ - /** - * The progress thus far. This should increase every time progress is made, even if the total is unknown. - */ - progress: z.number(), - /** - * Total number of items to process (or total progress required), if known. - */ - total: z.optional(z.number()), - /** - * An optional message describing the current progress. - */ - message: z.optional(z.string()) -}); -export const ProgressNotificationParamsSchema = z.object({ - ...NotificationsParamsSchema.shape, - ...ProgressSchema.shape, - /** - * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. - */ - progressToken: ProgressTokenSchema -}); -/** - * An out-of-band notification used to inform the receiver of a progress update for a long-running request. - * - * @category notifications/progress - */ -export const ProgressNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/progress'), - params: ProgressNotificationParamsSchema -}); -export const PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * An opaque token representing the current pagination position. - * If provided, the server should return results starting after this cursor. - */ - cursor: CursorSchema.optional() -}); -/* Pagination */ -export const PaginatedRequestSchema = RequestSchema.extend({ - params: PaginatedRequestParamsSchema.optional() -}); -export const PaginatedResultSchema = ResultSchema.extend({ - /** - * An opaque token representing the pagination position after the last returned result. - * If present, there may be more results available. - */ - nextCursor: CursorSchema.optional() -}); -/** - * The status of a task. - * */ -export const TaskStatusSchema = z.enum(['working', 'input_required', 'completed', 'failed', 'cancelled']); -/* Tasks */ -/** - * A pollable state object associated with a request. - */ -export const TaskSchema = z.object({ - taskId: z.string(), - status: TaskStatusSchema, - /** - * Time in milliseconds to keep task results available after completion. - * If null, the task has unlimited lifetime until manually cleaned up. - */ - ttl: z.union([z.number(), z.null()]), - /** - * ISO 8601 timestamp when the task was created. - */ - createdAt: z.string(), - /** - * ISO 8601 timestamp when the task was last updated. - */ - lastUpdatedAt: z.string(), - pollInterval: z.optional(z.number()), - /** - * Optional diagnostic message for failed tasks or other status information. - */ - statusMessage: z.optional(z.string()) -}); -/** - * Result returned when a task is created, containing the task data wrapped in a task field. - */ -export const CreateTaskResultSchema = ResultSchema.extend({ - task: TaskSchema -}); -/** - * Parameters for task status notification. - */ -export const TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema); -/** - * A notification sent when a task's status changes. - */ -export const TaskStatusNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/tasks/status'), - params: TaskStatusNotificationParamsSchema -}); -/** - * A request to get the state of a specific task. - */ -export const GetTaskRequestSchema = RequestSchema.extend({ - method: z.literal('tasks/get'), - params: BaseRequestParamsSchema.extend({ - taskId: z.string() - }) -}); -/** - * The response to a tasks/get request. - */ -export const GetTaskResultSchema = ResultSchema.merge(TaskSchema); -/** - * A request to get the result of a specific task. - */ -export const GetTaskPayloadRequestSchema = RequestSchema.extend({ - method: z.literal('tasks/result'), - params: BaseRequestParamsSchema.extend({ - taskId: z.string() - }) -}); -/** - * The response to a tasks/result request. - * The structure matches the result type of the original request. - * For example, a tools/call task would return the CallToolResult structure. - * - */ -export const GetTaskPayloadResultSchema = ResultSchema.loose(); -/** - * A request to list tasks. - */ -export const ListTasksRequestSchema = PaginatedRequestSchema.extend({ - method: z.literal('tasks/list') -}); -/** - * The response to a tasks/list request. - */ -export const ListTasksResultSchema = PaginatedResultSchema.extend({ - tasks: z.array(TaskSchema) -}); -/** - * A request to cancel a specific task. - */ -export const CancelTaskRequestSchema = RequestSchema.extend({ - method: z.literal('tasks/cancel'), - params: BaseRequestParamsSchema.extend({ - taskId: z.string() - }) -}); -/** - * The response to a tasks/cancel request. - */ -export const CancelTaskResultSchema = ResultSchema.merge(TaskSchema); -/* Resources */ -/** - * The contents of a specific resource or sub-resource. - */ -export const ResourceContentsSchema = z.object({ - /** - * The URI of this resource. - */ - uri: z.string(), - /** - * The MIME type of this resource, if known. - */ - mimeType: z.optional(z.string()), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -export const TextResourceContentsSchema = ResourceContentsSchema.extend({ - /** - * The text of the item. This must only be set if the item can actually be represented as text (not binary data). - */ - text: z.string() -}); -/** - * A Zod schema for validating Base64 strings that is more performant and - * robust for very large inputs than the default regex-based check. It avoids - * stack overflows by using the native `atob` function for validation. - */ -const Base64Schema = z.string().refine(val => { - try { - // atob throws a DOMException if the string contains characters - // that are not part of the Base64 character set. - atob(val); - return true; - } - catch { - return false; - } -}, { message: 'Invalid Base64 string' }); -export const BlobResourceContentsSchema = ResourceContentsSchema.extend({ - /** - * A base64-encoded string representing the binary data of the item. - */ - blob: Base64Schema -}); -/** - * The sender or recipient of messages and data in a conversation. - */ -export const RoleSchema = z.enum(['user', 'assistant']); -/** - * Optional annotations providing clients additional context about a resource. - */ -export const AnnotationsSchema = z.object({ - /** - * Intended audience(s) for the resource. - */ - audience: z.array(RoleSchema).optional(), - /** - * Importance hint for the resource, from 0 (least) to 1 (most). - */ - priority: z.number().min(0).max(1).optional(), - /** - * ISO 8601 timestamp for the most recent modification. - */ - lastModified: z.iso.datetime({ offset: true }).optional() -}); -/** - * A known resource that the server is capable of reading. - */ -export const ResourceSchema = z.object({ - ...BaseMetadataSchema.shape, - ...IconsSchema.shape, - /** - * The URI of this resource. - */ - uri: z.string(), - /** - * A description of what this resource represents. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description: z.optional(z.string()), - /** - * The MIME type of this resource, if known. - */ - mimeType: z.optional(z.string()), - /** - * Optional annotations for the client. - */ - annotations: AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.optional(z.looseObject({})) -}); -/** - * A template description for resources available on the server. - */ -export const ResourceTemplateSchema = z.object({ - ...BaseMetadataSchema.shape, - ...IconsSchema.shape, - /** - * A URI template (according to RFC 6570) that can be used to construct resource URIs. - */ - uriTemplate: z.string(), - /** - * A description of what this template is for. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description: z.optional(z.string()), - /** - * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. - */ - mimeType: z.optional(z.string()), - /** - * Optional annotations for the client. - */ - annotations: AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.optional(z.looseObject({})) -}); -/** - * Sent from the client to request a list of resources the server has. - */ -export const ListResourcesRequestSchema = PaginatedRequestSchema.extend({ - method: z.literal('resources/list') -}); -/** - * The server's response to a resources/list request from the client. - */ -export const ListResourcesResultSchema = PaginatedResultSchema.extend({ - resources: z.array(ResourceSchema) -}); -/** - * Sent from the client to request a list of resource templates the server has. - */ -export const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({ - method: z.literal('resources/templates/list') -}); -/** - * The server's response to a resources/templates/list request from the client. - */ -export const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({ - resourceTemplates: z.array(ResourceTemplateSchema) -}); -export const ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. - * - * @format uri - */ - uri: z.string() -}); -/** - * Parameters for a `resources/read` request. - */ -export const ReadResourceRequestParamsSchema = ResourceRequestParamsSchema; -/** - * Sent from the client to the server, to read a specific resource URI. - */ -export const ReadResourceRequestSchema = RequestSchema.extend({ - method: z.literal('resources/read'), - params: ReadResourceRequestParamsSchema -}); -/** - * The server's response to a resources/read request from the client. - */ -export const ReadResourceResultSchema = ResultSchema.extend({ - contents: z.array(z.union([TextResourceContentsSchema, BlobResourceContentsSchema])) -}); -/** - * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. - */ -export const ResourceListChangedNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/resources/list_changed'), - params: NotificationsParamsSchema.optional() -}); -export const SubscribeRequestParamsSchema = ResourceRequestParamsSchema; -/** - * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. - */ -export const SubscribeRequestSchema = RequestSchema.extend({ - method: z.literal('resources/subscribe'), - params: SubscribeRequestParamsSchema -}); -export const UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema; -/** - * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. - */ -export const UnsubscribeRequestSchema = RequestSchema.extend({ - method: z.literal('resources/unsubscribe'), - params: UnsubscribeRequestParamsSchema -}); -/** - * Parameters for a `notifications/resources/updated` notification. - */ -export const ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({ - /** - * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. - */ - uri: z.string() -}); -/** - * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. - */ -export const ResourceUpdatedNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/resources/updated'), - params: ResourceUpdatedNotificationParamsSchema -}); -/* Prompts */ -/** - * Describes an argument that a prompt can accept. - */ -export const PromptArgumentSchema = z.object({ - /** - * The name of the argument. - */ - name: z.string(), - /** - * A human-readable description of the argument. - */ - description: z.optional(z.string()), - /** - * Whether this argument must be provided. - */ - required: z.optional(z.boolean()) -}); -/** - * A prompt or prompt template that the server offers. - */ -export const PromptSchema = z.object({ - ...BaseMetadataSchema.shape, - ...IconsSchema.shape, - /** - * An optional description of what this prompt provides - */ - description: z.optional(z.string()), - /** - * A list of arguments to use for templating the prompt. - */ - arguments: z.optional(z.array(PromptArgumentSchema)), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.optional(z.looseObject({})) -}); -/** - * Sent from the client to request a list of prompts and prompt templates the server has. - */ -export const ListPromptsRequestSchema = PaginatedRequestSchema.extend({ - method: z.literal('prompts/list') -}); -/** - * The server's response to a prompts/list request from the client. - */ -export const ListPromptsResultSchema = PaginatedResultSchema.extend({ - prompts: z.array(PromptSchema) -}); -/** - * Parameters for a `prompts/get` request. - */ -export const GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * The name of the prompt or prompt template. - */ - name: z.string(), - /** - * Arguments to use for templating the prompt. - */ - arguments: z.record(z.string(), z.string()).optional() -}); -/** - * Used by the client to get a prompt provided by the server. - */ -export const GetPromptRequestSchema = RequestSchema.extend({ - method: z.literal('prompts/get'), - params: GetPromptRequestParamsSchema -}); -/** - * Text provided to or from an LLM. - */ -export const TextContentSchema = z.object({ - type: z.literal('text'), - /** - * The text content of the message. - */ - text: z.string(), - /** - * Optional annotations for the client. - */ - annotations: AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * An image provided to or from an LLM. - */ -export const ImageContentSchema = z.object({ - type: z.literal('image'), - /** - * The base64-encoded image data. - */ - data: Base64Schema, - /** - * The MIME type of the image. Different providers may support different image types. - */ - mimeType: z.string(), - /** - * Optional annotations for the client. - */ - annotations: AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * An Audio provided to or from an LLM. - */ -export const AudioContentSchema = z.object({ - type: z.literal('audio'), - /** - * The base64-encoded audio data. - */ - data: Base64Schema, - /** - * The MIME type of the audio. Different providers may support different audio types. - */ - mimeType: z.string(), - /** - * Optional annotations for the client. - */ - annotations: AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * A tool call request from an assistant (LLM). - * Represents the assistant's request to use a tool. - */ -export const ToolUseContentSchema = z.object({ - type: z.literal('tool_use'), - /** - * The name of the tool to invoke. - * Must match a tool name from the request's tools array. - */ - name: z.string(), - /** - * Unique identifier for this tool call. - * Used to correlate with ToolResultContent in subsequent messages. - */ - id: z.string(), - /** - * Arguments to pass to the tool. - * Must conform to the tool's inputSchema. - */ - input: z.record(z.string(), z.unknown()), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * The contents of a resource, embedded into a prompt or tool call result. - */ -export const EmbeddedResourceSchema = z.object({ - type: z.literal('resource'), - resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]), - /** - * Optional annotations for the client. - */ - annotations: AnnotationsSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * A resource that the server is capable of reading, included in a prompt or tool call result. - * - * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. - */ -export const ResourceLinkSchema = ResourceSchema.extend({ - type: z.literal('resource_link') -}); -/** - * A content block that can be used in prompts and tool results. - */ -export const ContentBlockSchema = z.union([ - TextContentSchema, - ImageContentSchema, - AudioContentSchema, - ResourceLinkSchema, - EmbeddedResourceSchema -]); -/** - * Describes a message returned as part of a prompt. - */ -export const PromptMessageSchema = z.object({ - role: RoleSchema, - content: ContentBlockSchema -}); -/** - * The server's response to a prompts/get request from the client. - */ -export const GetPromptResultSchema = ResultSchema.extend({ - /** - * An optional description for the prompt. - */ - description: z.string().optional(), - messages: z.array(PromptMessageSchema) -}); -/** - * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. - */ -export const PromptListChangedNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/prompts/list_changed'), - params: NotificationsParamsSchema.optional() -}); -/* Tools */ -/** - * Additional properties describing a Tool to clients. - * - * NOTE: all properties in ToolAnnotations are **hints**. - * They are not guaranteed to provide a faithful description of - * tool behavior (including descriptive properties like `title`). - * - * Clients should never make tool use decisions based on ToolAnnotations - * received from untrusted servers. - */ -export const ToolAnnotationsSchema = z.object({ - /** - * A human-readable title for the tool. - */ - title: z.string().optional(), - /** - * If true, the tool does not modify its environment. - * - * Default: false - */ - readOnlyHint: z.boolean().optional(), - /** - * If true, the tool may perform destructive updates to its environment. - * If false, the tool performs only additive updates. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: true - */ - destructiveHint: z.boolean().optional(), - /** - * If true, calling the tool repeatedly with the same arguments - * will have no additional effect on the its environment. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: false - */ - idempotentHint: z.boolean().optional(), - /** - * If true, this tool may interact with an "open world" of external - * entities. If false, the tool's domain of interaction is closed. - * For example, the world of a web search tool is open, whereas that - * of a memory tool is not. - * - * Default: true - */ - openWorldHint: z.boolean().optional() -}); -/** - * Execution-related properties for a tool. - */ -export const ToolExecutionSchema = z.object({ - /** - * Indicates the tool's preference for task-augmented execution. - * - "required": Clients MUST invoke the tool as a task - * - "optional": Clients MAY invoke the tool as a task or normal request - * - "forbidden": Clients MUST NOT attempt to invoke the tool as a task - * - * If not present, defaults to "forbidden". - */ - taskSupport: z.enum(['required', 'optional', 'forbidden']).optional() -}); -/** - * Definition for a tool the client can call. - */ -export const ToolSchema = z.object({ - ...BaseMetadataSchema.shape, - ...IconsSchema.shape, - /** - * A human-readable description of the tool. - */ - description: z.string().optional(), - /** - * A JSON Schema 2020-12 object defining the expected parameters for the tool. - * Must have type: 'object' at the root level per MCP spec. - */ - inputSchema: z - .object({ - type: z.literal('object'), - properties: z.record(z.string(), AssertObjectSchema).optional(), - required: z.array(z.string()).optional() - }) - .catchall(z.unknown()), - /** - * An optional JSON Schema 2020-12 object defining the structure of the tool's output - * returned in the structuredContent field of a CallToolResult. - * Must have type: 'object' at the root level per MCP spec. - */ - outputSchema: z - .object({ - type: z.literal('object'), - properties: z.record(z.string(), AssertObjectSchema).optional(), - required: z.array(z.string()).optional() - }) - .catchall(z.unknown()) - .optional(), - /** - * Optional additional tool information. - */ - annotations: ToolAnnotationsSchema.optional(), - /** - * Execution-related properties for this tool. - */ - execution: ToolExecutionSchema.optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * Sent from the client to request a list of tools the server has. - */ -export const ListToolsRequestSchema = PaginatedRequestSchema.extend({ - method: z.literal('tools/list') -}); -/** - * The server's response to a tools/list request from the client. - */ -export const ListToolsResultSchema = PaginatedResultSchema.extend({ - tools: z.array(ToolSchema) -}); -/** - * The server's response to a tool call. - */ -export const CallToolResultSchema = ResultSchema.extend({ - /** - * A list of content objects that represent the result of the tool call. - * - * If the Tool does not define an outputSchema, this field MUST be present in the result. - * For backwards compatibility, this field is always present, but it may be empty. - */ - content: z.array(ContentBlockSchema).default([]), - /** - * An object containing structured tool output. - * - * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. - */ - structuredContent: z.record(z.string(), z.unknown()).optional(), - /** - * Whether the tool call ended in an error. - * - * If not set, this is assumed to be false (the call was successful). - * - * Any errors that originate from the tool SHOULD be reported inside the result - * object, with `isError` set to true, _not_ as an MCP protocol-level error - * response. Otherwise, the LLM would not be able to see that an error occurred - * and self-correct. - * - * However, any errors in _finding_ the tool, an error indicating that the - * server does not support tool calls, or any other exceptional conditions, - * should be reported as an MCP error response. - */ - isError: z.boolean().optional() -}); -/** - * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. - */ -export const CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({ - toolResult: z.unknown() -})); -/** - * Parameters for a `tools/call` request. - */ -export const CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({ - /** - * The name of the tool to call. - */ - name: z.string(), - /** - * Arguments to pass to the tool. - */ - arguments: z.record(z.string(), z.unknown()).optional() -}); -/** - * Used by the client to invoke a tool provided by the server. - */ -export const CallToolRequestSchema = RequestSchema.extend({ - method: z.literal('tools/call'), - params: CallToolRequestParamsSchema -}); -/** - * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. - */ -export const ToolListChangedNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/tools/list_changed'), - params: NotificationsParamsSchema.optional() -}); -/** - * Base schema for list changed subscription options (without callback). - * Used internally for Zod validation of autoRefresh and debounceMs. - */ -export const ListChangedOptionsBaseSchema = z.object({ - /** - * If true, the list will be refreshed automatically when a list changed notification is received. - * The callback will be called with the updated list. - * - * If false, the callback will be called with null items, allowing manual refresh. - * - * @default true - */ - autoRefresh: z.boolean().default(true), - /** - * Debounce time in milliseconds for list changed notification processing. - * - * Multiple notifications received within this timeframe will only trigger one refresh. - * Set to 0 to disable debouncing. - * - * @default 300 - */ - debounceMs: z.number().int().nonnegative().default(300) -}); -/* Logging */ -/** - * The severity of a log message. - */ -export const LoggingLevelSchema = z.enum(['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency']); -/** - * Parameters for a `logging/setLevel` request. - */ -export const SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({ - /** - * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. - */ - level: LoggingLevelSchema -}); -/** - * A request from the client to the server, to enable or adjust logging. - */ -export const SetLevelRequestSchema = RequestSchema.extend({ - method: z.literal('logging/setLevel'), - params: SetLevelRequestParamsSchema -}); -/** - * Parameters for a `notifications/message` notification. - */ -export const LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({ - /** - * The severity of this log message. - */ - level: LoggingLevelSchema, - /** - * An optional name of the logger issuing this message. - */ - logger: z.string().optional(), - /** - * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. - */ - data: z.unknown() -}); -/** - * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. - */ -export const LoggingMessageNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/message'), - params: LoggingMessageNotificationParamsSchema -}); -/* Sampling */ -/** - * Hints to use for model selection. - */ -export const ModelHintSchema = z.object({ - /** - * A hint for a model name. - */ - name: z.string().optional() -}); -/** - * The server's preferences for model selection, requested of the client during sampling. - */ -export const ModelPreferencesSchema = z.object({ - /** - * Optional hints to use for model selection. - */ - hints: z.array(ModelHintSchema).optional(), - /** - * How much to prioritize cost when selecting a model. - */ - costPriority: z.number().min(0).max(1).optional(), - /** - * How much to prioritize sampling speed (latency) when selecting a model. - */ - speedPriority: z.number().min(0).max(1).optional(), - /** - * How much to prioritize intelligence and capabilities when selecting a model. - */ - intelligencePriority: z.number().min(0).max(1).optional() -}); -/** - * Controls tool usage behavior in sampling requests. - */ -export const ToolChoiceSchema = z.object({ - /** - * Controls when tools are used: - * - "auto": Model decides whether to use tools (default) - * - "required": Model MUST use at least one tool before completing - * - "none": Model MUST NOT use any tools - */ - mode: z.enum(['auto', 'required', 'none']).optional() -}); -/** - * The result of a tool execution, provided by the user (server). - * Represents the outcome of invoking a tool requested via ToolUseContent. - */ -export const ToolResultContentSchema = z.object({ - type: z.literal('tool_result'), - toolUseId: z.string().describe('The unique identifier for the corresponding tool call.'), - content: z.array(ContentBlockSchema).default([]), - structuredContent: z.object({}).loose().optional(), - isError: z.boolean().optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * Basic content types for sampling responses (without tool use). - * Used for backwards-compatible CreateMessageResult when tools are not used. - */ -export const SamplingContentSchema = z.discriminatedUnion('type', [TextContentSchema, ImageContentSchema, AudioContentSchema]); -/** - * Content block types allowed in sampling messages. - * This includes text, image, audio, tool use requests, and tool results. - */ -export const SamplingMessageContentBlockSchema = z.discriminatedUnion('type', [ - TextContentSchema, - ImageContentSchema, - AudioContentSchema, - ToolUseContentSchema, - ToolResultContentSchema -]); -/** - * Describes a message issued to or received from an LLM API. - */ -export const SamplingMessageSchema = z.object({ - role: RoleSchema, - content: z.union([SamplingMessageContentBlockSchema, z.array(SamplingMessageContentBlockSchema)]), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * Parameters for a `sampling/createMessage` request. - */ -export const CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({ - messages: z.array(SamplingMessageSchema), - /** - * The server's preferences for which model to select. The client MAY modify or omit this request. - */ - modelPreferences: ModelPreferencesSchema.optional(), - /** - * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. - */ - systemPrompt: z.string().optional(), - /** - * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. - * The client MAY ignore this request. - * - * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client - * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases. - */ - includeContext: z.enum(['none', 'thisServer', 'allServers']).optional(), - temperature: z.number().optional(), - /** - * The requested maximum number of tokens to sample (to prevent runaway completions). - * - * The client MAY choose to sample fewer tokens than the requested maximum. - */ - maxTokens: z.number().int(), - stopSequences: z.array(z.string()).optional(), - /** - * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. - */ - metadata: AssertObjectSchema.optional(), - /** - * Tools that the model may use during generation. - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. - */ - tools: z.array(ToolSchema).optional(), - /** - * Controls how the model uses tools. - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. - * Default is `{ mode: "auto" }`. - */ - toolChoice: ToolChoiceSchema.optional() -}); -/** - * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. - */ -export const CreateMessageRequestSchema = RequestSchema.extend({ - method: z.literal('sampling/createMessage'), - params: CreateMessageRequestParamsSchema -}); -/** - * The client's response to a sampling/create_message request from the server. - * This is the backwards-compatible version that returns single content (no arrays). - * Used when the request does not include tools. - */ -export const CreateMessageResultSchema = ResultSchema.extend({ - /** - * The name of the model that generated the message. - */ - model: z.string(), - /** - * The reason why sampling stopped, if known. - * - * Standard values: - * - "endTurn": Natural end of the assistant's turn - * - "stopSequence": A stop sequence was encountered - * - "maxTokens": Maximum token limit was reached - * - * This field is an open string to allow for provider-specific stop reasons. - */ - stopReason: z.optional(z.enum(['endTurn', 'stopSequence', 'maxTokens']).or(z.string())), - role: RoleSchema, - /** - * Response content. Single content block (text, image, or audio). - */ - content: SamplingContentSchema -}); -/** - * The client's response to a sampling/create_message request when tools were provided. - * This version supports array content for tool use flows. - */ -export const CreateMessageResultWithToolsSchema = ResultSchema.extend({ - /** - * The name of the model that generated the message. - */ - model: z.string(), - /** - * The reason why sampling stopped, if known. - * - * Standard values: - * - "endTurn": Natural end of the assistant's turn - * - "stopSequence": A stop sequence was encountered - * - "maxTokens": Maximum token limit was reached - * - "toolUse": The model wants to use one or more tools - * - * This field is an open string to allow for provider-specific stop reasons. - */ - stopReason: z.optional(z.enum(['endTurn', 'stopSequence', 'maxTokens', 'toolUse']).or(z.string())), - role: RoleSchema, - /** - * Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse". - */ - content: z.union([SamplingMessageContentBlockSchema, z.array(SamplingMessageContentBlockSchema)]) -}); -/* Elicitation */ -/** - * Primitive schema definition for boolean fields. - */ -export const BooleanSchemaSchema = z.object({ - type: z.literal('boolean'), - title: z.string().optional(), - description: z.string().optional(), - default: z.boolean().optional() -}); -/** - * Primitive schema definition for string fields. - */ -export const StringSchemaSchema = z.object({ - type: z.literal('string'), - title: z.string().optional(), - description: z.string().optional(), - minLength: z.number().optional(), - maxLength: z.number().optional(), - format: z.enum(['email', 'uri', 'date', 'date-time']).optional(), - default: z.string().optional() -}); -/** - * Primitive schema definition for number fields. - */ -export const NumberSchemaSchema = z.object({ - type: z.enum(['number', 'integer']), - title: z.string().optional(), - description: z.string().optional(), - minimum: z.number().optional(), - maximum: z.number().optional(), - default: z.number().optional() -}); -/** - * Schema for single-selection enumeration without display titles for options. - */ -export const UntitledSingleSelectEnumSchemaSchema = z.object({ - type: z.literal('string'), - title: z.string().optional(), - description: z.string().optional(), - enum: z.array(z.string()), - default: z.string().optional() -}); -/** - * Schema for single-selection enumeration with display titles for each option. - */ -export const TitledSingleSelectEnumSchemaSchema = z.object({ - type: z.literal('string'), - title: z.string().optional(), - description: z.string().optional(), - oneOf: z.array(z.object({ - const: z.string(), - title: z.string() - })), - default: z.string().optional() -}); -/** - * Use TitledSingleSelectEnumSchema instead. - * This interface will be removed in a future version. - */ -export const LegacyTitledEnumSchemaSchema = z.object({ - type: z.literal('string'), - title: z.string().optional(), - description: z.string().optional(), - enum: z.array(z.string()), - enumNames: z.array(z.string()).optional(), - default: z.string().optional() -}); -// Combined single selection enumeration -export const SingleSelectEnumSchemaSchema = z.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]); -/** - * Schema for multiple-selection enumeration without display titles for options. - */ -export const UntitledMultiSelectEnumSchemaSchema = z.object({ - type: z.literal('array'), - title: z.string().optional(), - description: z.string().optional(), - minItems: z.number().optional(), - maxItems: z.number().optional(), - items: z.object({ - type: z.literal('string'), - enum: z.array(z.string()) - }), - default: z.array(z.string()).optional() -}); -/** - * Schema for multiple-selection enumeration with display titles for each option. - */ -export const TitledMultiSelectEnumSchemaSchema = z.object({ - type: z.literal('array'), - title: z.string().optional(), - description: z.string().optional(), - minItems: z.number().optional(), - maxItems: z.number().optional(), - items: z.object({ - anyOf: z.array(z.object({ - const: z.string(), - title: z.string() - })) - }), - default: z.array(z.string()).optional() -}); -/** - * Combined schema for multiple-selection enumeration - */ -export const MultiSelectEnumSchemaSchema = z.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]); -/** - * Primitive schema definition for enum fields. - */ -export const EnumSchemaSchema = z.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]); -/** - * Union of all primitive schema definitions. - */ -export const PrimitiveSchemaDefinitionSchema = z.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]); -/** - * Parameters for an `elicitation/create` request for form-based elicitation. - */ -export const ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({ - /** - * The elicitation mode. - * - * Optional for backward compatibility. Clients MUST treat missing mode as "form". - */ - mode: z.literal('form').optional(), - /** - * The message to present to the user describing what information is being requested. - */ - message: z.string(), - /** - * A restricted subset of JSON Schema. - * Only top-level properties are allowed, without nesting. - */ - requestedSchema: z.object({ - type: z.literal('object'), - properties: z.record(z.string(), PrimitiveSchemaDefinitionSchema), - required: z.array(z.string()).optional() - }) -}); -/** - * Parameters for an `elicitation/create` request for URL-based elicitation. - */ -export const ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({ - /** - * The elicitation mode. - */ - mode: z.literal('url'), - /** - * The message to present to the user explaining why the interaction is needed. - */ - message: z.string(), - /** - * The ID of the elicitation, which must be unique within the context of the server. - * The client MUST treat this ID as an opaque value. - */ - elicitationId: z.string(), - /** - * The URL that the user should navigate to. - */ - url: z.string().url() -}); -/** - * The parameters for a request to elicit additional information from the user via the client. - */ -export const ElicitRequestParamsSchema = z.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]); -/** - * A request from the server to elicit user input via the client. - * The client should present the message and form fields to the user (form mode) - * or navigate to a URL (URL mode). - */ -export const ElicitRequestSchema = RequestSchema.extend({ - method: z.literal('elicitation/create'), - params: ElicitRequestParamsSchema -}); -/** - * Parameters for a `notifications/elicitation/complete` notification. - * - * @category notifications/elicitation/complete - */ -export const ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({ - /** - * The ID of the elicitation that completed. - */ - elicitationId: z.string() -}); -/** - * A notification from the server to the client, informing it of a completion of an out-of-band elicitation request. - * - * @category notifications/elicitation/complete - */ -export const ElicitationCompleteNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/elicitation/complete'), - params: ElicitationCompleteNotificationParamsSchema -}); -/** - * The client's response to an elicitation/create request from the server. - */ -export const ElicitResultSchema = ResultSchema.extend({ - /** - * The user action in response to the elicitation. - * - "accept": User submitted the form/confirmed the action - * - "decline": User explicitly decline the action - * - "cancel": User dismissed without making an explicit choice - */ - action: z.enum(['accept', 'decline', 'cancel']), - /** - * The submitted form data, only present when action is "accept". - * Contains values matching the requested schema. - * Per MCP spec, content is "typically omitted" for decline/cancel actions. - * We normalize null to undefined for leniency while maintaining type compatibility. - */ - content: z.preprocess(val => (val === null ? undefined : val), z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])).optional()) -}); -/* Autocomplete */ -/** - * A reference to a resource or resource template definition. - */ -export const ResourceTemplateReferenceSchema = z.object({ - type: z.literal('ref/resource'), - /** - * The URI or URI template of the resource. - */ - uri: z.string() -}); -/** - * @deprecated Use ResourceTemplateReferenceSchema instead - */ -export const ResourceReferenceSchema = ResourceTemplateReferenceSchema; -/** - * Identifies a prompt. - */ -export const PromptReferenceSchema = z.object({ - type: z.literal('ref/prompt'), - /** - * The name of the prompt or prompt template - */ - name: z.string() -}); -/** - * Parameters for a `completion/complete` request. - */ -export const CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({ - ref: z.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]), - /** - * The argument's information - */ - argument: z.object({ - /** - * The name of the argument - */ - name: z.string(), - /** - * The value of the argument to use for completion matching. - */ - value: z.string() - }), - context: z - .object({ - /** - * Previously-resolved variables in a URI template or prompt. - */ - arguments: z.record(z.string(), z.string()).optional() - }) - .optional() -}); -/** - * A request from the client to the server, to ask for completion options. - */ -export const CompleteRequestSchema = RequestSchema.extend({ - method: z.literal('completion/complete'), - params: CompleteRequestParamsSchema -}); -export function assertCompleteRequestPrompt(request) { - if (request.params.ref.type !== 'ref/prompt') { - throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`); - } - void request; -} -export function assertCompleteRequestResourceTemplate(request) { - if (request.params.ref.type !== 'ref/resource') { - throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`); - } - void request; -} -/** - * The server's response to a completion/complete request - */ -export const CompleteResultSchema = ResultSchema.extend({ - completion: z.looseObject({ - /** - * An array of completion values. Must not exceed 100 items. - */ - values: z.array(z.string()).max(100), - /** - * The total number of completion options available. This can exceed the number of values actually sent in the response. - */ - total: z.optional(z.number().int()), - /** - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. - */ - hasMore: z.optional(z.boolean()) - }) -}); -/* Roots */ -/** - * Represents a root directory or file that the server can operate on. - */ -export const RootSchema = z.object({ - /** - * The URI identifying the root. This *must* start with file:// for now. - */ - uri: z.string().startsWith('file://'), - /** - * An optional name for the root. - */ - name: z.string().optional(), - /** - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) - * for notes on _meta usage. - */ - _meta: z.record(z.string(), z.unknown()).optional() -}); -/** - * Sent from the server to request a list of root URIs from the client. - */ -export const ListRootsRequestSchema = RequestSchema.extend({ - method: z.literal('roots/list'), - params: BaseRequestParamsSchema.optional() -}); -/** - * The client's response to a roots/list request from the server. - */ -export const ListRootsResultSchema = ResultSchema.extend({ - roots: z.array(RootSchema) -}); -/** - * A notification from the client to the server, informing it that the list of roots has changed. - */ -export const RootsListChangedNotificationSchema = NotificationSchema.extend({ - method: z.literal('notifications/roots/list_changed'), - params: NotificationsParamsSchema.optional() -}); -/* Client messages */ -export const ClientRequestSchema = z.union([ - PingRequestSchema, - InitializeRequestSchema, - CompleteRequestSchema, - SetLevelRequestSchema, - GetPromptRequestSchema, - ListPromptsRequestSchema, - ListResourcesRequestSchema, - ListResourceTemplatesRequestSchema, - ReadResourceRequestSchema, - SubscribeRequestSchema, - UnsubscribeRequestSchema, - CallToolRequestSchema, - ListToolsRequestSchema, - GetTaskRequestSchema, - GetTaskPayloadRequestSchema, - ListTasksRequestSchema, - CancelTaskRequestSchema -]); -export const ClientNotificationSchema = z.union([ - CancelledNotificationSchema, - ProgressNotificationSchema, - InitializedNotificationSchema, - RootsListChangedNotificationSchema, - TaskStatusNotificationSchema -]); -export const ClientResultSchema = z.union([ - EmptyResultSchema, - CreateMessageResultSchema, - CreateMessageResultWithToolsSchema, - ElicitResultSchema, - ListRootsResultSchema, - GetTaskResultSchema, - ListTasksResultSchema, - CreateTaskResultSchema -]); -/* Server messages */ -export const ServerRequestSchema = z.union([ - PingRequestSchema, - CreateMessageRequestSchema, - ElicitRequestSchema, - ListRootsRequestSchema, - GetTaskRequestSchema, - GetTaskPayloadRequestSchema, - ListTasksRequestSchema, - CancelTaskRequestSchema -]); -export const ServerNotificationSchema = z.union([ - CancelledNotificationSchema, - ProgressNotificationSchema, - LoggingMessageNotificationSchema, - ResourceUpdatedNotificationSchema, - ResourceListChangedNotificationSchema, - ToolListChangedNotificationSchema, - PromptListChangedNotificationSchema, - TaskStatusNotificationSchema, - ElicitationCompleteNotificationSchema -]); -export const ServerResultSchema = z.union([ - EmptyResultSchema, - InitializeResultSchema, - CompleteResultSchema, - GetPromptResultSchema, - ListPromptsResultSchema, - ListResourcesResultSchema, - ListResourceTemplatesResultSchema, - ReadResourceResultSchema, - CallToolResultSchema, - ListToolsResultSchema, - GetTaskResultSchema, - ListTasksResultSchema, - CreateTaskResultSchema -]); -export class McpError extends Error { - constructor(code, message, data) { - super(`MCP error ${code}: ${message}`); - this.code = code; - this.data = data; - this.name = 'McpError'; - } - /** - * Factory method to create the appropriate error type based on the error code and data - */ - static fromError(code, message, data) { - // Check for specific error types - if (code === ErrorCode.UrlElicitationRequired && data) { - const errorData = data; - if (errorData.elicitations) { - return new UrlElicitationRequiredError(errorData.elicitations, message); - } - } - // Default to generic McpError - return new McpError(code, message, data); - } -} -/** - * Specialized error type when a tool requires a URL mode elicitation. - * This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against. - */ -export class UrlElicitationRequiredError extends McpError { - constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? 's' : ''} required`) { - super(ErrorCode.UrlElicitationRequired, message, { - elicitations: elicitations - }); - } - get elicitations() { - return this.data?.elicitations ?? []; - } -} -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map deleted file mode 100644 index 285ab0c..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AACpD,MAAM,CAAC,MAAM,mCAAmC,GAAG,YAAY,CAAC;AAChE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,uBAAuB,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAE7H,MAAM,CAAC,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAE5E,oBAAoB;AACpB,MA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,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW;QACjI,KAAK,CAAC,SAAS,CAAC,sBAAsB,EAAE,OAAO,EAAE;YAC7C,YAAY,EAAE,YAAY;SAC7B,CAAC,CAAC;IACP,CAAC;IAED,IAAI,YAAY;QACZ,OAAQ,IAAI,CAAC,IAAmD,EAAE,YAAY,IAAI,EAAE,CAAC;IACzF,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts deleted file mode 100644 index 952ee68..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * AJV-based JSON Schema validator provider - */ -import Ajv from 'ajv'; -import type { JsonSchemaType, JsonSchemaValidator, jsonSchemaValidator } from './types.js'; -/** - * @example - * ```typescript - * // Use with default AJV instance (recommended) - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // Use with custom AJV instance - * import { Ajv } from 'ajv'; - * const ajv = new Ajv({ strict: true, allErrors: true }); - * const validator = new AjvJsonSchemaValidator(ajv); - * ``` - */ -export declare class AjvJsonSchemaValidator implements jsonSchemaValidator { - private _ajv; - /** - * Create an AJV validator - * - * @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created. - * - * @example - * ```typescript - * // Use default configuration (recommended for most cases) - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // Or provide custom AJV instance for advanced configuration - * import { Ajv } from 'ajv'; - * import addFormats from 'ajv-formats'; - * - * const ajv = new Ajv({ validateFormats: true }); - * addFormats(ajv); - * const validator = new AjvJsonSchemaValidator(ajv); - * ``` - */ - constructor(ajv?: Ajv); - /** - * Create a validator for the given JSON Schema - * - * The validator is compiled once and can be reused multiple times. - * If the schema has an $id, it will be cached by AJV automatically. - * - * @param schema - Standard JSON Schema object - * @returns A validator function that validates input data - */ - getValidator(schema: JsonSchemaType): JsonSchemaValidator; -} -//# sourceMappingURL=ajv-provider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts.map deleted file mode 100644 index 6704c4d..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv-provider.d.ts","sourceRoot":"","sources":["../../../src/validation/ajv-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAA6B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAgBtH;;;;;;;;;;;;GAYG;AACH,qBAAa,sBAAuB,YAAW,mBAAmB;IAC9D,OAAO,CAAC,IAAI,CAAM;IAElB;;;;;;;;;;;;;;;;;;;OAmBG;gBACS,GAAG,CAAC,EAAE,GAAG;IAIrB;;;;;;;;OAQG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC;CAyBlE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js deleted file mode 100644 index a0ab067..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +++ /dev/null @@ -1,87 +0,0 @@ -/** - * AJV-based JSON Schema validator provider - */ -import Ajv from 'ajv'; -import _addFormats from 'ajv-formats'; -function createDefaultAjvInstance() { - const ajv = new Ajv({ - strict: false, - validateFormats: true, - validateSchema: false, - allErrors: true - }); - const addFormats = _addFormats; - addFormats(ajv); - return ajv; -} -/** - * @example - * ```typescript - * // Use with default AJV instance (recommended) - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // Use with custom AJV instance - * import { Ajv } from 'ajv'; - * const ajv = new Ajv({ strict: true, allErrors: true }); - * const validator = new AjvJsonSchemaValidator(ajv); - * ``` - */ -export class AjvJsonSchemaValidator { - /** - * Create an AJV validator - * - * @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created. - * - * @example - * ```typescript - * // Use default configuration (recommended for most cases) - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // Or provide custom AJV instance for advanced configuration - * import { Ajv } from 'ajv'; - * import addFormats from 'ajv-formats'; - * - * const ajv = new Ajv({ validateFormats: true }); - * addFormats(ajv); - * const validator = new AjvJsonSchemaValidator(ajv); - * ``` - */ - constructor(ajv) { - this._ajv = ajv ?? createDefaultAjvInstance(); - } - /** - * Create a validator for the given JSON Schema - * - * The validator is compiled once and can be reused multiple times. - * If the schema has an $id, it will be cached by AJV automatically. - * - * @param schema - Standard JSON Schema object - * @returns A validator function that validates input data - */ - getValidator(schema) { - // Check if schema has $id and is already compiled/cached - const ajvValidator = '$id' in schema && typeof schema.$id === 'string' - ? (this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema)) - : this._ajv.compile(schema); - return (input) => { - const valid = ajvValidator(input); - if (valid) { - return { - valid: true, - data: input, - errorMessage: undefined - }; - } - else { - return { - valid: false, - data: undefined, - errorMessage: this._ajv.errorsText(ajvValidator.errors) - }; - } - }; - } -} -//# sourceMappingURL=ajv-provider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map deleted file mode 100644 index 7b01905..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv-provider.js","sourceRoot":"","sources":["../../../src/validation/ajv-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,WAAW,MAAM,aAAa,CAAC;AAGtC,SAAS,wBAAwB;IAC7B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC;QAChB,MAAM,EAAE,KAAK;QACb,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,WAAoD,CAAC;IACxE,UAAU,CAAC,GAAG,CAAC,CAAC;IAEhB,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,sBAAsB;IAG/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,GAAS;QACjB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,wBAAwB,EAAE,CAAC;IAClD,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAI,MAAsB;QAClC,yDAAyD;QACzD,MAAM,YAAY,GACd,KAAK,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YAC7C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAChE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEpC,OAAO,CAAC,KAAc,EAAgC,EAAE;YACpD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;YAElC,IAAI,KAAK,EAAE,CAAC;gBACR,OAAO;oBACH,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,KAAU;oBAChB,YAAY,EAAE,SAAS;iBAC1B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC;iBAC1D,CAAC;YACN,CAAC;QACL,CAAC,CAAC;IACN,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts deleted file mode 100644 index 89c244a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Cloudflare Worker-compatible JSON Schema validator provider - * - * This provider uses @cfworker/json-schema for validation without code generation, - * making it compatible with edge runtimes like Cloudflare Workers that restrict - * eval and new Function. - */ -import type { JsonSchemaType, JsonSchemaValidator, jsonSchemaValidator } from './types.js'; -/** - * JSON Schema draft version supported by @cfworker/json-schema - */ -export type CfWorkerSchemaDraft = '4' | '7' | '2019-09' | '2020-12'; -/** - * - * @example - * ```typescript - * // Use with default configuration (2020-12, shortcircuit) - * const validator = new CfWorkerJsonSchemaValidator(); - * - * // Use with custom configuration - * const validator = new CfWorkerJsonSchemaValidator({ - * draft: '2020-12', - * shortcircuit: false // Report all errors - * }); - * ``` - */ -export declare class CfWorkerJsonSchemaValidator implements jsonSchemaValidator { - private shortcircuit; - private draft; - /** - * Create a validator - * - * @param options - Configuration options - * @param options.shortcircuit - If true, stop validation after first error (default: true) - * @param options.draft - JSON Schema draft version to use (default: '2020-12') - */ - constructor(options?: { - shortcircuit?: boolean; - draft?: CfWorkerSchemaDraft; - }); - /** - * Create a validator for the given JSON Schema - * - * Unlike AJV, this validator is not cached internally - * - * @param schema - Standard JSON Schema object - * @returns A validator function that validates input data - */ - getValidator(schema: JsonSchemaType): JsonSchemaValidator; -} -//# sourceMappingURL=cfworker-provider.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts.map deleted file mode 100644 index ce404d9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cfworker-provider.d.ts","sourceRoot":"","sources":["../../../src/validation/cfworker-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAA6B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;IACnE,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,KAAK,CAAsB;IAEnC;;;;;;OAMG;gBACS,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,mBAAmB,CAAA;KAAE;IAK7E;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC;CAsBlE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js deleted file mode 100644 index 5764914..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Cloudflare Worker-compatible JSON Schema validator provider - * - * This provider uses @cfworker/json-schema for validation without code generation, - * making it compatible with edge runtimes like Cloudflare Workers that restrict - * eval and new Function. - */ -import { Validator } from '@cfworker/json-schema'; -/** - * - * @example - * ```typescript - * // Use with default configuration (2020-12, shortcircuit) - * const validator = new CfWorkerJsonSchemaValidator(); - * - * // Use with custom configuration - * const validator = new CfWorkerJsonSchemaValidator({ - * draft: '2020-12', - * shortcircuit: false // Report all errors - * }); - * ``` - */ -export class CfWorkerJsonSchemaValidator { - /** - * Create a validator - * - * @param options - Configuration options - * @param options.shortcircuit - If true, stop validation after first error (default: true) - * @param options.draft - JSON Schema draft version to use (default: '2020-12') - */ - constructor(options) { - this.shortcircuit = options?.shortcircuit ?? true; - this.draft = options?.draft ?? '2020-12'; - } - /** - * Create a validator for the given JSON Schema - * - * Unlike AJV, this validator is not cached internally - * - * @param schema - Standard JSON Schema object - * @returns A validator function that validates input data - */ - getValidator(schema) { - // Cast to the cfworker Schema type - our JsonSchemaType is structurally compatible - const validator = new Validator(schema, this.draft, this.shortcircuit); - return (input) => { - const result = validator.validate(input); - if (result.valid) { - return { - valid: true, - data: input, - errorMessage: undefined - }; - } - else { - return { - valid: false, - data: undefined, - errorMessage: result.errors.map(err => `${err.instanceLocation}: ${err.error}`).join('; ') - }; - } - }; - } -} -//# sourceMappingURL=cfworker-provider.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js.map deleted file mode 100644 index 21c014a..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cfworker-provider.js","sourceRoot":"","sources":["../../../src/validation/cfworker-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQlD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,2BAA2B;IAIpC;;;;;;OAMG;IACH,YAAY,OAAiE;QACzE,IAAI,CAAC,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,IAAI,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,SAAS,CAAC;IAC7C,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAI,MAAsB;QAClC,mFAAmF;QACnF,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,MAAoD,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAErH,OAAO,CAAC,KAAc,EAAgC,EAAE;YACpD,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEzC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO;oBACH,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,KAAU;oBAChB,YAAY,EAAE,SAAS;iBAC1B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,gBAAgB,KAAK,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC7F,CAAC;YACN,CAAC;QACL,CAAC,CAAC;IACN,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts deleted file mode 100644 index 99e9939..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * JSON Schema validation - * - * This module provides configurable JSON Schema validation for the MCP SDK. - * Choose a validator based on your runtime environment: - * - * - AjvJsonSchemaValidator: Best for Node.js (default, fastest) - * Import from: @modelcontextprotocol/sdk/validation/ajv - * Requires peer dependencies: ajv, ajv-formats - * - * - CfWorkerJsonSchemaValidator: Best for edge runtimes - * Import from: @modelcontextprotocol/sdk/validation/cfworker - * Requires peer dependency: @cfworker/json-schema - * - * @example - * ```typescript - * // For Node.js with AJV - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // For Cloudflare Workers - * import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/cfworker'; - * const validator = new CfWorkerJsonSchemaValidator(); - * ``` - * - * @module validation - */ -export type { JsonSchemaType, JsonSchemaValidator, JsonSchemaValidatorResult, jsonSchemaValidator } from './types.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts.map deleted file mode 100644 index a8845b9..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js deleted file mode 100644 index 685b1fd..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * JSON Schema validation - * - * This module provides configurable JSON Schema validation for the MCP SDK. - * Choose a validator based on your runtime environment: - * - * - AjvJsonSchemaValidator: Best for Node.js (default, fastest) - * Import from: @modelcontextprotocol/sdk/validation/ajv - * Requires peer dependencies: ajv, ajv-formats - * - * - CfWorkerJsonSchemaValidator: Best for edge runtimes - * Import from: @modelcontextprotocol/sdk/validation/cfworker - * Requires peer dependency: @cfworker/json-schema - * - * @example - * ```typescript - * // For Node.js with AJV - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv'; - * const validator = new AjvJsonSchemaValidator(); - * - * // For Cloudflare Workers - * import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/cfworker'; - * const validator = new CfWorkerJsonSchemaValidator(); - * ``` - * - * @module validation - */ -export {}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js.map deleted file mode 100644 index ed2b9fc..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts deleted file mode 100644 index 9fa9222..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { JSONSchema } from 'json-schema-typed'; -/** - * JSON Schema type definition (JSON Schema Draft 2020-12) - * - * This uses the object form of JSON Schema (excluding boolean schemas). - * While `true` and `false` are valid JSON Schemas, this SDK uses the - * object form for practical type safety. - * - * Re-exported from json-schema-typed for convenience. - * @see https://json-schema.org/draft/2020-12/json-schema-core.html - */ -export type JsonSchemaType = JSONSchema.Interface; -/** - * Result of a JSON Schema validation operation - */ -export type JsonSchemaValidatorResult = { - valid: true; - data: T; - errorMessage: undefined; -} | { - valid: false; - data: undefined; - errorMessage: string; -}; -/** - * A validator function that validates data against a JSON Schema - */ -export type JsonSchemaValidator = (input: unknown) => JsonSchemaValidatorResult; -/** - * Provider interface for creating validators from JSON Schemas - * - * This is the main extension point for custom validator implementations. - * Implementations should: - * - Support JSON Schema Draft 2020-12 (or be compatible with it) - * - Return validator functions that can be called multiple times - * - Handle schema compilation/caching internally - * - Provide clear error messages on validation failure - * - * @example - * ```typescript - * class MyValidatorProvider implements jsonSchemaValidator { - * getValidator(schema: JsonSchemaType): JsonSchemaValidator { - * // Compile/cache validator from schema - * return (input: unknown) => { - * // Validate input against schema - * if (valid) { - * return { valid: true, data: input as T, errorMessage: undefined }; - * } else { - * return { valid: false, data: undefined, errorMessage: 'Error details' }; - * } - * }; - * } - * } - * ``` - */ -export interface jsonSchemaValidator { - /** - * Create a validator for the given JSON Schema - * - * @param schema - Standard JSON Schema object - * @returns A validator function that can be called multiple times - */ - getValidator(schema: JsonSchemaType): JsonSchemaValidator; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts.map deleted file mode 100644 index 52aa0ef..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/validation/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IACjC;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC;IAAC,YAAY,EAAE,SAAS,CAAA;CAAE,GACjD;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;;OAKG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;CACnE"} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js deleted file mode 100644 index 718fd38..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js.map b/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js.map deleted file mode 100644 index 51361cf..0000000 --- a/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/validation/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@modelcontextprotocol/sdk/package.json b/node_modules/@modelcontextprotocol/sdk/package.json deleted file mode 100644 index dc02209..0000000 --- a/node_modules/@modelcontextprotocol/sdk/package.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "name": "@modelcontextprotocol/sdk", - "version": "1.26.0", - "description": "Model Context Protocol implementation for TypeScript", - "license": "MIT", - "author": "Anthropic, PBC (https://anthropic.com)", - "homepage": "https://modelcontextprotocol.io", - "bugs": "https://github.com/modelcontextprotocol/typescript-sdk/issues", - "type": "module", - "repository": { - "type": "git", - "url": "git+https://github.com/modelcontextprotocol/typescript-sdk.git" - }, - "engines": { - "node": ">=18" - }, - "keywords": [ - "modelcontextprotocol", - "mcp" - ], - "exports": { - ".": { - "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js" - }, - "./client": { - "import": "./dist/esm/client/index.js", - "require": "./dist/cjs/client/index.js" - }, - "./server": { - "import": "./dist/esm/server/index.js", - "require": "./dist/cjs/server/index.js" - }, - "./validation": { - "import": "./dist/esm/validation/index.js", - "require": "./dist/cjs/validation/index.js" - }, - "./validation/ajv": { - "import": "./dist/esm/validation/ajv-provider.js", - "require": "./dist/cjs/validation/ajv-provider.js" - }, - "./validation/cfworker": { - "import": "./dist/esm/validation/cfworker-provider.js", - "require": "./dist/cjs/validation/cfworker-provider.js" - }, - "./experimental": { - "import": "./dist/esm/experimental/index.js", - "require": "./dist/cjs/experimental/index.js" - }, - "./experimental/tasks": { - "import": "./dist/esm/experimental/tasks/index.js", - "require": "./dist/cjs/experimental/tasks/index.js" - }, - "./*": { - "import": "./dist/esm/*", - "require": "./dist/cjs/*" - } - }, - "typesVersions": { - "*": { - "*": [ - "./dist/esm/*" - ] - } - }, - "files": [ - "dist" - ], - "scripts": { - "fetch:spec-types": "tsx scripts/fetch-spec-types.ts", - "typecheck": "tsgo --noEmit", - "build": "npm run build:esm && npm run build:cjs", - "build:esm": "mkdir -p dist/esm && echo '{\"type\": \"module\"}' > dist/esm/package.json && tsc -p tsconfig.prod.json", - "build:esm:w": "npm run build:esm -- -w", - "build:cjs": "mkdir -p dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json && tsc -p tsconfig.cjs.json", - "build:cjs:w": "npm run build:cjs -- -w", - "examples:simple-server:w": "tsx --watch src/examples/server/simpleStreamableHttp.ts --oauth", - "prepack": "npm run build:esm && npm run build:cjs", - "lint": "eslint src/ && prettier --check .", - "lint:fix": "eslint src/ --fix && prettier --write .", - "check": "npm run typecheck && npm run lint", - "test": "vitest run", - "test:watch": "vitest", - "start": "npm run server", - "server": "tsx watch --clear-screen=false scripts/cli.ts server", - "client": "tsx scripts/cli.ts client" - }, - "dependencies": { - "@hono/node-server": "^1.19.9", - "ajv": "^8.17.1", - "ajv-formats": "^3.0.1", - "content-type": "^1.0.5", - "cors": "^2.8.5", - "cross-spawn": "^7.0.5", - "eventsource": "^3.0.2", - "eventsource-parser": "^3.0.0", - "express": "^5.2.1", - "express-rate-limit": "^8.2.1", - "hono": "^4.11.4", - "jose": "^6.1.3", - "json-schema-typed": "^8.0.2", - "pkce-challenge": "^5.0.0", - "raw-body": "^3.0.0", - "zod": "^3.25 || ^4.0", - "zod-to-json-schema": "^3.25.1" - }, - "peerDependencies": { - "@cfworker/json-schema": "^4.1.1", - "zod": "^3.25 || ^4.0" - }, - "peerDependenciesMeta": { - "@cfworker/json-schema": { - "optional": true - }, - "zod": { - "optional": false - } - }, - "devDependencies": { - "@cfworker/json-schema": "^4.1.1", - "@eslint/js": "^9.39.1", - "@types/content-type": "^1.1.8", - "@types/cors": "^2.8.17", - "@types/cross-spawn": "^6.0.6", - "@types/eventsource": "^1.1.15", - "@types/express": "^5.0.0", - "@types/express-serve-static-core": "^5.1.0", - "@types/node": "^22.12.0", - "@types/supertest": "^6.0.2", - "@types/ws": "^8.5.12", - "@typescript/native-preview": "^7.0.0-dev.20251103.1", - "eslint": "^9.8.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-n": "^17.23.1", - "prettier": "3.6.2", - "supertest": "^7.0.0", - "tsx": "^4.16.5", - "typescript": "^5.5.4", - "typescript-eslint": "^8.48.1", - "vitest": "^4.0.8", - "ws": "^8.18.0" - }, - "resolutions": { - "strip-ansi": "6.0.1" - }, - "overrides": { - "qs": "6.14.1" - } -} diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md deleted file mode 100644 index 05fdbfc..0000000 --- a/node_modules/@types/node/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for node (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v20. - -### Additional Details - * Last updated: Sun, 08 Feb 2026 00:09:19 GMT - * Dependencies: [undici-types](https://npmjs.com/package/undici-types) - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). diff --git a/node_modules/@types/node/assert.d.ts b/node_modules/@types/node/assert.d.ts deleted file mode 100644 index c32c903..0000000 --- a/node_modules/@types/node/assert.d.ts +++ /dev/null @@ -1,1062 +0,0 @@ -/** - * The `node:assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/assert.js) - */ -declare module "assert" { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - type AssertMethodNames = - | "deepEqual" - | "deepStrictEqual" - | "doesNotMatch" - | "doesNotReject" - | "doesNotThrow" - | "equal" - | "fail" - | "ifError" - | "match" - | "notDeepEqual" - | "notDeepStrictEqual" - | "notEqual" - | "notStrictEqual" - | "ok" - | "rejects" - | "strictEqual" - | "throws"; - /** - * Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class. - */ - class AssertionError extends Error { - /** - * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. - */ - actual: unknown; - /** - * Set to the `expected` argument for methods such as {@link assert.strictEqual()}. - */ - expected: unknown; - /** - * Set to the passed in operator value. - */ - operator: string; - /** - * Indicates if the message was auto-generated (`true`) or not. - */ - generatedMessage: boolean; - /** - * Value is always `ERR_ASSERTION` to show that the error is an assertion error. - */ - code: "ERR_ASSERTION"; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type - stackStartFn?: Function | undefined; - }); - } - /** - * This feature is deprecated and will be removed in a future version. - * Please consider using alternatives such as the `mock` helper function. - * @since v14.2.0, v12.19.0 - * @deprecated Deprecated - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return A function that wraps `fn`. - */ - calls(exact?: number): () => void; - calls(fn: undefined, exact?: number): () => void; - calls any>(fn: Func, exact?: number): Func; - calls any>(fn?: Func, exact?: number): Func | (() => void); - /** - * Example: - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * callsfunc(1, 2, 3); - * - * assert.deepStrictEqual(tracker.getCalls(callsfunc), - * [{ thisArg: undefined, arguments: [1, 2, 3] }]); - * ``` - * @since v18.8.0, v16.18.0 - * @return An array with all the calls to a tracked function. - */ - getCalls(fn: Function): CallTrackerCall[]; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * console.log(tracker.report()); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return An array of objects containing information about the wrapper functions returned by {@link tracker.calls()}. - */ - report(): CallTrackerReportInformation[]; - /** - * Reset calls of the call tracker. If a tracked function is passed as an argument, the calls will be reset for it. - * If no arguments are passed, all tracked functions will be reset. - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * - * callsfunc(); - * // Tracker was called once - * assert.strictEqual(tracker.getCalls(callsfunc).length, 1); - * - * tracker.reset(callsfunc); - * assert.strictEqual(tracker.getCalls(callsfunc).length, 0); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn a tracked function to reset. - */ - reset(fn?: Function): void; - /** - * Iterates through the list of functions passed to {@link tracker.calls()} and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerCall { - thisArg: object; - arguments: unknown[]; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type - stackStartFn?: Function, - ): never; - /** - * Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is `undefined`, a default - * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled - * and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default - * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is - * specially handled and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error - * message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'node:assert'; - * - * const obj1 = { - * a: { - * b: 1, - * }, - * }; - * const obj2 = { - * a: { - * b: 2, - * }, - * }; - * const obj3 = { - * a: { - * b: 1, - * }, - * }; - * const obj4 = { __proto__: obj1 }; - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default - * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a - * default error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a - * default error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for deep equality between the `actual` and `expected` parameters. - * "Deep" equality means that the enumerable "own" properties of child objects - * are recursively evaluated also by the following rules. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `AssertionError` is thrown - * with a `message` property set equal to the value of the `message` parameter. If - * the `message` parameter is undefined, a default error message is assigned. If - * the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the `AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'node:assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text', - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text', - * }, - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * }, - * ); - * - * // Using regular expressions to validate error properties: - * assert.throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text', - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i, - * }, - * ); - * - * // Fails due to the different `message` and `name` properties: - * assert.throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err, - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error, - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/, - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error', - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an `ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'node:assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn` function. - * - * If an error is thrown and it is the same type as that specified by the `error` parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError, - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message` parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops', - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for `ifError()` itself. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is rejected. - * - * If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v20.x/api/errors.html#err_invalid_return_value) - * error. In both cases the error handler is skipped. - * - * Besides the async nature to await the completion behaves identically to {@link throws}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and `name` properties. - * - * If specified, `message` will be the message provided by the `{@link AssertionError}` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error, - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second argument, then `error` is assumed to - * be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If - * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v20.x/api/errors.html#err_invalid_return_value) error. In both cases - * the error handler is skipped. - * - * Using `assert.doesNotReject()` is actually not useful because there is little - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject( - block: (() => Promise) | Promise, - message?: string | Error, - ): Promise; - function doesNotReject( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * If the values do not match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an [Error](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. - * @since v13.6.0, v12.16.0 - */ - function match(value: string, regExp: RegExp, message?: string | Error): void; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * If the values do match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an [Error](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. - * @since v13.6.0, v12.16.0 - */ - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - /** - * In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example, - * {@link deepEqual} will behave like {@link deepStrictEqual}. - * - * In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error - * messages for objects display the objects, often truncated. - * - * To use strict assertion mode: - * - * ```js - * import { strict as assert } from 'node:assert';COPY - * import assert from 'node:assert/strict'; - * ``` - * - * Example error diff: - * - * ```js - * import { strict as assert } from 'node:assert'; - * - * assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]); - * // AssertionError: Expected inputs to be strictly deep-equal: - * // + actual - expected ... Lines skipped - * // - * // [ - * // [ - * // ... - * // 2, - * // + 3 - * // - '3' - * // ], - * // ... - * // 5 - * // ] - * ``` - * - * To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` environment variables. This will also - * deactivate the colors in the REPL. For more on color support in terminal environments, read the tty - * `getColorDepth()` documentation. - * - * @since v15.0.0, v13.9.0, v12.16.2, v9.9.0 - */ - namespace strict { - type AssertionError = assert.AssertionError; - type AssertPredicate = assert.AssertPredicate; - type CallTrackerCall = assert.CallTrackerCall; - type CallTrackerReportInformation = assert.CallTrackerReportInformation; - } - const strict: - & Omit< - typeof assert, - | "equal" - | "notEqual" - | "deepEqual" - | "notDeepEqual" - | "ok" - | "strictEqual" - | "deepStrictEqual" - | "ifError" - | "strict" - | "AssertionError" - > - & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - AssertionError: typeof AssertionError; - }; - } - export = assert; -} -declare module "node:assert" { - import assert = require("assert"); - export = assert; -} diff --git a/node_modules/@types/node/assert/strict.d.ts b/node_modules/@types/node/assert/strict.d.ts deleted file mode 100644 index f333913..0000000 --- a/node_modules/@types/node/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module "assert/strict" { - import { strict } from "node:assert"; - export = strict; -} -declare module "node:assert/strict" { - import { strict } from "node:assert"; - export = strict; -} diff --git a/node_modules/@types/node/async_hooks.d.ts b/node_modules/@types/node/async_hooks.d.ts deleted file mode 100644 index fd9d2aa..0000000 --- a/node_modules/@types/node/async_hooks.d.ts +++ /dev/null @@ -1,605 +0,0 @@ -/** - * We strongly discourage the use of the `async_hooks` API. - * Other APIs that can cover most of its use cases include: - * - * * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v20.x/api/async_context.html#class-asynclocalstorage) tracks async context - * * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v20.x/api/process.html#processgetactiveresourcesinfo) tracks active resources - * - * The `node:async_hooks` module provides an API to track asynchronous resources. - * It can be accessed using: - * - * ```js - * import async_hooks from 'node:async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/async_hooks.js) - */ -declare module "async_hooks" { - /** - * ```js - * import { executionAsyncId } from 'node:async_hooks'; - * import fs from 'node:fs'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * const path = '.'; - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on [promise execution tracking](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking). - * @since v8.1.0 - * @return The `asyncId` of the current execution context. Useful to track when something calls. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'node:fs'; - * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'node:http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook, - * } from 'async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * }, - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on [promise execution tracking](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking). - * @return The ID of the resource responsible for calling the callback that is currently being executed. - */ - function triggerAsyncId(): number; - interface HookCallbacks { - /** - * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId A unique ID for the async resource - * @param type The type of the async resource - * @param triggerAsyncId The unique ID of the async resource in whose execution context this async resource was created - * @param resource Reference to the resource representing the async operation, needs to be released during destroy - */ - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; - /** - * When an asynchronous operation is initiated or completes a callback is called to notify the user. - * The before callback is called just before said callback is executed. - * @param asyncId the unique identifier assigned to the resource about to execute the callback. - */ - before?(asyncId: number): void; - /** - * Called immediately after the callback specified in `before` is completed. - * - * If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs. - * @param asyncId the unique identifier assigned to the resource which has executed the callback. - */ - after?(asyncId: number): void; - /** - * Called when a promise has resolve() called. This may not be in the same execution id - * as the promise itself. - * @param asyncId the unique id for the promise that was resolve()d. - */ - promiseResolve?(asyncId: number): void; - /** - * Called after the resource corresponding to asyncId is destroyed - * @param asyncId a unique ID for the async resource - */ - destroy?(asyncId: number): void; - } - interface AsyncHook { - /** - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. - */ - enable(): this; - /** - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. - */ - disable(): this; - } - /** - * Registers functions to be called for different lifetime events of each async - * operation. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'node:async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { }, - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * Disables automatic `emitDestroy` when the object is garbage collected. - * This usually does not need to be set (even if `emitDestroy` is called - * manually), unless the resource's `asyncId` is retrieved and the - * sensitive API's `emitDestroy` is called with it. - * @default false - */ - requireManualDestroy?: boolean | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'node:async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }, - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - class AsyncResource { - /** - * AsyncResource() is meant to be extended. Instantiating a - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * async_hook.executionAsyncId() is used. - * @param type The type of async event. - * @param triggerAsyncId The ID of the execution context that created - * this async event (default: `executionAsyncId()`), or an - * AsyncResourceOptions object (since v9.3.0) - */ - constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); - /** - * Binds the given function to the current execution context. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg, - ): Func; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>(fn: Func): Func; - /** - * Call the provided function with the provided arguments in the execution context - * of the async resource. This will establish the context, trigger the AsyncHooks - * before callbacks, call the function, trigger the AsyncHooks after callbacks, and - * then restore the original execution context. - * @since v9.6.0 - * @param fn The function to call in the execution context of this async resource. - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runInAsyncScope( - fn: (this: This, ...args: any[]) => Result, - thisArg?: This, - ...args: any[] - ): Result; - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `node:async_hooks` module, `AsyncLocalStorage` should be preferred as it is a performant and memory - * safe implementation that involves significant optimizations that are non-obvious - * to implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'node:http'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other's data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * Binds the given function to the current execution context. - * @since v19.8.0 - * @experimental - * @param fn The function to bind to the current execution context. - * @return A new function that calls `fn` within the captured execution context. - */ - static bind any>(fn: Func): Func; - /** - * Captures the current execution context and returns a function that accepts a - * function as an argument. Whenever the returned function is called, it - * calls the function passed to it within the captured context. - * - * ```js - * const asyncLocalStorage = new AsyncLocalStorage(); - * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot()); - * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore())); - * console.log(result); // returns 123 - * ``` - * - * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple - * async context tracking purposes, for example: - * - * ```js - * class Foo { - * #runInAsyncScope = AsyncLocalStorage.snapshot(); - * - * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); } - * } - * - * const foo = asyncLocalStorage.run(123, () => new Foo()); - * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123 - * ``` - * @since v19.8.0 - * @experimental - * @return A new function with the signature `(fn: (...args) : R, ...args) : R`. - */ - static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the `asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function. - * The store is accessible to any asynchronous operations created within the - * callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * setTimeout(() => { - * asyncLocalStorage.getStore(); // Returns the store object - * }, 200); - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: () => R): R; - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()` call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why `run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } - /** - * @since v17.2.0, v16.14.0 - * @return A map of provider types to the corresponding numeric id. - * This map contains all the event types that might be emitted by the `async_hooks.init()` event. - */ - namespace asyncWrapProviders { - const NONE: number; - const DIRHANDLE: number; - const DNSCHANNEL: number; - const ELDHISTOGRAM: number; - const FILEHANDLE: number; - const FILEHANDLECLOSEREQ: number; - const FIXEDSIZEBLOBCOPY: number; - const FSEVENTWRAP: number; - const FSREQCALLBACK: number; - const FSREQPROMISE: number; - const GETADDRINFOREQWRAP: number; - const GETNAMEINFOREQWRAP: number; - const HEAPSNAPSHOT: number; - const HTTP2SESSION: number; - const HTTP2STREAM: number; - const HTTP2PING: number; - const HTTP2SETTINGS: number; - const HTTPINCOMINGMESSAGE: number; - const HTTPCLIENTREQUEST: number; - const JSSTREAM: number; - const JSUDPWRAP: number; - const MESSAGEPORT: number; - const PIPECONNECTWRAP: number; - const PIPESERVERWRAP: number; - const PIPEWRAP: number; - const PROCESSWRAP: number; - const PROMISE: number; - const QUERYWRAP: number; - const SHUTDOWNWRAP: number; - const SIGNALWRAP: number; - const STATWATCHER: number; - const STREAMPIPE: number; - const TCPCONNECTWRAP: number; - const TCPSERVERWRAP: number; - const TCPWRAP: number; - const TTYWRAP: number; - const UDPSENDWRAP: number; - const UDPWRAP: number; - const SIGINTWATCHDOG: number; - const WORKER: number; - const WORKERHEAPSNAPSHOT: number; - const WRITEWRAP: number; - const ZLIB: number; - const CHECKPRIMEREQUEST: number; - const PBKDF2REQUEST: number; - const KEYPAIRGENREQUEST: number; - const KEYGENREQUEST: number; - const KEYEXPORTREQUEST: number; - const CIPHERREQUEST: number; - const DERIVEBITSREQUEST: number; - const HASHREQUEST: number; - const RANDOMBYTESREQUEST: number; - const RANDOMPRIMEREQUEST: number; - const SCRYPTREQUEST: number; - const SIGNREQUEST: number; - const TLSWRAP: number; - const VERIFYREQUEST: number; - } -} -declare module "node:async_hooks" { - export * from "async_hooks"; -} diff --git a/node_modules/@types/node/buffer.buffer.d.ts b/node_modules/@types/node/buffer.buffer.d.ts deleted file mode 100644 index 023bb0f..0000000 --- a/node_modules/@types/node/buffer.buffer.d.ts +++ /dev/null @@ -1,471 +0,0 @@ -declare module "buffer" { - type ImplicitArrayBuffer> = T extends - { valueOf(): infer V extends ArrayBufferLike } ? V : T; - global { - interface BufferConstructor { - // see buffer.d.ts for implementation shared with all TypeScript versions - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new(str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new(size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: ArrayLike): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new(arrayBuffer: TArrayBuffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * If `array` is an `Array`-like object (that is, one with a `length` property of - * type `number`), it is treated as if it is an array, unless it is a `Buffer` or - * a `Uint8Array`. This means all other `TypedArray` variants get treated as an - * `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use - * `Buffer.copyBytesFrom()`. - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal - * `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from(array: WithImplicitCoercion>): Buffer; - /** - * This creates a view of the `ArrayBuffer` without copying the underlying - * memory. For example, when passed a reference to the `.buffer` property of a - * `TypedArray` instance, the newly created `Buffer` will share the same - * allocated memory as the `TypedArray`'s underlying `ArrayBuffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const arr = new Uint16Array(2); - * - * arr[0] = 5000; - * arr[1] = 4000; - * - * // Shares memory with `arr`. - * const buf = Buffer.from(arr.buffer); - * - * console.log(buf); - * // Prints: - * - * // Changing the original Uint16Array changes the Buffer also. - * arr[1] = 6000; - * - * console.log(buf); - * // Prints: - * ``` - * - * The optional `byteOffset` and `length` arguments specify a memory range within - * the `arrayBuffer` that will be shared by the `Buffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const ab = new ArrayBuffer(10); - * const buf = Buffer.from(ab, 0, 2); - * - * console.log(buf.length); - * // Prints: 2 - * ``` - * - * A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a - * `SharedArrayBuffer` or another type appropriate for `Buffer.from()` - * variants. - * - * It is important to remember that a backing `ArrayBuffer` can cover a range - * of memory that extends beyond the bounds of a `TypedArray` view. A new - * `Buffer` created using the `buffer` property of a `TypedArray` may extend - * beyond the range of the `TypedArray`: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements - * const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements - * console.log(arrA.buffer === arrB.buffer); // true - * - * const buf = Buffer.from(arrB.buffer); - * console.log(buf); - * // Prints: - * ``` - * @since v5.10.0 - * @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the - * `.buffer` property of a `TypedArray`. - * @param byteOffset Index of first byte to expose. **Default:** `0`. - * @param length Number of bytes to expose. **Default:** - * `arrayBuffer.byteLength - byteOffset`. - */ - from>( - arrayBuffer: TArrayBuffer, - byteOffset?: number, - length?: number, - ): Buffer>; - /** - * Creates a new `Buffer` containing `string`. The `encoding` parameter identifies - * the character encoding to be used when converting `string` into bytes. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('this is a tést'); - * const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); - * - * console.log(buf1.toString()); - * // Prints: this is a tést - * console.log(buf2.toString()); - * // Prints: this is a tést - * console.log(buf1.toString('latin1')); - * // Prints: this is a tést - * ``` - * - * A `TypeError` will be thrown if `string` is not a string or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(string)` may also use the internal `Buffer` pool like - * `Buffer.allocUnsafe()` does. - * @since v5.10.0 - * @param string A string to encode. - * @param encoding The encoding of `string`. **Default:** `'utf8'`. - */ - from(string: WithImplicitCoercion, encoding?: BufferEncoding): Buffer; - from(arrayOrString: WithImplicitCoercion | string>): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: readonly Uint8Array[], totalLength?: number): Buffer; - /** - * Copies the underlying memory of `view` into a new `Buffer`. - * - * ```js - * const u16 = new Uint16Array([0, 0xffff]); - * const buf = Buffer.copyBytesFrom(u16, 1, 1); - * u16[1] = 0; - * console.log(buf.length); // 2 - * console.log(buf[0]); // 255 - * console.log(buf[1]); // 255 - * ``` - * @since v19.8.0 - * @param view The {TypedArray} to copy. - * @param [offset=0] The starting offset within `view`. - * @param [length=view.length - offset] The number of elements from `view` to copy. - */ - copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if - * `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - } - interface Buffer extends Uint8Array { - // see buffer.d.ts for implementation shared with all TypeScript versions - - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * - * // With buf.slice(), the original buffer is modified. - * const notReallyCopiedBuf = buf.slice(); - * notReallyCopiedBuf[0]++; - * console.log(notReallyCopiedBuf.toString()); - * // Prints: cuffer - * console.log(buf.toString()); - * // Also prints: cuffer (!) - * ``` - * @since v0.3.0 - * @deprecated Use `subarray` instead. - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - } - // TODO: remove globals in future version - /** - * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports - * TypeScript versions earlier than 5.7. - */ - type NonSharedBuffer = Buffer; - /** - * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports - * TypeScript versions earlier than 5.7. - */ - type AllowSharedBuffer = Buffer; - } - /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */ - var SlowBuffer: { - /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */ - new(size: number): Buffer; - prototype: Buffer; - }; -} diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts deleted file mode 100644 index 7c2e873..0000000 --- a/node_modules/@types/node/buffer.d.ts +++ /dev/null @@ -1,1936 +0,0 @@ -// If lib.dom.d.ts or lib.webworker.d.ts is loaded, then use the global types. -// Otherwise, use the types from node. -type _Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : import("buffer").Blob; -type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : import("buffer").File; - -/** - * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many - * Node.js APIs support `Buffer`s. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. - * const buf7 = Buffer.from('tést', 'latin1'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/buffer.js) - */ -declare module "buffer" { - import { BinaryLike } from "node:crypto"; - import { ReadableStream as WebReadableStream } from "node:stream/web"; - /** - * This function returns `true` if `input` contains only valid UTF-8-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.4.0, v18.14.0 - * @param input The input to validate. - */ - export function isUtf8(input: ArrayBuffer | NodeJS.TypedArray): boolean; - /** - * This function returns `true` if `input` contains only valid ASCII-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.6.0, v18.15.0 - * @param input The input to validate. - */ - export function isAscii(input: ArrayBuffer | NodeJS.TypedArray): boolean; - export let INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "latin1" - | "binary"; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`, `'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'node:buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @param fromEnc The current encoding. - * @param toEnc To target encoding. - */ - export function transcode( - source: Uint8Array, - fromEnc: TranscodeEncoding, - toEnc: TranscodeEncoding, - ): NonSharedBuffer; - /** - * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using - * a prior call to `URL.createObjectURL()`. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - export function resolveObjectURL(id: string): Blob | undefined; - export { type AllowSharedBuffer, Buffer, type NonSharedBuffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts - * will be converted to the platform native line-ending as specified by `import { EOL } from 'node:node:os'`. - */ - endings?: "transparent" | "native"; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0, v14.18.0 - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0, v14.18.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0, v14.18.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0, v14.18.0 - */ - arrayBuffer(): Promise; - /** - * The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise`. - * - * ```js - * const blob = new Blob(['hello']); - * blob.bytes().then((bytes) => { - * console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ] - * }); - * ``` - * @since v20.16.0 - */ - bytes(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0, v14.18.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0, v14.18.0 - */ - text(): Promise; - /** - * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): WebReadableStream; - } - export interface FileOptions { - /** - * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be - * converted to the platform native line-ending as specified by `import { EOL } from 'node:node:os'`. - */ - endings?: "native" | "transparent"; - /** The File content-type. */ - type?: string; - /** The last modified date of the file. `Default`: Date.now(). */ - lastModified?: number; - } - /** - * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files. - * @since v19.2.0, v18.13.0 - */ - export class File extends Blob { - constructor(sources: Array, fileName: string, options?: FileOptions); - /** - * The name of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly name: string; - /** - * The last modified date of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly lastModified: number; - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - export type WithImplicitCoercion = - | T - | { valueOf(): T } - | (T extends string ? { [Symbol.toPrimitive](hint: "string"): T } : never); - global { - namespace NodeJS { - export { BufferEncoding }; - } - // Buffer class - type BufferEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "base64" - | "base64url" - | "latin1" - | "binary" - | "hex"; - /** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' - */ - interface BufferConstructor { - // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later - // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier - - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength( - string: string | NodeJS.ArrayBufferView | ArrayBufferLike, - encoding?: BufferEncoding, - ): number; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of `Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. - */ - compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - interface Buffer { - // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later - // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier - - /** - * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did - * not contain enough space to fit the entire string, only part of `string` will be - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: "Buffer"; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd` arguments can be used to limit the comparison to specific ranges within `target` and `buf` respectively. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`, `targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare( - target: Uint8Array, - targetStart?: number, - targetEnd?: number, - sourceStart?: number, - sourceEnd?: number, - ): -1 | 0 | 1; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntLE - * @since v14.9.0, v12.19.0 - */ - writeUintLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntBE - * @since v14.9.0, v12.19.0 - */ - writeUintBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - readBigUint64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - readBigUint64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntLE - * @since v14.9.0, v12.19.0 - */ - readUintLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntBE - * @since v14.9.0, v12.19.0 - */ - readUintBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * @alias Buffer.readUInt8 - * @since v14.9.0, v12.19.0 - */ - readUint8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * @alias Buffer.readUInt16LE - * @since v14.9.0, v12.19.0 - */ - readUint16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * @alias Buffer.readUInt16BE - * @since v14.9.0, v12.19.0 - */ - readUint16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * @alias Buffer.readUInt32LE - * @since v14.9.0, v12.19.0 - */ - readUint32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * @alias Buffer.readUInt32BE - * @since v14.9.0, v12.19.0 - */ - readUint32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap16(): this; - /** - * Interprets `buf` as an array of unsigned 32-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap32(): this; - /** - * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. - * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - swap64(): this; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a - * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt8 - * @since v14.9.0, v12.19.0 - */ - writeUint8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16LE - * @since v14.9.0, v12.19.0 - */ - writeUint16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16BE - * @since v14.9.0, v12.19.0 - */ - writeUint16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32LE - * @since v14.9.0, v12.19.0 - */ - writeUint32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32BE - * @since v14.9.0, v12.19.0 - */ - writeUint32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * - * // Fill a buffer with empty string - * const c = Buffer.allocUnsafe(5).fill(''); - * - * console.log(c.fill('')); - * // Prints: - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - fill(value: string | Uint8Array | number, offset: number, encoding: BufferEncoding): this; - fill(value: string | Uint8Array | number, encoding: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in `encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.subarray`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - indexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - lastIndexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - includes(value: string | number | Buffer, encoding: BufferEncoding): boolean; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - interface Blob extends _Blob {} - /** - * `Blob` class is a global reference for `import { Blob } from 'node:node:buffer'` - * https://nodejs.org/api/buffer.html#class-blob - * @since v18.0.0 - */ - var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T - : typeof import("buffer").Blob; - interface File extends _File {} - /** - * `File` class is a global reference for `import { File } from 'node:node:buffer'` - * https://nodejs.org/api/buffer.html#class-file - * @since v20.0.0 - */ - var File: typeof globalThis extends { onmessage: any; File: infer T } ? T - : typeof import("buffer").File; - } -} -declare module "node:buffer" { - export * from "buffer"; -} diff --git a/node_modules/@types/node/child_process.d.ts b/node_modules/@types/node/child_process.d.ts deleted file mode 100644 index 5089071..0000000 --- a/node_modules/@types/node/child_process.d.ts +++ /dev/null @@ -1,1475 +0,0 @@ -/** - * The `node:child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * import { spawn } from 'node:child_process'; - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * the parent Node.js process and the spawned subprocess. These pipes have - * limited (and platform-specific) capacity. If the subprocess writes to - * stdout in excess of that limit without the output being captured, the - * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed. - * - * The command lookup is performed using the `options.env.PATH` environment - * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is - * used. If `options.env` is set without `PATH`, lookup on Unix is performed - * on a default search path search of `/usr/bin:/bin` (see your operating system's - * manual for execvpe/execvp), on Windows the current processes environment - * variable `PATH` is used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as `PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `node:child_process` module provides a handful of - * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, - * the synchronous methods can have significant impact on performance due to - * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/child_process.js) - */ -declare module "child_process" { - import { NonSharedBuffer } from "node:buffer"; - import { Abortable, EventEmitter } from "node:events"; - import * as dgram from "node:dgram"; - import * as net from "node:net"; - import { Readable, Stream, Writable } from "node:stream"; - import { URL } from "node:url"; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server | dgram.Socket | undefined; - /** - * Instances of the `ChildProcess` represent spawned child processes. - * - * Instances of `ChildProcess` are not intended to be created directly. Rather, - * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create - * instances of `ChildProcess`. - * @since v2.2.0 - */ - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `null` or `undefined` if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` or `undefined` if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` or `undefined` if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Control | null; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and `subprocess.stdio[2]` are also available as `subprocess.stdin`, `subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * import assert from 'node:assert'; - * import fs from 'node:fs'; - * import child_process from 'node:child_process'; - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ], - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined, // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * import { spawn } from 'node:child_process'; - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is `false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * import { spawn } from 'node:child_process'; - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to `'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'], - * }, - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * Calls {@link ChildProcess.kill} with `'SIGTERM'`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * import cp from 'node:child_process'; - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the `'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for `'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received and buffered in - * the socket will not be sent to the child. Sending IPC sockets is not supported on Windows. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an `'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```js - * import child_process from 'node:child_process'; - * const subprocess = child_process.fork('subprocess.js'); - * - * // Open up the server object and send the handle. - * import net from 'node:net'; - * const server = net.createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `node:net` module, `node:dgram` module servers use exactly the same workflow with the exceptions of - * listening on a `'message'` event instead of `'connection'` and using `server.bind()` instead of `server.listen()`. This is, however, only - * supported on Unix platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * import { fork } from 'node:child_process'; - * const normal = fork('subprocess.js', ['normal']); - * const special = fork('subprocess.js', ['special']); - * - * // Open up the server and send sockets to child. Use pauseOnConnect to prevent - * // the sockets from being read before they are sent to the child process. - * import net from 'node:net'; - * const server = net.createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * as the connection may have been closed during the time it takes to send the - * connection to the child. - * @since v0.5.9 - * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v20.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v20.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v20.x/api/dgram.html#class-dgramsocket) object. - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: Serializable, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send( - message: Serializable, - sendHandle?: SendHandle, - options?: MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the `subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: "spawn", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean; - emit(event: "spawn", listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: "spawn", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: "spawn", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: "spawn", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "close", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "exit", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: "spawn", listener: () => void): this; - } - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio - extends ChildProcess - { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - interface Control extends EventEmitter { - ref(): void; - unref(): void; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = "overlapped" | "pipe" | "ignore" | "inherit"; - type StdioOptions = IOType | Array; - type SerializationType = "json" | "advanced"; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default false - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = "inherit" | "ignore" | Stream; - type StdioPipeNamed = "pipe" | "overlapped"; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple< - Stdin extends StdioNull | StdioPipe, - Stdout extends StdioNull | StdioPipe, - Stderr extends StdioNull | StdioPipe, - > extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given `command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env, - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * import { spawn } from 'node:child_process'; - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * import { spawn } from 'node:child_process'; - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * import { spawn } from 'node:child_process'; - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js overwrites `argv[0]` with `process.execPath` on startup, so `process.argv[0]` in a Node.js child process will not match the `argv0` parameter passed to `spawn` from the parent. Retrieve - * it with the `process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * import { spawn } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn( - command: string, - args?: readonly string[], - options?: SpawnOptionsWithoutStdio, - ): ChildProcessWithoutNullStreams; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - signal?: AbortSignal | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - encoding?: string | null | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding?: BufferEncoding | undefined; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: "buffer" | null; // specify `null`. - } - // TODO: Just Plain Wrong™ (see also nodejs/node#57392) - interface ExecException extends Error { - cmd?: string; - killed?: boolean; - code?: number; - signal?: NodeJS.Signals; - stdout?: string; - stderr?: string; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * import { exec } from 'node:child_process'; - * - * exec('"/path/to/test file/test.sh" arg1 arg2'); - * // Double quotes are used so that the space in the path is not interpreted as - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments `(error, stdout, stderr)`. On success, `error` will be `null`. On error, `error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0` indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * import { exec } from 'node:child_process'; - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * import util from 'node:util'; - * import child_process from 'node:child_process'; - * const exec = util.promisify(child_process.exec); - * - * async function lsExample() { - * const { stdout, stderr } = await exec('ls'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * import { exec } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - function exec( - command: string, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function exec( - command: string, - options: ExecOptionsWithBufferEncoding, - callback?: (error: ExecException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void, - ): ChildProcess; - // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: ExecOptionsWithStringEncoding, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function exec( - command: string, - options: ExecOptions | undefined | null, - callback?: ( - error: ExecException | null, - stdout: string | NonSharedBuffer, - stderr: string | NonSharedBuffer, - ) => void, - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: NonSharedBuffer; - stderr: NonSharedBuffer; - }>; - function __promisify__( - command: string, - options: ExecOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptions | undefined | null, - ): PromiseWithChild<{ - stdout: string | NonSharedBuffer; - stderr: string | NonSharedBuffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - encoding?: string | null | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding?: BufferEncoding | undefined; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: "buffer" | null; - } - /** @deprecated Use `ExecFileOptions` instead. */ - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {} - // TODO: execFile exceptions can take many forms... this accurately describes none of them - type ExecFileException = - & Omit - & Omit - & { code?: string | number | null }; - /** - * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified - * executable `file` is spawned directly as a new process making it slightly more - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * import { execFile } from 'node:child_process'; - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * import util from 'node:util'; - * const execFile = util.promisify(require('node:child_process').execFile); - * async function getVersion() { - * const { stdout } = await execFile('node', ['--version']); - * console.log(stdout); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * import { execFile } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @param callback Called with the output when process terminates. - */ - // no `options` definitely means stdout/stderr are `string`. - function execFile( - file: string, - callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function execFile( - file: string, - options: ExecFileOptionsWithBufferEncoding, - callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void, - ): ChildProcess; - // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptionsWithStringEncoding, - callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: ExecFileOptions | undefined | null, - callback: - | (( - error: ExecFileException | null, - stdout: string | NonSharedBuffer, - stderr: string | NonSharedBuffer, - ) => void) - | undefined - | null, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptions | undefined | null, - callback: - | (( - error: ExecFileException | null, - stdout: string | NonSharedBuffer, - stderr: string | NonSharedBuffer, - ) => void) - | undefined - | null, - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: NonSharedBuffer; - stderr: NonSharedBuffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: NonSharedBuffer; - stderr: NonSharedBuffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptions | undefined | null, - ): PromiseWithChild<{ - stdout: string | NonSharedBuffer; - stderr: string | NonSharedBuffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptions | undefined | null, - ): PromiseWithChild<{ - stdout: string | NonSharedBuffer; - stderr: string | NonSharedBuffer; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the `options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by `child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * import { fork } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string | URL, options?: ForkOptions): ChildProcess; - function fork(modulePath: string | URL, args?: readonly string[], options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: "buffer" | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithStringEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithBufferEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args?: readonly string[], - options?: SpawnSyncOptions, - ): SpawnSyncReturns; - interface CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - /** - * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: "buffer" | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM` signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - function execSync(command: string): NonSharedBuffer; - function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): NonSharedBuffer; - function execSync(command: string, options?: ExecSyncOptions): string | NonSharedBuffer; - interface ExecFileSyncOptions extends CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding?: "buffer" | null | undefined; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): NonSharedBuffer; - function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): NonSharedBuffer; - function execFileSync(file: string, options?: ExecFileSyncOptions): string | NonSharedBuffer; - function execFileSync(file: string, args: readonly string[]): NonSharedBuffer; - function execFileSync( - file: string, - args: readonly string[], - options: ExecFileSyncOptionsWithStringEncoding, - ): string; - function execFileSync( - file: string, - args: readonly string[], - options: ExecFileSyncOptionsWithBufferEncoding, - ): NonSharedBuffer; - function execFileSync( - file: string, - args?: readonly string[], - options?: ExecFileSyncOptions, - ): string | NonSharedBuffer; -} -declare module "node:child_process" { - export * from "child_process"; -} diff --git a/node_modules/@types/node/cluster.d.ts b/node_modules/@types/node/cluster.d.ts deleted file mode 100644 index 42b21bf..0000000 --- a/node_modules/@types/node/cluster.d.ts +++ /dev/null @@ -1,577 +0,0 @@ -/** - * Clusters of Node.js processes can be used to run multiple instances of Node.js - * that can distribute workloads among their application threads. When process isolation - * is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html) - * module instead, which allows running multiple application threads within a single Node.js instance. - * - * The cluster module allows easy creation of child processes that all share - * server ports. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/cluster.js) - */ -declare module "cluster" { - import * as child from "node:child_process"; - import EventEmitter = require("node:events"); - import * as net from "node:net"; - type SerializationType = "json" | "advanced"; - export interface ClusterSettings { - /** - * List of string arguments passed to the Node.js executable. - * @default process.execArgv - */ - execArgv?: string[] | undefined; - /** - * File path to worker file. - * @default process.argv[1] - */ - exec?: string | undefined; - /** - * String arguments passed to worker. - * @default process.argv.slice(2) - */ - args?: readonly string[] | undefined; - /** - * Whether or not to send output to parent's stdio. - * @default false - */ - silent?: boolean | undefined; - /** - * Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must - * contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processspawncommand-args-options)'s - * [`stdio`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#optionsstdio). - */ - stdio?: any[] | undefined; - /** - * Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).) - */ - uid?: number | undefined; - /** - * Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).) - */ - gid?: number | undefined; - /** - * Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number. - * By default each worker gets its own port, incremented from the primary's `process.debugPort`. - */ - inspectPort?: number | (() => number) | undefined; - /** - * Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. - * See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#advanced-serialization) for more details. - * @default false - */ - serialization?: SerializationType | undefined; - /** - * Current working directory of the worker process. - * @default undefined (inherits from parent process) - */ - cwd?: string | undefined; - /** - * Hide the forked processes console window that would normally be created on Windows systems. - * @default false - */ - windowsHide?: boolean | undefined; - } - export interface Address { - address: string; - port: number; - /** - * The `addressType` is one of: - * - * * `4` (TCPv4) - * * `6` (TCPv6) - * * `-1` (Unix domain socket) - * * `'udp4'` or `'udp6'` (UDPv4 or UDPv6) - */ - addressType: 4 | 6 | -1 | "udp4" | "udp6"; - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the `id`. - * - * While a worker is alive, this is the key that indexes it in `cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object - * from this function is stored as `.process`. In a worker, the global `process` is stored. - * - * See: [Child Process module](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options). - * - * Workers will call `process.exit(0)` if the `'disconnect'` event occurs - * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * Send a message to a worker or primary, optionally with a handle. - * - * In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). - * - * In a worker, this sends a message to the primary. It is identical to `process.send()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - callback?: (error: Error | null) => void, - ): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - options?: child.MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * This function will kill the worker. In the primary worker, it does this by - * disconnecting the `worker.process`, and once disconnected, killing with `signal`. In the worker, it does it by killing the process with `signal`. - * - * The `kill()` function kills the worker process without waiting for a graceful - * disconnect, it has the same behavior as `worker.process.kill()`. - * - * This method is aliased as `worker.destroy()` for backwards compatibility. - * - * In a worker, `process.kill()` exists, but it is not this function; - * it is [`kill()`](https://nodejs.org/docs/latest-v20.x/api/process.html#processkillpid-signal). - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call `.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * the `'disconnect'` event has not been emitted after some time. - * - * ```js - * import net from 'node:net'; - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * let timeout; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): this; - /** - * This function returns `true` if the worker is connected to its primary via its - * IPC channel, `false` otherwise. A worker is connected to its primary after it - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.disconnect()`. - * If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "exit", listener: (code: number, signal: string) => void): this; - addListener(event: "listening", listener: (address: Address) => void): this; - addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "exit", code: number, signal: string): boolean; - emit(event: "listening", address: Address): boolean; - emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "exit", listener: (code: number, signal: string) => void): this; - on(event: "listening", listener: (address: Address) => void): this; - on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "exit", listener: (code: number, signal: string) => void): this; - once(event: "listening", listener: (address: Address) => void): this; - once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependListener(event: "listening", listener: (address: Address) => void): this; - prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: "online", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependOnceListener(event: "listening", listener: (address: Address) => void): this; - prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: "online", listener: () => void): this; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - /** - * Spawn a new worker process. - * - * This can only be called from the primary process. - * @param env Key/value pairs to add to worker process environment. - * @since v0.6.0 - */ - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - /** - * True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` - * is undefined, then `isPrimary` is `true`. - * @since v16.0.0 - */ - readonly isPrimary: boolean; - /** - * True if the process is not a primary (it is the negation of `cluster.isPrimary`). - * @since v0.6.0 - */ - readonly isWorker: boolean; - /** - * The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a - * global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings) - * is called, whichever comes first. - * - * `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute - * IOCP handles without incurring a large performance hit. - * - * `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`. - * @since v0.11.2 - */ - schedulingPolicy: number; - /** - * After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings) - * (or [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv)) this settings object will contain - * the settings, including the default values. - * - * This object is not intended to be changed or set manually. - * @since v0.7.1 - */ - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings) instead. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`. - * - * Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv) - * and have no effect on workers that are already running. - * - * The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to - * [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv). - * - * The defaults above apply to the first call only; the defaults for later calls are the current values at the time of - * `cluster.setupPrimary()` is called. - * - * ```js - * import cluster from 'node:cluster'; - * - * cluster.setupPrimary({ - * exec: 'worker.js', - * args: ['--use', 'https'], - * silent: true, - * }); - * cluster.fork(); // https worker - * cluster.setupPrimary({ - * exec: 'worker.js', - * args: ['--use', 'http'], - * }); - * cluster.fork(); // http worker - * ``` - * - * This can only be called from the primary process. - * @since v16.0.0 - */ - setupPrimary(settings?: ClusterSettings): void; - /** - * A reference to the current worker object. Not available in the primary process. - * - * ```js - * import cluster from 'node:cluster'; - * - * if (cluster.isPrimary) { - * console.log('I am primary'); - * cluster.fork(); - * cluster.fork(); - * } else if (cluster.isWorker) { - * console.log(`I am worker #${cluster.worker.id}`); - * } - * ``` - * @since v0.7.0 - */ - readonly worker?: Worker; - /** - * A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process. - * - * A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it - * is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted. - * - * ```js - * import cluster from 'node:cluster'; - * - * for (const worker of Object.values(cluster.workers)) { - * worker.send('big announcement to all workers'); - * } - * ``` - * @since v0.7.0 - */ - readonly workers?: NodeJS.Dict; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: (worker: Worker) => void): this; - addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: "fork", listener: (worker: Worker) => void): this; - addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - addListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: (worker: Worker) => void): this; - addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect", worker: Worker): boolean; - emit(event: "exit", worker: Worker, code: number, signal: string): boolean; - emit(event: "fork", worker: Worker): boolean; - emit(event: "listening", worker: Worker, address: Address): boolean; - emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online", worker: Worker): boolean; - emit(event: "setup", settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: (worker: Worker) => void): this; - on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: "fork", listener: (worker: Worker) => void): this; - on(event: "listening", listener: (worker: Worker, address: Address) => void): this; - on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: (worker: Worker) => void): this; - on(event: "setup", listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: (worker: Worker) => void): this; - once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: "fork", listener: (worker: Worker) => void): this; - once(event: "listening", listener: (worker: Worker, address: Address) => void): this; - once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: (worker: Worker) => void): this; - once(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: "fork", listener: (worker: Worker) => void): this; - prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - prependListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; - prependListener(event: "online", listener: (worker: Worker) => void): this; - prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; - prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; - prependOnceListener(event: "online", listener: (worker: Worker) => void): this; - prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - } - const cluster: Cluster; - export default cluster; -} -declare module "node:cluster" { - export * from "cluster"; - export { default as default } from "cluster"; -} diff --git a/node_modules/@types/node/compatibility/disposable.d.ts b/node_modules/@types/node/compatibility/disposable.d.ts deleted file mode 100644 index 5fff612..0000000 --- a/node_modules/@types/node/compatibility/disposable.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Polyfills for the explicit resource management types added in TypeScript 5.2. -// TODO: remove once this package no longer supports TS 5.1, and replace with a -// to TypeScript's disposable library in index.d.ts. - -interface SymbolConstructor { - readonly dispose: unique symbol; - readonly asyncDispose: unique symbol; -} - -interface Disposable { - [Symbol.dispose](): void; -} - -interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; -} diff --git a/node_modules/@types/node/compatibility/index.d.ts b/node_modules/@types/node/compatibility/index.d.ts deleted file mode 100644 index 5c41e37..0000000 --- a/node_modules/@types/node/compatibility/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Declaration files in this directory contain types relating to TypeScript library features -// that are not included in all TypeScript versions supported by DefinitelyTyped, but -// which can be made backwards-compatible without needing `typesVersions`. -// If adding declarations to this directory, please specify which versions of TypeScript require them, -// so that they can be removed when no longer needed. - -/// -/// -/// diff --git a/node_modules/@types/node/compatibility/indexable.d.ts b/node_modules/@types/node/compatibility/indexable.d.ts deleted file mode 100644 index 262ba09..0000000 --- a/node_modules/@types/node/compatibility/indexable.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Polyfill for ES2022's .at() method on string/array prototypes, added to TypeScript in 4.6. - -interface RelativeIndexable { - at(index: number): T | undefined; -} - -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface ReadonlyArray extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} diff --git a/node_modules/@types/node/compatibility/iterators.d.ts b/node_modules/@types/node/compatibility/iterators.d.ts deleted file mode 100644 index 156e785..0000000 --- a/node_modules/@types/node/compatibility/iterators.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6. -// The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects -// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded. -// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods -// if lib.esnext.iterator is loaded. -// TODO: remove once this package no longer supports TS 5.5, and replace NodeJS.BuiltinIteratorReturn with BuiltinIteratorReturn. - -// Placeholders for TS <5.6 -interface IteratorObject {} -interface AsyncIteratorObject {} - -declare namespace NodeJS { - // Populate iterator methods for TS <5.6 - interface Iterator extends globalThis.Iterator {} - interface AsyncIterator extends globalThis.AsyncIterator {} - - // Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators - type BuiltinIteratorReturn = ReturnType extends - globalThis.Iterator ? TReturn - : any; -} diff --git a/node_modules/@types/node/console.d.ts b/node_modules/@types/node/console.d.ts deleted file mode 100644 index 206e3fc..0000000 --- a/node_modules/@types/node/console.d.ts +++ /dev/null @@ -1,452 +0,0 @@ -/** - * The `node:console` module provides a simple debugging console that is similar to - * the JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and - * [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v20.x/api/process.html#a-note-on-process-io) for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/console.js) - */ -declare module "console" { - import console = require("node:console"); - export = console; -} -declare module "node:console" { - import { InspectOptions } from "node:util"; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using - * [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args). - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()` operates similarly to the `clear` shell command. On Windows, `console.clear()` will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options) on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) - * (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then - * [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options) is called on each argument and the - * resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args) - * for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation` length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation` length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) - * (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args) for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData` (or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can't be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: readonly string[]): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - * @param [label='default'] - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('bunch-of-stuff'); - * // Do a bunch of stuff. - * console.timeEnd('bunch-of-stuff'); - * // Prints: bunch-of-stuff: 225.438ms - * ``` - * @since v0.1.104 - * @param [label='default'] - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - * @param [label='default'] - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args) - * formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. The `console.profile()` - * method starts a JavaScript CPU profile with an optional label until {@link profileEnd} - * is called. The profile is then added to the Profile panel of the inspector. - * - * ```js - * console.profile('MyLabel'); - * // Some code - * console.profileEnd('MyLabel'); - * // Adds the profile 'MyLabel' to the Profiles panel of the inspector. - * ``` - * @since v8.0.0 - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. Stops the current - * JavaScript CPU profiling session if one has been started and prints the report to the - * Profiles panel of the inspector. See {@link profile} for an example. - * - * If this method is called without a label, the most recently started profile is stopped. - * @since v8.0.0 - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. The `console.timeStamp()` - * method adds an event with the label `'label'` to the Timeline panel of the inspector. - * @since v8.0.0 - */ - timeStamp(label?: string): void; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and - * [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v20.x/api/process.html#a-note-on-process-io) for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.11.1/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - /** - * Ignore errors when writing to the underlying streams. - * @default true - */ - ignoreErrors?: boolean | undefined; - /** - * Set color support for this `Console` instance. Setting to true enables coloring while inspecting - * values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color - * support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the - * respective stream. This option can not be used, if `inspectOptions.colors` is set as well. - * @default auto - */ - colorMode?: boolean | "auto" | undefined; - /** - * Specifies options that are passed along to - * [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options). - */ - inspectOptions?: InspectOptions | undefined; - /** - * Set group indentation. - * @default 2 - */ - groupIndentation?: number | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new(options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/node_modules/@types/node/constants.d.ts b/node_modules/@types/node/constants.d.ts deleted file mode 100644 index 5685a9d..0000000 --- a/node_modules/@types/node/constants.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @deprecated The `node:constants` module is deprecated. When requiring access to constants - * relevant to specific Node.js builtin modules, developers should instead refer - * to the `constants` property exposed by the relevant module. For instance, - * `require('node:fs').constants` and `require('node:os').constants`. - */ -declare module "constants" { - const constants: - & typeof import("node:os").constants.dlopen - & typeof import("node:os").constants.errno - & typeof import("node:os").constants.priority - & typeof import("node:os").constants.signals - & typeof import("node:fs").constants - & typeof import("node:crypto").constants; - export = constants; -} - -declare module "node:constants" { - import constants = require("constants"); - export = constants; -} diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts deleted file mode 100644 index 036cf8c..0000000 --- a/node_modules/@types/node/crypto.d.ts +++ /dev/null @@ -1,4590 +0,0 @@ -/** - * The `node:crypto` module provides cryptographic functionality that includes a - * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify - * functions. - * - * ```js - * const { createHmac } = await import('node:crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/crypto.js) - */ -declare module "crypto" { - import { NonSharedBuffer } from "node:buffer"; - import * as stream from "node:stream"; - import { PeerCertificate } from "node:tls"; - /** - * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of HTML5's `keygen` element. - * - * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects - * should not use this element anymore. - * - * The `node:crypto` module provides the `Certificate` class for working with SPKAC - * data. The most common usage is handling output generated by the HTML5 `` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. - * @since v0.11.8 - */ - class Certificate { - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const challenge = Certificate.exportChallenge(spkac); - * console.log(challenge.toString('utf8')); - * // Prints: the challenge as a UTF8 string - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportChallenge(spkac: BinaryLike): NonSharedBuffer; - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const publicKey = Certificate.exportPublicKey(spkac); - * console.log(publicKey); - * // Prints: the public key as - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer; - /** - * ```js - * import { Buffer } from 'node:buffer'; - * const { Certificate } = await import('node:crypto'); - * - * const spkac = getSpkacSomehow(); - * console.log(Certificate.verifySpkac(Buffer.from(spkac))); - * // Prints: true or false - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return `true` if the given `spkac` data structure is valid, `false` otherwise. - */ - static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): NonSharedBuffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - namespace constants { - // https://nodejs.org/dist/latest-v20.x/docs/api/crypto.html#crypto-constants - const OPENSSL_VERSION_NUMBER: number; - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */ - const SSL_OP_ALLOW_NO_DHE_KEX: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's version identifier of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - /** Instructs OpenSSL to disable encrypt-then-MAC. */ - const SSL_OP_NO_ENCRYPT_THEN_MAC: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to disable renegotiation. */ - const SSL_OP_NO_RENEGOTIATION: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - /** Instructs OpenSSL to turn off SSL v2 */ - const SSL_OP_NO_SSLv2: number; - /** Instructs OpenSSL to turn off SSL v3 */ - const SSL_OP_NO_SSLv3: number; - /** Instructs OpenSSL to disable use of RFC4507bis tickets. */ - const SSL_OP_NO_TICKET: number; - /** Instructs OpenSSL to turn off TLS v1 */ - const SSL_OP_NO_TLSv1: number; - /** Instructs OpenSSL to turn off TLS v1.1 */ - const SSL_OP_NO_TLSv1_1: number; - /** Instructs OpenSSL to turn off TLS v1.2 */ - const SSL_OP_NO_TLSv1_2: number; - /** Instructs OpenSSL to turn off TLS v1.3 */ - const SSL_OP_NO_TLSv1_3: number; - /** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */ - const SSL_OP_PRIORITIZE_CHACHA: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHash, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was - * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not - * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary"; - type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1"; - type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2"; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { createHash } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: HashOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): NonSharedBuffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - * @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances. - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): NonSharedBuffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = "secret" | "public" | "private"; - interface KeyExportOptions { - type: "pkcs1" | "spki" | "pkcs8" | "sec1"; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: "jwk"; - } - interface JsonWebKey { - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - k?: string; - kty?: string; - n?: string; - p?: string; - q?: string; - qi?: string; - x?: string; - y?: string; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number; - /** - * Name of the curve (EC). - */ - namedCurve?: string; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * Example: Converting a `CryptoKey` instance to a `KeyObject`: - * - * ```js - * const { KeyObject } = await import('node:crypto'); - * const { subtle } = globalThis.crypto; - * - * const key = await subtle.generateKey({ - * name: 'HMAC', - * hash: 'SHA-256', - * length: 256, - * }, true, ['sign', 'verify']); - * - * const keyObject = KeyObject.from(key); - * console.log(keyObject.symmetricKeySize); - * // Prints: 32 (symmetric key size in bytes) - * ``` - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<"pem">): string | NonSharedBuffer; - export(options?: KeyExportOptions<"der">): NonSharedBuffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * Returns `true` or `false` depending on whether the keys have exactly the same - * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). - * @since v17.7.0, v16.15.0 - * @param otherKeyObject A `KeyObject` with which to compare `keyObject`. - */ - equals(otherKeyObject: KeyObject): boolean; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm"; - type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; - type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb"; - type CipherChaCha20Poly1305Types = "chacha20-poly1305"; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - interface CipherOCBOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherChaCha20Poly1305Options extends stream.TransformOptions { - /** @default 16 */ - authTagLength?: number | undefined; - } - /** - * Creates and returns a `Cipher` object that uses the given `algorithm` and `password`. - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `password` is used to derive the cipher key and initialization vector (IV). - * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. - * - * **This function is semantically insecure for all** - * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** - * **GCM, or CCM).** - * - * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode - * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when - * they are used in order to avoid the risk of IV reuse that causes - * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. - * @param options `stream.transform` options - */ - function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherOCBTypes, password: BinaryLike, options: CipherOCBOptions): CipherOCB; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher( - algorithm: CipherChaCha20Poly1305Types, - password: BinaryLike, - options?: CipherChaCha20Poly1305Options, - ): CipherChaCha20Poly1305; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createCipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): CipherCCM; - function createCipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): CipherOCB; - function createCipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): CipherGCM; - function createCipheriv( - algorithm: CipherChaCha20Poly1305Types, - key: CipherKey, - iv: BinaryLike, - options?: CipherChaCha20Poly1305Options, - ): CipherChaCha20Poly1305; - function createCipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Cipher; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipher} or {@link createCipheriv} methods are - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * - * import { - * pipeline, - * } from 'node:stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or `DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then `inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): NonSharedBuffer; - update(data: string, inputEncoding: Encoding): NonSharedBuffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): NonSharedBuffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - getAuthTag(): NonSharedBuffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): NonSharedBuffer; - } - interface CipherOCB extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): NonSharedBuffer; - } - interface CipherChaCha20Poly1305 extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - getAuthTag(): NonSharedBuffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm` and `password` (key). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * **This function is semantically insecure for all** - * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** - * **GCM, or CCM).** - * - * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. - * @param options `stream.transform` options - */ - function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherOCBTypes, password: BinaryLike, options: CipherOCBOptions): DecipherOCB; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher( - algorithm: CipherChaCha20Poly1305Types, - password: BinaryLike, - options?: CipherChaCha20Poly1305Options, - ): DecipherChaCha20Poly1305; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength` option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): DecipherCCM; - function createDecipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): DecipherOCB; - function createDecipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): DecipherGCM; - function createDecipheriv( - algorithm: CipherChaCha20Poly1305Types, - key: CipherKey, - iv: BinaryLike, - options?: CipherChaCha20Poly1305Options, - ): DecipherChaCha20Poly1305; - function createDecipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipher} or {@link createDecipheriv} methods are - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * let chunk; - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data` argument is a string using the specified encoding. If the `inputEncoding` argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding` is specified, a string using the specified encoding is returned. If no `outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): NonSharedBuffer; - update(data: string, inputEncoding: Encoding): NonSharedBuffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): NonSharedBuffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface DecipherOCB extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface DecipherChaCha20Poly1305 extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "pkcs8" | "sec1" | undefined; - passphrase?: string | Buffer | undefined; - encoding?: string | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "spki" | undefined; - encoding?: string | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey, - * } = await import('node:crypto'); - * - * generateKey('hmac', { length: 512 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: "hmac" | "aes", - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void, - ): void; - /** - * Synchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKeySync, - * } = await import('node:crypto'); - * - * const key = generateKeySync('hmac', { length: 512 }); - * console.log(key.export().toString('hex')); // e89..........41e - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKeySync( - type: "hmac" | "aes", - options: { - length: number; - }, - ): KeyObject; - interface JsonWebKeyInput { - key: JsonWebKey; - format: "jwk"; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key` must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type `'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = "der" | "ieee-p1363"; - interface SigningOptions { - /** - * @see crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1', - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer; - sign( - privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, - outputFormat: BinaryToTextEncoding, - ): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances. `Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or `DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if `object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: string, - signature_format?: BinaryToTextEncoding, - ): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If `generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createDiffieHellman, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values unless they have been - * generated or computed already, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, - * once a private key has been generated or set, calling this function only updates - * the public key but does not generate a new private key. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): NonSharedBuffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret( - otherPublicKey: NodeJS.ArrayBufferView, - inputEncoding?: null, - outputEncoding?: null, - ): NonSharedBuffer; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding?: null, - ): NonSharedBuffer; - computeSecret( - otherPublicKey: NodeJS.ArrayBufferView, - inputEncoding: null, - outputEncoding: BinaryToTextEncoding, - ): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): NonSharedBuffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): NonSharedBuffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): NonSharedBuffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): NonSharedBuffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * - * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be - * used to manually provide the public key or to automatically derive it. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `node:constants` module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. - * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. - * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. - * - * ```js - * const { createDiffieHellmanGroup } = await import('node:crypto'); - * const dh = createDiffieHellmanGroup('modp1'); - * ``` - * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): - * ```bash - * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h - * modp1 # 768 bits - * modp2 # 1024 bits - * modp5 # 1536 bits - * modp14 # 2048 bits - * modp15 # etc. - * modp16 - * modp17 - * modp18 - * ``` - * @since v0.7.5 - */ - const DiffieHellmanGroup: DiffieHellmanGroupConstructor; - interface DiffieHellmanGroupConstructor { - new(name: string): DiffieHellmanGroup; - (name: string): DiffieHellmanGroup; - readonly prototype: DiffieHellmanGroup; - } - type DiffieHellmanGroup = Omit; - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are listed in the documentation for `DiffieHellmanGroup`. - * - * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman, - * } = await import('node:crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellmanGroup; - /** - * An alias for {@link getDiffieHellman} - * @since v0.9.3 - */ - function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated `derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2, - * } = await import('node:crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - callback: (err: Error | null, derivedKey: NonSharedBuffer) => void, - ): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync, - * } = await import('node:crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - ): NonSharedBuffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The `buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - function randomBytes(size: number): NonSharedBuffer; - function randomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void; - function pseudoRandomBytes(size: number): NonSharedBuffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 2**48. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as `buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - function randomFill( - buffer: T, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - size: number, - callback: (err: Error | null, buf: T) => void, - ): void; - interface ScryptOptions { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`. `err` is an exception object when key derivation fails, otherwise `err` is `null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt, - * } = await import('node:crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: NonSharedBuffer) => void, - ): void; - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - options: ScryptOptions, - callback: (err: Error | null, derivedKey: NonSharedBuffer) => void, - ): void; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync, - * } = await import('node:crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - options?: ScryptOptions, - ): NonSharedBuffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt( - key: RsaPublicKey | RsaPrivateKey | KeyLike, - buffer: NodeJS.ArrayBufferView, - ): NonSharedBuffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt( - key: RsaPublicKey | RsaPrivateKey | KeyLike, - buffer: NodeJS.ArrayBufferView, - ): NonSharedBuffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): NonSharedBuffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): NonSharedBuffer; - /** - * ```js - * const { - * getCiphers, - * } = await import('node:crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves, - * } = await import('node:crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. - * Throws an error if FIPS mode is not available. - * @since v10.0.0 - * @param bool `true` to enable FIPS mode. - */ - function setFips(bool: boolean): void; - /** - * ```js - * const { - * getHashes, - * } = await import('node:crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createECDH, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'` format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH, - * } = await import('node:crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: "latin1" | "hex" | "base64" | "base64url", - format?: "uncompressed" | "compressed" | "hybrid", - ): NonSharedBuffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): NonSharedBuffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey` lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): NonSharedBuffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): NonSharedBuffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): NonSharedBuffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function compares the underlying bytes that represent the given `ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time - * algorithm. - * - * This function does not leak timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. An error is thrown if `a` and `b` have - * different byte lengths. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * **When both of the inputs are `Float32Array`s or `Float64Array`s, this function might return unexpected results due to IEEE 754** - * **encoding of floating-point numbers. In particular, neither `x === y` nor `Object.is(x, y)` implies that the byte representations of two floating-point** - * **numbers `x` and `y` are equal.** - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448"; - type KeyFormat = "pem" | "der" | "jwk"; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use - */ - namedCurve: string; - /** - * Must be `'named'` or `'explicit'`. Default: `'named'`. - */ - paramEncoding?: "explicit" | "named" | undefined; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes - */ - saltLength?: string | undefined; - } - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - } - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs1" | "pkcs8"; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes - */ - saltLength?: string | undefined; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ECKeyPairOptions extends ECKeyPairKeyObjectOptions { - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "sec1" | "pkcs8"; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync, - * } = await import('node:crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as `'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair, - * } = await import('node:crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and `publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - namespace generateKeyPair { - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ed25519", - options?: ED25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "x25519", - options?: X25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: NonSharedBuffer; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: NonSharedBuffer; - privateKey: NonSharedBuffer; - }>; - function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise; - } - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, - ): NonSharedBuffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, - callback: (error: Error | null, data: NonSharedBuffer) => void, - ): void; - /** - * Verifies the given signature for `data` using the given key and algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is dependent upon the - * key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void, - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'` (for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer; - /** - * A utility for creating one-shot hash digests of data. It can be faster than the object-based `crypto.createHash()` when hashing a smaller amount of data - * (<= 5MB) that's readily available. If the data can be big or if it is streamed, it's still recommended to use `crypto.createHash()` instead. The `algorithm` - * is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. On recent releases - * of OpenSSL, `openssl list -digest-algorithms` will display the available digest algorithms. - * - * Example: - * - * ```js - * import crypto from 'node:crypto'; - * import { Buffer } from 'node:buffer'; - * - * // Hashing a string and return the result as a hex-encoded string. - * const string = 'Node.js'; - * // 10b3493287f831e81a438811a1ffba01f8cec4b7 - * console.log(crypto.hash('sha1', string)); - * - * // Encode a base64-encoded string into a Buffer, hash it and return - * // the result as a buffer. - * const base64 = 'Tm9kZS5qcw=='; - * // - * console.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer')); - * ``` - * @since v21.7.0, v20.12.0 - * @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user - * could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead. - * @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-v20.x/api/buffer.html#buffers-and-character-encodings) used to encode the returned digest. - */ - function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string; - function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): NonSharedBuffer; - function hash( - algorithm: string, - data: BinaryLike, - outputEncoding?: BinaryToTextEncoding | "buffer", - ): string | NonSharedBuffer; - type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts"; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdf, - * } = await import('node:crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf( - digest: string, - irm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: ArrayBuffer) => void, - ): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdfSync, - * } = await import('node:crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync( - digest: string, - ikm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - ): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - type UUID = `${string}-${string}-${string}-${string}-${string}`; - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0, v14.17.0 - */ - function randomUUID(options?: RandomUUIDOptions): UUID; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject?: "always" | "default" | "never" | undefined; - /** - * @default true - */ - wildcards?: boolean | undefined; - /** - * @default true - */ - partialWildcards?: boolean | undefined; - /** - * @default false - */ - multiLabelWildcards?: boolean | undefined; - /** - * @default false - */ - singleLabelSubdomains?: boolean | undefined; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('node:crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (CA) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * - * Because SHA-1 is cryptographically broken and because the security of SHA-1 is - * significantly worse than that of algorithms that are commonly used to sign - * certificates, consider using `x509.fingerprint256` instead. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The SHA-512 fingerprint of this certificate. - * - * Because computing the SHA-256 fingerprint is usually faster and because it is - * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be - * a better choice. While SHA-512 presumably provides a higher level of security in - * general, the security of SHA-256 matches that of most algorithms that are - * commonly used to sign certificates. - * @since v17.2.0, v16.14.0 - */ - readonly fingerprint512: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate. - * - * This is a comma-separated list of subject alternative names. Each entry begins - * with a string identifying the kind of the subject alternative name followed by - * a colon and the value associated with the entry. - * - * Earlier versions of Node.js incorrectly assumed that it is safe to split this - * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However, - * both malicious and legitimate certificates can contain subject alternative names - * that include this sequence when represented as a string. - * - * After the prefix denoting the type of the entry, the remainder of each entry - * might be enclosed in quotes to indicate that the value is a JSON string literal. - * For backward compatibility, Node.js only uses JSON string literals within this - * property when necessary to avoid ambiguity. Third-party code should be prepared - * to handle both possible entry formats. - * @since v15.6.0 - */ - readonly subjectAltName: string | undefined; - /** - * A textual representation of the certificate's authority information access - * extension. - * - * This is a line feed separated list of access descriptions. Each line begins with - * the access method and the kind of the access location, followed by a colon and - * the value associated with the access location. - * - * After the prefix denoting the access method and the kind of the access location, - * the remainder of each line might be enclosed in quotes to indicate that the - * value is a JSON string literal. For backward compatibility, Node.js only uses - * JSON string literals within this property when necessary to avoid ambiguity. - * Third-party code should be prepared to handle both possible entry formats. - * @since v15.6.0 - */ - readonly infoAccess: string | undefined; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: NonSharedBuffer; - /** - * The serial number of this certificate. - * - * Serial numbers are assigned by certificate authorities and do not uniquely - * identify certificates. Consider using `x509.fingerprint256` as a unique - * identifier instead. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any email addresses. - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching email - * address, the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: Pick): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * - * If the certificate matches the given host name, the matching subject name is - * returned. The returned name might be an exact match (e.g., `foo.example.com`) - * or it might contain wildcards (e.g., `*.example.com`). Because host name - * comparisons are case-insensitive, the returned subject name might also differ - * from the given `name` in capitalization. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching DNS name, - * the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * - * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they - * must match the given `ip` address exactly. Other subject alternative names as - * well as the subject field of the certificate are ignored. - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsBigInt, - callback: (err: Error | null, prime: bigint) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsArrayBuffer, - callback: (err: Error | null, prime: ArrayBuffer) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptions, - callback: (err: Error | null, prime: ArrayBuffer | bigint) => void, - ): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime( - value: LargeNumberLike, - options: CheckPrimeOptions, - callback: (err: Error | null, result: boolean) => void, - ): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - /** - * Load and set the `engine` for some or all OpenSSL functions (selected by flags). - * - * `engine` could be either an id or a path to the engine's shared library. - * - * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`): - * - * * `crypto.constants.ENGINE_METHOD_RSA` - * * `crypto.constants.ENGINE_METHOD_DSA` - * * `crypto.constants.ENGINE_METHOD_DH` - * * `crypto.constants.ENGINE_METHOD_RAND` - * * `crypto.constants.ENGINE_METHOD_EC` - * * `crypto.constants.ENGINE_METHOD_CIPHERS` - * * `crypto.constants.ENGINE_METHOD_DIGESTS` - * * `crypto.constants.ENGINE_METHOD_PKEY_METHS` - * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` - * * `crypto.constants.ENGINE_METHOD_ALL` - * * `crypto.constants.ENGINE_METHOD_NONE` - * @since v0.11.11 - * @param flags - */ - function setEngine(engine: string, flags?: number): void; - /** - * A convenient alias for {@link webcrypto.getRandomValues}. This - * implementation is not compliant with the Web Crypto spec, to write - * web-compatible code use {@link webcrypto.getRandomValues} instead. - * @since v17.4.0 - * @return Returns `typedArray`. - */ - function getRandomValues(typedArray: T): T; - /** - * A convenient alias for `crypto.webcrypto.subtle`. - * @since v17.4.0 - */ - const subtle: webcrypto.SubtleCrypto; - /** - * An implementation of the Web Crypto API standard. - * - * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. - * @since v15.0.0 - */ - const webcrypto: webcrypto.Crypto; - namespace webcrypto { - type BufferSource = ArrayBufferView | ArrayBuffer; - type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; - type KeyType = "private" | "public" | "secret"; - type KeyUsage = - | "decrypt" - | "deriveBits" - | "deriveKey" - | "encrypt" - | "sign" - | "unwrapKey" - | "verify" - | "wrapKey"; - type AlgorithmIdentifier = Algorithm | string; - type HashAlgorithmIdentifier = AlgorithmIdentifier; - type NamedCurve = string; - type BigInteger = Uint8Array; - interface AesCbcParams extends Algorithm { - iv: BufferSource; - } - interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; - } - interface AesDerivedKeyParams extends Algorithm { - length: number; - } - interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; - } - interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; - } - interface AesKeyGenParams extends Algorithm { - length: number; - } - interface Algorithm { - name: string; - } - interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: NamedCurve; - } - interface EcKeyGenParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcKeyImportParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; - } - interface EcdsaParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface Ed448Params extends Algorithm { - context?: BufferSource; - } - interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; - } - interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; - } - interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface JsonWebKey { - alg?: string; - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - ext?: boolean; - k?: string; - key_ops?: string[]; - kty?: string; - n?: string; - oth?: RsaOtherPrimesInfo[]; - p?: string; - q?: string; - qi?: string; - use?: string; - x?: string; - y?: string; - } - interface KeyAlgorithm { - name: string; - } - interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; - } - interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; - } - interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; - } - interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaOaepParams extends Algorithm { - label?: BufferSource; - } - interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; - } - interface RsaPssParams extends Algorithm { - saltLength: number; - } - /** - * Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class. - * `Crypto` is a singleton that provides access to the remainder of the crypto API. - * @since v15.0.0 - */ - interface Crypto { - /** - * Provides access to the `SubtleCrypto` API. - * @since v15.0.0 - */ - readonly subtle: SubtleCrypto; - /** - * Generates cryptographically strong random values. - * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. - * - * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. - * - * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. - * @since v15.0.0 - */ - getRandomValues>(typedArray: T): T; - /** - * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. - * The UUID is generated using a cryptographic pseudorandom number generator. - * @since v16.7.0 - */ - randomUUID(): UUID; - CryptoKey: CryptoKeyConstructor; - } - // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. - interface CryptoKeyConstructor { - /** Illegal constructor */ - (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. - readonly length: 0; - readonly name: "CryptoKey"; - readonly prototype: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface CryptoKey { - /** - * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. - * @since v15.0.0 - */ - readonly algorithm: KeyAlgorithm; - /** - * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. - * @since v15.0.0 - */ - readonly extractable: boolean; - /** - * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. - * @since v15.0.0 - */ - readonly type: KeyType; - /** - * An array of strings identifying the operations for which the key may be used. - * - * The possible usages are: - * - `'encrypt'` - The key may be used to encrypt data. - * - `'decrypt'` - The key may be used to decrypt data. - * - `'sign'` - The key may be used to generate digital signatures. - * - `'verify'` - The key may be used to verify digital signatures. - * - `'deriveKey'` - The key may be used to derive a new key. - * - `'deriveBits'` - The key may be used to derive bits. - * - `'wrapKey'` - The key may be used to wrap another key. - * - `'unwrapKey'` - The key may be used to unwrap another key. - * - * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). - * @since v15.0.0 - */ - readonly usages: KeyUsage[]; - } - /** - * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. - * @since v15.0.0 - */ - interface CryptoKeyPair { - /** - * A {@link CryptoKey} whose type will be `'private'`. - * @since v15.0.0 - */ - privateKey: CryptoKey; - /** - * A {@link CryptoKey} whose type will be `'public'`. - * @since v15.0.0 - */ - publicKey: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface SubtleCrypto { - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, - * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, - * the returned promise will be resolved with an `` containing the plaintext result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - decrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, - * `subtle.deriveBits()` attempts to generate `length` bits. - * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. - * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed - * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. - * If successful, the returned promise will be resolved with an `` containing the generated data. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @since v15.0.0 - */ - deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; - deriveBits( - algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - length: number, - ): Promise; - /** - * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, - * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. - * - * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, - * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - deriveKey( - algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - derivedKeyAlgorithm: - | AlgorithmIdentifier - | AesDerivedKeyParams - | HmacImportParams - | HkdfParams - | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - /** - * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. - * If successful, the returned promise is resolved with an `` containing the computed digest. - * - * If `algorithm` is provided as a ``, it must be one of: - * - * - `'SHA-1'` - * - `'SHA-256'` - * - `'SHA-384'` - * - `'SHA-512'` - * - * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. - * @since v15.0.0 - */ - digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; - /** - * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, - * `subtle.encrypt()` attempts to encipher `data`. If successful, - * the returned promise is resolved with an `` containing the encrypted result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - encrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Exports the given key into the specified format, if supported. - * - * If the `` is not extractable, the returned promise will reject. - * - * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, - * the returned promise will be resolved with an `` containing the exported key data. - * - * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a - * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @returns `` containing ``. - * @since v15.0.0 - */ - exportKey(format: "jwk", key: CryptoKey): Promise; - exportKey(format: Exclude, key: CryptoKey): Promise; - /** - * Using the method and parameters provided in `algorithm`, - * `subtle.generateKey()` attempts to generate new keying material. - * Depending the method used, the method may generate either a single `` or a ``. - * - * The `` (public and private key) generating algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * The `` (secret key) generating algorithms supported include: - * - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - generateKey( - algorithm: RsaHashedKeyGenParams | EcKeyGenParams, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AlgorithmIdentifier, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` - * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. - * If the import is successful, the returned promise will be resolved with the created ``. - * - * If importing a `'PBKDF2'` key, `extractable` must be `false`. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - importKey( - format: "jwk", - keyData: JsonWebKey, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - importKey( - format: Exclude, - keyData: BufferSource, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given by `algorithm` and the keying material provided by `key`, - * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, - * the returned promise is resolved with an `` containing the generated signature. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - sign( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. - * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) - * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. - * If successful, the returned promise is resolved with a `` object. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * - * The unwrapped key algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - unwrapKey( - format: KeyFormat, - wrappedKey: BufferSource, - unwrappingKey: CryptoKey, - unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - unwrappedKeyAlgorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given in `algorithm` and the keying material provided by `key`, - * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. - * The returned promise is resolved with either `true` or `false`. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - verify( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - signature: BufferSource, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, - * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. - * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, - * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. - * If successful, the returned promise will be resolved with an `` containing the encrypted key data. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @since v15.0.0 - */ - wrapKey( - format: KeyFormat, - key: CryptoKey, - wrappingKey: CryptoKey, - wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - ): Promise; - } - } - - global { - var crypto: typeof globalThis extends { - crypto: infer T; - onmessage: any; - } ? T - : webcrypto.Crypto; - } -} -declare module "node:crypto" { - export * from "crypto"; -} diff --git a/node_modules/@types/node/dgram.d.ts b/node_modules/@types/node/dgram.d.ts deleted file mode 100644 index 4c74367..0000000 --- a/node_modules/@types/node/dgram.d.ts +++ /dev/null @@ -1,597 +0,0 @@ -/** - * The `node:dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dgram.js) - */ -declare module "dgram" { - import { NonSharedBuffer } from "node:buffer"; - import { AddressInfo } from "node:net"; - import * as dns from "node:dns"; - import { Abortable, EventEmitter } from "node:events"; - interface RemoteInfo { - address: string; - family: "IPv4" | "IPv6"; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = "udp4" | "udp6"; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: - | (( - hostname: string, - options: dns.LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ) => void) - | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @param options Available options are: - * @param callback Attached as a listener for `'message'` events. Optional. - */ - function createSocket(type: SocketType, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and `multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'node:cluster'; - * import dgram from 'node:dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family`, and `port` properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a `'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a `callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - bind(port?: number, address?: string, callback?: () => void): this; - bind(port?: number, callback?: () => void): this; - bind(callback?: () => void): this; - bind(options: BindOptions, callback?: () => void): this; - /** - * Close the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): this; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the `IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of bytes queued for sending. - */ - getSendQueueSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of send requests currently in the queue awaiting to be processed. - */ - getSendQueueCount(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer` with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a `callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on `localhost`: - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send( - msg: string | NodeJS.ArrayBufferView | readonly any[], - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | NodeJS.ArrayBufferView | readonly any[], - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | NodeJS.ArrayBufferView | readonly any[], - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | NodeJS.ArrayBufferView, - offset: number, - length: number, - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | NodeJS.ArrayBufferView, - offset: number, - length: number, - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | NodeJS.ArrayBufferView, - offset: number, - length: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): boolean; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): number; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no additional effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given `sourceAddress` and `groupAddress`, using the `multicastInterface` with the `IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call `socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "message", msg: NonSharedBuffer, rinfo: RemoteInfo): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this; - /** - * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } -} -declare module "node:dgram" { - export * from "dgram"; -} diff --git a/node_modules/@types/node/diagnostics_channel.d.ts b/node_modules/@types/node/diagnostics_channel.d.ts deleted file mode 100644 index f758aec..0000000 --- a/node_modules/@types/node/diagnostics_channel.d.ts +++ /dev/null @@ -1,578 +0,0 @@ -/** - * The `node:diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * should generally include the module name to avoid collisions with data from - * other modules. - * @since v15.1.0, v14.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/diagnostics_channel.js) - */ -declare module "diagnostics_channel" { - import { AsyncLocalStorage } from "node:async_hooks"; - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string | symbol): boolean; - /** - * This is the primary entry-point for anyone wanting to publish to a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return The named channel object - */ - function channel(name: string | symbol): Channel; - type ChannelListener = (message: unknown, name: string | symbol) => void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * diagnostics_channel.subscribe('my-channel', (message, name) => { - * // Received data - * }); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The handler to receive channel messages - */ - function subscribe(name: string | symbol, onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with {@link subscribe}. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * function onMessage(message, name) { - * // Received data - * } - * - * diagnostics_channel.subscribe('my-channel', onMessage); - * - * diagnostics_channel.unsubscribe('my-channel', onMessage); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; - /** - * Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing - * channels will be created in the form of `tracing:${name}:${eventType}` where `eventType` corresponds to the types of `TracingChannel Channels`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channelsByName = diagnostics_channel.tracingChannel('my-channel'); - * - * // or... - * - * const channelsByCollection = diagnostics_channel.tracingChannel({ - * start: diagnostics_channel.channel('tracing:my-channel:start'), - * end: diagnostics_channel.channel('tracing:my-channel:end'), - * asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'), - * asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'), - * error: diagnostics_channel.channel('tracing:my-channel:error'), - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param nameOrChannels Channel name or object containing all the `TracingChannel Channels` - * @return Collection of channels to trace with - */ - function tracingChannel< - StoreType = unknown, - ContextType extends object = StoreType extends object ? StoreType : object, - >( - nameOrChannels: string | TracingChannelCollection, - ): TracingChannel; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is used to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - * @since v15.1.0, v14.17.0 - */ - class Channel { - readonly name: string | symbol; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - */ - readonly hasSubscribers: boolean; - private constructor(name: string | symbol); - /** - * Publish a message to any subscribers to the channel. This will trigger - * message handlers synchronously so they will execute within the same context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.publish({ - * some: 'message', - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param message The message to send to the channel subscribers - */ - publish(message: unknown): void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)} - * @param onMessage The handler to receive channel messages - */ - subscribe(onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * channel.unsubscribe(onMessage); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)} - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - unsubscribe(onMessage: ChannelListener): void; - /** - * When `channel.runStores(context, ...)` is called, the given context data - * will be applied to any store bound to the channel. If the store has already been - * bound the previous `transform` function will be replaced with the new one. - * The `transform` function may be omitted to set the given context data as the - * context directly. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (data) => { - * return { data }; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to which to bind the context data - * @param transform Transform context data before setting the store context - */ - bindStore(store: AsyncLocalStorage, transform?: (context: ContextType) => StoreType): void; - /** - * Remove a message handler previously registered to this channel with `channel.bindStore(store)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store); - * channel.unbindStore(store); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to unbind from the channel. - * @return `true` if the store was found, `false` otherwise. - */ - unbindStore(store: AsyncLocalStorage): boolean; - /** - * Applies the given data to any AsyncLocalStorage instances bound to the channel - * for the duration of the given function, then publishes to the channel within - * the scope of that data is applied to the stores. - * - * If a transform function was given to `channel.bindStore(store)` it will be - * applied to transform the message data before it becomes the context value for - * the store. The prior storage context is accessible from within the transform - * function in cases where context linking is required. - * - * The context applied to the store should be accessible in any async code which - * continues from execution which began during the given function, however - * there are some situations in which `context loss` may occur. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (message) => { - * const parent = store.getStore(); - * return new Span(message, parent); - * }); - * channel.runStores({ some: 'message' }, () => { - * store.getStore(); // Span({ some: 'message' }) - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param context Message to send to subscribers and bind to stores - * @param fn Handler to run within the entered storage context - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runStores( - context: ContextType, - fn: (this: ThisArg, ...args: Args) => Result, - thisArg?: ThisArg, - ...args: Args - ): Result; - } - interface TracingChannelSubscribers { - start: (message: ContextType) => void; - end: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncStart: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncEnd: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - error: ( - message: ContextType & { - error: unknown; - }, - ) => void; - } - interface TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - } - /** - * The class `TracingChannel` is a collection of `TracingChannel Channels` which - * together express a single traceable action. It is used to formalize and - * simplify the process of producing events for tracing application flow. {@link tracingChannel} is used to construct a `TracingChannel`. As with `Channel` it is recommended to create and reuse a - * single `TracingChannel` at the top-level of the file rather than creating them - * dynamically. - * @since v19.9.0 - * @experimental - */ - class TracingChannel implements TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - /** - * Helper to subscribe a collection of functions to the corresponding channels. - * This is the same as calling `channel.subscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.subscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - */ - subscribe(subscribers: TracingChannelSubscribers): void; - /** - * Helper to unsubscribe a collection of functions from the corresponding channels. - * This is the same as calling `channel.unsubscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.unsubscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - * @return `true` if all handlers were successfully unsubscribed, and `false` otherwise. - */ - unsubscribe(subscribers: TracingChannelSubscribers): void; - /** - * Trace a synchronous function call. This will always produce a `start event` and `end event` around the execution and may produce an `error event` if the given function throws an error. - * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions - * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceSync(() => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Function to wrap a trace around - * @param context Shared object to correlate events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceSync( - fn: (this: ThisArg, ...args: Args) => Result, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): Result; - /** - * Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the - * function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also - * produce an `error event` if the given function throws an error or the - * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions - * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.tracePromise(async () => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Promise-returning function to wrap a trace around - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return Chained from promise returned by the given function - */ - tracePromise( - fn: (this: ThisArg, ...args: Args) => Promise, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): Promise; - /** - * Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the - * function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or - * the returned - * promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * The `position` will be -1 by default to indicate the final argument should - * be used as the callback. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceCallback((arg1, callback) => { - * // Do something - * callback(null, 'result'); - * }, 1, { - * some: 'thing', - * }, thisArg, arg1, callback); - * ``` - * - * The callback will also be run with `channel.runStores(context, ...)` which - * enables context loss recovery in some cases. - * - * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions - * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * const myStore = new AsyncLocalStorage(); - * - * // The start channel sets the initial store data to something - * // and stores that store data value on the trace context object - * channels.start.bindStore(myStore, (data) => { - * const span = new Span(data); - * data.span = span; - * return span; - * }); - * - * // Then asyncStart can restore from that data it stored previously - * channels.asyncStart.bindStore(myStore, (data) => { - * return data.span; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn callback using function to wrap a trace around - * @param position Zero-indexed argument position of expected callback - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceCallback( - fn: (this: ThisArg, ...args: Args) => Result, - position?: number, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): Result; - /** - * `true` if any of the individual channels has a subscriber, `false` if not. - * - * This is a helper method available on a {@link TracingChannel} instance to check - * if any of the [TracingChannel Channels](https://nodejs.org/api/diagnostics_channel.html#tracingchannel-channels) have subscribers. - * A `true` is returned if any of them have at least one subscriber, a `false` is returned otherwise. - * - * ```js - * const diagnostics_channel = require('node:diagnostics_channel'); - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * if (channels.hasSubscribers) { - * // Do something - * } - * ``` - * @since v22.0.0, v20.13.0 - */ - readonly hasSubscribers: boolean; - } -} -declare module "node:diagnostics_channel" { - export * from "diagnostics_channel"; -} diff --git a/node_modules/@types/node/dns.d.ts b/node_modules/@types/node/dns.d.ts deleted file mode 100644 index acb5264..0000000 --- a/node_modules/@types/node/dns.d.ts +++ /dev/null @@ -1,871 +0,0 @@ -/** - * The `node:dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * import dns from 'node:dns'; - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `node:dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * import dns from 'node:dns'; - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) for more information. - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dns.js) - */ -declare module "dns" { - import * as dnsPromises from "node:dns/promises"; - // Supported getaddrinfo flags. - /** - * Limits returned address types to the types of non-loopback addresses configured on the system. For example, IPv4 addresses are - * only returned if the current system has at least one IPv4 address configured. - */ - export const ADDRCONFIG: number; - /** - * If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported - * on some operating systems (e.g. FreeBSD 10.1). - */ - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - /** - * The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted - * as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used - * with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned. - * @default 0 - */ - family?: number | "IPv4" | "IPv6" | undefined; - /** - * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v20.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be - * passed by bitwise `OR`ing their values. - */ - hints?: number | undefined; - /** - * When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. - * @default false - */ - all?: boolean | undefined; - /** - * When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted - * by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 - * addresses before IPv4 addresses. Default value is configurable using - * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). - * @default `verbatim` (addresses are not reordered) - */ - order?: "ipv4first" | "ipv6first" | "verbatim" | undefined; - /** - * When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 - * addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, - * `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder} - * or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). - * @default true (addresses are not reordered) - */ - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - /** - * A string representation of an IPv4 or IPv6 address. - */ - address: string; - /** - * `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a - * bug in the name resolution service used by the operating system. - */ - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then - * IPv4 and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to `(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * The implementation uses an operating system facility that can associate names - * with addresses and vice versa. This implementation can have subtle but - * important consequences on the behavior of any Node.js program. Please take some - * time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) - * before using `dns.lookup()`. - * - * Example usage: - * - * ```js - * import dns from 'node:dns'; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * ``` - * - * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v20.x/api/util.html#utilpromisifyoriginal) ed - * version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties. - * @since v0.1.90 - */ - export function lookup( - hostname: string, - family: number, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupAllOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void, - ): void; - export function lookup( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. - * - * On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, - * where `err.code` is the error code. - * - * ```js - * import dns from 'node:dns'; - * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - * console.log(hostname, service); - * // Prints: localhost ssh - * }); - * ``` - * - * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v20.x/api/util.html#utilpromisifyoriginal) ed - * version, it returns a `Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService( - address: string, - port: number, - callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void, - ): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: "A"; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: "AAAA"; - } - export interface CaaRecord { - critical: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface AnyCaaRecord extends CaaRecord { - type: "CAA"; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: "MX"; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: "NAPTR"; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: "SOA"; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: "SRV"; - } - export interface AnyTxtRecord { - type: "TXT"; - entries: string[]; - } - export interface AnyNsRecord { - type: "NS"; - value: string; - } - export interface AnyPtrRecord { - type: "PTR"; - value: string; - } - export interface AnyCnameRecord { - type: "CNAME"; - value: string; - } - export type AnyRecord = - | AnyARecord - | AnyAaaaRecord - | AnyCaaRecord - | AnyCnameRecord - | AnyMxRecord - | AnyNaptrRecord - | AnyNsRecord - | AnyPtrRecord - | AnySoaRecord - | AnySrvRecord - | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments `(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, - * where `err.code` is one of the `DNS error codes`. - * @since v0.1.27 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - export function resolve( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "ANY", - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "CAA", - callback: (err: NodeJS.ErrnoException | null, address: CaaRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "MX", - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "NAPTR", - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SOA", - callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SRV", - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "TXT", - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: string, - callback: ( - err: NodeJS.ErrnoException | null, - addresses: - | string[] - | CaaRecord[] - | MxRecord[] - | NaptrRecord[] - | SoaRecord - | SrvRecord[] - | string[][] - | AnyRecord[], - ) => void, - ): void; - export namespace resolve { - function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - function __promisify__(hostname: string, rrtype: "ANY"): Promise; - function __promisify__(hostname: string, rrtype: "CAA"): Promise; - function __promisify__(hostname: string, rrtype: "MX"): Promise; - function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; - function __promisify__(hostname: string, rrtype: "SOA"): Promise; - function __promisify__(hostname: string, rrtype: "SRV"): Promise; - function __promisify__(hostname: string, rrtype: "TXT"): Promise; - function __promisify__( - hostname: string, - rrtype: string, - ): Promise< - | string[] - | CaaRecord[] - | MxRecord[] - | NaptrRecord[] - | SoaRecord - | SrvRecord[] - | string[][] - | AnyRecord[] - >; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - export function resolveCaa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void, - ): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void, - ): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a - * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see - * [RFC 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is - * one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). - * @since v0.1.16 - */ - export function reverse( - ip: string, - callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void, - ): void; - /** - * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). - * The value could be: - * - * * `ipv4first`: for `order` defaulting to `ipv4first`. - * * `ipv6first`: for `order` defaulting to `ipv6first`. - * * `verbatim`: for `order` defaulting to `verbatim`. - * @since v18.17.0 - */ - export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve}, `dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952#section-6) formatted addresses - */ - export function setServers(servers: readonly string[]): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - /** - * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). - * The value could be: - * - * * `ipv4first`: sets default `order` to `ipv4first`. - * * `ipv6first`: sets default `order` to `ipv6first`. - * * `verbatim`: sets default `order` to `verbatim`. - * - * The default is `verbatim` and {@link setDefaultResultOrder} have higher - * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using - * [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main - * thread won't affect the default dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. - */ - export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; - // Error codes - export const NODATA: "ENODATA"; - export const FORMERR: "EFORMERR"; - export const SERVFAIL: "ESERVFAIL"; - export const NOTFOUND: "ENOTFOUND"; - export const NOTIMP: "ENOTIMP"; - export const REFUSED: "EREFUSED"; - export const BADQUERY: "EBADQUERY"; - export const BADNAME: "EBADNAME"; - export const BADFAMILY: "EBADFAMILY"; - export const BADRESP: "EBADRESP"; - export const CONNREFUSED: "ECONNREFUSED"; - export const TIMEOUT: "ETIMEOUT"; - export const EOF: "EOF"; - export const FILE: "EFILE"; - export const NOMEM: "ENOMEM"; - export const DESTRUCTION: "EDESTRUCTION"; - export const BADSTR: "EBADSTR"; - export const BADFLAGS: "EBADFLAGS"; - export const NONAME: "ENONAME"; - export const BADHINTS: "EBADHINTS"; - export const NOTINITIALIZED: "ENOTINITIALIZED"; - export const LOADIPHLPAPI: "ELOADIPHLPAPI"; - export const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; - export const CANCELLED: "ECANCELLED"; - export interface ResolverOptions { - /** - * Query timeout in milliseconds, or `-1` to use the default timeout. - */ - timeout?: number | undefined; - /** - * The number of tries the resolver will try contacting each name server before giving up. - * @default 4 - */ - tries?: number | undefined; - } - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnssetserversservers) does not affect - * other resolvers: - * - * ```js - * import { Resolver } from 'node:dns'; - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `node:dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module "node:dns" { - export * from "dns"; -} diff --git a/node_modules/@types/node/dns/promises.d.ts b/node_modules/@types/node/dns/promises.d.ts deleted file mode 100644 index 29ae2ba..0000000 --- a/node_modules/@types/node/dns/promises.d.ts +++ /dev/null @@ -1,479 +0,0 @@ -/** - * The `dns.promises` API provides an alternative set of asynchronous DNS methods - * that return `Promise` objects rather than using callbacks. The API is accessible - * via `import { promises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`. - * @since v10.6.0 - */ -declare module "dns/promises" { - import { - AnyRecord, - CaaRecord, - LookupAddress, - LookupAllOptions, - LookupOneOptions, - LookupOptions, - MxRecord, - NaptrRecord, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - ResolveWithTtlOptions, - SoaRecord, - SrvRecord, - } from "node:dns"; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`. - * - * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options) does not necessarily have anything to do with the DNS - * protocol. The implementation uses an operating system facility that can - * associate names with addresses and vice versa. This implementation can have - * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * import dns from 'node:dns'; - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. - * - * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. - * - * ```js - * import dns from 'node:dns'; - * dns.promises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` - * is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - function resolve(hostname: string, rrtype: "ANY"): Promise; - function resolve(hostname: string, rrtype: "CAA"): Promise; - function resolve(hostname: string, rrtype: "MX"): Promise; - function resolve(hostname: string, rrtype: "NAPTR"): Promise; - function resolve(hostname: string, rrtype: "SOA"): Promise; - function resolve(hostname: string, rrtype: "SRV"): Promise; - function resolve(hostname: string, rrtype: "TXT"): Promise; - function resolve(hostname: string, rrtype: string): Promise< - | string[] - | CaaRecord[] - | MxRecord[] - | NaptrRecord[] - | SoaRecord - | SrvRecord[] - | string[][] - | AnyRecord[] - >; - /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4 - * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array - * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` - * is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Get the default value for `verbatim` in {@link lookup} and [dnsPromises.lookup()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). - * The value could be: - * - * * `ipv4first`: for `verbatim` defaulting to `false`. - * * `verbatim`: for `verbatim` defaulting to `true`. - * @since v20.1.0 - */ - function getDefaultResultOrder(): "ipv4first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: readonly string[]): void; - /** - * Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be: - * - * * `ipv4first`: sets default `order` to `ipv4first`. - * * `ipv6first`: sets default `order` to `ipv6first`. - * * `verbatim`: sets default `order` to `verbatim`. - * - * The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) - * have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). - * When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) - * from the main thread won't affect the default dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. - */ - function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; - // Error codes - const NODATA: "ENODATA"; - const FORMERR: "EFORMERR"; - const SERVFAIL: "ESERVFAIL"; - const NOTFOUND: "ENOTFOUND"; - const NOTIMP: "ENOTIMP"; - const REFUSED: "EREFUSED"; - const BADQUERY: "EBADQUERY"; - const BADNAME: "EBADNAME"; - const BADFAMILY: "EBADFAMILY"; - const BADRESP: "EBADRESP"; - const CONNREFUSED: "ECONNREFUSED"; - const TIMEOUT: "ETIMEOUT"; - const EOF: "EOF"; - const FILE: "EFILE"; - const NOMEM: "ENOMEM"; - const DESTRUCTION: "EDESTRUCTION"; - const BADSTR: "EBADSTR"; - const BADFLAGS: "EBADFLAGS"; - const NONAME: "ENONAME"; - const BADHINTS: "EBADHINTS"; - const NOTINITIALIZED: "ENOTINITIALIZED"; - const LOADIPHLPAPI: "ELOADIPHLPAPI"; - const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; - const CANCELLED: "ECANCELLED"; - - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetserversservers) does not affect - * other resolvers: - * - * ```js - * import dns from 'node:dns'; - * const { Resolver } = dns.promises; - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org').then((addresses) => { - * // ... - * }); - * - * // Alternatively, the same code can be written using async-await style. - * (async function() { - * const addresses = await resolver.resolve4('example.org'); - * })(); - * ``` - * - * The following methods from the `dnsPromises` API are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v10.6.0 - */ - class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module "node:dns/promises" { - export * from "dns/promises"; -} diff --git a/node_modules/@types/node/domain.d.ts b/node_modules/@types/node/domain.d.ts deleted file mode 100644 index d83b0f0..0000000 --- a/node_modules/@types/node/domain.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should - * **not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to - * exit immediately with an error code. - * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/domain.js) - */ -declare module "domain" { - import EventEmitter = require("node:events"); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and `intercept()` methods to set the active domain. It sets `domain.active` and `process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context, `exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and low-level requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * import domain from 'node:domain'; - * import fs from 'node:fs'; - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module "node:domain" { - export * from "domain"; -} diff --git a/node_modules/@types/node/events.d.ts b/node_modules/@types/node/events.d.ts deleted file mode 100644 index 31ab3ca..0000000 --- a/node_modules/@types/node/events.d.ts +++ /dev/null @@ -1,977 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/events.js) - */ -declare module "events" { - import { AsyncResource, AsyncResourceOptions } from "node:async_hooks"; - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean | undefined; - } - interface StaticEventEmitterOptions { - /** - * Can be used to cancel awaiting events. - */ - signal?: AbortSignal | undefined; - } - interface StaticEventEmitterIteratorOptions extends StaticEventEmitterOptions { - /** - * Names of events that will end the iteration. - */ - close?: string[] | undefined; - /** - * The high watermark. The emitter is paused every time the size of events being buffered is higher than it. - * Supported only on emitters implementing `pause()` and `resume()` methods. - * @default Number.MAX_SAFE_INTEGER - */ - highWaterMark?: number | undefined; - /** - * The low watermark. The emitter is resumed every time the size of events being buffered is lower than it. - * Supported only on emitters implementing `pause()` and `resume()` methods. - * @default 1 - */ - lowWaterMark?: number | undefined; - } - interface EventEmitter = DefaultEventMap> extends NodeJS.EventEmitter {} - type EventMap = Record | DefaultEventMap; - type DefaultEventMap = [never]; - type AnyRest = [...args: any[]]; - type Args = T extends DefaultEventMap ? AnyRest : ( - K extends keyof T ? T[K] : never - ); - type Key = T extends DefaultEventMap ? string | symbol : K | keyof T; - type Key2 = T extends DefaultEventMap ? string | symbol : K & keyof T; - type Listener = T extends DefaultEventMap ? F : ( - K extends keyof T ? ( - T[K] extends unknown[] ? (...args: T[K]) => void : never - ) - : never - ); - type Listener1 = Listener void>; - type Listener2 = Listener; - - /** - * The `EventEmitter` class is defined and exposed by the `node:events` module: - * - * ```js - * import { EventEmitter } from 'node:events'; - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter = DefaultEventMap> { - constructor(options?: EventEmitterOptions); - - [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; - - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * import { once, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.error('error happened', err); - * } - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.error('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once( - emitter: NodeJS.EventEmitter, - eventName: string | symbol, - options?: StaticEventEmitterOptions, - ): Promise; - static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * - * Use the `close` option to specify an array of event names that will end the iteration: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * ee.emit('close'); - * }); - * - * for await (const event of on(ee, 'foo', { close: ['close'] })) { - * console.log(event); // prints ['bar'] [42] - * } - * // the loop will exit after 'close' is emitted - * console.log('done'); // prints 'done' - * ``` - * @since v13.6.0, v12.16.0 - * @return An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` - */ - static on( - emitter: NodeJS.EventEmitter, - eventName: string | symbol, - options?: StaticEventEmitterIteratorOptions, - ): NodeJS.AsyncIterator; - static on( - emitter: EventTarget, - eventName: string, - options?: StaticEventEmitterIteratorOptions, - ): NodeJS.AsyncIterator; - /** - * A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. - * - * ```js - * import { EventEmitter, listenerCount } from 'node:events'; - * - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * import { getEventListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] - * } - * ``` - * @since v15.2.0, v14.17.0 - */ - static getEventListeners(emitter: EventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * Returns the currently set max amount of listeners. - * - * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the max event listeners for the - * event target. If the number of event handlers on a single EventTarget exceeds - * the max set, the EventTarget will print a warning. - * - * ```js - * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * console.log(getMaxListeners(ee)); // 10 - * setMaxListeners(11, ee); - * console.log(getMaxListeners(ee)); // 11 - * } - * { - * const et = new EventTarget(); - * console.log(getMaxListeners(et)); // 10 - * setMaxListeners(11, et); - * console.log(getMaxListeners(et)); // 11 - * } - * ``` - * @since v19.9.0 - */ - static getMaxListeners(emitter: EventTarget | NodeJS.EventEmitter): number; - /** - * ```js - * import { setMaxListeners, EventEmitter } from 'node:events'; - * - * const target = new EventTarget(); - * const emitter = new EventEmitter(); - * - * setMaxListeners(5, target, emitter); - * ``` - * @since v15.4.0 - * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. - * @param eventTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} - * objects. - */ - static setMaxListeners(n?: number, ...eventTargets: Array): void; - /** - * Listens once to the `abort` event on the provided `signal`. - * - * Listening to the `abort` event on abort signals is unsafe and may - * lead to resource leaks since another third party with the signal can - * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change - * this since it would violate the web standard. Additionally, the original - * API makes it easy to forget to remove listeners. - * - * This API allows safely using `AbortSignal`s in Node.js APIs by solving these - * two issues by listening to the event such that `stopImmediatePropagation` does - * not prevent the listener from running. - * - * Returns a disposable so that it may be unsubscribed from more easily. - * - * ```js - * import { addAbortListener } from 'node:events'; - * - * function example(signal) { - * let disposable; - * try { - * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); - * disposable = addAbortListener(signal, (e) => { - * // Do something when signal is aborted. - * }); - * } finally { - * disposable?.[Symbol.dispose](); - * } - * } - * ``` - * @since v20.5.0 - * @experimental - * @return Disposable that removes the `abort` listener. - */ - static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; - /** - * This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no - * regular `'error'` listener is installed. - * @since v13.6.0, v12.17.0 - */ - static readonly errorMonitor: unique symbol; - /** - * Value: `Symbol.for('nodejs.rejection')` - * - * See how to write a custom `rejection handler`. - * @since v13.4.0, v12.16.0 - */ - static readonly captureRejectionSymbol: unique symbol; - /** - * Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - * - * Change the default `captureRejections` option on all new `EventEmitter` objects. - * @since v13.4.0, v12.16.0 - */ - static captureRejections: boolean; - /** - * By default, a maximum of `10` listeners can be registered for any single - * event. This limit can be changed for individual `EventEmitter` instances - * using the `emitter.setMaxListeners(n)` method. To change the default - * for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property - * can be used. If this value is not a positive number, a `RangeError` is thrown. - * - * Take caution when setting the `events.defaultMaxListeners` because the - * change affects _all_ `EventEmitter` instances, including those created before - * the change is made. However, calling `emitter.setMaxListeners(n)` still has - * precedence over `events.defaultMaxListeners`. - * - * This is not a hard limit. The `EventEmitter` instance will allow - * more listeners to be added but will output a trace warning to stderr indicating - * that a "possible EventEmitter memory leak" has been detected. For any single - * `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to - * temporarily avoid this warning: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.setMaxListeners(emitter.getMaxListeners() + 1); - * emitter.once('event', () => { - * // do stuff - * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); - * }); - * ``` - * - * The `--trace-warnings` command-line flag can be used to display the - * stack trace for such warnings. - * - * The emitted warning can be inspected with `process.on('warning')` and will - * have the additional `emitter`, `type`, and `count` properties, referring to - * the event emitter instance, the event's name and the number of attached - * listeners, respectively. - * Its `name` property is set to `'MaxListenersExceededWarning'`. - * @since v0.11.2 - */ - static defaultMaxListeners: number; - } - import internal = require("node:events"); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - - export interface EventEmitterReferencingAsyncResource extends AsyncResource { - readonly eventEmitter: EventEmitterAsyncResource; - } - - export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions { - /** - * The type of async event, this is required when instantiating `EventEmitterAsyncResource` - * directly rather than as a child class. - * @default new.target.name if instantiated as a child class. - */ - name?: string | undefined; - } - - /** - * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that - * require manual async tracking. Specifically, all events emitted by instances - * of `events.EventEmitterAsyncResource` will run within its `async context`. - * - * ```js - * import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; - * import { notStrictEqual, strictEqual } from 'node:assert'; - * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; - * - * // Async tracking tooling will identify this as 'Q'. - * const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); - * - * // 'foo' listeners will run in the EventEmitters async context. - * ee1.on('foo', () => { - * strictEqual(executionAsyncId(), ee1.asyncId); - * strictEqual(triggerAsyncId(), ee1.triggerAsyncId); - * }); - * - * const ee2 = new EventEmitter(); - * - * // 'foo' listeners on ordinary EventEmitters that do not track async - * // context, however, run in the same async context as the emit(). - * ee2.on('foo', () => { - * notStrictEqual(executionAsyncId(), ee2.asyncId); - * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId); - * }); - * - * Promise.resolve().then(() => { - * ee1.emit('foo'); - * ee2.emit('foo'); - * }); - * ``` - * - * The `EventEmitterAsyncResource` class has the same methods and takes the - * same options as `EventEmitter` and `AsyncResource` themselves. - * @since v17.4.0, v16.14.0 - */ - export class EventEmitterAsyncResource extends EventEmitter { - /** - * @param options Only optional in child class. - */ - constructor(options?: EventEmitterAsyncResourceOptions); - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - */ - emitDestroy(): void; - /** - * The unique `asyncId` assigned to the resource. - */ - readonly asyncId: number; - /** - * The same triggerAsyncId that is passed to the AsyncResource constructor. - */ - readonly triggerAsyncId: number; - /** - * The returned `AsyncResource` object has an additional `eventEmitter` property - * that provides a reference to this `EventEmitterAsyncResource`. - */ - readonly asyncResource: EventEmitterReferencingAsyncResource; - } - /** - * The `NodeEventTarget` is a Node.js-specific extension to `EventTarget` - * that emulates a subset of the `EventEmitter` API. - * @since v14.5.0 - */ - export interface NodeEventTarget extends EventTarget { - /** - * Node.js-specific extension to the `EventTarget` class that emulates the - * equivalent `EventEmitter` API. The only difference between `addListener()` and - * `addEventListener()` is that `addListener()` will return a reference to the - * `EventTarget`. - * @since v14.5.0 - */ - addListener(type: string, listener: (arg: any) => void): this; - /** - * Node.js-specific extension to the `EventTarget` class that dispatches the - * `arg` to the list of handlers for `type`. - * @since v15.2.0 - * @returns `true` if event listeners registered for the `type` exist, - * otherwise `false`. - */ - emit(type: string, arg: any): boolean; - /** - * Node.js-specific extension to the `EventTarget` class that returns an array - * of event `type` names for which event listeners are registered. - * @since 14.5.0 - */ - eventNames(): string[]; - /** - * Node.js-specific extension to the `EventTarget` class that returns the number - * of event listeners registered for the `type`. - * @since v14.5.0 - */ - listenerCount(type: string): number; - /** - * Node.js-specific extension to the `EventTarget` class that sets the number - * of max event listeners as `n`. - * @since v14.5.0 - */ - setMaxListeners(n: number): void; - /** - * Node.js-specific extension to the `EventTarget` class that returns the number - * of max event listeners. - * @since v14.5.0 - */ - getMaxListeners(): number; - /** - * Node.js-specific alias for `eventTarget.removeEventListener()`. - * @since v14.5.0 - */ - off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this; - /** - * Node.js-specific alias for `eventTarget.addEventListener()`. - * @since v14.5.0 - */ - on(type: string, listener: (arg: any) => void): this; - /** - * Node.js-specific extension to the `EventTarget` class that adds a `once` - * listener for the given event `type`. This is equivalent to calling `on` - * with the `once` option set to `true`. - * @since v14.5.0 - */ - once(type: string, listener: (arg: any) => void): this; - /** - * Node.js-specific extension to the `EventTarget` class. If `type` is specified, - * removes all registered listeners for `type`, otherwise removes all registered - * listeners. - * @since v14.5.0 - */ - removeAllListeners(type?: string): this; - /** - * Node.js-specific extension to the `EventTarget` class that removes the - * `listener` for the given `type`. The only difference between `removeListener()` - * and `removeEventListener()` is that `removeListener()` will return a reference - * to the `EventTarget`. - * @since v14.5.0 - */ - removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this; - } - } - global { - namespace NodeJS { - interface EventEmitter = DefaultEventMap> { - [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: Key, listener: Listener1): this; - /** - * Adds the `listener` function to the end of the listeners array for the event - * named `eventName`. No checks are made to see if the `listener` has already - * been added. Multiple calls passing the same combination of `eventName` and - * `listener` will result in the `listener` being added, and called, multiple times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: Key, listener: Listener1): this; - /** - * Adds a **one-time** `listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: Key, listener: Listener1): this; - /** - * Removes the specified `listener` from the listener array for the event named `eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution - * will not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * import { EventEmitter } from 'node:events'; - * class MyEmitter extends EventEmitter {} - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')` listener is removed: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: Key, listener: Listener1): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: Key, listener: Listener1): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(eventName?: Key): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link EventEmitter.defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: Key): Array>; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: Key): Array>; - /** - * Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: Key, ...args: Args): boolean; - /** - * Returns the number of listeners listening for the event named `eventName`. - * If `listener` is provided, it will return how many times the listener is found - * in the list of the listeners of the event. - * @since v3.2.0 - * @param eventName The name of the event being listened for - * @param listener The event handler function - */ - listenerCount(eventName: Key, listener?: Listener2): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName` - * and `listener` will result in the `listener` being added, and called, multiple times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: Key, listener: Listener1): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: Key, listener: Listener1): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array<(string | symbol) & Key2>; - } - } - } - export = EventEmitter; -} -declare module "node:events" { - import events = require("events"); - export = events; -} diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts deleted file mode 100644 index 4115ffe..0000000 --- a/node_modules/@types/node/fs.d.ts +++ /dev/null @@ -1,4375 +0,0 @@ -/** - * The `node:fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'node:fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'node:fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/fs.js) - */ -declare module "fs" { - import { NonSharedBuffer } from "node:buffer"; - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import { URL } from "node:url"; - import * as promises from "node:fs/promises"; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | "buffer" - | { - encoding: "buffer"; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. `Stat` objects are not to be created directly using the `new` keyword. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats {} - export interface StatsFsBase { - /** Type of file system. */ - type: T; - /** Optimal transfer block size. */ - bsize: T; - /** Total data blocks in file system. */ - blocks: T; - /** Free blocks in file system. */ - bfree: T; - /** Available blocks for unprivileged users */ - bavail: T; - /** Total file nodes in file system. */ - files: T; - /** Free file nodes in file system. */ - ffree: T; - } - export interface StatsFs extends StatsFsBase {} - /** - * Provides information about a mounted file system. - * - * Objects returned from {@link statfs} and its synchronous counterpart are of - * this type. If `bigint` in the `options` passed to those methods is `true`, the - * numeric values will be `bigint` instead of `number`. - * - * ```console - * StatFs { - * type: 1397114950, - * bsize: 4096, - * blocks: 121938943, - * bfree: 61058895, - * bavail: 61058895, - * files: 999, - * ffree: 1000000 - * } - * ``` - * - * `bigint` version: - * - * ```console - * StatFs { - * type: 1397114950n, - * bsize: 4096n, - * blocks: 121938943n, - * bfree: 61058895n, - * bavail: 61058895n, - * files: 999n, - * ffree: 1000000n - * } - * ``` - * @since v19.6.0, v18.15.0 - */ - export class StatsFs {} - export interface BigIntStatsFs extends StatsFsBase {} - export interface StatFsOptions { - bigint?: boolean | undefined; - } - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: Name; - /** - * The base path that this `fs.Dirent` object refers to. - * @since v20.12.0 - */ - parentPath: string; - /** - * Alias for `dirent.parentPath`. - * @since v20.1.0 - * @deprecated Since v20.12.0 - */ - path: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): NodeJS.AsyncIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be fulfilled after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be fulfilled with an `fs.Dirent`, or `null` if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - /** - * Class: fs.StatWatcher - * @since v14.3.0, v12.20.0 - * Extends `EventEmitter` - * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. - */ - export interface StatWatcher extends EventEmitter { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.StatWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.StatWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - close(): void; - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.FSWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.FSWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.FSWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.FSWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - /** - * events.EventEmitter - * 1. change - * 2. close - * 3. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "change", listener: (eventType: string, filename: string | NonSharedBuffer) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "change", listener: (eventType: string, filename: string | NonSharedBuffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "change", listener: (eventType: string, filename: string | NonSharedBuffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener( - event: "change", - listener: (eventType: string, filename: string | NonSharedBuffer) => void, - ): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "change", - listener: (eventType: string, filename: string | NonSharedBuffer) => void, - ): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: K, listener: ReadStreamEvents[K]): this; - on(event: K, listener: ReadStreamEvents[K]): this; - once(event: K, listener: ReadStreamEvents[K]): this; - prependListener(event: K, listener: ReadStreamEvents[K]): this; - prependOnceListener(event: K, listener: ReadStreamEvents[K]): this; - } - - /** - * The Keys are events of the ReadStream and the values are the functions that are called when the event is emitted. - */ - type ReadStreamEvents = { - close: () => void; - data: (chunk: Buffer | string) => void; - end: () => void; - error: (err: Error) => void; - open: (fd: number) => void; - pause: () => void; - readable: () => void; - ready: () => void; - resume: () => void; - } & CustomEvents; - - /** - * string & {} allows to allow any kind of strings for the event - * but still allows to have auto completion for the normal events. - */ - type CustomEvents = { [Key in string & {} | symbol]: (...args: any[]) => void }; - - /** - * The Keys are events of the WriteStream and the values are the functions that are called when the event is emitted. - */ - type WriteStreamEvents = { - close: () => void; - drain: () => void; - error: (err: Error) => void; - finish: () => void; - open: (fd: number) => void; - pipe: (src: stream.Readable) => void; - ready: () => void; - unpipe: (src: stream.Readable) => void; - } & CustomEvents; - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: K, listener: WriteStreamEvents[K]): this; - on(event: K, listener: WriteStreamEvents[K]): this; - once(event: K, listener: WriteStreamEvents[K]): this; - prependListener(event: K, listener: WriteStreamEvents[K]): this; - prependOnceListener(event: K, listener: WriteStreamEvents[K]): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'node:fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number): Promise; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number): Promise; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'node:fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - /** @deprecated */ - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * {@link stat} follows symbolic links. Use {@link lstat} to look at the - * links themselves. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'node:fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: PathLike, options?: undefined): Stats; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - }, - ): Stats | undefined; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - throwIfNoEntry: false; - }, - ): BigIntStats | undefined; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - }, - ): Stats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - }, - ): BigIntStats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - }, - ): Stats | BigIntStats; - (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Retrieves the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstatSync( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Stats; - export function fstatSync( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): BigIntStats; - export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - /** - * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; - export function statfs( - path: PathLike, - options: - | (StatFsOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void, - ): void; - export namespace statfs { - /** - * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. - * @param path A path to an existing file or directory on the file system to be queried. - */ - function __promisify__( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatFsOptions): Promise; - } - /** - * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfsSync( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): StatsFs; - export function statfsSync( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): BigIntStatsFs; - export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than - * a possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`. - * If the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction - * points on NTFS volumes can only point to directories. - * - * Relative targets are relative to the link's parent directory. - * - * ```js - * import { symlink } from 'node:fs'; - * - * symlink('./mew', './mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` which points to `mew` in the - * same directory: - * - * ```bash - * $ tree . - * . - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - * @param [type='null'] - */ - export function symlink( - target: PathLike, - path: PathLike, - type: symlink.Type | undefined | null, - callback: NoParamCallback, - ): void; - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - type Type = "dir" | "file" | "junction"; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - * @param [type='null'] - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: NonSharedBuffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string | NonSharedBuffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readlink( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - export namespace readlink { - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..`, and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: NonSharedBuffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | NonSharedBuffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function realpath( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - export namespace realpath { - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - function native( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: NonSharedBuffer) => void, - ): void; - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | NonSharedBuffer) => void, - ): void; - function native( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): NonSharedBuffer; - function native(path: PathLike, options?: EncodingOption): string | NonSharedBuffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm` utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created (for instance, if it was previously created). - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. If `recursive` is false and the directory exists, - * an `EEXIST` error occurs. - * - * ```js - * import { mkdir } from 'node:fs'; - * - * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. - * mkdir('./tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'node:fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: Mode | MakeDirectoryOptions | null | undefined, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: Mode | MakeDirectoryOptions | null, - ): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is `true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): string | undefined; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): void; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.mkdtemp()` method will append the six randomly selected characters - * directly to the `prefix` string. For instance, given a directory `/tmp`, if the - * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator - * (`import { sep } from 'node:node:path'`). - * - * ```js - * import { tmpdir } from 'node:os'; - * import { mkdtemp } from 'node:fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'node:path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: NonSharedBuffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string | NonSharedBuffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp( - prefix: string, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - export namespace mkdtemp { - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link mkdtemp}. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * @since v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): NonSharedBuffer; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | NonSharedBuffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)` where `files` is an array of the names of the files in the directory excluding `'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - callback: (err: NodeJS.ErrnoException | null, files: NonSharedBuffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | NonSharedBuffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. - */ - export function readdir( - path: PathLike, - options: { - encoding: "buffer"; - withFileTypes: true; - recursive?: boolean | undefined; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, - ): void; - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options: - | "buffer" - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. - */ - function __promisify__( - path: PathLike, - options: { - encoding: "buffer"; - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise[]>; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): string[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): NonSharedBuffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): string[] | NonSharedBuffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Dirent[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. - */ - export function readdirSync( - path: PathLike, - options: { - encoding: "buffer"; - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - mode: Mode | undefined | null, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param [flags='r'] See `support of file system `flags``. - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds, `Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - export interface WriteOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `buffer.byteLength - offset` - */ - length?: number | undefined; - /** - * @default null - */ - position?: number | null | undefined; - } - /** - * Write `buffer` to the file specified by `fd`. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where `bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write( - fd: number, - buffer: TBuffer, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param options An object with the following properties: - * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`. - * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write( - fd: number, - buffer: TBuffer, - options: WriteOptions, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write( - fd: number, - string: string, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param options An object with the following properties: - * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`. - * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - options?: WriteOptions, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - * @return The number of bytes written. - */ - export function writeSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset?: number | null, - length?: number | null, - position?: number | null, - ): number; - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): number; - export type ReadPosition = number | bigint; - export interface ReadOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - export interface ReadOptionsWithBuffer extends ReadOptions { - buffer?: T | undefined; - } - /** @deprecated Use `ReadOptions` instead. */ - // TODO: remove in future major - export interface ReadSyncOptions extends ReadOptions {} - /** @deprecated Use `ReadOptionsWithBuffer` instead. */ - // TODO: remove in future major - export interface ReadAsyncOptions extends ReadOptionsWithBuffer {} - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param buffer The buffer that the data will be written to. - * @param offset The position in `buffer` to write the data to. - * @param length The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - /** - * Similar to the above `fs.read` function, this version takes an optional `options` object. - * If not otherwise specified in an `options` object, - * `buffer` defaults to `Buffer.alloc(16384)`, - * `offset` defaults to `0`, - * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 - * `position` defaults to `null` - * @since v12.17.0, 13.11.0 - */ - export function read( - fd: number, - options: ReadOptionsWithBuffer, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - export function read( - fd: number, - buffer: TBuffer, - options: ReadOptions, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - export function read( - fd: number, - buffer: TBuffer, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - export function read( - fd: number, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NonSharedBuffer) => void, - ): void; - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__( - fd: number, - options: ReadOptionsWithBuffer, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__(fd: number): Promise<{ - bytesRead: number; - buffer: NonSharedBuffer; - }>; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - * @param [position='null'] - */ - export function readSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset: number, - length: number, - position: ReadPosition | null, - ): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - callback: (err: NodeJS.ErrnoException | null, data: string) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile( - path: PathOrFileDescriptor, - callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void, - ): void; - export namespace readFile { - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of `fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): NonSharedBuffer; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): string; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): string | NonSharedBuffer; - export type WriteFileOptions = - | ( - & ObjectEncodingOptions - & Abortable - & { - mode?: Mode | undefined; - flag?: string | undefined; - flush?: boolean | undefined; - } - ) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling `fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'node:fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - callback: NoParamCallback, - ): void; - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): Promise; - } - /** - * Returns `undefined`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__( - file: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'node:fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export interface WatchFileOptions { - bigint?: boolean | undefined; - persistent?: boolean | undefined; - interval?: number | undefined; - } - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'node:fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint?: false | undefined; - }) - | undefined, - listener: StatsListener, - ): StatWatcher; - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint: true; - }) - | undefined, - listener: BigIntStatsListener, - ): StatWatcher; - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and `fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()` and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: StatsListener): void; - export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | "buffer" | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = "rename" | "change"; - export type WatchListener = (event: WatchEventType, filename: T | null) => void; - export type StatsListener = (curr: Stats, prev: Stats) => void; - export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of `eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options?: WatchOptions | BufferEncoding | null, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options: WatchOptions | string, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'node:fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err` parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won't be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - /** @deprecated */ - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback` parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'node:fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export namespace constants { - // File Access Constants - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - // File Copy Constants - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - // File Open Constants - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - // File Type Constants - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - // File Mode Constants - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if `package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'node:fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file is readable and writable. - * access(file, constants.R_OK | constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - /** - * Synchronously tests a user's permissions for the file or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and - * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'node:fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - signal?: AbortSignal | null | undefined; - highWaterMark?: number | undefined; - } - interface FSImplementation { - open?: (...args: any[]) => any; - close?: (...args: any[]) => any; - } - interface CreateReadStreamFSImplementation extends FSImplementation { - read: (...args: any[]) => any; - } - interface CreateWriteStreamFSImplementation extends FSImplementation { - write: (...args: any[]) => any; - writev?: (...args: any[]) => any; - } - interface ReadStreamOptions extends StreamOptions { - fs?: CreateReadStreamFSImplementation | null | undefined; - end?: number | undefined; - } - interface WriteStreamOptions extends StreamOptions { - fs?: CreateWriteStreamFSImplementation | null | undefined; - flush?: boolean | undefined; - } - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs` implementations for `open`, `read`, and `close`. When providing the `fs` option, - * an override for `read` is required. If no `fd` is provided, an override for `open` is also required. If `autoClose` is `true`, an override for `close` is - * also required. - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` option to be set to `r+` rather than the - * default `w`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs` implementations for `open`, `write`, `writev`, and `close`. Overriding `write()` without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for at least one of `write` and `writev` are required. If no `fd` option is supplied, an override - * for `open` is also required. If `autoClose` is `true`, an override for `close` is also required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the `path` argument and will use the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export function fdatasyncSync(fd: number): void; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. No arguments other than a possible exception are given to the - * callback function. Node.js makes no guarantees about the atomicity of the copy - * operation. If an error occurs after the destination file has been opened for - * writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'node:fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. Node.js makes no guarantees about the - * atomicity of the copy operation. If an error occurs after the destination file - * has been opened for writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'node:fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using `writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and `buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an `Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] - */ - export function writev( - fd: number, - buffers: TBuffers, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: TBuffers) => void, - ): void; - export function writev( - fd: number, - buffers: TBuffers, - position: number | null, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: TBuffers) => void, - ): void; - // Providing a default type parameter doesn't provide true BC for userland consumers, but at least suppresses TS2314 - // TODO: remove default in future major version - export interface WriteVResult { - bytesWritten: number; - buffers: T; - } - export namespace writev { - function __promisify__( - fd: number, - buffers: TBuffers, - position?: number, - ): Promise>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @param [position='null'] - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and `buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - */ - export function readv( - fd: number, - buffers: TBuffers, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: TBuffers) => void, - ): void; - export function readv( - fd: number, - buffers: TBuffers, - position: number | null, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: TBuffers) => void, - ): void; - // Providing a default type parameter doesn't provide true BC for userland consumers, but at least suppresses TS2314 - // TODO: remove default in future major version - export interface ReadVResult { - bytesRead: number; - buffers: T; - } - export namespace readv { - function __promisify__( - fd: number, - buffers: TBuffers, - position?: number, - ): Promise>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - - export interface OpenAsBlobOptions { - /** - * An optional mime type for the blob. - * - * @default 'undefined' - */ - type?: string | undefined; - } - - /** - * Returns a `Blob` whose data is backed by the given file. - * - * The file must not be modified after the `Blob` is created. Any modifications - * will cause reading the `Blob` data to fail with a `DOMException` error. - * Synchronous stat operations on the file when the `Blob` is created, and before - * each read in order to detect whether the file data has been modified on disk. - * - * ```js - * import { openAsBlob } from 'node:fs'; - * - * const blob = await openAsBlob('the.file.txt'); - * const ab = await blob.arrayBuffer(); - * blob.stream(); - * ``` - * @since v19.8.0 - * @experimental - */ - export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; - - export interface OpenDirOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - /** - * @default false - */ - recursive?: boolean | undefined; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir( - path: PathLike, - options: OpenDirOptions, - cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void, - ): void; - export namespace opendir { - function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - } - export interface StatSyncOptions extends StatOptions { - throwIfNoEntry?: boolean | undefined; - } - interface CopyOptionsBase { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean | undefined; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean | undefined; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean | undefined; - /** - * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()} - */ - mode?: number | undefined; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean | undefined; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean | undefined; - /** - * When true, path resolution for symlinks will be skipped - * @default false - */ - verbatimSymlinks?: boolean | undefined; - } - export interface CopyOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?: ((source: string, destination: string) => boolean | Promise) | undefined; - } - export interface CopySyncOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?: ((source: string, destination: string) => boolean) | undefined; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp( - source: string | URL, - destination: string | URL, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - export function cp( - source: string | URL, - destination: string | URL, - opts: CopyOptions, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; -} -declare module "node:fs" { - export * from "fs"; -} diff --git a/node_modules/@types/node/fs/promises.d.ts b/node_modules/@types/node/fs/promises.d.ts deleted file mode 100644 index 7cc4dee..0000000 --- a/node_modules/@types/node/fs/promises.d.ts +++ /dev/null @@ -1,1270 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module "fs/promises" { - import { NonSharedBuffer } from "node:buffer"; - import { Abortable } from "node:events"; - import { Stream } from "node:stream"; - import { ReadableStream } from "node:stream/web"; - import { - BigIntStats, - BigIntStatsFs, - BufferEncodingOption, - constants as fsConstants, - CopyOptions, - Dir, - Dirent, - MakeDirectoryOptions, - Mode, - ObjectEncodingOptions, - OpenDirOptions, - OpenMode, - PathLike, - ReadOptions, - ReadOptionsWithBuffer, - ReadStream, - ReadVResult, - RmDirOptions, - RmOptions, - StatFsOptions, - StatOptions, - Stats, - StatsFs, - TimeLike, - WatchEventType, - WatchOptions, - WriteStream, - WriteVResult, - } from "node:fs"; - import { Interface as ReadlineInterface } from "node:readline"; - interface FileChangeInfo { - eventType: WatchEventType; - filename: T | null; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - /** @deprecated This interface will be removed in a future version. Use `import { ReadOptionsWithBuffer } from "node:fs"` instead. */ - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - interface CreateReadStreamOptions extends Abortable { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - end?: number | undefined; - highWaterMark?: number | undefined; - } - interface CreateWriteStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - flush?: boolean | undefined; - } - interface ReadableWebStreamOptions { - /** - * Whether to open a normal or a `'bytes'` stream. - * @since v20.0.0 - */ - type?: "bytes" | undefined; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & Abortable) - | BufferEncoding - | null, - ): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is - * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from - * the current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If the `FileHandle` points to a character device that only supports blocking - * reads (such as keyboard or sound card), read operations do not finish until data - * is available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('/dev/input/event0'); - * // Create a stream from some character device. - * const stream = fd.createReadStream(); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('sample.txt'); - * fd.createReadStream({ start: 90, end: 99 }); - * ``` - * @since v16.11.0 - */ - createReadStream(options?: CreateReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` `open` option to be set to `r+` rather than - * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * @since v16.11.0 - */ - createWriteStream(options?: CreateWriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param offset The location in the buffer at which to start filling. - * @param length The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read( - buffer: T, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise>; - read( - buffer: T, - options?: ReadOptions, - ): Promise>; - read( - options?: ReadOptionsWithBuffer, - ): Promise>; - /** - * Returns a `ReadableStream` that may be used to read the files data. - * - * An error will be thrown if this method is called more than once or is called - * after the `FileHandle` is closed or closing. - * - * ```js - * import { - * open, - * } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const chunk of file.readableWebStream()) - * console.log(chunk); - * - * await file.close(); - * ``` - * - * While the `ReadableStream` will read the file to completion, it will not - * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method. - * @since v17.0.0 - * @experimental - */ - readableWebStream(options?: ReadableWebStreamOptions): ReadableStream; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a `filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: - | ({ encoding?: null | undefined } & Abortable) - | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - */ - readFile( - options: - | ({ encoding: BufferEncoding } & Abortable) - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - */ - readFile( - options?: - | (ObjectEncodingOptions & Abortable) - | BufferEncoding - | null, - ): Promise; - /** - * Convenience method to create a `readline` interface and stream over the file. - * See `filehandle.createReadStream()` for the options. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const line of file.readLines()) { - * console.log(line); - * } - * ``` - * @since v18.11.0 - */ - readLines(options?: CreateReadStreamOptions): ReadlineInterface; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - }, - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then fulfills the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: TimeLike, mtime: TimeLike): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * The promise is fulfilled with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & Abortable) - | BufferEncoding - | null, - ): Promise; - /** - * Write `buffer` to the file. - * - * The promise is fulfilled with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). For this - * scenario, use `filehandle.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param offset The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. - * @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current - * position. See the POSIX pwrite(2) documentation for more detail. - */ - write( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. - * - * The promise is fulfilled with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be fulfilled (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current - * position. - */ - writev( - buffers: TBuffers, - position?: number, - ): Promise>; - /** - * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s - * @since v13.13.0, v12.17.0 - * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. - * @return Fulfills upon success an object containing two properties: - */ - readv( - buffers: TBuffers, - position?: number, - ): Promise>; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - /** - * An alias for {@link FileHandle.close()}. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - const constants: typeof fsConstants; - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If the accessibility check is successful, the promise is fulfilled with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access, constants } from 'node:fs/promises'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { copyFile, constants } from 'node:fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len` bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * - * ```js - * import { mkdir } from 'node:fs/promises'; - * - * try { - * const projectFolder = new URL('./test/project/', import.meta.url); - * const createDir = await mkdir(projectFolder, { recursive: true }); - * - * console.log(`created ${createDir}`); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the returned array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'node:fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a directory. If a URL is provided, it must use the `file:` protocol. - * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`. - */ - function readdir( - path: PathLike, - options: { - encoding: "buffer"; - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise[]>; - /** - * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * fulfilled with the`linkString` upon success. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink( - path: PathLike, - options?: ObjectEncodingOptions | string | null, - ): Promise; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`, `'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will - * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not - * exist, `'file'` will be used. Windows junction points require the destination - * path to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. Junction points on NTFS volumes - * can only point to directories. - * @since v10.0.0 - * @param [type='null'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v19.6.0, v18.15.0 - * @return Fulfills with the {fs.StatFs} object for the given `path`. - */ - function statfs( - path: PathLike, - opts?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function statfs( - path: PathLike, - opts: StatFsOptions & { - bigint: true; - }, - ): Promise; - function statfs(path: PathLike, opts?: StatFsOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Determines the actual location of `path` using the same semantics as the `fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath( - path: PathLike, - options?: ObjectEncodingOptions | BufferEncoding | null, - ): Promise; - /** - * Creates a unique temporary directory. A unique directory name is generated by - * appending six random characters to the end of the provided `prefix`. Due to - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs/promises'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * try { - * await mkdtemp(join(tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory `/tmp`, if the intention is to create a temporary directory _within_ `/tmp`, the `prefix` must end with a trailing - * platform-specific path separator - * (`import { sep } from 'node:node:path'`). - * @since v10.0.0 - * @return Fulfills with a string containing the file system path of the newly created temporary directory. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp( - prefix: string, - options?: ObjectEncodingOptions | BufferEncoding | null, - ): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs/promises'; - * import { Buffer } from 'node:buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: - | string - | NodeJS.ArrayBufferView - | Iterable - | AsyncIterable - | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - /** - * If all data is successfully written to the file, and `flush` - * is `true`, `filehandle.sync()` is used to flush the data. - * @default false - */ - flush?: boolean | undefined; - } & Abortable) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile( - path: PathLike | FileHandle, - data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) | BufferEncoding | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * An example of reading a `package.json` file located in the same directory of the - * running code: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * try { - * const filePath = new URL('./package.json', import.meta.url); - * const contents = await readFile(filePath, { encoding: 'utf8' }); - * console.log(contents); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options: - | ({ - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ( - & ObjectEncodingOptions - & Abortable - & { - flag?: OpenMode | undefined; - } - ) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: PathLike, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * import { watch } from 'node:fs/promises'; - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0, v14.18.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - ): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch( - filename: PathLike, - options: WatchOptions | string, - ): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; -} -declare module "node:fs/promises" { - export * from "fs/promises"; -} diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts deleted file mode 100644 index 3bff22a..0000000 --- a/node_modules/@types/node/globals.d.ts +++ /dev/null @@ -1,172 +0,0 @@ -declare var global: typeof globalThis; - -declare var process: NodeJS.Process; -declare var console: Console; - -interface ErrorConstructor { - /** - * Creates a `.stack` property on `targetObject`, which when accessed returns - * a string representing the location in the code at which - * `Error.captureStackTrace()` was called. - * - * ```js - * const myObject = {}; - * Error.captureStackTrace(myObject); - * myObject.stack; // Similar to `new Error().stack` - * ``` - * - * The first line of the trace will be prefixed with - * `${myObject.name}: ${myObject.message}`. - * - * The optional `constructorOpt` argument accepts a function. If given, all frames - * above `constructorOpt`, including `constructorOpt`, will be omitted from the - * generated stack trace. - * - * The `constructorOpt` argument is useful for hiding implementation - * details of error generation from the user. For instance: - * - * ```js - * function a() { - * b(); - * } - * - * function b() { - * c(); - * } - * - * function c() { - * // Create an error without stack trace to avoid calculating the stack trace twice. - * const { stackTraceLimit } = Error; - * Error.stackTraceLimit = 0; - * const error = new Error(); - * Error.stackTraceLimit = stackTraceLimit; - * - * // Capture the stack trace above function b - * Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace - * throw error; - * } - * - * a(); - * ``` - */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - /** - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; - /** - * The `Error.stackTraceLimit` property specifies the number of stack frames - * collected by a stack trace (whether generated by `new Error().stack` or - * `Error.captureStackTrace(obj)`). - * - * The default value is `10` but may be set to any valid JavaScript number. Changes - * will affect any stack trace captured _after_ the value has been changed. - * - * If set to a non-number value, or set to a negative number, stack traces will - * not capture any frames. - */ - stackTraceLimit: number; -} - -/** - * Enable this API with the `--expose-gc` CLI flag. - */ -declare var gc: NodeJS.GCFunction | undefined; - -declare namespace NodeJS { - interface CallSite { - getColumnNumber(): number | null; - getEnclosingColumnNumber(): number | null; - getEnclosingLineNumber(): number | null; - getEvalOrigin(): string | undefined; - getFileName(): string | null; - getFunction(): Function | undefined; - getFunctionName(): string | null; - getLineNumber(): number | null; - getMethodName(): string | null; - getPosition(): number; - getPromiseIndex(): number | null; - getScriptHash(): string; - getScriptNameOrSourceURL(): string | null; - getThis(): unknown; - getTypeName(): string | null; - isAsync(): boolean; - isConstructor(): boolean; - isEval(): boolean; - isNative(): boolean; - isPromiseAll(): boolean; - isToplevel(): boolean; - } - - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } - - type PartialOptions = { [K in keyof T]?: T[K] | undefined }; - - interface GCFunction { - (minor?: boolean): void; - (options: NodeJS.GCOptions & { execution: "async" }): Promise; - (options: NodeJS.GCOptions): void; - } - - interface GCOptions { - execution?: "sync" | "async" | undefined; - flavor?: "regular" | "last-resort" | undefined; - type?: "major-snapshot" | "major" | "minor" | undefined; - filename?: string | undefined; - } - - /** An iterable iterator returned by the Node.js API. */ - // Default TReturn/TNext in v20 is `any`, for compatibility with the previously-used IterableIterator. - interface Iterator extends IteratorObject { - [Symbol.iterator](): NodeJS.Iterator; - } - - /** An async iterable iterator returned by the Node.js API. */ - // Default TReturn/TNext in v20 is `any`, for compatibility with the previously-used AsyncIterableIterator. - interface AsyncIterator extends AsyncIteratorObject { - [Symbol.asyncIterator](): NodeJS.AsyncIterator; - } -} diff --git a/node_modules/@types/node/globals.typedarray.d.ts b/node_modules/@types/node/globals.typedarray.d.ts deleted file mode 100644 index 8eafc3b..0000000 --- a/node_modules/@types/node/globals.typedarray.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -export {}; // Make this a module - -declare global { - namespace NodeJS { - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = - | TypedArray - | DataView; - - // The following aliases are required to allow use of non-shared ArrayBufferViews in @types/node - // while maintaining compatibility with TS <=5.6. - type NonSharedUint8Array = Uint8Array; - type NonSharedUint8ClampedArray = Uint8ClampedArray; - type NonSharedUint16Array = Uint16Array; - type NonSharedUint32Array = Uint32Array; - type NonSharedInt8Array = Int8Array; - type NonSharedInt16Array = Int16Array; - type NonSharedInt32Array = Int32Array; - type NonSharedBigUint64Array = BigUint64Array; - type NonSharedBigInt64Array = BigInt64Array; - type NonSharedFloat32Array = Float32Array; - type NonSharedFloat64Array = Float64Array; - type NonSharedDataView = DataView; - type NonSharedTypedArray = TypedArray; - type NonSharedArrayBufferView = ArrayBufferView; - } -} diff --git a/node_modules/@types/node/http.d.ts b/node_modules/@types/node/http.d.ts deleted file mode 100644 index 12261fa..0000000 --- a/node_modules/@types/node/http.d.ts +++ /dev/null @@ -1,2049 +0,0 @@ -/** - * To use the HTTP server and client one must import the `node:http` module. - * - * The HTTP interfaces in Node.js are designed to support many features - * of the protocol which have been traditionally difficult to use. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```json - * { "content-length": "123", - * "content-type": "text/plain", - * "connection": "keep-alive", - * "host": "example.com", - * "accept": "*" } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders` property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders` list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'example.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/http.js) - */ -declare module "http" { - import { NonSharedBuffer } from "node:buffer"; - import * as stream from "node:stream"; - import { URL } from "node:url"; - import { LookupOptions } from "node:dns"; - import { EventEmitter } from "node:events"; - import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net"; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - "accept-encoding"?: string | undefined; - "accept-language"?: string | undefined; - "accept-patch"?: string | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - "alt-svc"?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - connection?: string | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-type"?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - "proxy-authenticate"?: string | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "retry-after"?: string | undefined; - "sec-fetch-site"?: string | undefined; - "sec-fetch-mode"?: string | undefined; - "sec-fetch-user"?: string | undefined; - "sec-fetch-dest"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | undefined; - "sec-websocket-version"?: string | undefined; - "set-cookie"?: string[] | undefined; - "strict-transport-security"?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - upgrade?: string | undefined; - "user-agent"?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - "www-authenticate"?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict { - accept?: string | string[] | undefined; - "accept-charset"?: string | string[] | undefined; - "accept-encoding"?: string | string[] | undefined; - "accept-language"?: string | string[] | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - "cdn-cache-control"?: string | undefined; - connection?: string | string[] | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | number | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-security-policy"?: string | undefined; - "content-security-policy-report-only"?: string | undefined; - cookie?: string | string[] | undefined; - dav?: string | string[] | undefined; - dnt?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-range"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - link?: string | string[] | undefined; - location?: string | undefined; - "max-forwards"?: string | undefined; - origin?: string | undefined; - pragma?: string | string[] | undefined; - "proxy-authenticate"?: string | string[] | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - "public-key-pins-report-only"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "referrer-policy"?: string | undefined; - refresh?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | string[] | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | string[] | undefined; - "sec-websocket-version"?: string | undefined; - server?: string | undefined; - "set-cookie"?: string | string[] | undefined; - "strict-transport-security"?: string | undefined; - te?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - "user-agent"?: string | undefined; - upgrade?: string | undefined; - "upgrade-insecure-requests"?: string | undefined; - vary?: string | undefined; - via?: string | string[] | undefined; - warning?: string | undefined; - "www-authenticate"?: string | string[] | undefined; - "x-content-type-options"?: string | undefined; - "x-dns-prefetch-control"?: string | undefined; - "x-frame-options"?: string | undefined; - "x-xss-protection"?: string | undefined; - } - interface ClientRequestArgs extends Pick { - _defaultAgent?: Agent | undefined; - agent?: Agent | boolean | undefined; - auth?: string | null | undefined; - createConnection?: - | (( - options: ClientRequestArgs, - oncreate: (err: Error | null, socket: stream.Duplex) => void, - ) => stream.Duplex | null | undefined) - | undefined; - defaultPort?: number | string | undefined; - family?: number | undefined; - headers?: OutgoingHttpHeaders | readonly string[] | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - insecureHTTPParser?: boolean | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - lookup?: LookupFunction | undefined; - /** - * @default 16384 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - port?: number | string | null | undefined; - protocol?: string | null | undefined; - setHost?: boolean | undefined; - signal?: AbortSignal | undefined; - socketPath?: string | undefined; - timeout?: number | undefined; - uniqueHeaders?: Array | undefined; - joinDuplicateHeaders?: boolean | undefined; - } - interface ServerOptions< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - > { - /** - * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. - */ - IncomingMessage?: Request | undefined; - /** - * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. - */ - ServerResponse?: Response | undefined; - /** - * Sets the timeout value in milliseconds for receiving the entire request from the client. - * @see Server.requestTimeout for more information. - * @default 300000 - * @since v18.0.0 - */ - requestTimeout?: number | undefined; - /** - * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. - * @default false - * @since v18.14.0 - */ - joinDuplicateHeaders?: boolean | undefined; - /** - * The number of milliseconds of inactivity a server needs to wait for additional incoming data, - * after it has finished writing the last response, before a socket will be destroyed. - * @see Server.keepAliveTimeout for more information. - * @default 5000 - * @since v18.0.0 - */ - keepAliveTimeout?: number | undefined; - /** - * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. - * @default 30000 - */ - connectionsCheckingInterval?: number | undefined; - /** - * Sets the timeout value in milliseconds for receiving the complete HTTP headers from the client. - * See {@link Server.headersTimeout} for more information. - * @default 60000 - * @since 18.0.0 - */ - headersTimeout?: number | undefined; - /** - * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. - * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. - * Default: @see stream.getDefaultHighWaterMark(). - * @since v20.1.0 - */ - highWaterMark?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - /** - * Optionally overrides the value of `--max-http-header-size` for requests received by - * this server, i.e. the maximum length of request headers in bytes. - * @default 16384 - * @since v13.3.0 - */ - maxHeaderSize?: number | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default true - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it forces the server to respond with a 400 (Bad Request) status code - * to any HTTP/1.1 request message that lacks a Host header (as mandated by the specification). - * @default true - * @since 20.0.0 - */ - requireHostHeader?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - /** - * A list of response headers that should be sent only once. - * If the header's value is an array, the items will be joined using `; `. - */ - uniqueHeaders?: Array | undefined; - /** - * If set to `true`, an error is thrown when writing to an HTTP response which does not have a body. - * @default false - * @since v18.17.0, v20.2.0 - */ - rejectNonStandardBodyWrites?: boolean | undefined; - } - type RequestListener< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; - /** - * @since v0.1.17 - */ - class Server< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - > extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: (socket: Socket) => void): this; - setTimeout(callback: (socket: Socket) => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The maximum number of requests socket can handle - * before closing keep alive connection. - * - * A value of `0` will disable the limit. - * - * When the limit is reached it will set the `Connection` header value to `close`, - * but will not actually close the connection, subsequent requests sent - * after the limit is reached will get `503 Service Unavailable` as a response. - * @since v16.10.0 - */ - maxRequestsPerSocket: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * The number of milliseconds of inactivity a server needs to wait for additional - * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e., `server.timeout`. - * - * A value of `0` will disable the keep-alive timeout behavior on incoming - * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior - * to 8.0.0, which did not have a keep-alive timeout. - * - * The socket timeout logic is set up on connection, so changing this value only - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request - * or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: RequestListener): this; - addListener(event: "checkExpectation", listener: RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - addListener(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - addListener(event: "request", listener: RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "clientError", err: Error, socket: stream.Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer): boolean; - emit(event: "dropRequest", req: InstanceType, socket: stream.Duplex): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: RequestListener): this; - on(event: "checkExpectation", listener: RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - on( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - on(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - on(event: "request", listener: RequestListener): this; - on( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: RequestListener): this; - once(event: "checkExpectation", listener: RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - once( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - once(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - once(event: "request", listener: RequestListener): this; - once( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: RequestListener): this; - prependListener(event: "checkExpectation", listener: RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - prependListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependListener(event: "request", listener: RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - prependOnceListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependOnceListener(event: "request", listener: RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: NonSharedBuffer) => void, - ): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from - * the perspective of the participants of an HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: Request; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Alias of `outgoingMessage.socket`. - * @since v0.3.0 - * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * Once a socket is associated with the message and is connected, `socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value. If the header already exists in the to-be-sent - * headers, its value will be replaced. Use an array of strings to send multiple - * headers with the same name. - * @since v0.4.0 - * @param name Header name - * @param value Header value - */ - setHeader(name: string, value: number | string | readonly string[]): this; - /** - * Sets multiple header values for implicit headers. headers must be an instance of - * `Headers` or `Map`, if a header already exists in the to-be-sent headers, its - * value will be replaced. - * - * ```js - * const headers = new Headers({ foo: 'bar' }); - * outgoingMessage.setHeaders(headers); - * ``` - * - * or - * - * ```js - * const headers = new Map([['foo', 'bar']]); - * outgoingMessage.setHeaders(headers); - * ``` - * - * When headers have been set with `outgoingMessage.setHeaders()`, they will be - * merged with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * const headers = new Headers({ 'Content-Type': 'text/html' }); - * res.setHeaders(headers); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * @since v19.6.0, v18.15.0 - * @param name Header name - * @param value Header value - */ - setHeaders(headers: Headers | Map): this; - /** - * Append a single header value to the header object. - * - * If the value is an array, this is equivalent to calling this method multiple - * times. - * - * If there were no previous values for the header, this is equivalent to calling `outgoingMessage.setHeader(name, value)`. - * - * Depending of the value of `options.uniqueHeaders` when the client request or the - * server were created, this will end up in the header being sent multiple times or - * a single time with values joined using `; `. - * @since v18.3.0, v16.17.0 - * @param name Header name - * @param value Header value - */ - appendHeader(name: string, value: string | readonly string[]): this; - /** - * Gets the value of the HTTP header with the given name. If that header is not - * set, the returned value will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript `Object`. This means that - * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v7.7.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All names are lowercase. - * @since v7.7.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v7.7.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - * @param name Header name - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers will **only** be emitted if the message is chunked encoded. If not, - * the trailers will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header field names in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Flushes the message headers. - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()` bypasses the optimization and kickstarts the message. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - /** - * If set to `true`, Node.js will check whether the `Content-Length` header value and the size of the body, in bytes, are equal. - * Mismatching the `Content-Length` header value will result - * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * @since v18.10.0, v16.18.0 - */ - strictContentLength: boolean; - constructor(req: Request); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends an HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on `Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. The optional `callback` argument will be called when - * the response message has been written. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics', - * }); - * - * const earlyHintsCallback = () => console.log('early hints message sent'); - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }, earlyHintsCallback); - * ``` - * @since v18.11.0 - * @param hints An object containing the values of headers - * @param callback Will be called when the response message has been written - */ - writeEarlyHints(hints: Record, callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain', - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * will check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a \[`Error`\]\[\] being thrown. - * @since v0.1.30 - */ - writeHead( - statusCode: number, - statusMessage?: string, - headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], - ): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends a HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(callback?: () => void): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`, `getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object. `'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an `'error'` listener registered. - * - * Set `Content-Length` header to limit the response body size. - * If `response.strictContentLength` is set to `true`, mismatching the `Content-Length` header value will result in an `Error` being thrown, - * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * - * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - * @deprecated Since v17.0.0, v16.12.0 - Check `destroyed` instead. - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - /** - * When sending request through a keep-alive enabled agent, the underlying socket - * might be reused. But if server closes connection at unfortunate time, client - * may run into a 'ECONNRESET' error. - * - * ```js - * import http from 'node:http'; - * - * // Server has a 5 seconds keep-alive timeout by default - * http - * .createServer((req, res) => { - * res.write('hello\n'); - * res.end(); - * }) - * .listen(3000); - * - * setInterval(() => { - * // Adapting a keep-alive agent - * http.get('http://localhost:3000', { agent }, (res) => { - * res.on('data', (data) => { - * // Do nothing - * }); - * }); - * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout - * ``` - * - * By marking a request whether it reused socket or not, we can do - * automatic error retry base on it. - * - * ```js - * import http from 'node:http'; - * const agent = new http.Agent({ keepAlive: true }); - * - * function retriableRequest() { - * const req = http - * .get('http://localhost:3000', { agent }, (res) => { - * // ... - * }) - * .on('error', (err) => { - * // Check if retry is needed - * if (req.reusedSocket && err.code === 'ECONNRESET') { - * retriableRequest(); - * } - * }); - * } - * - * retriableRequest(); - * ``` - * @since v13.0.0, v12.16.0 - */ - reusedSocket: boolean; - /** - * Limits maximum response headers count. If set to 0, no limit will be applied. - */ - maxHeadersCount: number; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0, v14.17.0 - */ - getRawHeaderNames(): string[]; - /** - * @deprecated - */ - addListener(event: "abort", listener: () => void): this; - addListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - addListener(event: "continue", listener: () => void): this; - addListener(event: "information", listener: (info: InformationEvent) => void): this; - addListener(event: "response", listener: (response: IncomingMessage) => void): this; - addListener(event: "socket", listener: (socket: Socket) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - on(event: "abort", listener: () => void): this; - on( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - on(event: "continue", listener: () => void): this; - on(event: "information", listener: (info: InformationEvent) => void): this; - on(event: "response", listener: (response: IncomingMessage) => void): this; - on(event: "socket", listener: (socket: Socket) => void): this; - on(event: "timeout", listener: () => void): this; - on( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - once(event: "abort", listener: () => void): this; - once( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - once(event: "continue", listener: () => void): this; - once(event: "information", listener: (info: InformationEvent) => void): this; - once(event: "response", listener: (response: IncomingMessage) => void): this; - once(event: "socket", listener: (socket: Socket) => void): this; - once(event: "timeout", listener: () => void): this; - once( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependListener(event: "abort", listener: () => void): this; - prependListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - prependListener(event: "continue", listener: () => void): this; - prependListener(event: "information", listener: (info: InformationEvent) => void): this; - prependListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependListener(event: "socket", listener: (socket: Socket) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependOnceListener(event: "abort", listener: () => void): this; - prependOnceListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: "continue", listener: () => void): this; - prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this; - prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: "socket", listener: (socket: Socket) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers, and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the `IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST', - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket` or internally nulled. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`, `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, `last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`, `retry-after`, `server`, or `user-agent` are discarded. - * To allow duplicate values of the headers listed above to be joined, - * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more - * information. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with `; `. - * * For all other headers, the values are joined together with `, `. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * Similar to `message.headers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': ['curl/7.22.0'], - * // host: ['127.0.0.1:8000'], - * // accept: ['*'] } - * console.log(request.headersDistinct); - * ``` - * @since v18.3.0, v16.17.0 - */ - headersDistinct: NodeJS.Dict; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * Similar to `message.trailers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * Only populated at the `'end'` event. - * @since v18.3.0, v16.17.0 - */ - trailersDistinct: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and `process.env.HOST` is undefined: - * - * ```console - * $ node - * > new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); - * URL { - * href: 'http://localhost/status?name=ryan', - * origin: 'http://localhost', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost', - * hostname: 'localhost', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * - * Ensure that you set `process.env.HOST` to the server's host name, or consider replacing this part entirely. If using `req.headers.host`, ensure proper - * validation is used, as clients may specify a custom `Host` header. - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error` is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - destroy(error?: Error): this; - } - interface AgentOptions extends NodeJS.PartialOptions { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean | undefined; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: "fifo" | "lifo" | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the `keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing `{agent: false}` as an option to the `http.get()` or `http.request()` functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false, // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * - * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v20.x/api/net.html#socketconnectoptions-connectlistener) are also supported. - * - * To configure any of them, a custom {@link Agent} instance must be created. - * - * ```js - * import http from 'node:http'; - * const keepAliveAgent = new http.Agent({ keepAlive: true }); - * options.agent = keepAliveAgent; - * http.request(options, onResponseCallback) - * ``` - * @since v0.3.4 - */ - class Agent extends EventEmitter { - /** - * By default set to 256. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - /** - * Produces a socket/stream to be used for HTTP requests. - * - * By default, this function is the same as `net.createConnection()`. However, - * custom agents may override this method in case greater flexibility is desired. - * - * A socket/stream can be supplied in one of two ways: by returning the - * socket/stream from this function, or by passing the socket/stream to `callback`. - * - * This method is guaranteed to return an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specifies a socket - * type other than `net.Socket`. - * - * `callback` has a signature of `(err, stream)`. - * @since v0.11.4 - * @param options Options containing connection details. Check `createConnection` for the format of the options - * @param callback Callback function that receives the created socket - */ - createConnection( - options: ClientRequestArgs, - callback?: (err: Error | null, stream: stream.Duplex) => void, - ): stream.Duplex | null | undefined; - /** - * Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to: - * - * ```js - * socket.setKeepAlive(true, this.keepAliveMsecs); - * socket.unref(); - * return true; - * ``` - * - * This method can be overridden by a particular `Agent` subclass. If this - * method returns a falsy value, the socket will be destroyed instead of persisting - * it for use with the next request. - * - * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`. - * @since v8.1.0 - */ - keepSocketAlive(socket: stream.Duplex): void; - /** - * Called when `socket` is attached to `request` after being persisted because of - * the keep-alive options. Default behavior is to: - * - * ```js - * socket.ref(); - * ``` - * - * This method can be overridden by a particular `Agent` subclass. - * - * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`. - * @since v8.1.0 - */ - reuseSocket(socket: stream.Duplex, request: ClientRequest): void; - /** - * Get a unique name for a set of request options, to determine whether a - * connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent, - * the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options - * that determine socket reusability. - * @since v0.11.4 - * @param options A set of options providing information for name generation - */ - getName(options?: ClientRequestArgs): string; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer(); - * - * // Listen to the request event - * server.on('request', (request, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.1.13 - */ - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - >(requestListener?: RequestListener): Server; - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - >( - options: ServerOptions, - requestListener?: RequestListener, - ): Server; - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs {} - /** - * `options` in `socket.connect()` are also supported. - * - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the `options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * import http from 'node:http'; - * import { Buffer } from 'node:buffer'; - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!', - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData), - * }, - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'close'` - * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'close'` - * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort()` on the corresponding `AbortController` will behave the same way as calling `.destroy()` on the - * request. Specifically, the `'error'` event will be emitted with an error with - * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'` and the `cause`, if one was provided. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: IncomingMessage) => void, - ): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()` automatically. The callback must take care to - * consume the response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the method set to GET by default. - */ - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - /** - * Performs the low-level validations on the provided `name` that are done when `res.setHeader(name, value)` is called. - * - * Passing illegal value as `name` will result in a `TypeError` being thrown, - * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Example: - * - * ```js - * import { validateHeaderName } from 'node:http'; - * - * try { - * validateHeaderName(''); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' - * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' - * } - * ``` - * @since v14.3.0 - * @param [label='Header name'] Label for error message. - */ - function validateHeaderName(name: string): void; - /** - * Performs the low-level validations on the provided `value` that are done when `res.setHeader(name, value)` is called. - * - * Passing illegal value as `value` will result in a `TypeError` being thrown. - * - * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. - * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Examples: - * - * ```js - * import { validateHeaderValue } from 'node:http'; - * - * try { - * validateHeaderValue('x-my-header', undefined); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true - * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' - * } - * - * try { - * validateHeaderValue('x-my-header', 'oʊmɪɡə'); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true - * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' - * } - * ``` - * @since v14.3.0 - * @param name Header name - * @param value Header value - */ - function validateHeaderValue(name: string, value: string): void; - /** - * Set the maximum number of idle HTTP parsers. - * @since v18.8.0, v16.18.0 - * @param [max=1000] - */ - function setMaxIdleHTTPParsers(max: number): void; - /** - * Global instance of `Agent` which is used as the default for all HTTP client - * requests. Diverges from a default `Agent` configuration by having `keepAlive` - * enabled and a `timeout` of 5 seconds. - * @since v0.5.9 - */ - let globalAgent: Agent; - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; -} -declare module "node:http" { - export * from "http"; -} diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts deleted file mode 100644 index 9c69a19..0000000 --- a/node_modules/@types/node/http2.d.ts +++ /dev/null @@ -1,2631 +0,0 @@ -/** - * The `node:http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. - * It can be accessed using: - * - * ```js - * import http2 from 'node:http2'; - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/http2.js) - */ -declare module "http2" { - import { NonSharedBuffer } from "node:buffer"; - import EventEmitter = require("node:events"); - import * as fs from "node:fs"; - import * as net from "node:net"; - import * as stream from "node:stream"; - import * as tls from "node:tls"; - import * as url from "node:url"; - import { - IncomingHttpHeaders as Http1IncomingHttpHeaders, - IncomingMessage, - OutgoingHttpHeaders, - ServerResponse, - } from "node:http"; - export { OutgoingHttpHeaders } from "node:http"; - export interface IncomingHttpStatusHeader { - ":status"?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ":path"?: string | undefined; - ":method"?: string | undefined; - ":authority"?: string | undefined; - ":scheme"?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - statCheck?: - | ((stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void) - | undefined; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?: ((err: NodeJS.ErrnoException) => void) | undefined; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Set to `true` if the `END_STREAM` flag was set in the request or response - * HEADERS frame received, indicating that no additional data should be received - * and the readable side of the `Http2Stream` will be closed. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined` if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be `undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session | undefined; - /** - * Provides miscellaneous information about the current state of the `Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * import http2 from 'node:http2'; - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: "aborted", listener: () => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: "streamClosed", listener: (code: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "wantTrailers", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted"): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: NonSharedBuffer | string): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "frameError", frameType: number, errorCode: number): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: "streamClosed", code: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "wantTrailers"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: () => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: "streamClosed", listener: (code: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "wantTrailers", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: () => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: "streamClosed", listener: (code: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "wantTrailers", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: () => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "streamClosed", listener: (code: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "wantTrailers", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: () => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "wantTrailers", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: "continue", listener: () => {}): this; - addListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "continue"): boolean; - emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "continue", listener: () => {}): this; - on( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "continue", listener: () => {}): this; - once( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "continue", listener: () => {}): this; - prependListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "continue", listener: () => {}): this; - prependOnceListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every `Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream` instance created for the push stream passed as the second argument, or an `Error` passed as the first argument. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to `true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - pushStream( - headers: OutgoingHttpHeaders, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - pushStream( - headers: OutgoingHttpHeaders, - options?: StreamPriorityOptions, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - /** - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * Initiates a response. When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be used to send trailing header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * import http2 from 'node:http2'; - * import fs from 'node:fs'; - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the `http2stream.respondWithFD()` method will - * perform an `fs.fstat()` call to collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either `http2stream.sendTrailers()` - * or `http2stream.close()` to close the `Http2Stream`. - * - * ```js - * import http2 from 'node:http2'; - * import fs from 'node:fs'; - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD( - fd: number | fs.promises.FileHandle, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptions, - ): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream` will be closed using an - * `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * If the `onError` callback is defined, then it will be called. Otherwise, the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.error(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate `304` response: - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile( - path: string, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptionsWithError, - ): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - signal?: AbortSignal | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol` property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise `false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect` callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this `Http2Session`. - * The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the `http2session.settings()` method. - * Will be `false` once all sent `SETTINGS` frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. - * The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to `http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or `tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error` is not undefined, an `'error'` event will be emitted immediately before the `'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the `Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false` otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the `maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView` containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING` payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: NonSharedBuffer) => void): boolean; - ping( - payload: NodeJS.ArrayBufferView, - callback: (err: Error | null, duration: number, payload: NonSharedBuffer) => void, - ): boolean; - /** - * Calls `ref()` on this `Http2Session` instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * import http2 from 'node:http2'; - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0, v14.18.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new `SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true` while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings( - settings: Settings, - callback?: (err: Error | null, settings: Settings, duration: number) => void, - ): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - unref(): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - addListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - addListener(event: "localSettings", listener: (settings: Settings) => void): this; - addListener(event: "ping", listener: () => void): this; - addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; - emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer): boolean; - emit(event: "localSettings", settings: Settings): boolean; - emit(event: "ping"): boolean; - emit(event: "remoteSettings", settings: Settings): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - on(event: "localSettings", listener: (settings: Settings) => void): this; - on(event: "ping", listener: () => void): this; - on(event: "remoteSettings", listener: (settings: Settings) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - once(event: "localSettings", listener: (settings: Settings) => void): this; - once(event: "ping", listener: () => void): this; - once(event: "remoteSettings", listener: (settings: Settings) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - prependListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependListener(event: "ping", listener: () => void): this; - prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependOnceListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "ping", listener: () => void): this; - prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()` creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * When a `ClientHttp2Session` is first created, the socket may not yet be - * connected. if `clienthttp2session.request()` is called during this time, the - * actual request will be deferred until the socket is ready to go. - * If the `session` is closed before the actual request be executed, an `ERR_HTTP2_GOAWAY_SESSION` is thrown. - * - * This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * import http2 from 'node:http2'; - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS, - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: "origin", listener: (origins: string[]) => void): this; - addListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; - emit(event: "origin", origins: readonly string[]): boolean; - emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit( - event: "stream", - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - on(event: "origin", listener: (origins: string[]) => void): this; - on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - once(event: "origin", listener: (origins: string[]) => void): this; - once( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: "origin", listener: (origins: string[]) => void): this; - prependListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - export interface ServerHttp2Session< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends Http2Session { - readonly server: - | Http2Server - | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * import http2 from 'node:http2'; - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * import http2 from 'node:http2'; - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL `'https://example.org/foo/bar'` is the ASCII string` 'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * import http2 from 'node:http2'; - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - addListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "connect", - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - // Http2Server - export interface SessionOptions { - /** - * Sets the maximum dynamic table size for deflating header fields. - * @default 4Kib - */ - maxDeflateDynamicTableSize?: number | undefined; - /** - * Sets the maximum number of settings entries per `SETTINGS` frame. - * The minimum value allowed is `1`. - * @default 32 - */ - maxSettings?: number | undefined; - /** - * Sets the maximum memory that the `Http2Session` is permitted to use. - * The value is expressed in terms of number of megabytes, e.g. `1` equal 1 megabyte. - * The minimum value allowed is `1`. - * This is a credit based limit, existing `Http2Stream`s may cause this limit to be exceeded, - * but new `Http2Stream` instances will be rejected while this limit is exceeded. - * The current number of `Http2Stream` sessions, the current memory use of the header compression tables, - * current data queued to be sent, and unacknowledged `PING` and `SETTINGS` frames are all counted towards the current limit. - * @default 10 - */ - maxSessionMemory?: number | undefined; - /** - * Sets the maximum number of header entries. - * This is similar to `server.maxHeadersCount` or `request.maxHeadersCount` in the `node:http` module. - * The minimum value is `1`. - * @default 128 - */ - maxHeaderListPairs?: number | undefined; - /** - * Sets the maximum number of outstanding, unacknowledged pings. - * @default 10 - */ - maxOutstandingPings?: number | undefined; - /** - * Sets the maximum allowed size for a serialized, compressed block of headers. - * Attempts to send headers that exceed this limit will result in - * a `'frameError'` event being emitted and the stream being closed and destroyed. - */ - maxSendHeaderBlockLength?: number | undefined; - /** - * Strategy used for determining the amount of padding to use for `HEADERS` and `DATA` frames. - * @default http2.constants.PADDING_STRATEGY_NONE - */ - paddingStrategy?: number | undefined; - /** - * Sets the maximum number of concurrent streams for the remote peer as if a `SETTINGS` frame had been received. - * Will be overridden if the remote peer sets its own value for `maxConcurrentStreams`. - * @default 100 - */ - peerMaxConcurrentStreams?: number | undefined; - /** - * The initial settings to send to the remote peer upon connection. - */ - settings?: Settings | undefined; - /** - * The array of integer values determines the settings types, - * which are included in the `CustomSettings`-property of the received remoteSettings. - * Please see the `CustomSettings`-property of the `Http2Settings` object for more information, on the allowed setting types. - */ - remoteCustomSettings?: number[] | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - } - export interface ClientSessionOptions extends SessionOptions { - /** - * Sets the maximum number of reserved push streams the client will accept at any given time. - * Once the current number of currently reserved push streams exceeds reaches this limit, - * new push streams sent by the server will be automatically rejected. - * The minimum allowed value is 0. The maximum allowed value is 232-1. - * A negative value sets this option to the maximum allowed value. - * @default 200 - */ - maxReservedRemoteStreams?: number | undefined; - /** - * An optional callback that receives the `URL` instance passed to `connect` and the `options` object, - * and returns any `Duplex` stream that is to be used as the connection for this session. - */ - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - /** - * The protocol to connect with, if not set in the `authority`. - * Value may be either `'http:'` or `'https:'`. - * @default 'https:' - */ - protocol?: "http:" | "https:" | undefined; - } - export interface ServerSessionOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends SessionOptions { - Http1IncomingMessage?: Http1Request | undefined; - Http1ServerResponse?: Http1Response | undefined; - Http2ServerRequest?: Http2Request | undefined; - Http2ServerResponse?: Http2Response | undefined; - } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends ServerSessionOptions {} - export interface SecureServerOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends SecureServerSessionOptions { - allowHTTP1?: boolean | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends net.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "checkContinue", - request: InstanceType, - response: InstanceType, - ): boolean; - emit(event: "request", request: InstanceType, response: InstanceType): boolean; - emit( - event: "session", - session: ServerHttp2Session, - ): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface Http2SecureServer< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends tls.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "checkContinue", - request: InstanceType, - response: InstanceType, - ): boolean; - emit(event: "request", request: InstanceType, response: InstanceType): boolean; - emit( - event: "session", - session: ServerHttp2Session, - ): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - options: stream.ReadableOptions, - rawHeaders: readonly string[], - ); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from `req.headers[':authority']` if present. Otherwise, it is derived from `req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns `'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream`s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): NonSharedBuffer | string | null; - addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted", hadError: boolean, code: number): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: NonSharedBuffer | string): boolean; - emit(event: "end"): boolean; - emit(event: "readable"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: NonSharedBuffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Append a single header value to the header object. - * - * If the value is an array, this is equivalent to calling this method multiple times. - * - * If there were no previous values for the header, this is equivalent to calling {@link setHeader}. - * - * Attempting to set a header field name or value that contains invalid characters will result in a - * [TypeError](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-typeerror) being thrown. - * - * ```js - * // Returns headers including "set-cookie: a" and "set-cookie: b" - * const server = http2.createServer((req, res) => { - * res.setHeader('set-cookie', 'a'); - * res.appendHeader('set-cookie', 'b'); - * res.writeHead(200); - * res.end('ok'); - * }); - * ``` - * @since v20.12.0 - */ - appendHeader(name: string, value: string | string[]): void; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 `request` object. - * @since v15.7.0 - */ - readonly req: Request; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ""; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): this; - end(data: string | Uint8Array, callback?: () => void): this; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | readonly string[]): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'` events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `node:http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and `Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a status `103 Early Hints` to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }); - * ``` - * @since v18.11.0 - */ - writeEarlyHints(hints: Record): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the `Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - createPushResponse( - headers: OutgoingHttpHeaders, - callback: (err: Error | null, res: Http2ServerResponse) => void, - ): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: string; - const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: string; - const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session` instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * import http2 from 'node:http2'; - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): NonSharedBuffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session` instances. - * - * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * import http2 from 'node:http2'; - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8000); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2Server; - export function createServer< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - >( - options: ServerOptions, - onRequestHandler?: (request: InstanceType, response: InstanceType) => void, - ): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session` instances. - * - * ```js - * import http2 from 'node:http2'; - * import fs from 'node:fs'; - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8443); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2SecureServer; - export function createSecureServer< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - >( - options: SecureServerOptions, - onRequestHandler?: (request: InstanceType, response: InstanceType) => void, - ): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * import http2 from 'node:http2'; - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - export function connect( - authority: string | url.URL, - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; - /** - * Create an HTTP/2 server session from an existing socket. - * @param socket A Duplex Stream - * @param options Any `{@link createServer}` options can be provided. - * @since v20.12.0 - */ - export function performServerHandshake< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - >( - socket: stream.Duplex, - options?: ServerOptions, - ): ServerHttp2Session; -} -declare module "node:http2" { - export * from "http2"; -} diff --git a/node_modules/@types/node/https.d.ts b/node_modules/@types/node/https.d.ts deleted file mode 100644 index 5ac4581..0000000 --- a/node_modules/@types/node/https.d.ts +++ /dev/null @@ -1,578 +0,0 @@ -/** - * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a - * separate module. - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/https.js) - */ -declare module "https" { - import { NonSharedBuffer } from "node:buffer"; - import { Duplex } from "node:stream"; - import * as tls from "node:tls"; - import * as http from "node:http"; - import { URL } from "node:url"; - interface ServerOptions< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > extends http.ServerOptions, tls.TlsOptions {} - interface RequestOptions extends http.RequestOptions, tls.SecureContextOptions { - checkServerIdentity?: typeof tls.checkServerIdentity | undefined; - rejectUnauthorized?: boolean | undefined; // Defaults to true - servername?: string | undefined; // SNI TLS Extension - } - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean | undefined; - maxCachedSessions?: number | undefined; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - createConnection( - options: RequestOptions, - callback?: (err: Error | null, stream: Duplex) => void, - ): Duplex | null | undefined; - getName(options?: RequestOptions): string; - } - interface Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor( - options: ServerOptions, - requestListener?: http.RequestListener, - ); - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Duplex) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: http.RequestListener): this; - addListener(event: "checkExpectation", listener: http.RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - addListener(event: "request", listener: http.RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "keylog", line: NonSharedBuffer, tlsSocket: tls.TLSSocket): boolean; - emit( - event: "newSession", - sessionId: NonSharedBuffer, - sessionData: NonSharedBuffer, - callback: () => void, - ): boolean; - emit( - event: "OCSPRequest", - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ): boolean; - emit( - event: "resumeSession", - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ): boolean; - emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Duplex): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType, - ): boolean; - emit(event: "clientError", err: Error, socket: Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: Duplex, head: NonSharedBuffer): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: Duplex, head: NonSharedBuffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - on( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - on( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Duplex) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: http.RequestListener): this; - on(event: "checkExpectation", listener: http.RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - on( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - on(event: "request", listener: http.RequestListener): this; - on( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Duplex) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: http.RequestListener): this; - once(event: "checkExpectation", listener: http.RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - once( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - once(event: "request", listener: http.RequestListener): this; - once( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Duplex) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: http.RequestListener): this; - prependListener(event: "checkExpectation", listener: http.RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - prependListener(event: "request", listener: http.RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: http.RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: http.RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - prependOnceListener(event: "request", listener: http.RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: NonSharedBuffer) => void, - ): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * import https from 'node:https'; - * import fs from 'node:fs'; - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * import https from 'node:https'; - * import fs from 'node:fs'; - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample', - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - >(requestListener?: http.RequestListener): Server; - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - >( - options: ServerOptions, - requestListener?: http.RequestListener, - ): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted: `ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`, `honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`, `secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`, `highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * import https from 'node:https'; - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false, - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * import tls from 'node:tls'; - * import https from 'node:https'; - * import crypto from 'node:crypto'; - * - * function sha256(s) { - * return crypto.createHash('sha256').update(s).digest('base64'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha256 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - function request( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * ```js - * import https from 'node:https'; - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - function get( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function get( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - let globalAgent: Agent; -} -declare module "node:https" { - export * from "https"; -} diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts deleted file mode 100644 index 4676281..0000000 --- a/node_modules/@types/node/index.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support Node.js and TypeScript 5.7+. - -// Reference required TypeScript libs: -/// - -// TypeScript backwards-compatibility definitions: -/// - -// Definitions specific to TypeScript 5.7+: -/// -/// - -// Definitions for Node.js modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// diff --git a/node_modules/@types/node/inspector.generated.d.ts b/node_modules/@types/node/inspector.generated.d.ts deleted file mode 100644 index 3303dba..0000000 --- a/node_modules/@types/node/inspector.generated.d.ts +++ /dev/null @@ -1,3966 +0,0 @@ -// These definitions are automatically generated by the generate-inspector script. -// Do not edit this file directly. -// See scripts/generate-inspector/README.md for information on how to update the protocol definitions. -// Changes to the module itself should be added to the generator template (scripts/generate-inspector/inspector.d.ts.template). - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - * @see [source](https://github.com/nodejs/node/blob/v20.x/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - - interface InspectorNotification { - method: string; - params: T; - } - - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[] | undefined; - } - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - } - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {} | undefined; - } - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string | undefined; - } - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace | undefined; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - /** - * Call frame identifier. - */ - type CallFrameId = string; - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - } - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location | undefined; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject | undefined; - } - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId | undefined; - } - } - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string | undefined; - /** - * Included category filters. - */ - includedCategories: string[]; - } - interface StartParameterType { - traceConfig: TraceConfig; - } - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - namespace NodeWorker { - type WorkerID = string; - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - interface DetachParameterType { - sessionId: SessionID; - } - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - namespace Network { - /** - * Resource type as it was perceived by the rendering engine. - */ - type ResourceType = string; - /** - * Unique request identifier. - */ - type RequestId = string; - /** - * UTC time in seconds, counted from January 1, 1970. - */ - type TimeSinceEpoch = number; - /** - * Monotonically increasing time in seconds since an arbitrary point in the past. - */ - type MonotonicTime = number; - /** - * HTTP request data. - */ - interface Request { - url: string; - method: string; - headers: Headers; - } - /** - * HTTP response data. - */ - interface Response { - url: string; - status: number; - statusText: string; - headers: Headers; - } - /** - * Request / response headers as keys / values of JSON object. - */ - interface Headers { - } - interface RequestWillBeSentEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Request data. - */ - request: Request; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - /** - * Timestamp. - */ - wallTime: TimeSinceEpoch; - } - interface ResponseReceivedEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - /** - * Resource type. - */ - type: ResourceType; - /** - * Response data. - */ - response: Response; - } - interface LoadingFailedEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - /** - * Resource type. - */ - type: ResourceType; - /** - * Error message. - */ - errorText: string; - } - interface LoadingFinishedEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. - */ - constructor(); - - /** - * Connects a session to the inspector back-end. - */ - connect(): void; - - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if this API was not called on a Worker thread. - * @since v12.11.0 - */ - connectToMainThread(): void; - - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * `session.connect()` will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - - /** - * Posts a message to the inspector back-end. `callback` will be notified when - * a response is received. `callback` is a function that accepts two optional - * arguments: error and message-specific result. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the - * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - */ - post(method: string, callback?: (err: Error | null, params?: object) => void): void; - post(method: string, params?: object, callback?: (err: Error | null, params?: object) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: 'Runtime.globalLexicalScopeNames', - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: 'Debugger.getPossibleBreakpoints', - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; - post( - method: 'HeapProfiler.getObjectByHeapObjectId', - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Disables network tracking, prevents network events from being sent to the client. - */ - post(method: 'Network.disable', callback?: (err: Error | null) => void): void; - /** - * Enables network tracking, network events will now be delivered to the client. - */ - post(method: 'Network.enable', callback?: (err: Error | null) => void): void; - /** - * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.enable', callback?: (err: Error | null) => void): void; - /** - * Disable NodeRuntime events - */ - post(method: 'NodeRuntime.disable', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; - - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'Network.requestWillBeSent', message: InspectorNotification): boolean; - emit(event: 'Network.responseReceived', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFailed', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFinished', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - emit(event: 'NodeRuntime.waitingForDebugger'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - on(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - once(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - } - - /** - * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the [security warning](https://nodejs.org/docs/latest-v20.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure) - * regarding the `host` parameter usage. - * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI. - * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI. - * @param wait Block until a client has connected. Defaults to what was specified on the CLI. - * @returns Disposable that calls `inspector.close()`. - */ - function open(port?: number, host?: string, wait?: boolean): Disposable; - - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help, see: https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help, see: https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - - /** - * Blocks until a client (existing or connected later) has sent `Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; - - // These methods are exposed by the V8 inspector console API (inspector/v8-console.h). - // The method signatures differ from those of the Node.js console, and are deliberately - // typed permissively. - interface InspectorConsole { - debug(...data: any[]): void; - error(...data: any[]): void; - info(...data: any[]): void; - log(...data: any[]): void; - warn(...data: any[]): void; - dir(...data: any[]): void; - dirxml(...data: any[]): void; - table(...data: any[]): void; - trace(...data: any[]): void; - group(...data: any[]): void; - groupCollapsed(...data: any[]): void; - groupEnd(...data: any[]): void; - clear(...data: any[]): void; - count(label?: any): void; - countReset(label?: any): void; - assert(value?: any, ...data: any[]): void; - profile(label?: any): void; - profileEnd(label?: any): void; - time(label?: any): void; - timeLog(label?: any): void; - timeStamp(label?: any): void; - } - - /** - * An object to send messages to the remote inspector console. - * @since v11.0.0 - */ - const console: InspectorConsole; - - // DevTools protocol event broadcast methods - namespace Network { - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that - * the application is about to send an HTTP request. - * @since v22.6.0 - * @experimental - */ - function requestWillBeSent(params: RequestWillBeSentEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that - * HTTP response is available. - * @since v22.6.0 - * @experimental - */ - function responseReceived(params: ResponseReceivedEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that - * HTTP request has finished loading. - * @since v22.6.0 - * @experimental - */ - function loadingFinished(params: LoadingFinishedEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that - * HTTP request has failed to load. - * @since v22.7.0 - * @experimental - */ - function loadingFailed(params: LoadingFailedEventDataType): void; - } -} - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - */ -declare module 'node:inspector' { - export * from 'inspector'; -} - -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @see [source](https://github.com/nodejs/node/blob/v20.x/lib/inspector/promises.js) - * @since v19.0.0 - */ -declare module 'inspector/promises' { - import EventEmitter = require('node:events'); - import { - open, - close, - url, - waitForDebugger, - console, - InspectorNotification, - Schema, - Runtime, - Debugger, - Console, - Profiler, - HeapProfiler, - NodeTracing, - NodeWorker, - Network, - NodeRuntime, - } from 'inspector'; - - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - * @since v19.0.0 - */ - class Session extends EventEmitter { - /** - * Create a new instance of the `inspector.Session` class. - * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. - */ - constructor(); - - /** - * Connects a session to the inspector back-end. - */ - connect(): void; - - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if this API was not called on a Worker thread. - */ - connectToMainThread(): void; - - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * `session.connect()` will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - - /** - * Posts a message to the inspector back-end. - * - * ```js - * import { Session } from 'node:inspector/promises'; - * try { - * const session = new Session(); - * session.connect(); - * const result = await session.post('Runtime.evaluate', { expression: '2 + 2' }); - * console.log(result); - * } catch (error) { - * console.error(error); - * } - * // Output: { result: { type: 'number', value: 4, description: '4' } } - * ``` - * - * The latest version of the V8 inspector protocol is published on the - * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - */ - post(method: string, params?: object): Promise; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains'): Promise; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType): Promise; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType): Promise; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType): Promise; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType): Promise; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType): Promise; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType): Promise; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger'): Promise; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable'): Promise; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable'): Promise; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries'): Promise; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType): Promise; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType): Promise; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType): Promise; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType): Promise; - /** - * Returns all let, const and class variables from global scope. - */ - post(method: 'Runtime.globalLexicalScopeNames', params?: Runtime.GlobalLexicalScopeNamesParameterType): Promise; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable'): Promise; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable'): Promise; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType): Promise; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType): Promise; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType): Promise; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType): Promise; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType): Promise; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post(method: 'Debugger.getPossibleBreakpoints', params?: Debugger.GetPossibleBreakpointsParameterType): Promise; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType): Promise; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType): Promise; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver'): Promise; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType): Promise; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut'): Promise; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause'): Promise; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync'): Promise; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume'): Promise; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType): Promise; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType): Promise; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType): Promise; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType): Promise; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType): Promise; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType): Promise; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType): Promise; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType): Promise; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType): Promise; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType): Promise; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType): Promise; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType): Promise; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable'): Promise; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable'): Promise; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages'): Promise; - post(method: 'Profiler.enable'): Promise; - post(method: 'Profiler.disable'): Promise; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType): Promise; - post(method: 'Profiler.start'): Promise; - post(method: 'Profiler.stop'): Promise; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType): Promise; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage'): Promise; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage'): Promise; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage'): Promise; - post(method: 'HeapProfiler.enable'): Promise; - post(method: 'HeapProfiler.disable'): Promise; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType): Promise; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType): Promise; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType): Promise; - post(method: 'HeapProfiler.collectGarbage'): Promise; - post(method: 'HeapProfiler.getObjectByHeapObjectId', params?: HeapProfiler.GetObjectByHeapObjectIdParameterType): Promise; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType): Promise; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType): Promise; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType): Promise; - post(method: 'HeapProfiler.stopSampling'): Promise; - post(method: 'HeapProfiler.getSamplingProfile'): Promise; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories'): Promise; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType): Promise; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop'): Promise; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType): Promise; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType): Promise; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable'): Promise; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType): Promise; - /** - * Disables network tracking, prevents network events from being sent to the client. - */ - post(method: 'Network.disable'): Promise; - /** - * Enables network tracking, network events will now be delivered to the client. - */ - post(method: 'Network.enable'): Promise; - /** - * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.enable'): Promise; - /** - * Disable NodeRuntime events - */ - post(method: 'NodeRuntime.disable'): Promise; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise; - - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'Network.requestWillBeSent', message: InspectorNotification): boolean; - emit(event: 'Network.responseReceived', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFailed', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFinished', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - emit(event: 'NodeRuntime.waitingForDebugger'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - on(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - once(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - } - - export { - Session, - open, - close, - url, - waitForDebugger, - console, - InspectorNotification, - Schema, - Runtime, - Debugger, - Console, - Profiler, - HeapProfiler, - NodeTracing, - NodeWorker, - Network, - NodeRuntime, - }; -} - -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @since v19.0.0 - */ -declare module 'node:inspector/promises' { - export * from 'inspector/promises'; -} diff --git a/node_modules/@types/node/module.d.ts b/node_modules/@types/node/module.d.ts deleted file mode 100644 index 36b86ff..0000000 --- a/node_modules/@types/node/module.d.ts +++ /dev/null @@ -1,539 +0,0 @@ -/** - * @since v0.3.7 - */ -declare module "module" { - import { URL } from "node:url"; - import { MessagePort } from "node:worker_threads"; - class Module { - constructor(id: string, parent?: Module); - } - interface Module extends NodeJS.Module {} - namespace Module { - export { Module }; - } - namespace Module { - /** - * A list of the names of all modules provided by Node.js. Can be used to verify - * if a module is maintained by a third party or not. - * - * Note: the list doesn't contain prefix-only modules like `node:test`. - * @since v9.3.0, v8.10.0, v6.13.0 - */ - const builtinModules: readonly string[]; - /** - * @since v12.2.0 - * @param path Filename to be used to construct the require - * function. Must be a file URL object, file URL string, or absolute path - * string. - */ - function createRequire(path: string | URL): NodeJS.Require; - /** - * @since v18.6.0, v16.17.0 - */ - function isBuiltin(moduleName: string): boolean; - interface RegisterOptions { - /** - * If you want to resolve `specifier` relative to a - * base URL, such as `import.meta.url`, you can pass that URL here. This - * property is ignored if the `parentURL` is supplied as the second argument. - * @default 'data:' - */ - parentURL?: string | URL | undefined; - /** - * Any arbitrary, cloneable JavaScript value to pass into the - * {@link initialize} hook. - */ - data?: Data | undefined; - /** - * [Transferable objects](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html#portpostmessagevalue-transferlist) - * to be passed into the `initialize` hook. - */ - transferList?: any[] | undefined; - } - /* eslint-disable @definitelytyped/no-unnecessary-generics */ - /** - * Register a module that exports hooks that customize Node.js module - * resolution and loading behavior. See - * [Customization hooks](https://nodejs.org/docs/latest-v20.x/api/module.html#customization-hooks). - * @since v20.6.0, v18.19.0 - * @param specifier Customization hooks to be registered; this should be - * the same string that would be passed to `import()`, except that if it is - * relative, it is resolved relative to `parentURL`. - * @param parentURL f you want to resolve `specifier` relative to a base - * URL, such as `import.meta.url`, you can pass that URL here. - */ - function register( - specifier: string | URL, - parentURL?: string | URL, - options?: RegisterOptions, - ): void; - function register(specifier: string | URL, options?: RegisterOptions): void; - /* eslint-enable @definitelytyped/no-unnecessary-generics */ - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * import fs from 'node:fs'; - * import assert from 'node:assert'; - * import { syncBuiltinESMExports } from 'node:module'; - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('node:fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** @deprecated Use `ImportAttributes` instead */ - interface ImportAssertions extends ImportAttributes {} - interface ImportAttributes extends NodeJS.Dict { - type?: string | undefined; - } - type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm"; - type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray; - /** - * The `initialize` hook provides a way to define a custom function that runs in - * the hooks thread when the hooks module is initialized. Initialization happens - * when the hooks module is registered via {@link register}. - * - * This hook can receive data from a {@link register} invocation, including - * ports and other transferable objects. The return value of `initialize` can be a - * `Promise`, in which case it will be awaited before the main application thread - * execution resumes. - */ - type InitializeHook = (data: Data) => void | Promise; - interface ResolveHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * @deprecated Use `importAttributes` instead - */ - importAssertions: ImportAttributes; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - /** - * The module importing this one, or undefined if this is the Node.js entry point - */ - parentURL: string | undefined; - } - interface ResolveFnOutput { - /** - * A hint to the load hook (it might be ignored) - */ - format?: ModuleFormat | null | undefined; - /** - * @deprecated Use `importAttributes` instead - */ - importAssertions?: ImportAttributes | undefined; - /** - * The import attributes to use when caching the module (optional; if excluded the input will be used) - */ - importAttributes?: ImportAttributes | undefined; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The absolute URL to which this input resolves - */ - url: string; - } - /** - * The `resolve` hook chain is responsible for telling Node.js where to find and - * how to cache a given `import` statement or expression, or `require` call. It can - * optionally return a format (such as `'module'`) as a hint to the `load` hook. If - * a format is specified, the `load` hook is ultimately responsible for providing - * the final `format` value (and it is free to ignore the hint provided by - * `resolve`); if `resolve` provides a `format`, a custom `load` hook is required - * even if only to pass the value to the Node.js default `load` hook. - */ - type ResolveHook = ( - specifier: string, - context: ResolveHookContext, - nextResolve: ( - specifier: string, - context?: Partial, - ) => ResolveFnOutput | Promise, - ) => ResolveFnOutput | Promise; - interface LoadHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * The format optionally supplied by the `resolve` hook chain - */ - format: ModuleFormat | null | undefined; - /** - * @deprecated Use `importAttributes` instead - */ - importAssertions: ImportAttributes; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - } - interface LoadFnOutput { - format: string | null | undefined; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The source for Node.js to evaluate - */ - source?: ModuleSource | undefined; - } - /** - * The `load` hook provides a way to define a custom method of determining how a - * URL should be interpreted, retrieved, and parsed. It is also in charge of - * validating the import attributes. - */ - type LoadHook = ( - url: string, - context: LoadHookContext, - nextLoad: ( - url: string, - context?: Partial, - ) => LoadFnOutput | Promise, - ) => LoadFnOutput | Promise; - interface GlobalPreloadContext { - port: MessagePort; - } - /** - * Sometimes it might be necessary to run some code inside of the same global - * scope that the application runs in. This hook allows the return of a string - * that is run as a sloppy-mode script on startup. - * @deprecated This hook will be removed in a future version. Use - * `initialize` instead. When a hooks module has an `initialize` export, - * `globalPreload` will be ignored. - */ - type GlobalPreloadHook = (context: GlobalPreloadContext) => string; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise. - */ - function findSourceMap(path: string): SourceMap | undefined; - interface SourceMapConstructorOptions { - /** - * @since v20.5.0 - */ - lineLengths?: readonly number[] | undefined; - } - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - interface SourceOrigin { - /** - * The name of the range in the source map, if one was provided - */ - name: string | undefined; - /** - * The file name of the original source, as reported in the SourceMap - */ - fileName: string; - /** - * The 1-indexed lineNumber of the corresponding call site in the original source - */ - lineNumber: number; - /** - * The 1-indexed columnNumber of the corresponding call site in the original source - */ - columnNumber: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - constructor(payload: SourceMapPayload, options?: SourceMapConstructorOptions); - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - /** - * Given a line offset and column offset in the generated source - * file, returns an object representing the SourceMap range in the - * original file if found, or an empty object if not. - * - * The object returned contains the following keys: - * - * The returned value represents the raw range as it appears in the - * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and - * column numbers as they appear in Error messages and CallSite - * objects. - * - * To get the corresponding 1-indexed line and column numbers from a - * lineNumber and columnNumber as they are reported by Error stacks - * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` - * @param lineOffset The zero-indexed line number offset in the generated source - * @param columnOffset The zero-indexed column number offset in the generated source - */ - findEntry(lineOffset: number, columnOffset: number): SourceMapping | {}; - /** - * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source, - * find the corresponding call site location in the original source. - * - * If the `lineNumber` and `columnNumber` provided are not found in any source map, - * then an empty object is returned. - * @param lineNumber The 1-indexed line number of the call site in the generated source - * @param columnNumber The 1-indexed column number of the call site in the generated source - */ - findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {}; - } - function runMain(main?: string): void; - function wrap(script: string): string; - } - global { - interface ImportMeta { - /** - * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. - * **Caveat:** only present on `file:` modules. - */ - dirname: string; - /** - * The full absolute path and filename of the current module, with symlinks resolved. - * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. - * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. - */ - filename: string; - /** - * The absolute `file:` URL of the module. - */ - url: string; - /** - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * Second `parent` parameter is only used when the `--experimental-import-meta-resolve` - * command flag enabled. - * - * @since v20.6.0 - * - * @param specifier The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. - * @returns The absolute (`file:`) URL string for the resolved module. - */ - resolve(specifier: string, parent?: string | URL | undefined): string; - } - namespace NodeJS { - interface Module { - /** - * The module objects required for the first time by this one. - * @since v0.1.16 - */ - children: Module[]; - /** - * The `module.exports` object is created by the `Module` system. Sometimes this is - * not acceptable; many want their module to be an instance of some class. To do - * this, assign the desired export object to `module.exports`. - * @since v0.1.16 - */ - exports: any; - /** - * The fully resolved filename of the module. - * @since v0.1.16 - */ - filename: string; - /** - * The identifier for the module. Typically this is the fully resolved - * filename. - * @since v0.1.16 - */ - id: string; - /** - * `true` if the module is running during the Node.js preload - * phase. - * @since v15.4.0, v14.17.0 - */ - isPreloading: boolean; - /** - * Whether or not the module is done loading, or is in the process of - * loading. - * @since v0.1.16 - */ - loaded: boolean; - /** - * The module that first required this one, or `null` if the current module is the - * entry point of the current process, or `undefined` if the module was loaded by - * something that is not a CommonJS module (e.g. REPL or `import`). - * @since v0.1.16 - * @deprecated Please use `require.main` and `module.children` instead. - */ - parent: Module | null | undefined; - /** - * The directory name of the module. This is usually the same as the - * `path.dirname()` of the `module.id`. - * @since v11.14.0 - */ - path: string; - /** - * The search paths for the module. - * @since v0.4.0 - */ - paths: string[]; - /** - * The `module.require()` method provides a way to load a module as if - * `require()` was called from the original module. - * @since v0.5.1 - */ - require(id: string): any; - } - interface Require { - /** - * Used to import modules, `JSON`, and local files. - * @since v0.1.13 - */ - (id: string): any; - /** - * Modules are cached in this object when they are required. By deleting a key - * value from this object, the next `require` will reload the module. - * This does not apply to - * [native addons](https://nodejs.org/docs/latest-v20.x/api/addons.html), - * for which reloading will result in an error. - * @since v0.3.0 - */ - cache: Dict; - /** - * Instruct `require` on how to handle certain file extensions. - * @since v0.3.0 - * @deprecated - */ - extensions: RequireExtensions; - /** - * The `Module` object representing the entry script loaded when the Node.js - * process launched, or `undefined` if the entry point of the program is not a - * CommonJS module. - * @since v0.1.17 - */ - main: Module | undefined; - /** - * @since v0.3.0 - */ - resolve: RequireResolve; - } - /** @deprecated */ - interface RequireExtensions extends Dict<(module: Module, filename: string) => any> { - ".js": (module: Module, filename: string) => any; - ".json": (module: Module, filename: string) => any; - ".node": (module: Module, filename: string) => any; - } - interface RequireResolveOptions { - /** - * Paths to resolve module location from. If present, these - * paths are used instead of the default resolution paths, with the exception - * of - * [GLOBAL\_FOLDERS](https://nodejs.org/docs/latest-v20.x/api/modules.html#loading-from-the-global-folders) - * like `$HOME/.node_modules`, which are - * always included. Each of these paths is used as a starting point for - * the module resolution algorithm, meaning that the `node_modules` hierarchy - * is checked from this location. - * @since v8.9.0 - */ - paths?: string[] | undefined; - } - interface RequireResolve { - /** - * Use the internal `require()` machinery to look up the location of a module, - * but rather than loading the module, just return the resolved filename. - * - * If the module can not be found, a `MODULE_NOT_FOUND` error is thrown. - * @since v0.3.0 - * @param request The module path to resolve. - */ - (id: string, options?: RequireResolveOptions): string; - /** - * Returns an array containing the paths searched during resolution of `request` or - * `null` if the `request` string references a core module, for example `http` or - * `fs`. - * @since v8.9.0 - * @param request The module path whose lookup paths are being retrieved. - */ - paths(request: string): string[] | null; - } - } - /** - * The directory name of the current module. This is the same as the - * `path.dirname()` of the `__filename`. - * @since v0.1.27 - */ - var __dirname: string; - /** - * The file name of the current module. This is the current module file's absolute - * path with symlinks resolved. - * - * For a main program this is not necessarily the same as the file name used in the - * command line. - * @since v0.0.1 - */ - var __filename: string; - /** - * The `exports` variable is available within a module's file-level scope, and is - * assigned the value of `module.exports` before the module is evaluated. - * @since v0.1.16 - */ - var exports: NodeJS.Module["exports"]; - /** - * A reference to the current module. - * @since v0.1.16 - */ - var module: NodeJS.Module; - /** - * @since v0.1.13 - */ - var require: NodeJS.Require; - // Global-scope aliases for backwards compatibility with @types/node <13.0.x - /** @deprecated Use `NodeJS.Module` instead. */ - interface NodeModule extends NodeJS.Module {} - /** @deprecated Use `NodeJS.Require` instead. */ - interface NodeRequire extends NodeJS.Require {} - /** @deprecated Use `NodeJS.RequireResolve` instead. */ - interface RequireResolve extends NodeJS.RequireResolve {} - } - export = Module; -} -declare module "node:module" { - import module = require("module"); - export = module; -} diff --git a/node_modules/@types/node/net.d.ts b/node_modules/@types/node/net.d.ts deleted file mode 100644 index 0689472..0000000 --- a/node_modules/@types/node/net.d.ts +++ /dev/null @@ -1,1012 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `node:net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * import net from 'node:net'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/net.js) - */ -declare module "net" { - import { NonSharedBuffer } from "node:buffer"; - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import * as dns from "node:dns"; - type LookupFunction = ( - hostname: string, - options: dns.LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | dns.LookupAddress[], family?: number) => void, - ) => void; - interface AddressInfo { - address: string; - family: string; - port: number; - } - interface SocketConstructorOpts { - fd?: number | undefined; - allowHalfOpen?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - signal?: AbortSignal | undefined; - } - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. - * Return false from this function to implicitly pause() the socket. - */ - callback(bytesWritten: number, buf: Uint8Array): boolean; - } - interface ConnectOpts { - /** - * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. - * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will - * still be emitted as normal and methods like pause() and resume() will also behave as expected. - */ - onread?: OnReadOpts | undefined; - } - interface TcpSocketConnectOpts extends ConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - noDelay?: boolean | undefined; - keepAlive?: boolean | undefined; - keepAliveInitialDelay?: number | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamily?: boolean | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamilyAttemptTimeout?: number | undefined; - } - interface IpcSocketConnectOpts extends ConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed"; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately. - * If the socket is still writable it implicitly calls `socket.end()`. - * @since v0.3.4 - */ - destroySoon(): void; - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - */ - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Close the TCP connection by sending an RST packet and destroy the stream. - * If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected. - * Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. - * If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error. - * @since v18.3.0, v16.17.0 - */ - resetAndDestroy(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)` - * and it is an array of the addresses that have been attempted. - * - * Each address is a string in the form of `$IP:$PORT`. - * If the connection was successful, then the last address is the one that the socket is currently connected to. - * @since v19.4.0 - */ - readonly autoSelectFamilyAttemptedAddresses: string[]; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`, `socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting - * (see `socket.connecting`). - * @since v11.2.0, v10.16.0 - */ - readonly pending: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress?: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort?: number; - /** - * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. - * @since v18.8.0, v16.18.0 - */ - readonly localFamily?: string; - /** - * This property represents the state of the connection as a string. - * - * * If the stream is connecting `socket.readyState` is `opening`. - * * If the stream is readable and writable, it is `open`. - * * If the stream is readable and not writable, it is `readOnly`. - * * If the stream is not readable and writable, it is `writeOnly`. - * @since v0.5.0 - */ - readonly readyState: SocketReadyState; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remoteAddress: string | undefined; - /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.11.14 - */ - readonly remoteFamily: string | undefined; - /** - * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remotePort: number | undefined; - /** - * The socket timeout in milliseconds as set by `socket.setTimeout()`. - * It is `undefined` if a timeout has not been set. - * @since v10.7.0 - */ - readonly timeout?: number; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): this; - end(buffer: Uint8Array | string, callback?: () => void): this; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. connectionAttempt - * 4. connectionAttemptFailed - * 5. connectionAttemptTimeout - * 6. data - * 7. drain - * 8. end - * 9. error - * 10. lookup - * 11. ready - * 12. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (hadError: boolean) => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - addListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, - ): this; - addListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - addListener(event: "data", listener: (data: NonSharedBuffer) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "timeout", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", hadError: boolean): boolean; - emit(event: "connect"): boolean; - emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean; - emit(event: "connectionAttemptFailed", ip: string, port: number, family: number, error: Error): boolean; - emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean; - emit(event: "data", data: NonSharedBuffer): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; - emit(event: "ready"): boolean; - emit(event: "timeout"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (hadError: boolean) => void): this; - on(event: "connect", listener: () => void): this; - on(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - on( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, - ): this; - on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this; - on(event: "data", listener: (data: NonSharedBuffer) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - on(event: "ready", listener: () => void): this; - on(event: "timeout", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (hadError: boolean) => void): this; - once(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - once( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, - ): this; - once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this; - once(event: "connect", listener: () => void): this; - once(event: "data", listener: (data: NonSharedBuffer) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - once(event: "ready", listener: () => void): this; - once(event: "timeout", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (hadError: boolean) => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - prependListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, - ): this; - prependListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependListener(event: "data", listener: (data: NonSharedBuffer) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: (hadError: boolean) => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener( - event: "connectionAttempt", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number, error: Error) => void, - ): this; - prependOnceListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener(event: "data", listener: (data: NonSharedBuffer) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - } - interface ListenOptions extends Abortable { - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - path?: string | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - /** - * Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`. - * @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v20.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode). - * @since v18.17.0, v20.1.0 - */ - highWaterMark?: number | undefined; - } - interface DropArgument { - localAddress?: string; - localPort?: number; - localFamily?: string; - remoteAddress?: string; - remotePort?: number; - remoteFamily?: string; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.error('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). - * If the server is `ref`ed calling `ref()` again will have no effect. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - readonly listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - * 5. drop - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "drop", listener: (data?: DropArgument) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "drop", data?: DropArgument): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "drop", listener: (data?: DropArgument) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "drop", listener: (data?: DropArgument) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "drop", listener: (data?: DropArgument) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this; - /** - * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } - type IPVersion = "ipv4" | "ipv6"; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0, v14.18.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0, v14.18.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0, v14.18.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0, v14.18.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0, v14.18.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - /** - * The list of rules added to the blocklist. - * @since v15.0.0, v14.18.0 - */ - rules: readonly string[]; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of a TCP echo server which listens for connections - * on port 8124: - * - * ```js - * import net from 'node:net'; - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```bash - * telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```bash - * nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`. - * The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided. - * @since v19.4.0 - */ - function getDefaultAutoSelectFamily(): boolean; - /** - * Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`. - * @since v19.4.0 - */ - function setDefaultAutoSelectFamily(value: boolean): void; - /** - * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`. - * @returns The current default value of the `autoSelectFamilyAttemptTimeout` option. - * @since v19.8.0, v18.8.0 - */ - function getDefaultAutoSelectFamilyAttemptTimeout(): number; - /** - * Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * @param value The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line - * option `--network-family-autoselection-attempt-timeout`. - * @since v19.8.0, v18.8.0 - */ - function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void; - /** - * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 - * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. - * - * ```js - * net.isIP('::1'); // returns 6 - * net.isIP('127.0.0.1'); // returns 4 - * net.isIP('127.000.000.001'); // returns 0 - * net.isIP('127.0.0.1/24'); // returns 0 - * net.isIP('fhqwhgads'); // returns 0 - * ``` - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no - * leading zeroes. Otherwise, returns `false`. - * - * ```js - * net.isIPv4('127.0.0.1'); // returns true - * net.isIPv4('127.000.000.001'); // returns false - * net.isIPv4('127.0.0.1/24'); // returns false - * net.isIPv4('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. - * - * ```js - * net.isIPv6('::1'); // returns true - * net.isIPv6('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0, v14.18.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0, v14.18.0 - */ - readonly port: number; - /** - * @since v15.14.0, v14.18.0 - */ - readonly flowlabel: number; - } -} -declare module "node:net" { - export * from "net"; -} diff --git a/node_modules/@types/node/os.d.ts b/node_modules/@types/node/os.d.ts deleted file mode 100644 index 331df6e..0000000 --- a/node_modules/@types/node/os.d.ts +++ /dev/null @@ -1,506 +0,0 @@ -/** - * The `node:os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * import os from 'node:os'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/os.js) - */ -declare module "os" { - import { NonSharedBuffer } from "buffer"; - interface CpuInfo { - model: string; - speed: number; - times: { - /** The number of milliseconds the CPU has spent in user mode. */ - user: number; - /** The number of milliseconds the CPU has spent in nice mode. */ - nice: number; - /** The number of milliseconds the CPU has spent in sys mode. */ - sys: number; - /** The number of milliseconds the CPU has spent in idle mode. */ - idle: number; - /** The number of milliseconds the CPU has spent in irq mode. */ - irq: number; - }; - } - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - scopeid?: number; - } - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: "IPv4"; - } - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: "IPv6"; - scopeid: number; - } - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T | null; - homedir: T; - } - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * The array will be empty if no CPU information is available, such as if the `/proc` file system is unavailable. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20, - * }, - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * - * `os.cpus().length` should not be used to calculate the amount of parallelism - * available to an application. Use {@link availableParallelism} for this purpose. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns an estimate of the default amount of parallelism a program should use. - * Always returns a value greater than zero. - * - * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism). - * @since v19.4.0, v18.14.0 - */ - function availableParallelism(): number; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See - * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - interface UserInfoOptions { - encoding?: BufferEncoding | "buffer" | undefined; - } - interface UserInfoOptionsWithBufferEncoding extends UserInfoOptions { - encoding: "buffer"; - } - interface UserInfoOptionsWithStringEncoding extends UserInfoOptions { - encoding?: BufferEncoding | undefined; - } - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and `gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a [`SystemError`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options?: UserInfoOptionsWithStringEncoding): UserInfo; - function userInfo(options: UserInfoOptionsWithBufferEncoding): UserInfo; - function userInfo(options: UserInfoOptions): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace dlopen { - const RTLD_LAZY: number; - const RTLD_NOW: number; - const RTLD_GLOBAL: number; - const RTLD_LOCAL: number; - const RTLD_DEEPBIND: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - /** - * The operating system-specific end-of-line marker. - * * `\n` on POSIX - * * `\r\n` on Windows - */ - const EOL: string; - /** - * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, - * and `'x64'`. - * - * The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v20.x/api/process.html#processarch). - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform for which - * the Node.js binary was compiled. The value is set at compile time. - * Possible values are `'aix'`, `'darwin'`, `'freebsd'`, `'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - function platform(): NodeJS.Platform; - /** - * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`, `mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`. - * - * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v18.9.0, v16.18.0 - */ - function machine(): string; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): "BE" | "LE"; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If `pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19` (low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in `os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to `PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module "node:os" { - export * from "os"; -} diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json deleted file mode 100644 index 16f62f4..0000000 --- a/node_modules/@types/node/package.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "name": "@types/node", - "version": "20.19.33", - "description": "TypeScript definitions for node", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", - "license": "MIT", - "contributors": [ - { - "name": "Microsoft TypeScript", - "githubUsername": "Microsoft", - "url": "https://github.com/Microsoft" - }, - { - "name": "Alberto Schiabel", - "githubUsername": "jkomyno", - "url": "https://github.com/jkomyno" - }, - { - "name": "Andrew Makarov", - "githubUsername": "r3nya", - "url": "https://github.com/r3nya" - }, - { - "name": "Benjamin Toueg", - "githubUsername": "btoueg", - "url": "https://github.com/btoueg" - }, - { - "name": "David Junger", - "githubUsername": "touffy", - "url": "https://github.com/touffy" - }, - { - "name": "Mohsen Azimi", - "githubUsername": "mohsen1", - "url": "https://github.com/mohsen1" - }, - { - "name": "Nikita Galkin", - "githubUsername": "galkin", - "url": "https://github.com/galkin" - }, - { - "name": "Sebastian Silbermann", - "githubUsername": "eps1lon", - "url": "https://github.com/eps1lon" - }, - { - "name": "Wilco Bakker", - "githubUsername": "WilcoBakker", - "url": "https://github.com/WilcoBakker" - }, - { - "name": "Marcin Kopacz", - "githubUsername": "chyzwar", - "url": "https://github.com/chyzwar" - }, - { - "name": "Trivikram Kamat", - "githubUsername": "trivikr", - "url": "https://github.com/trivikr" - }, - { - "name": "Junxiao Shi", - "githubUsername": "yoursunny", - "url": "https://github.com/yoursunny" - }, - { - "name": "Ilia Baryshnikov", - "githubUsername": "qwelias", - "url": "https://github.com/qwelias" - }, - { - "name": "ExE Boss", - "githubUsername": "ExE-Boss", - "url": "https://github.com/ExE-Boss" - }, - { - "name": "Piotr Błażejewicz", - "githubUsername": "peterblazejewicz", - "url": "https://github.com/peterblazejewicz" - }, - { - "name": "Anna Henningsen", - "githubUsername": "addaleax", - "url": "https://github.com/addaleax" - }, - { - "name": "Victor Perin", - "githubUsername": "victorperin", - "url": "https://github.com/victorperin" - }, - { - "name": "NodeJS Contributors", - "githubUsername": "NodeJS", - "url": "https://github.com/NodeJS" - }, - { - "name": "Linus Unnebäck", - "githubUsername": "LinusU", - "url": "https://github.com/LinusU" - }, - { - "name": "wafuwafu13", - "githubUsername": "wafuwafu13", - "url": "https://github.com/wafuwafu13" - }, - { - "name": "Matteo Collina", - "githubUsername": "mcollina", - "url": "https://github.com/mcollina" - }, - { - "name": "Dmitry Semigradsky", - "githubUsername": "Semigradsky", - "url": "https://github.com/Semigradsky" - } - ], - "main": "", - "types": "index.d.ts", - "typesVersions": { - "<=5.6": { - "*": [ - "ts5.6/*" - ] - } - }, - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/node" - }, - "scripts": {}, - "dependencies": { - "undici-types": "~6.21.0" - }, - "peerDependencies": {}, - "typesPublisherContentHash": "d4cd30c43a08f690617e195e57a46fefea3c5b57689407429ba7a4f30c8f1b83", - "typeScriptVersion": "5.2" -} \ No newline at end of file diff --git a/node_modules/@types/node/path.d.ts b/node_modules/@types/node/path.d.ts deleted file mode 100644 index dd69692..0000000 --- a/node_modules/@types/node/path.d.ts +++ /dev/null @@ -1,200 +0,0 @@ -declare module "path/posix" { - import path = require("path"); - export = path; -} -declare module "path/win32" { - import path = require("path"); - export = path; -} -/** - * The `node:path` module provides utilities for working with file and directory - * paths. It can be accessed using: - * - * ```js - * import path from 'node:path'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/path.js) - */ -declare module "path" { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. If the path is a zero-length string, '.' is returned, representing the current working directory. - * - * @param path string path to normalize. - * @throws {TypeError} if `path` is not a string. - */ - normalize(path: string): string; - /** - * Join all arguments together and normalize the resulting path. - * - * @param paths paths to join. - * @throws {TypeError} if any of the path segments is not a string. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param paths A sequence of paths or path segments. - * @throws {TypeError} if any of the arguments is not a string. - */ - resolve(...paths: string[]): string; - /** - * The `path.matchesGlob()` method determines if `path` matches the `pattern`. - * @param path The path to glob-match against. - * @param pattern The glob to check the path against. - * @returns Whether or not the `path` matched the `pattern`. - * @throws {TypeError} if `path` or `pattern` are not strings. - * @since v20.17.0 - */ - matchesGlob(path: string, pattern: string): boolean; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * If the given {path} is a zero-length string, `false` will be returned. - * - * @param path path to test. - * @throws {TypeError} if `path` is not a string. - */ - isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to} based on the current working directory. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @throws {TypeError} if either `from` or `to` is not a string. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - dirname(path: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param path the path to evaluate. - * @param suffix optionally, an extension to remove from the result. - * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. - */ - basename(path: string, suffix?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - extname(path: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: "\\" | "/"; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: ";" | ":"; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param path path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - parse(path: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathObject path to evaluate. - */ - format(pathObject: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module "node:path" { - import path = require("path"); - export = path; -} -declare module "node:path/posix" { - import path = require("path/posix"); - export = path; -} -declare module "node:path/win32" { - import path = require("path/win32"); - export = path; -} diff --git a/node_modules/@types/node/perf_hooks.d.ts b/node_modules/@types/node/perf_hooks.d.ts deleted file mode 100644 index 730af9b..0000000 --- a/node_modules/@types/node/perf_hooks.d.ts +++ /dev/null @@ -1,961 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/) - * - * ```js - * import { PerformanceObserver, performance } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/perf_hooks.js) - */ -declare module "perf_hooks" { - import { AsyncResource } from "node:async_hooks"; - type EntryType = - | "dns" // Node.js only - | "function" // Node.js only - | "gc" // Node.js only - | "http2" // Node.js only - | "http" // Node.js only - | "mark" // available on the Web - | "measure" // available on the Web - | "net" // Node.js only - | "node" // Node.js only - | "resource"; // available on the Web - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind: number; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags: number; - } - /** - * The constructor of this class is not exposed to users directly. - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @since v8.5.0 - */ - readonly entryType: EntryType; - toJSON(): any; - } - /** - * Exposes marks created via the `Performance.mark()` method. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMark extends PerformanceEntry { - readonly detail: any; - readonly duration: 0; - readonly entryType: "mark"; - } - /** - * Exposes measures created via the `Performance.measure()` method. - * - * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMeasure extends PerformanceEntry { - readonly detail: any; - readonly entryType: "measure"; - } - interface UVMetrics { - /** - * Number of event loop iterations. - */ - readonly loopCount: number; - /** - * Number of events that have been processed by the event handler. - */ - readonly events: number; - /** - * Number of events that were waiting to be processed when the event provider was called. - */ - readonly eventsWaiting: number; - } - // TODO: PerformanceNodeEntry is missing - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @since v8.5.0 - */ - class PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process - * completed bootstrapping. If bootstrapping has not yet finished, the property - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the Node.js process was initialized. - * @since v8.5.0 - */ - readonly nodeStart: number; - /** - * This is a wrapper to the `uv_metrics_info` function. - * It returns the current set of event loop metrics. - * - * It is recommended to use this property inside a function whose execution was - * scheduled using `setImmediate` to avoid collecting metrics before finishing all - * operations scheduled during the current loop iteration. - * @since v20.18.0 - */ - readonly uvMetricsInfo: UVMetrics; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param utilization1 The result of a previous call to `eventLoopUtilization()`. - * @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`. - */ - type EventLoopUtilityFunction = ( - utilization1?: EventLoopUtilization, - utilization2?: EventLoopUtilization, - ) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()` - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using `perf_hooks.createHistogram()` that will record runtime - * durations in nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. - * If `name` is provided, removes only the named mark. - * @since v8.5.0 - */ - clearMarks(name?: string): void; - /** - * If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline. - * If `name` is provided, removes only the named measure. - * @since v16.7.0 - */ - clearMeasures(name?: string): void; - /** - * If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline. - * If `name` is provided, removes only the named resource. - * @since v18.2.0, v16.17.0 - */ - clearResourceTimings(name?: string): void; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. - * If you are only interested in performance entries of certain types or that have certain names, see - * `performance.getEntriesByType()` and `performance.getEntriesByName()`. - * @since v16.7.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. - * @param name - * @param type - * @since v16.7.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.entryType` is equal to `type`. - * @param type - * @since v16.7.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - /** - * Creates a new `PerformanceMark` entry in the Performance Timeline. - * A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`, - * and whose `performanceEntry.duration` is always `0`. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * - * The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with - * `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is - * performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`. - * @param name - */ - mark(name: string, options?: MarkOptions): PerformanceMark; - /** - * Creates a new `PerformanceResourceTiming` entry in the Resource Timeline. - * A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`. - * Performance resources are used to mark moments in the Resource Timeline. - * @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info) - * @param requestedUrl The resource url - * @param initiatorType The initiator name, e.g: 'fetch' - * @param global - * @param cacheMode The cache mode must be an empty string ('') or 'local' - * @since v18.2.0, v16.17.0 - */ - markResourceTiming( - timingInfo: object, - requestedUrl: string, - initiatorType: string, - global: object, - cacheMode: "" | "local", - ): PerformanceResourceTiming; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - * @return The PerformanceMeasure entry that was created - */ - measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; - measure(name: string, options: MeasureOptions): PerformanceMeasure; - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones. - * @since v8.5.0 - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process. - * @since v8.5.0 - */ - now(): number; - /** - * Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects. - * - * By default the max buffer size is set to 250. - * @since v18.8.0 - */ - setResourceTimingBufferSize(maxSize: number): void; - /** - * The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp - * at which the current `node` process began, measured in Unix time. - * @since v8.5.0 - */ - readonly timeOrigin: number; - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Wraps a function within a new function that measures the running time of the wrapped function. - * A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * function someFunction() { - * console.log('hello world'); - * } - * - * const wrapped = performance.timerify(someFunction); - * - * const obs = new PerformanceObserver((list) => { - * console.log(list.getEntries()[0].duration); - * - * performance.clearMarks(); - * performance.clearMeasures(); - * obs.disconnect(); - * }); - * obs.observe({ entryTypes: ['function'] }); - * - * // A performance timeline entry will be created - * wrapped(); - * ``` - * - * If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported - * once the finally handler is invoked. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * An object which is JSON representation of the performance object. It is similar to - * [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers. - * @since v16.1.0 - */ - toJSON(): any; - } - class PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - /** - * @since v8.5.0 - */ - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`: - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called once asynchronously. `list` contains three items. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: readonly EntryType[]; - buffered?: boolean | undefined; - } - | { - type: EntryType; - buffered?: boolean | undefined; - }, - ): void; - /** - * @since v16.0.0 - * @returns Current list of entries stored in the performance observer, emptying it out. - */ - takeRecords(): PerformanceEntry[]; - } - /** - * Provides detailed network timing data regarding the loading of an application's resources. - * - * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 - */ - class PerformanceResourceTiming extends PerformanceEntry { - readonly entryType: "resource"; - protected constructor(); - /** - * The high resolution millisecond timestamp at immediately before dispatching the `fetch` - * request. If the resource is not intercepted by a worker the property will always return 0. - * @since v18.2.0, v16.17.0 - */ - readonly workerStart: number; - /** - * The high resolution millisecond timestamp that represents the start time of the fetch which - * initiates the redirect. - * @since v18.2.0, v16.17.0 - */ - readonly redirectStart: number; - /** - * The high resolution millisecond timestamp that will be created immediately after receiving - * the last byte of the response of the last redirect. - * @since v18.2.0, v16.17.0 - */ - readonly redirectEnd: number; - /** - * The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource. - * @since v18.2.0, v16.17.0 - */ - readonly fetchStart: number; - /** - * The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup - * for the resource. - * @since v18.2.0, v16.17.0 - */ - readonly domainLookupStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after the Node.js finished - * the domain name lookup for the resource. - * @since v18.2.0, v16.17.0 - */ - readonly domainLookupEnd: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js starts to - * establish the connection to the server to retrieve the resource. - * @since v18.2.0, v16.17.0 - */ - readonly connectStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after Node.js finishes - * establishing the connection to the server to retrieve the resource. - * @since v18.2.0, v16.17.0 - */ - readonly connectEnd: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js starts the - * handshake process to secure the current connection. - * @since v18.2.0, v16.17.0 - */ - readonly secureConnectionStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js receives the - * first byte of the response from the server. - * @since v18.2.0, v16.17.0 - */ - readonly requestStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after Node.js receives the - * last byte of the resource or immediately before the transport connection is closed, whichever comes first. - * @since v18.2.0, v16.17.0 - */ - readonly responseEnd: number; - /** - * A number representing the size (in octets) of the fetched resource. The size includes the response header - * fields plus the response payload body. - * @since v18.2.0, v16.17.0 - */ - readonly transferSize: number; - /** - * A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before - * removing any applied content-codings. - * @since v18.2.0, v16.17.0 - */ - readonly encodedBodySize: number; - /** - * A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after - * removing any applied content-codings. - * @since v18.2.0, v16.17.0 - */ - readonly decodedBodySize: number; - /** - * Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object - * @since v18.2.0, v16.17.0 - */ - toJSON(): any; - } - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * The number of samples recorded by the histogram. - * @since v17.4.0, v16.14.0 - */ - readonly count: number; - /** - * The number of samples recorded by the histogram. - * v17.4.0, v16.14.0 - */ - readonly countBigInt: bigint; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. - * @since v17.4.0, v16.14.0 - */ - readonly exceedsBigInt: bigint; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The maximum recorded event loop delay. - * v17.4.0, v16.14.0 - */ - readonly maxBigInt: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The minimum recorded event loop delay. - * v17.4.0, v16.14.0 - */ - readonly minBigInt: bigint; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - /** - * Returns the value at the given percentile. - * @since v17.4.0, v16.14.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentileBigInt(percentile: number): bigint; - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v17.4.0, v16.14.0 - */ - readonly percentilesBigInt: Map; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0, v14.18.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * @since v15.9.0, v14.18.0 - */ - recordDelta(): void; - /** - * Adds the values from `other` to this histogram. - * @since v17.4.0, v16.14.0 - */ - add(other: RecordableHistogram): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * import { monitorEventLoopDelay } from 'node:perf_hooks'; - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - lowest?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - highest?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0, v14.18.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - import { - performance as _performance, - PerformanceEntry as _PerformanceEntry, - PerformanceMark as _PerformanceMark, - PerformanceMeasure as _PerformanceMeasure, - PerformanceObserver as _PerformanceObserver, - PerformanceObserverEntryList as _PerformanceObserverEntryList, - PerformanceResourceTiming as _PerformanceResourceTiming, - } from "perf_hooks"; - global { - /** - * `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceentry - * @since v19.0.0 - */ - var PerformanceEntry: typeof globalThis extends { - onmessage: any; - PerformanceEntry: infer T; - } ? T - : typeof _PerformanceEntry; - /** - * `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemark - * @since v19.0.0 - */ - var PerformanceMark: typeof globalThis extends { - onmessage: any; - PerformanceMark: infer T; - } ? T - : typeof _PerformanceMark; - /** - * `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemeasure - * @since v19.0.0 - */ - var PerformanceMeasure: typeof globalThis extends { - onmessage: any; - PerformanceMeasure: infer T; - } ? T - : typeof _PerformanceMeasure; - /** - * `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserver - * @since v19.0.0 - */ - var PerformanceObserver: typeof globalThis extends { - onmessage: any; - PerformanceObserver: infer T; - } ? T - : typeof _PerformanceObserver; - /** - * `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserverentrylist - * @since v19.0.0 - */ - var PerformanceObserverEntryList: typeof globalThis extends { - onmessage: any; - PerformanceObserverEntryList: infer T; - } ? T - : typeof _PerformanceObserverEntryList; - /** - * `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceresourcetiming - * @since v19.0.0 - */ - var PerformanceResourceTiming: typeof globalThis extends { - onmessage: any; - PerformanceResourceTiming: infer T; - } ? T - : typeof _PerformanceResourceTiming; - /** - * `performance` is a global reference for `import { performance } from 'node:node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performance - * @since v16.0.0 - */ - var performance: typeof globalThis extends { - onmessage: any; - performance: infer T; - } ? T - : typeof _performance; - } -} -declare module "node:perf_hooks" { - export * from "perf_hooks"; -} diff --git a/node_modules/@types/node/process.d.ts b/node_modules/@types/node/process.d.ts deleted file mode 100644 index a120b0e..0000000 --- a/node_modules/@types/node/process.d.ts +++ /dev/null @@ -1,1966 +0,0 @@ -declare module "process" { - import { Control, MessageOptions, SendHandle } from "node:child_process"; - import { PathLike } from "node:fs"; - import * as tty from "node:tty"; - import { Worker } from "node:worker_threads"; - - interface BuiltInModule { - "assert": typeof import("assert"); - "node:assert": typeof import("node:assert"); - "assert/strict": typeof import("assert/strict"); - "node:assert/strict": typeof import("node:assert/strict"); - "async_hooks": typeof import("async_hooks"); - "node:async_hooks": typeof import("node:async_hooks"); - "buffer": typeof import("buffer"); - "node:buffer": typeof import("node:buffer"); - "child_process": typeof import("child_process"); - "node:child_process": typeof import("node:child_process"); - "cluster": typeof import("cluster"); - "node:cluster": typeof import("node:cluster"); - "console": typeof import("console"); - "node:console": typeof import("node:console"); - "constants": typeof import("constants"); - "node:constants": typeof import("node:constants"); - "crypto": typeof import("crypto"); - "node:crypto": typeof import("node:crypto"); - "dgram": typeof import("dgram"); - "node:dgram": typeof import("node:dgram"); - "diagnostics_channel": typeof import("diagnostics_channel"); - "node:diagnostics_channel": typeof import("node:diagnostics_channel"); - "dns": typeof import("dns"); - "node:dns": typeof import("node:dns"); - "dns/promises": typeof import("dns/promises"); - "node:dns/promises": typeof import("node:dns/promises"); - "domain": typeof import("domain"); - "node:domain": typeof import("node:domain"); - "events": typeof import("events"); - "node:events": typeof import("node:events"); - "fs": typeof import("fs"); - "node:fs": typeof import("node:fs"); - "fs/promises": typeof import("fs/promises"); - "node:fs/promises": typeof import("node:fs/promises"); - "http": typeof import("http"); - "node:http": typeof import("node:http"); - "http2": typeof import("http2"); - "node:http2": typeof import("node:http2"); - "https": typeof import("https"); - "node:https": typeof import("node:https"); - "inspector": typeof import("inspector"); - "node:inspector": typeof import("node:inspector"); - "inspector/promises": typeof import("inspector/promises"); - "node:inspector/promises": typeof import("node:inspector/promises"); - "module": typeof import("module"); - "node:module": typeof import("node:module"); - "net": typeof import("net"); - "node:net": typeof import("node:net"); - "os": typeof import("os"); - "node:os": typeof import("node:os"); - "path": typeof import("path"); - "node:path": typeof import("node:path"); - "path/posix": typeof import("path/posix"); - "node:path/posix": typeof import("node:path/posix"); - "path/win32": typeof import("path/win32"); - "node:path/win32": typeof import("node:path/win32"); - "perf_hooks": typeof import("perf_hooks"); - "node:perf_hooks": typeof import("node:perf_hooks"); - "process": typeof import("process"); - "node:process": typeof import("node:process"); - "punycode": typeof import("punycode"); - "node:punycode": typeof import("node:punycode"); - "querystring": typeof import("querystring"); - "node:querystring": typeof import("node:querystring"); - "readline": typeof import("readline"); - "node:readline": typeof import("node:readline"); - "readline/promises": typeof import("readline/promises"); - "node:readline/promises": typeof import("node:readline/promises"); - "repl": typeof import("repl"); - "node:repl": typeof import("node:repl"); - "node:sea": typeof import("node:sea"); - "stream": typeof import("stream"); - "node:stream": typeof import("node:stream"); - "stream/consumers": typeof import("stream/consumers"); - "node:stream/consumers": typeof import("node:stream/consumers"); - "stream/promises": typeof import("stream/promises"); - "node:stream/promises": typeof import("node:stream/promises"); - "stream/web": typeof import("stream/web"); - "node:stream/web": typeof import("node:stream/web"); - "string_decoder": typeof import("string_decoder"); - "node:string_decoder": typeof import("node:string_decoder"); - "node:test": typeof import("node:test"); - "node:test/reporters": typeof import("node:test/reporters"); - "timers": typeof import("timers"); - "node:timers": typeof import("node:timers"); - "timers/promises": typeof import("timers/promises"); - "node:timers/promises": typeof import("node:timers/promises"); - "tls": typeof import("tls"); - "node:tls": typeof import("node:tls"); - "trace_events": typeof import("trace_events"); - "node:trace_events": typeof import("node:trace_events"); - "tty": typeof import("tty"); - "node:tty": typeof import("node:tty"); - "url": typeof import("url"); - "node:url": typeof import("node:url"); - "util": typeof import("util"); - "node:util": typeof import("node:util"); - "sys": typeof import("util"); - "node:sys": typeof import("node:util"); - "util/types": typeof import("util/types"); - "node:util/types": typeof import("node:util/types"); - "v8": typeof import("v8"); - "node:v8": typeof import("node:v8"); - "vm": typeof import("vm"); - "node:vm": typeof import("node:vm"); - "wasi": typeof import("wasi"); - "node:wasi": typeof import("node:wasi"); - "worker_threads": typeof import("worker_threads"); - "node:worker_threads": typeof import("node:worker_threads"); - "zlib": typeof import("zlib"); - "node:zlib": typeof import("node:zlib"); - } - - global { - var process: NodeJS.Process; - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - /** - * Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the - * process, including all C++ and JavaScript objects and code. - */ - rss: number; - /** - * Refers to V8's memory usage. - */ - heapTotal: number; - /** - * Refers to V8's memory usage. - */ - heapUsed: number; - external: number; - /** - * Refers to memory allocated for `ArrayBuffer`s and `SharedArrayBuffer`s, including all Node.js Buffers. This is also included - * in the external value. When Node.js is used as an embedded library, this value may be `0` because allocations for `ArrayBuffer`s - * may not be tracked in that case. - */ - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessFeatures { - /** - * A boolean value that is `true` if the current Node.js build is caching builtin modules. - * @since v12.0.0 - */ - readonly cached_builtins: boolean; - /** - * A boolean value that is `true` if the current Node.js build is a debug build. - * @since v0.5.5 - */ - readonly debug: boolean; - /** - * A boolean value that is `true` if the current Node.js build includes the inspector. - * @since v11.10.0 - */ - readonly inspector: boolean; - /** - * A boolean value that is `true` if the current Node.js build includes support for IPv6. - * @since v0.5.3 - */ - readonly ipv6: boolean; - /** - * A boolean value that is `true` if the current Node.js build supports - * [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v20.x/api/modules.html#loading-ecmascript-modules-using-require). - * @since v20.19.0 - */ - readonly require_module: boolean; - /** - * A boolean value that is `true` if the current Node.js build includes support for TLS. - * @since v0.5.3 - */ - readonly tls: boolean; - /** - * A boolean value that is `true` if the current Node.js build includes support for ALPN in TLS. - * @since v4.8.0 - */ - readonly tls_alpn: boolean; - /** - * A boolean value that is `true` if the current Node.js build includes support for OCSP in TLS. - * @since v0.11.13 - */ - readonly tls_ocsp: boolean; - /** - * A boolean value that is `true` if the current Node.js build includes support for SNI in TLS. - * @since v0.5.3 - */ - readonly tls_sni: boolean; - /** - * A boolean value that is `true` if the current Node.js build includes support for libuv. - * @since v0.5.3 - */ - readonly uv: boolean; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = - | "aix" - | "android" - | "darwin" - | "freebsd" - | "haiku" - | "linux" - | "openbsd" - | "sunos" - | "win32" - | "cygwin" - | "netbsd"; - type Architecture = - | "arm" - | "arm64" - | "ia32" - | "loong64" - | "mips" - | "mipsel" - | "ppc" - | "ppc64" - | "riscv64" - | "s390" - | "s390x" - | "x64"; - type Signals = - | "SIGABRT" - | "SIGALRM" - | "SIGBUS" - | "SIGCHLD" - | "SIGCONT" - | "SIGFPE" - | "SIGHUP" - | "SIGILL" - | "SIGINT" - | "SIGIO" - | "SIGIOT" - | "SIGKILL" - | "SIGPIPE" - | "SIGPOLL" - | "SIGPROF" - | "SIGPWR" - | "SIGQUIT" - | "SIGSEGV" - | "SIGSTKFLT" - | "SIGSTOP" - | "SIGSYS" - | "SIGTERM" - | "SIGTRAP" - | "SIGTSTP" - | "SIGTTIN" - | "SIGTTOU" - | "SIGUNUSED" - | "SIGURG" - | "SIGUSR1" - | "SIGUSR2" - | "SIGVTALRM" - | "SIGWINCH" - | "SIGXCPU" - | "SIGXFSZ" - | "SIGBREAK" - | "SIGLOST" - | "SIGINFO"; - type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection"; - type MultipleResolveType = "resolve" | "reject"; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; - /** - * Most of the time the unhandledRejection will be an Error, but this should not be relied upon - * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. - */ - type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: SendHandle) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = ( - type: MultipleResolveType, - promise: Promise, - value: unknown, - ) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string | undefined; - } - interface HRTime { - /** - * This is the legacy version of {@link process.hrtime.bigint()} - * before bigint was introduced in JavaScript. - * - * The `process.hrtime()` method returns the current high-resolution real time in a `[seconds, nanoseconds]` tuple `Array`, - * where `nanoseconds` is the remaining part of the real time that can't be represented in second precision. - * - * `time` is an optional parameter that must be the result of a previous `process.hrtime()` call to diff with the current time. - * If the parameter passed in is not a tuple `Array`, a TypeError will be thrown. - * Passing in a user-defined array instead of the result of a previous call to `process.hrtime()` will lead to undefined behavior. - * - * These times are relative to an arbitrary time in the past, - * and not related to the time of day and therefore not subject to clock drift. - * The primary use is for measuring performance between intervals: - * ```js - * const { hrtime } = require('node:process'); - * const NS_PER_SEC = 1e9; - * const time = hrtime(); - * // [ 1800216, 25 ] - * - * setTimeout(() => { - * const diff = hrtime(time); - * // [ 1, 552 ] - * - * console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`); - * // Benchmark took 1000000552 nanoseconds - * }, 1000); - * ``` - * @since 0.7.6 - * @legacy Use {@link process.hrtime.bigint()} instead. - * @param time The result of a previous call to `process.hrtime()` - */ - (time?: [number, number]): [number, number]; - /** - * The `bigint` version of the {@link process.hrtime()} method returning the current high-resolution real time in nanoseconds as a `bigint`. - * - * Unlike {@link process.hrtime()}, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s. - * ```js - * import { hrtime } from 'node:process'; - * - * const start = hrtime.bigint(); - * // 191051479007711n - * - * setTimeout(() => { - * const end = hrtime.bigint(); - * // 191052633396993n - * - * console.log(`Benchmark took ${end - start} nanoseconds`); - * // Benchmark took 1154389282 nanoseconds - * }, 1000); - * ``` - * @since v10.7.0 - */ - bigint(): bigint; - } - interface ProcessPermission { - /** - * Verifies that the process is able to access the given scope and reference. - * If no reference is provided, a global scope is assumed, for instance, `process.permission.has('fs.read')` - * will check if the process has ALL file system read permissions. - * - * The reference has a meaning based on the provided scope. For example, the reference when the scope is File System means files and folders. - * - * The available scopes are: - * - * * `fs` - All File System - * * `fs.read` - File System read operations - * * `fs.write` - File System write operations - * * `child` - Child process spawning operations - * * `worker` - Worker thread spawning operation - * - * ```js - * // Check if the process has permission to read the README file - * process.permission.has('fs.read', './README.md'); - * // Check if the process has read permission operations - * process.permission.has('fs.read'); - * ``` - * @since v20.0.0 - */ - has(scope: string, reference?: string): boolean; - } - interface ProcessReport { - /** - * Write reports in a compact format, single-line JSON, more easily consumable by log processing systems - * than the default multi-line format designed for human consumption. - * @since v13.12.0, v12.17.0 - */ - compact: boolean; - /** - * Directory where the report is written. - * The default value is the empty string, indicating that reports are written to the current - * working directory of the Node.js process. - */ - directory: string; - /** - * Filename where the report is written. If set to the empty string, the output filename will be comprised - * of a timestamp, PID, and sequence number. The default value is the empty string. - */ - filename: string; - /** - * Returns a JavaScript Object representation of a diagnostic report for the running process. - * The report's JavaScript stack trace is taken from `err`, if present. - */ - getReport(err?: Error): object; - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @default false - */ - reportOnSignal: boolean; - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - /** - * Writes a diagnostic report to a file. If filename is not provided, the default filename - * includes the date, time, PID, and a sequence number. - * The report's JavaScript stack trace is taken from `err`, if present. - * - * If the value of filename is set to `'stdout'` or `'stderr'`, the report is written - * to the stdout or stderr of the process respectively. - * @param fileName Name of the file where the report is written. - * This should be a relative path, that will be appended to the directory specified in - * `process.report.directory`, or the current working directory of the Node.js process, - * if unspecified. - * @param err A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string, err?: Error): string; - writeReport(err?: Error): string; - } - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - interface EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'node:process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'node:process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```bash - * node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```bash - * node --icu-data-dir=./foo --require ./bar.js script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ["--icu-data-dir=./foo", "--require", "./bar.js"] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'node:process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'node:process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'node:process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.dlopen()` method allows dynamically loading shared objects. It is primarily used by `require()` to load C++ Addons, and - * should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()` - * unless there are specific reasons such as custom dlopen flags or loading from ES modules. - * - * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v20.x/api/os.html#dlopen-constants)` - * documentation for details. - * - * An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon - * are then accessible via `module.exports`. - * - * The example below shows how to load a C++ Addon, named `local.node`, that exports a `foo` function. All the symbols are loaded before the call returns, by passing the `RTLD_NOW` constant. - * In this example the constant is assumed to be available. - * - * ```js - * import { dlopen } from 'node:process'; - * import { constants } from 'node:os'; - * import { fileURLToPath } from 'node:url'; - * - * const module = { exports: {} }; - * dlopen(module, fileURLToPath(new URL('local.node', import.meta.url)), - * constants.dlopen.RTLD_NOW); - * module.exports.foo(); - * ``` - */ - dlopen(module: object, filename: string, flags?: number): void; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning using a string. - * emitWarning('Something happened!'); - * // Emits: (node: 56338) Warning: Something happened! - * ``` - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning using a string and a type. - * emitWarning('Something Happened!', 'CustomWarning'); - * // Emits: (node:56338) CustomWarning: Something Happened! - * ``` - * - * ```js - * import { emitWarning } from 'node:process'; - * - * emitWarning('Something happened!', 'CustomWarning', 'WARN001'); - * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! - * ```js - * - * In each of the previous examples, an `Error` object is generated internally by `process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'node:process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, it will be passed through to the `'warning'` event handler - * unmodified (and the optional `type`, `code` and `ctor` arguments will be ignored): - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning using an Error object. - * const myWarning = new Error('Something happened!'); - * // Use the Error name property to specify the type name - * myWarning.name = 'CustomWarning'; - * myWarning.code = 'WARN001'; - * - * emitWarning(myWarning); - * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! - * ``` - * - * A `TypeError` is thrown if `warning` is anything other than a string or `Error` object. - * - * While process warnings use `Error` objects, the process warning mechanism is not a replacement for normal error handling mechanisms. - * - * The following additional handling is implemented if the warning `type` is `'DeprecationWarning'`: - * * If the `--throw-deprecation` command-line flag is used, the deprecation warning is thrown as an exception rather than being emitted as an event. - * * If the `--no-deprecation` command-line flag is used, the deprecation warning is suppressed. - * * If the `--trace-deprecation` command-line flag is used, the deprecation warning is printed to `stderr` along with the full stack trace. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```bash - * node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'node:process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'node:process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread's `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. On Windows, a copy of `process.env` on a `Worker` instance operates in a case-sensitive manner - * unlike the main thread. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'node:process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and `process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()` explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the `process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'node:process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the `process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'node:process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current process. - * @since v0.1.13 - * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed. - */ - exit(code?: number | string | null): never; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @default undefined - * @since v0.11.8 - */ - exitCode: number | string | number | undefined; - /** - * The `process.getActiveResourcesInfo()` method returns an array of strings containing - * the types of the active resources that are currently keeping the event loop alive. - * - * ```js - * import { getActiveResourcesInfo } from 'node:process'; - * import { setTimeout } from 'node:timers'; - - * console.log('Before:', getActiveResourcesInfo()); - * setTimeout(() => {}, 1000); - * console.log('After:', getActiveResourcesInfo()); - * // Prints: - * // Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ] - * // After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ] - * ``` - * @since v17.3.0, v16.14.0 - */ - getActiveResourcesInfo(): string[]; - /** - * Provides a way to load built-in modules in a globally available function. - * @param id ID of the built-in module being requested. - * @since v20.16.0 - */ - getBuiltinModule(id: ID): BuiltInModule[ID]; - getBuiltinModule(id: string): object | undefined; - /** - * The `process.getgid()` method returns the numerical group identity of the - * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid?: () => number; - /** - * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid?: (id: number | string) => void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid?: () => number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid?: (id: number | string) => void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid?: () => number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid?: (id: number | string) => void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid?: () => number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid?: (id: number | string) => void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'node:process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups?: () => number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'node:process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups?: (groups: ReadonlyArray) => void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function, `process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.sourceMapsEnabled` property returns whether the [Source Map v3](https://sourcemaps.info/spec.html) support for stack traces is enabled. - * @since v20.7.0 - * @experimental - */ - readonly sourceMapsEnabled: boolean; - /** - * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for - * stack traces. - * - * It provides same features as launching Node.js process with commandline options `--enable-source-maps`. - * - * Only source maps in JavaScript files that are loaded after source maps has been - * enabled will be parsed and loaded. - * @since v16.6.0, v14.18.0 - * @experimental - */ - setSourceMapsEnabled(value: boolean): void; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'node:process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'node:process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '20.2.0', - * acorn: '8.8.2', - * ada: '2.4.0', - * ares: '1.19.0', - * base64: '0.5.0', - * brotli: '1.0.9', - * cjs_module_lexer: '1.2.2', - * cldr: '43.0', - * icu: '73.1', - * llhttp: '8.1.0', - * modules: '115', - * napi: '8', - * nghttp2: '1.52.0', - * nghttp3: '0.7.0', - * ngtcp2: '0.8.1', - * openssl: '3.0.8+quic', - * simdutf: '3.2.9', - * tz: '2023c', - * undici: '5.22.0', - * unicode: '15.0', - * uv: '1.44.2', - * uvwasi: '0.0.16', - * v8: '11.3.244.8-node.9', - * zlib: '1.2.13' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns a frozen `Object` containing the - * JavaScript representation of the configure options used to compile the current - * Node.js executable. This is the same as the `config.gypi` file that was produced - * when running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'node:process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * Loads the environment configuration from a `.env` file into `process.env`. If - * the file is not found, error will be thrown. - * - * To load a specific .env file by specifying its path, use the following code: - * - * ```js - * import { loadEnvFile } from 'node:process'; - * - * loadEnvFile('./development.env') - * ``` - * @since v20.12.0 - * @param path The path to the .env file - */ - loadEnvFile(path?: PathLike): void; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'node:process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'node:process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * The `process.title` property returns the current process title (i.e. returns - * the current value of `ps`). Assigning a new value to `process.title` modifies - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the `process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - title: string; - /** - * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * ```js - * import { arch } from 'node:process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: Architecture; - /** - * The `process.platform` property returns a string identifying the operating - * system platform for which the Node.js binary was compiled. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'node:process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module; - memoryUsage: MemoryUsageFn; - /** - * Gets the amount of memory available to the process (in bytes) based on - * limits imposed by the OS. If there is no such constraint, or the constraint - * is unknown, `0` is returned. - * - * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more - * information. - * @since v19.6.0, v18.15.0 - * @experimental - */ - constrainedMemory(): number; - /** - * Gets the amount of free memory that is still available to the process (in bytes). - * See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v20.x/api/process.html#processavailablememory) for more information. - * @experimental - * @since v20.13.0 - */ - availableMemory(): number; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'node:process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'node:process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * The process.noDeprecation property indicates whether the --no-deprecation flag is set on the current Node.js process. - * See the documentation for the ['warning' event](https://nodejs.org/docs/latest/api/process.html#event-warning) and the [emitWarning()](https://nodejs.org/docs/latest/api/process.html#processemitwarningwarning-type-code-ctor) method for more information about this flag's behavior. - */ - noDeprecation?: boolean; - /** - * This API is available through the [--experimental-permission](https://nodejs.org/api/cli.html#--experimental-permission) flag. - * - * `process.permission` is an object whose methods are used to manage permissions for the current process. - * Additional documentation is available in the [Permission Model](https://nodejs.org/api/permissions.html#permission-model). - * @since v20.0.0 - */ - permission: ProcessPermission; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Hydrogen', - * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the `name` property may be present. The additional properties should not be - * relied upon to exist. - * @since v3.0.0 - */ - readonly release: ProcessRelease; - readonly features: ProcessFeatures; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel. - * If no IPC channel exists, this property is undefined. - * @since v7.1.0 - */ - channel?: Control; - /** - * If Node.js is spawned with an IPC channel, the `process.send()` method can be - * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send?( - message: any, - sendHandle?: SendHandle, - options?: MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - send?( - message: any, - sendHandle: SendHandle, - callback?: (error: Error | null) => void, - ): boolean; - send?( - message: any, - callback: (error: Error | null) => void, - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return `true` so long as the IPC - * channel is connected and will return `false` after `process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides `Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g., `inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'node:process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `process.report` is an object whose methods are used to generate diagnostic reports for the current process. - * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v20.x/api/report.html). - * @since v11.8.0 - */ - report: ProcessReport; - /** - * ```js - * import { resourceUsage } from 'node:process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The initial value of `process.throwDeprecation` indicates whether the `--throw-deprecation` flag is set on the current Node.js process. `process.throwDeprecation` - * is mutable, so whether or not deprecation warnings result in errors may be altered at runtime. See the documentation for the 'warning' event and the emitWarning() - * method for more information. - * - * ```bash - * $ node --throw-deprecation -p "process.throwDeprecation" - * true - * $ node -p "process.throwDeprecation" - * undefined - * $ node - * > process.emitWarning('test', 'DeprecationWarning'); - * undefined - * > (node:26598) DeprecationWarning: test - * > process.throwDeprecation = true; - * true - * > process.emitWarning('test', 'DeprecationWarning'); - * Thrown: - * [DeprecationWarning: test] { name: 'DeprecationWarning' } - * ``` - * @since v0.9.12 - */ - throwDeprecation: boolean; - /** - * The `process.traceDeprecation` property indicates whether the `--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* EventEmitter */ - addListener(event: "beforeExit", listener: BeforeExitListener): this; - addListener(event: "disconnect", listener: DisconnectListener): this; - addListener(event: "exit", listener: ExitListener): this; - addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - addListener(event: "warning", listener: WarningListener): this; - addListener(event: "message", listener: MessageListener): this; - addListener(event: "workerMessage", listener: (value: any, source: number) => void): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: "multipleResolves", listener: MultipleResolveListener): this; - addListener(event: "worker", listener: WorkerListener): this; - emit(event: "beforeExit", code: number): boolean; - emit(event: "disconnect"): boolean; - emit(event: "exit", code: number): boolean; - emit(event: "rejectionHandled", promise: Promise): boolean; - emit(event: "uncaughtException", error: Error): boolean; - emit(event: "uncaughtExceptionMonitor", error: Error): boolean; - emit(event: "unhandledRejection", reason: unknown, promise: Promise): boolean; - emit(event: "warning", warning: Error): boolean; - emit(event: "message", message: unknown, sendHandle: SendHandle): this; - emit(event: "workerMessage", value: any, source: number): this; - emit(event: Signals, signal?: Signals): boolean; - emit( - event: "multipleResolves", - type: MultipleResolveType, - promise: Promise, - value: unknown, - ): this; - emit(event: "worker", listener: WorkerListener): this; - on(event: "beforeExit", listener: BeforeExitListener): this; - on(event: "disconnect", listener: DisconnectListener): this; - on(event: "exit", listener: ExitListener): this; - on(event: "rejectionHandled", listener: RejectionHandledListener): this; - on(event: "uncaughtException", listener: UncaughtExceptionListener): this; - on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - on(event: "warning", listener: WarningListener): this; - on(event: "message", listener: MessageListener): this; - on(event: "workerMessage", listener: (value: any, source: number) => void): this; - on(event: Signals, listener: SignalsListener): this; - on(event: "multipleResolves", listener: MultipleResolveListener): this; - on(event: "worker", listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "beforeExit", listener: BeforeExitListener): this; - once(event: "disconnect", listener: DisconnectListener): this; - once(event: "exit", listener: ExitListener): this; - once(event: "rejectionHandled", listener: RejectionHandledListener): this; - once(event: "uncaughtException", listener: UncaughtExceptionListener): this; - once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - once(event: "warning", listener: WarningListener): this; - once(event: "message", listener: MessageListener): this; - once(event: "workerMessage", listener: (value: any, source: number) => void): this; - once(event: Signals, listener: SignalsListener): this; - once(event: "multipleResolves", listener: MultipleResolveListener): this; - once(event: "worker", listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "beforeExit", listener: BeforeExitListener): this; - prependListener(event: "disconnect", listener: DisconnectListener): this; - prependListener(event: "exit", listener: ExitListener): this; - prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependListener(event: "warning", listener: WarningListener): this; - prependListener(event: "message", listener: MessageListener): this; - prependListener(event: "workerMessage", listener: (value: any, source: number) => void): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependListener(event: "worker", listener: WorkerListener): this; - prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; - prependOnceListener(event: "disconnect", listener: DisconnectListener): this; - prependOnceListener(event: "exit", listener: ExitListener): this; - prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependOnceListener(event: "warning", listener: WarningListener): this; - prependOnceListener(event: "message", listener: MessageListener): this; - prependOnceListener(event: "workerMessage", listener: (value: any, source: number) => void): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependOnceListener(event: "worker", listener: WorkerListener): this; - listeners(event: "beforeExit"): BeforeExitListener[]; - listeners(event: "disconnect"): DisconnectListener[]; - listeners(event: "exit"): ExitListener[]; - listeners(event: "rejectionHandled"): RejectionHandledListener[]; - listeners(event: "uncaughtException"): UncaughtExceptionListener[]; - listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[]; - listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; - listeners(event: "warning"): WarningListener[]; - listeners(event: "message"): MessageListener[]; - listeners(event: "workerMessage"): ((value: any, source: number) => void)[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: "multipleResolves"): MultipleResolveListener[]; - listeners(event: "worker"): WorkerListener[]; - } - } - } - export = process; -} -declare module "node:process" { - import process = require("process"); - export = process; -} diff --git a/node_modules/@types/node/punycode.d.ts b/node_modules/@types/node/punycode.d.ts deleted file mode 100644 index 394d611..0000000 --- a/node_modules/@types/node/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated. **In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * import punycode from 'node:punycode'; - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word, `'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string `'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * made available to developers as a convenience. Fixes or other modifications to - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/punycode.js) - */ -declare module "punycode" { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: readonly number[]): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module "node:punycode" { - export * from "punycode"; -} diff --git a/node_modules/@types/node/querystring.d.ts b/node_modules/@types/node/querystring.d.ts deleted file mode 100644 index 27eaed2..0000000 --- a/node_modules/@types/node/querystring.d.ts +++ /dev/null @@ -1,152 +0,0 @@ -/** - * The `node:querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * import querystring from 'node:querystring'; - * ``` - * - * `querystring` is more performant than `URLSearchParams` but is not a - * standardized API. Use `URLSearchParams` when performance is not critical or - * when compatibility with browser code is desirable. - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/querystring.js) - */ -declare module "querystring" { - interface StringifyOptions { - /** - * The function to use when converting URL-unsafe characters to percent-encoding in the query string. - * @default `querystring.escape()` - */ - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - /** - * Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations. - * @default 1000 - */ - maxKeys?: number | undefined; - /** - * The function to use when decoding percent-encoded characters in the query string. - * @default `querystring.unescape()` - */ - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends - NodeJS.Dict< - | string - | number - | boolean - | bigint - | ReadonlyArray - | null - > - {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative `encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```json - * { - * "foo": "bar", - * "abc": ["xyz", "123"] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] The substring used to delimit keys and values in the query string. - */ - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given `str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module "node:querystring" { - export * from "querystring"; -} diff --git a/node_modules/@types/node/readline.d.ts b/node_modules/@types/node/readline.d.ts deleted file mode 100644 index 1504c26..0000000 --- a/node_modules/@types/node/readline.d.ts +++ /dev/null @@ -1,589 +0,0 @@ -/** - * The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/https://nodejs.org/docs/latest-v20.x/api/stream.html#readable-streams) stream - * (such as [`process.stdin`](https://nodejs.org/docs/https://nodejs.org/docs/latest-v20.x/api/process.html#processstdin)) one line at a time. - * - * To use the promise-based APIs: - * - * ```js - * import * as readline from 'node:readline/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as readline from 'node:readline'; - * ``` - * - * The following simple example illustrates the basic use of the `node:readline` module. - * - * ```js - * import * as readline from 'node:readline/promises'; - * import { stdin as input, stdout as output } from 'node:process'; - * - * const rl = readline.createInterface({ input, output }); - * - * const answer = await rl.question('What do you think of Node.js? '); - * - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * ``` - * - * Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be - * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/readline.js) - */ -declare module "readline" { - import { Abortable, EventEmitter } from "node:events"; - import * as promises from "node:readline/promises"; - export { promises }; - export interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a - * single `input` [Readable](https://nodejs.org/docs/https://nodejs.org/docs/latest-v20.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/https://nodejs.org/docs/latest-v20.x/api/stream.html#writable-streams) stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v0.1.104 - */ - export class Interface extends EventEmitter { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' '), - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/docs/latest-v20.x/api/readline.html#class-interfaceconstructor - */ - protected constructor( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/docs/latest-v20.x/api/readline.html#class-interfaceconstructor - */ - protected constructor(options: ReadLineOptions); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0, v14.17.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output` whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * An error will be thrown if calling `rl.question()` after `rl.close()`. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including `'line'`) from being emitted by the `Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `Interface` instance. - * @since v0.1.98 - */ - close(): void; - /** - * The `rl.write()` method will write either `data` or a key sequence identified - * by `key` to the `output`. The `key` argument is supported only if `output` is - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s `input` _as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - write(data: undefined | null | string | Buffer, key: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "history", listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "history", history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "history", listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "history", listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "history", listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "history", listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): NodeJS.AsyncIterator; - } - export type ReadLine = Interface; // type forwarded for backwards compatibility - export type Completer = (line: string) => CompleterResult; - export type AsyncCompleter = ( - line: string, - callback: (err?: null | Error, result?: CompleterResult) => void, - ) => void; - export type CompleterResult = [string[], string]; - export interface ReadLineOptions { - /** - * The [`Readable`](https://nodejs.org/docs/latest-v20.x/api/stream.html#readable-streams) stream to listen to - */ - input: NodeJS.ReadableStream; - /** - * The [`Writable`](https://nodejs.org/docs/latest-v20.x/api/stream.html#writable-streams) stream to write readline data to. - */ - output?: NodeJS.WritableStream | undefined; - /** - * An optional function used for Tab autocompletion. - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * `true` if the `input` and `output` streams should be treated like a TTY, - * and have ANSI/VT100 escape codes written to it. - * Default: checking `isTTY` on the `output` stream upon instantiation. - */ - terminal?: boolean | undefined; - /** - * Initial list of history lines. - * This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, - * otherwise the history caching mechanism is not initialized at all. - * @default [] - */ - history?: string[] | undefined; - /** - * Maximum number of history lines retained. - * To disable the history set this value to `0`. - * This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, - * otherwise the history caching mechanism is not initialized at all. - * @default 30 - */ - historySize?: number | undefined; - /** - * If `true`, when a new input line added to the history list duplicates an older one, - * this removes the older line from the list. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - /** - * The prompt string to use. - * @default "> " - */ - prompt?: string | undefined; - /** - * If the delay between `\r` and `\n` exceeds `crlfDelay` milliseconds, - * both `\r` and `\n` will be treated as separate end-of-line input. - * `crlfDelay` will be coerced to a number no less than `100`. - * It can be set to `Infinity`, in which case - * `\r` followed by `\n` will always be considered a single newline - * (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v20.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter). - * @default 100 - */ - crlfDelay?: number | undefined; - /** - * The duration `readline` will wait for a character - * (when reading an ambiguous key sequence in milliseconds - * one that can both form a complete key sequence using the input read so far - * and can take additional input to complete a longer key sequence). - * @default 500 - */ - escapeCodeTimeout?: number | undefined; - /** - * The number of spaces a tab is equal to (minimum 1). - * @default 8 - */ - tabSize?: number | undefined; - /** - * Allows closing the interface using an AbortSignal. - * Aborting the signal will internally call `close` on the interface. - */ - signal?: AbortSignal | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface` instance. - * - * ```js - * import readline from 'node:readline'; - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without - * waiting for user input, call `process.stdin.unref()`. - * @since v0.1.98 - */ - export function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - export function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the `input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * import readline from 'node:readline'; - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ', - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * import fs from 'node:fs'; - * import readline from 'node:readline'; - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity, - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * import fs from 'node:fs'; - * import readline from 'node:readline'; - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await` flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * import { once } from 'node:events'; - * import { createReadStream } from 'node:fs'; - * import { createInterface } from 'node:readline'; - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - */ - export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - export type Direction = -1 | 0 | 1; - export interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/https://nodejs.org/docs/latest-v20.x/api/tty.html) stream - * in a specified direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/https://nodejs.org/docs/latest-v20.x/api/tty.html) stream from - * the current position of the cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * The `readline.cursorTo()` method moves cursor to the specified position in a - * given [TTY](https://nodejs.org/docs/https://nodejs.org/docs/latest-v20.x/api/tty.html) `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given [TTY](https://nodejs.org/docs/https://nodejs.org/docs/latest-v20.x/api/tty.html) `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module "node:readline" { - export * from "readline"; -} diff --git a/node_modules/@types/node/readline/promises.d.ts b/node_modules/@types/node/readline/promises.d.ts deleted file mode 100644 index f6cdf66..0000000 --- a/node_modules/@types/node/readline/promises.d.ts +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @since v17.0.0 - * @experimental - */ -declare module "readline/promises" { - import { Abortable } from "node:events"; - import { - CompleterResult, - Direction, - Interface as _Interface, - ReadLineOptions as _ReadLineOptions, - } from "node:readline"; - /** - * Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v17.0.0 - */ - class Interface extends _Interface { - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. - * - * If the question is called after `rl.close()`, it returns a rejected promise. - * - * Example usage: - * - * ```js - * const answer = await rl.question('What is your favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * Using an `AbortSignal` to cancel a question. - * - * ```js - * const signal = AbortSignal.timeout(10_000); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * const answer = await rl.question('What is your favorite food? ', { signal }); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * @since v17.0.0 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @return A promise that is fulfilled with the user's input in response to the `query`. - */ - question(query: string): Promise; - question(query: string, options: Abortable): Promise; - } - /** - * @since v17.0.0 - */ - class Readline { - /** - * @param stream A TTY stream. - */ - constructor( - stream: NodeJS.WritableStream, - options?: { - autoCommit?: boolean | undefined; - }, - ); - /** - * The `rl.clearLine()` method adds to the internal list of pending action an - * action that clears current line of the associated `stream` in a specified - * direction identified by `dir`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearLine(dir: Direction): this; - /** - * The `rl.clearScreenDown()` method adds to the internal list of pending action an - * action that clears the associated stream from the current position of the - * cursor down. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearScreenDown(): this; - /** - * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. - * @since v17.0.0 - */ - commit(): Promise; - /** - * The `rl.cursorTo()` method adds to the internal list of pending action an action - * that moves cursor to the specified position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - cursorTo(x: number, y?: number): this; - /** - * The `rl.moveCursor()` method adds to the internal list of pending action an - * action that moves the cursor _relative_ to its current position in the - * associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - moveCursor(dx: number, dy: number): this; - /** - * The `rl.rollback` methods clears the internal list of pending actions without - * sending it to the associated `stream`. - * @since v17.0.0 - * @return this - */ - rollback(): this; - } - type Completer = (line: string) => CompleterResult | Promise; - interface ReadLineOptions extends Omit<_ReadLineOptions, "completer"> { - /** - * An optional function used for Tab autocompletion. - */ - completer?: Completer | undefined; - } - /** - * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. - * - * ```js - * import readlinePromises from 'node:readline/promises'; - * const rl = readlinePromises.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readlinePromises.Interface` instance is created, the most common case - * is to listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * @since v17.0.0 - */ - function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer, - terminal?: boolean, - ): Interface; - function createInterface(options: ReadLineOptions): Interface; -} -declare module "node:readline/promises" { - export * from "readline/promises"; -} diff --git a/node_modules/@types/node/repl.d.ts b/node_modules/@types/node/repl.d.ts deleted file mode 100644 index 8b1bb6b..0000000 --- a/node_modules/@types/node/repl.d.ts +++ /dev/null @@ -1,430 +0,0 @@ -/** - * The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation - * that is available both as a standalone program or includible in other - * applications. It can be accessed using: - * - * ```js - * import repl from 'node:repl'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/repl.js) - */ -declare module "repl" { - import { AsyncCompleter, Completer, Interface } from "node:readline"; - import { Context } from "node:vm"; - import { InspectOptions } from "node:util"; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - terminal?: boolean | undefined; - /** - * The function to be used when evaluating each given line of input. - * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * @default the REPL instance's `terminal` value - */ - useColors?: boolean | undefined; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * @default false - */ - useGlobal?: boolean | undefined; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * @default false - */ - ignoreUndefined?: boolean | undefined; - /** - * The function to invoke to format the output of each command before writing to `output`. - * @default a wrapper for `util.inspect` - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_customizing_repl_output - */ - writer?: REPLWriter | undefined; - /** - * An optional function used for custom Tab auto completion. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * @default false - */ - breakEvalOnSigint?: boolean | undefined; - } - type REPLEval = ( - this: REPLServer, - evalCmd: string, - context: Context, - file: string, - cb: (err: Error | null, result: any) => void, - ) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { - options: InspectOptions; - }; - type REPLCommandAction = (this: REPLServer, text: string) => void; - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * import repl from 'node:repl'; - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_commands_and_special_keys - */ - readonly editorMode: boolean; - /** - * A value indicating whether the `_` variable has been assigned. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreAssigned: boolean; - /** - * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly last: any; - /** - * A value indicating whether the `_error` variable has been assigned. - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreErrAssigned: boolean; - /** - * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the `keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * import repl from 'node:repl'; - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * }, - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (_without_ a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * The `replServer.displayPrompt()` method readies the REPL instance for input - * from the user, printing the configured `prompt` to a new line in the `output` and resuming the `input` to accept new input. - * - * When multi-line input is being entered, an ellipsis is printed rather than the - * 'prompt'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the `replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method clears any command that has been - * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the `replServer.defineCommand()` method. - * @since v9.0.0 - */ - clearBufferedCommand(): void; - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command-line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @since v11.10.0 - * @param historyPath the path to the history file - * @param callback called when history writes are ready or upon error - */ - setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "exit", listener: () => void): this; - addListener(event: "reset", listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "exit"): boolean; - emit(event: "reset", context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "exit", listener: () => void): this; - on(event: "reset", listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "exit", listener: () => void): this; - once(event: "reset", listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "exit", listener: () => void): this; - prependListener(event: "reset", listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "exit", listener: () => void): this; - prependOnceListener(event: "reset", listener: (context: Context) => void): this; - } - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * import repl from 'node:repl'; - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - function start(options?: string | ReplOptions): REPLServer; - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - constructor(err: Error); - } -} -declare module "node:repl" { - export * from "repl"; -} diff --git a/node_modules/@types/node/sea.d.ts b/node_modules/@types/node/sea.d.ts deleted file mode 100644 index 6f1d1ea..0000000 --- a/node_modules/@types/node/sea.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * This feature allows the distribution of a Node.js application conveniently to a - * system that does not have Node.js installed. - * - * Node.js supports the creation of [single executable applications](https://github.com/nodejs/single-executable) by allowing - * the injection of a blob prepared by Node.js, which can contain a bundled script, - * into the `node` binary. During start up, the program checks if anything has been - * injected. If the blob is found, it executes the script in the blob. Otherwise - * Node.js operates as it normally does. - * - * The single executable application feature currently only supports running a - * single embedded script using the `CommonJS` module system. - * - * Users can create a single executable application from their bundled script - * with the `node` binary itself and any tool which can inject resources into the - * binary. - * - * Here are the steps for creating a single executable application using one such - * tool, [postject](https://github.com/nodejs/postject): - * - * 1. Create a JavaScript file: - * ```bash - * echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js - * ``` - * 2. Create a configuration file building a blob that can be injected into the - * single executable application (see `Generating single executable preparation blobs` for details): - * ```bash - * echo '{ "main": "hello.js", "output": "sea-prep.blob" }' > sea-config.json - * ``` - * 3. Generate the blob to be injected: - * ```bash - * node --experimental-sea-config sea-config.json - * ``` - * 4. Create a copy of the `node` executable and name it according to your needs: - * * On systems other than Windows: - * ```bash - * cp $(command -v node) hello - * ``` - * * On Windows: - * ```text - * node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')" - * ``` - * The `.exe` extension is necessary. - * 5. Remove the signature of the binary (macOS and Windows only): - * * On macOS: - * ```bash - * codesign --remove-signature hello - * ``` - * * On Windows (optional): - * [signtool](https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool) can be used from the installed [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/). - * If this step is - * skipped, ignore any signature-related warning from postject. - * ```powershell - * signtool remove /s hello.exe - * ``` - * 6. Inject the blob into the copied binary by running `postject` with - * the following options: - * * `hello` / `hello.exe` \- The name of the copy of the `node` executable - * created in step 4. - * * `NODE_SEA_BLOB` \- The name of the resource / note / section in the binary - * where the contents of the blob will be stored. - * * `sea-prep.blob` \- The name of the blob created in step 1. - * * `--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2` \- The [fuse](https://www.electronjs.org/docs/latest/tutorial/fuses) used by the Node.js project to detect if a file has been - * injected. - * * `--macho-segment-name NODE_SEA` (only needed on macOS) - The name of the - * segment in the binary where the contents of the blob will be - * stored. - * To summarize, here is the required command for each platform: - * * On Linux: - * ```bash - * npx postject hello NODE_SEA_BLOB sea-prep.blob \ - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 - * ``` - * * On Windows - PowerShell: - * ```powershell - * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ` - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 - * ``` - * * On Windows - Command Prompt: - * ```text - * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ^ - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 - * ``` - * * On macOS: - * ```bash - * npx postject hello NODE_SEA_BLOB sea-prep.blob \ - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \ - * --macho-segment-name NODE_SEA - * ``` - * 7. Sign the binary (macOS and Windows only): - * * On macOS: - * ```bash - * codesign --sign - hello - * ``` - * * On Windows (optional): - * A certificate needs to be present for this to work. However, the unsigned - * binary would still be runnable. - * ```powershell - * signtool sign /fd SHA256 hello.exe - * ``` - * 8. Run the binary: - * * On systems other than Windows - * ```console - * $ ./hello world - * Hello, world! - * ``` - * * On Windows - * ```console - * $ .\hello.exe world - * Hello, world! - * ``` - * @since v19.7.0, v18.16.0 - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.12.0/src/node_sea.cc) - */ -declare module "node:sea" { - type AssetKey = string; - /** - * @since v20.12.0 - * @return Whether this script is running inside a single-executable application. - */ - function isSea(): boolean; - /** - * This method can be used to retrieve the assets configured to be bundled into the - * single-executable application at build time. - * An error is thrown when no matching asset can be found. - * @since v20.12.0 - */ - function getAsset(key: AssetKey): ArrayBuffer; - function getAsset(key: AssetKey, encoding: string): string; - /** - * Similar to `sea.getAsset()`, but returns the result in a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob). - * An error is thrown when no matching asset can be found. - * @since v20.12.0 - */ - function getAssetAsBlob(key: AssetKey, options?: { - type: string; - }): Blob; - /** - * This method can be used to retrieve the assets configured to be bundled into the - * single-executable application at build time. - * An error is thrown when no matching asset can be found. - * - * Unlike `sea.getRawAsset()` or `sea.getAssetAsBlob()`, this method does not - * return a copy. Instead, it returns the raw asset bundled inside the executable. - * - * For now, users should avoid writing to the returned array buffer. If the - * injected section is not marked as writable or not aligned properly, - * writes to the returned array buffer is likely to result in a crash. - * @since v20.12.0 - */ - function getRawAsset(key: AssetKey): string | ArrayBuffer; -} diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts deleted file mode 100644 index 9d13d1b..0000000 --- a/node_modules/@types/node/stream.d.ts +++ /dev/null @@ -1,1675 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `node:stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v20.x/api/http.html#class-httpincomingmessage) - * and [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v20.x/api/events.html#class-eventemitter). - * - * To access the `node:stream` module: - * - * ```js - * import stream from 'node:stream'; - * ``` - * - * The `node:stream` module is useful for creating new types of stream instances. - * It is usually not necessary to use the `node:stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/stream.js) - */ -declare module "stream" { - import { Abortable, EventEmitter } from "node:events"; - import { Blob as NodeBlob } from "node:buffer"; - import * as streamPromises from "node:stream/promises"; - import * as streamWeb from "node:stream/web"; - - type ComposeFnParam = (source: any) => void; - - class Stream extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - }, - ): T; - compose( - stream: T | ComposeFnParam | Iterable | AsyncIterable, - options?: { signal: AbortSignal }, - ): T; - } - namespace Stream { - export { Stream, streamPromises as promises }; - } - namespace Stream { - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined; - destroy?: ((this: T, error: Error | null, callback: (error?: Error | null) => void) => void) | undefined; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?: ((this: T, size: number) => void) | undefined; - } - interface ArrayOptions { - /** - * The maximum concurrent invocations of `fn` to call on the stream at once. - * @default 1 - */ - concurrency?: number | undefined; - /** Allows destroying the stream if the signal is aborted. */ - signal?: AbortSignal | undefined; - } - /** - * @since v0.9.4 - */ - class Readable extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - * @since v12.3.0, v10.17.0 - * @param iterable Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed. - * @param options Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * A utility method for creating a `Readable` from a web `ReadableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - readableStream: streamWeb.ReadableStream, - options?: Pick, - ): Readable; - /** - * A utility method for creating a web `ReadableStream` from a `Readable`. - * @since v17.0.0 - * @experimental - */ - static toWeb( - streamReadable: Readable, - options?: { - strategy?: streamWeb.QueuingStrategy | undefined; - }, - ): streamWeb.ReadableStream; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - * @experimental - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call {@link read}, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0, v14.18.0 - * @experimental - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding` property can be set using the {@link setEncoding} method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v20.x/api/stream.html#event-end) event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the [Three states](https://nodejs.org/docs/latest-v20.x/api/stream.html#three-states) section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method reads data out of the internal buffer and - * returns it. If no data is available to be read, `null` is returned. By default, - * the data is returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If - * `size` bytes are not available to be read, `null` will be returned _unless_ the - * stream has ended, in which case all of the data remaining in the internal buffer - * will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the `size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as `Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer` objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling `readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'` event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'` event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the `Readable`. - * This is used primarily by the mechanism that underlies the `readable.pipe()` method. - * In most typical cases, there will be no reason to use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * import fs from 'node:fs'; - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * import { StringDecoder } from 'node:string_decoder'; - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.includes('\n\n')) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * return; - * } - * // Still reading the header. - * header += str; - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must - * be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `node:stream` module API as it is currently defined. (See `Compatibility` for more - * information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the `readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * import { OldReader } from './old-api-module.js'; - * import { Readable } from 'node:stream'; - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - /** - * The iterator created by this method gives users the option to cancel the destruction - * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, - * or if the iterator should destroy the stream if the stream emitted an error during iteration. - * @since v16.3.0 - * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator, - * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream. - * **Default: `true`**. - */ - iterator(options?: { destroyOnReturn?: boolean }): NodeJS.AsyncIterator; - /** - * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream. - * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream. - * @since v17.4.0, v16.14.0 - * @param fn a function to map over every chunk in the stream. Async or not. - * @returns a stream mapped with the function *fn*. - */ - map(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called - * and if it returns a truthy value, the chunk will be passed to the result stream. - * If the *fn* function returns a promise - that promise will be `await`ed. - * @since v17.4.0, v16.14.0 - * @param fn a function to filter chunks from the stream. Async or not. - * @returns a stream filtered with the predicate *fn*. - */ - filter( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Readable; - /** - * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called. - * If the *fn* function returns a promise - that promise will be `await`ed. - * - * This method is different from `for await...of` loops in that it can optionally process chunks concurrently. - * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option - * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`. - * In either case the stream will be destroyed. - * - * This method is different from listening to the `'data'` event in that it uses the `readable` event - * in the underlying machinary and can limit the number of concurrent *fn* calls. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise for when the stream has finished. - */ - forEach( - fn: (data: any, options?: Pick) => void | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method allows easily obtaining the contents of a stream. - * - * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended - * for interoperability and convenience, not as the primary way to consume streams. - * @since v17.5.0 - * @returns a promise containing an array with the contents of the stream. - */ - toArray(options?: Pick): Promise; - /** - * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream - * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk - * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`. - * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks. - */ - some( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream - * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy, - * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value. - * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value, - * or `undefined` if no element was found. - */ - find( - fn: (data: any, options?: Pick) => data is T, - options?: ArrayOptions, - ): Promise; - find( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream - * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk - * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`. - * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks. - */ - every( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method returns a new stream by applying the given callback to each chunk of the stream - * and then flattening the result. - * - * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams - * will be merged (flattened) into the returned stream. - * @since v17.5.0 - * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator. - * @returns a stream flat-mapped with the function *fn*. - */ - flatMap(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method returns a new stream with the first *limit* chunks dropped from the start. - * @since v17.5.0 - * @param limit the number of chunks to drop from the readable. - * @returns a stream with *limit* chunks dropped from the start. - */ - drop(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with the first *limit* chunks. - * @since v17.5.0 - * @param limit the number of chunks to take from the readable. - * @returns a stream with *limit* chunks taken. - */ - take(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with chunks of the underlying stream paired with a counter - * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced. - * @since v17.5.0 - * @returns a stream of indexed pairs. - */ - asIndexedPairs(options?: Pick): Readable; - /** - * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation - * on the previous element. It returns a promise for the final value of the reduction. - * - * If no *initial* value is supplied the first chunk of the stream is used as the initial value. - * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property. - * - * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter - * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method. - * @since v17.5.0 - * @param fn a reducer function to call over every chunk in the stream. Async or not. - * @param initial the initial value to use in the reduction. - * @returns a promise for the final value of the reduction. - */ - reduce( - fn: (previous: any, data: any, options?: Pick) => T, - initial?: undefined, - options?: Pick, - ): Promise; - reduce( - fn: (previous: T, data: any, options?: Pick) => T, - initial: T, - options?: Pick, - ): Promise; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()` will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "pause"): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): NodeJS.AsyncIterator; - /** - * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?: - | (( - this: T, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ) => void) - | undefined; - writev?: - | (( - this: T, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ) => void) - | undefined; - final?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined; - } - /** - * @since v0.9.4 - */ - class Writable extends Stream implements NodeJS.WritableStream { - /** - * A utility method for creating a `Writable` from a web `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - writableStream: streamWeb.WritableStream, - options?: Pick, - ): Writable; - /** - * A utility method for creating a web `WritableStream` from a `Writable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamWritable: Writable): streamWeb.WritableStream; - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored, or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'finish'`. - * @since v18.0.0, v16.17.0 - * @experimental - */ - readonly writableAborted: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - /** - * Is `true` if the stream's buffer has been full and stream will emit `'drain'`. - * @since v15.2.0, v14.17.0 - */ - readonly writableNeedDrain: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the `highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * Once `write()` returns false, do not write more chunks - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, - * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * import fs from 'node:fs'; - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, - * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()` buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing `writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, defer calls to `writable.uncork()` using `process.nextTick()`. Doing so allows batching of all `writable.write()` calls that occur within a given Node.js event - * loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to `write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends Stream implements NodeJS.ReadWriteStream { - /** - * If `false` then the stream will automatically end the writable side when the - * readable side ends. Set initially by the `allowHalfOpen` constructor option, - * which defaults to `true`. - * - * This can be changed manually to change the half-open behavior of an existing - * `Duplex` stream instance, but must be changed before the `'end'` event is emitted. - * @since v0.9.4 - */ - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from( - src: - | Stream - | NodeBlob - | ArrayBuffer - | string - | Iterable - | AsyncIterable - | AsyncGeneratorFunction - | Promise - | Object, - ): Duplex; - /** - * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamDuplex: Duplex): { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }; - /** - * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - duplexStream: { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }, - options?: Pick< - DuplexOptions, - "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal" - >, - ): Duplex; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. drain - * 4. end - * 5. error - * 6. finish - * 7. pause - * 8. pipe - * 9. readable - * 10. resume - * 11. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pause"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pause", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pause", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - interface Duplex extends Readable, Writable {} - /** - * The utility function `duplexPair` returns an Array with two items, - * each being a `Duplex` stream connected to the other side: - * - * ```js - * const [ sideA, sideB ] = duplexPair(); - * ``` - * - * Whatever is written to one stream is made readable on the other. It provides - * behavior analogous to a network connection, where the data written by the client - * becomes readable by the server, and vice-versa. - * - * The Duplex streams are symmetrical; one or the other may be used without any - * difference in behavior. - * @param options A value to pass to both {@link Duplex} constructors, - * to set options such as buffering. - * @since v20.17.0 - */ - function duplexPair(options?: DuplexOptions): [Duplex, Duplex]; - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - transform?: - | ((this: T, chunk: any, encoding: BufferEncoding, callback: TransformCallback) => void) - | undefined; - flush?: ((this: T, callback: TransformCallback) => void) | undefined; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where `stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * A stream to attach a signal to. - * - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as calling `.destroy(new AbortError())` on the - * stream, and `controller.error(new AbortError())` for webstreams. - * - * ```js - * import fs from 'node:fs'; - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * - * Or using an `AbortSignal` with a ReadableStream: - * - * ```js - * const controller = new AbortController(); - * const rs = new ReadableStream({ - * start(controller) { - * controller.enqueue('hello'); - * controller.enqueue('world'); - * controller.close(); - * }, - * }); - * - * addAbortSignal(controller.signal, rs); - * - * finished(rs, (err) => { - * if (err) { - * if (err.name === 'AbortError') { - * // The operation was cancelled - * } - * } - * }); - * - * const reader = rs.getReader(); - * - * reader.read().then(({ value, done }) => { - * console.log(value); // hello - * console.log(done); // false - * controller.abort(); - * }); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream A stream to attach a signal to. - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - /** - * Returns the default highWaterMark used by streams. - * Defaults to `16384` (16 KiB), or `16` for `objectMode`. - * @since v19.9.0 - */ - function getDefaultHighWaterMark(objectMode: boolean): number; - /** - * Sets the default highWaterMark used by streams. - * @since v19.9.0 - * @param value highWaterMark value - */ - function setDefaultHighWaterMark(objectMode: boolean, value: number): void; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A readable and/or writable stream/webstream. - * - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * import { finished } from 'node:stream'; - * import fs from 'node:fs'; - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`. - * - * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streamfinishedstream-options). - * - * `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @returns A cleanup function which removes all registered listeners. - */ - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options: FinishedOptions, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - namespace finished { - function __promisify__( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | (( - source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable - : S, - ) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends - PipelineTransformSource ? - | NodeJS.WritableStream - | PipelineDestinationIterableFunction - | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends - PipelineDestinationPromiseFunction ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends - PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal?: AbortSignal | undefined; - end?: boolean | undefined; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * import { pipeline } from 'node:stream'; - * import fs from 'node:fs'; - * import zlib from 'node:zlib'; - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * }, - * ); - * ``` - * - * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streampipelinesource-transforms-destination-options). - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. If the last - * stream is readable, dangling event listeners will be removed so that the last - * stream can be consumed later. - * - * `stream.pipeline()` closes all the streams when an error is raised. - * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior - * once it would destroy the socket without sending the expected response. - * See the example below: - * - * ```js - * import fs from 'node:fs'; - * import http from 'node:http'; - * import { pipeline } from 'node:stream'; - * - * const server = http.createServer((req, res) => { - * const fileStream = fs.createReadStream('./fileNotExist.txt'); - * pipeline(fileStream, res, (err) => { - * if (err) { - * console.log(err); // No such file - * // this message can't be sent once `pipeline` already destroyed the socket - * return res.end('error!!!'); - * } - * }); - * }); - * ``` - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - callback: (err: NodeJS.ErrnoException | null) => void, - ): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array< - NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void) - > - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - // TODO: this interface never existed; remove in next major - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - /** - * Returns whether the stream has encountered an error. - * @since v17.3.0, v16.14.0 - * @experimental - */ - function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; - /** - * Returns whether the stream is readable. - * @since v17.4.0, v16.14.0 - * @experimental - */ - function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; - } - export = Stream; -} -declare module "node:stream" { - import stream = require("stream"); - export = stream; -} diff --git a/node_modules/@types/node/stream/consumers.d.ts b/node_modules/@types/node/stream/consumers.d.ts deleted file mode 100644 index 05db025..0000000 --- a/node_modules/@types/node/stream/consumers.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * The utility consumer functions provide common options for consuming - * streams. - * @since v16.7.0 - */ -declare module "stream/consumers" { - import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer"; - import { ReadableStream as WebReadableStream } from "node:stream/web"; - /** - * @since v16.7.0 - * @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream. - */ - function arrayBuffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; - /** - * @since v16.7.0 - * @returns Fulfills with a `Blob` containing the full contents of the stream. - */ - function blob(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; - /** - * @since v16.7.0 - * @returns Fulfills with a `Buffer` containing the full contents of the stream. - */ - function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; - /** - * @since v16.7.0 - * @returns Fulfills with the contents of the stream parsed as a - * UTF-8 encoded string that is then passed through `JSON.parse()`. - */ - function json(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; - /** - * @since v16.7.0 - * @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string. - */ - function text(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable): Promise; -} -declare module "node:stream/consumers" { - export * from "stream/consumers"; -} diff --git a/node_modules/@types/node/stream/promises.d.ts b/node_modules/@types/node/stream/promises.d.ts deleted file mode 100644 index d54c14c..0000000 --- a/node_modules/@types/node/stream/promises.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -declare module "stream/promises" { - import { - FinishedOptions as _FinishedOptions, - PipelineDestination, - PipelineOptions, - PipelinePromise, - PipelineSource, - PipelineTransform, - } from "node:stream"; - interface FinishedOptions extends _FinishedOptions { - /** - * If true, removes the listeners registered by this function before the promise is fulfilled. - * @default false - */ - cleanup?: boolean | undefined; - } - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module "node:stream/promises" { - export * from "stream/promises"; -} diff --git a/node_modules/@types/node/stream/web.d.ts b/node_modules/@types/node/stream/web.d.ts deleted file mode 100644 index 039ddc9..0000000 --- a/node_modules/@types/node/stream/web.d.ts +++ /dev/null @@ -1,533 +0,0 @@ -type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ByteLengthQueuingStrategy; -type _CompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {} - : import("stream/web").CompressionStream; -type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").CountQueuingStrategy; -type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {} - : import("stream/web").DecompressionStream; -type _QueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").QueuingStrategy; -type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableByteStreamController; -type _ReadableStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStream; -type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamBYOBReader; -type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamBYOBRequest; -type _ReadableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamDefaultController; -type _ReadableStreamDefaultReader = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamDefaultReader; -type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TextDecoderStream; -type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TextEncoderStream; -type _TransformStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TransformStream; -type _TransformStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TransformStreamDefaultController; -type _WritableStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStream; -type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStreamDefaultController; -type _WritableStreamDefaultWriter = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStreamDefaultWriter; - -declare module "stream/web" { - // stub module, pending copy&paste from .d.ts or manual impl - // copy from lib.dom.d.ts - interface ReadableWritablePair { - readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream - * through a transform stream (or any other { writable, readable } - * pair). It simply pipes the stream into the writable side of the - * supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - */ - writable: WritableStream; - } - interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It - * returns a promise that fulfills when the piping process completes - * successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate - * as follows: - * - * An error in this source readable stream will abort destination, - * unless preventAbort is truthy. The returned promise will be rejected - * with the source's error, or with any error that occurs during - * aborting the destination. - * - * An error in destination will cancel this source readable stream, - * unless preventCancel is truthy. The returned promise will be rejected - * with the destination's error, or with any error that occurs during - * canceling the source. - * - * When this source readable stream closes, destination will be closed, - * unless preventClose is truthy. The returned promise will be fulfilled - * once this process completes, unless an error is encountered while - * closing the destination, in which case it will be rejected with that - * error. - * - * If destination starts out closed or closing, this source readable - * stream will be canceled, unless preventCancel is true. The returned - * promise will be rejected with an error indicating piping to a closed - * stream failed, or with any error that occurs during canceling the - * source. - * - * The signal option can be set to an AbortSignal to allow aborting an - * ongoing pipe operation via the corresponding AbortController. In this - * case, this source readable stream will be canceled, and destination - * aborted, unless the respective options preventCancel or preventAbort - * are set. - */ - preventClose?: boolean; - signal?: AbortSignal; - } - interface ReadableStreamGenericReader { - readonly closed: Promise; - cancel(reason?: any): Promise; - } - type ReadableStreamController = ReadableStreamDefaultController; - interface ReadableStreamReadValueResult { - done: false; - value: T; - } - interface ReadableStreamReadDoneResult { - done: true; - value?: T; - } - type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; - interface ReadableByteStreamControllerCallback { - (controller: ReadableByteStreamController): void | PromiseLike; - } - interface UnderlyingSinkAbortCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSinkCloseCallback { - (): void | PromiseLike; - } - interface UnderlyingSinkStartCallback { - (controller: WritableStreamDefaultController): any; - } - interface UnderlyingSinkWriteCallback { - (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; - } - interface UnderlyingSourceCancelCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSourcePullCallback { - (controller: ReadableStreamController): void | PromiseLike; - } - interface UnderlyingSourceStartCallback { - (controller: ReadableStreamController): any; - } - interface TransformerFlushCallback { - (controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerStartCallback { - (controller: TransformStreamDefaultController): any; - } - interface TransformerTransformCallback { - (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; - } - interface UnderlyingByteSource { - autoAllocateChunkSize?: number; - cancel?: ReadableStreamErrorCallback; - pull?: ReadableByteStreamControllerCallback; - start?: ReadableByteStreamControllerCallback; - type: "bytes"; - } - interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; - } - interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; - } - interface ReadableStreamErrorCallback { - (reason: any): void | PromiseLike; - } - interface ReadableStreamAsyncIterator extends NodeJS.AsyncIterator { - [Symbol.asyncIterator](): ReadableStreamAsyncIterator; - } - /** This Streams API interface represents a readable stream of byte data. */ - interface ReadableStream { - readonly locked: boolean; - cancel(reason?: any): Promise; - getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; - getReader(): ReadableStreamDefaultReader; - getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader; - pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; - pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; - values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator; - [Symbol.asyncIterator](): ReadableStreamAsyncIterator; - } - const ReadableStream: { - prototype: ReadableStream; - from(iterable: Iterable | AsyncIterable): ReadableStream; - new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; - new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; - }; - type ReadableStreamReaderMode = "byob"; - interface ReadableStreamGetReaderOptions { - /** - * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. - * - * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation. - */ - mode?: ReadableStreamReaderMode; - } - type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; - interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; - } - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ - interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */ - read( - view: T, - options?: { - min?: number; - }, - ): Promise>; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */ - releaseLock(): void; - } - const ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new(stream: ReadableStream): ReadableStreamDefaultReader; - }; - const ReadableStreamBYOBReader: { - prototype: ReadableStreamBYOBReader; - new(stream: ReadableStream): ReadableStreamBYOBReader; - }; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */ - interface ReadableStreamBYOBRequest { - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */ - readonly view: ArrayBufferView | null; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */ - respond(bytesWritten: number): void; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */ - respondWithNewView(view: ArrayBufferView): void; - } - const ReadableStreamBYOBRequest: { - prototype: ReadableStreamBYOBRequest; - new(): ReadableStreamBYOBRequest; - }; - interface ReadableByteStreamController { - readonly byobRequest: ReadableStreamBYOBRequest | null; - readonly desiredSize: number | null; - close(): void; - enqueue(chunk: ArrayBufferView): void; - error(error?: any): void; - } - const ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new(): ReadableByteStreamController; - }; - interface ReadableStreamDefaultController { - readonly desiredSize: number | null; - close(): void; - enqueue(chunk?: R): void; - error(e?: any): void; - } - const ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new(): ReadableStreamDefaultController; - }; - interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; - } - interface TransformStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const TransformStream: { - prototype: TransformStream; - new( - transformer?: Transformer, - writableStrategy?: QueuingStrategy, - readableStrategy?: QueuingStrategy, - ): TransformStream; - }; - interface TransformStreamDefaultController { - readonly desiredSize: number | null; - enqueue(chunk?: O): void; - error(reason?: any): void; - terminate(): void; - } - const TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new(): TransformStreamDefaultController; - }; - /** - * This Streams API interface provides a standard abstraction for writing - * streaming data to a destination, known as a sink. This object comes with - * built-in back pressure and queuing. - */ - interface WritableStream { - readonly locked: boolean; - abort(reason?: any): Promise; - close(): Promise; - getWriter(): WritableStreamDefaultWriter; - } - const WritableStream: { - prototype: WritableStream; - new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; - }; - /** - * This Streams API interface is the object returned by - * WritableStream.getWriter() and once created locks the < writer to the - * WritableStream ensuring that no other streams can write to the underlying - * sink. - */ - interface WritableStreamDefaultWriter { - readonly closed: Promise; - readonly desiredSize: number | null; - readonly ready: Promise; - abort(reason?: any): Promise; - close(): Promise; - releaseLock(): void; - write(chunk?: W): Promise; - } - const WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new(stream: WritableStream): WritableStreamDefaultWriter; - }; - /** - * This Streams API interface represents a controller allowing control of a - * WritableStream's state. When constructing a WritableStream, the - * underlying sink is given a corresponding WritableStreamDefaultController - * instance to manipulate. - */ - interface WritableStreamDefaultController { - error(e?: any): void; - } - const WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new(): WritableStreamDefaultController; - }; - interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; - } - interface QueuingStrategySize { - (chunk?: T): number; - } - interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water - * mark. - * - * Note that the provided high water mark will not be validated ahead of - * time. Instead, if it is negative, NaN, or not a number, the resulting - * ByteLengthQueuingStrategy will cause the corresponding stream - * constructor to throw. - */ - highWaterMark: number; - } - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; - }; - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new(init: QueuingStrategyInit): CountQueuingStrategy; - }; - interface TextEncoderStream { - /** Returns "utf-8". */ - readonly encoding: "utf-8"; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextEncoderStream: { - prototype: TextEncoderStream; - new(): TextEncoderStream; - }; - interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; - } - type BufferSource = ArrayBufferView | ArrayBuffer; - interface TextDecoderStream { - /** Returns encoding's name, lower cased. */ - readonly encoding: string; - /** Returns `true` if error mode is "fatal", and `false` otherwise. */ - readonly fatal: boolean; - /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ - readonly ignoreBOM: boolean; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextDecoderStream: { - prototype: TextDecoderStream; - new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream; - }; - interface CompressionStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const CompressionStream: { - prototype: CompressionStream; - new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream; - }; - interface DecompressionStream { - readonly writable: WritableStream; - readonly readable: ReadableStream; - } - const DecompressionStream: { - prototype: DecompressionStream; - new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream; - }; - - global { - interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {} - var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T } - ? T - : typeof import("stream/web").ByteLengthQueuingStrategy; - - interface CompressionStream extends _CompressionStream {} - var CompressionStream: typeof globalThis extends { - onmessage: any; - // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit. - // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts - ReportingObserver: any; - CompressionStream: infer T; - } ? T - // TS 4.8, 4.9, 5.0 - : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? { - prototype: T; - new(format: "deflate" | "deflate-raw" | "gzip"): T; - } - : typeof import("stream/web").CompressionStream; - - interface CountQueuingStrategy extends _CountQueuingStrategy {} - var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T - : typeof import("stream/web").CountQueuingStrategy; - - interface DecompressionStream extends _DecompressionStream {} - var DecompressionStream: typeof globalThis extends { - onmessage: any; - // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit. - // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts - ReportingObserver: any; - DecompressionStream: infer T; - } ? T - // TS 4.8, 4.9, 5.0 - : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? { - prototype: T; - new(format: "deflate" | "deflate-raw" | "gzip"): T; - } - : typeof import("stream/web").DecompressionStream; - - interface QueuingStrategy extends _QueuingStrategy {} - - interface ReadableByteStreamController extends _ReadableByteStreamController {} - var ReadableByteStreamController: typeof globalThis extends - { onmessage: any; ReadableByteStreamController: infer T } ? T - : typeof import("stream/web").ReadableByteStreamController; - - interface ReadableStream extends _ReadableStream {} - var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T - : typeof import("stream/web").ReadableStream; - - interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {} - var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T } - ? T - : typeof import("stream/web").ReadableStreamBYOBReader; - - interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {} - var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T } - ? T - : typeof import("stream/web").ReadableStreamBYOBRequest; - - interface ReadableStreamDefaultController extends _ReadableStreamDefaultController {} - var ReadableStreamDefaultController: typeof globalThis extends - { onmessage: any; ReadableStreamDefaultController: infer T } ? T - : typeof import("stream/web").ReadableStreamDefaultController; - - interface ReadableStreamDefaultReader extends _ReadableStreamDefaultReader {} - var ReadableStreamDefaultReader: typeof globalThis extends - { onmessage: any; ReadableStreamDefaultReader: infer T } ? T - : typeof import("stream/web").ReadableStreamDefaultReader; - - interface TextDecoderStream extends _TextDecoderStream {} - var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T - : typeof import("stream/web").TextDecoderStream; - - interface TextEncoderStream extends _TextEncoderStream {} - var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T - : typeof import("stream/web").TextEncoderStream; - - interface TransformStream extends _TransformStream {} - var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T - : typeof import("stream/web").TransformStream; - - interface TransformStreamDefaultController extends _TransformStreamDefaultController {} - var TransformStreamDefaultController: typeof globalThis extends - { onmessage: any; TransformStreamDefaultController: infer T } ? T - : typeof import("stream/web").TransformStreamDefaultController; - - interface WritableStream extends _WritableStream {} - var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T - : typeof import("stream/web").WritableStream; - - interface WritableStreamDefaultController extends _WritableStreamDefaultController {} - var WritableStreamDefaultController: typeof globalThis extends - { onmessage: any; WritableStreamDefaultController: infer T } ? T - : typeof import("stream/web").WritableStreamDefaultController; - - interface WritableStreamDefaultWriter extends _WritableStreamDefaultWriter {} - var WritableStreamDefaultWriter: typeof globalThis extends - { onmessage: any; WritableStreamDefaultWriter: infer T } ? T - : typeof import("stream/web").WritableStreamDefaultWriter; - } -} -declare module "node:stream/web" { - export * from "stream/web"; -} diff --git a/node_modules/@types/node/string_decoder.d.ts b/node_modules/@types/node/string_decoder.d.ts deleted file mode 100644 index d08cbf6..0000000 --- a/node_modules/@types/node/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `node:string_decoder` module provides an API for decoding `Buffer` objects - * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * import { StringDecoder } from 'node:string_decoder'; - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * import { StringDecoder } from 'node:string_decoder'; - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); // Prints: ¢ - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); // Prints: € - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * import { StringDecoder } from 'node:string_decoder'; - * const decoder = new StringDecoder('utf8'); - * - * decoder.write(Buffer.from([0xE2])); - * decoder.write(Buffer.from([0x82])); - * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/string_decoder.js) - */ -declare module "string_decoder" { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to `stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer The bytes to decode. - */ - write(buffer: string | NodeJS.ArrayBufferView): string; - /** - * Returns any remaining input stored in the internal buffer as a string. Bytes - * representing incomplete UTF-8 and UTF-16 characters will be replaced with - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()` is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer The bytes to decode. - */ - end(buffer?: string | NodeJS.ArrayBufferView): string; - } -} -declare module "node:string_decoder" { - export * from "string_decoder"; -} diff --git a/node_modules/@types/node/test.d.ts b/node_modules/@types/node/test.d.ts deleted file mode 100644 index ec17fdf..0000000 --- a/node_modules/@types/node/test.d.ts +++ /dev/null @@ -1,1787 +0,0 @@ -/** - * The `node:test` module facilitates the creation of JavaScript tests. - * To access it: - * - * ```js - * import test from 'node:test'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'test'; - * ``` - * - * Tests created via the `test` module consist of a single function that is - * processed in one of three ways: - * - * 1. A synchronous function that is considered failing if it throws an exception, - * and is considered passing otherwise. - * 2. A function that returns a `Promise` that is considered failing if the `Promise` rejects, and is considered passing if the `Promise` fulfills. - * 3. A function that receives a callback function. If the callback receives any - * truthy value as its first argument, the test is considered failing. If a - * falsy value is passed as the first argument to the callback, the test is - * considered passing. If the test function receives a callback function and - * also returns a `Promise`, the test will fail. - * - * The following example illustrates how tests are written using the `test` module. - * - * ```js - * test('synchronous passing test', (t) => { - * // This test passes because it does not throw an exception. - * assert.strictEqual(1, 1); - * }); - * - * test('synchronous failing test', (t) => { - * // This test fails because it throws an exception. - * assert.strictEqual(1, 2); - * }); - * - * test('asynchronous passing test', async (t) => { - * // This test passes because the Promise returned by the async - * // function is settled and not rejected. - * assert.strictEqual(1, 1); - * }); - * - * test('asynchronous failing test', async (t) => { - * // This test fails because the Promise returned by the async - * // function is rejected. - * assert.strictEqual(1, 2); - * }); - * - * test('failing test using Promises', (t) => { - * // Promises can be used directly as well. - * return new Promise((resolve, reject) => { - * setImmediate(() => { - * reject(new Error('this will cause the test to fail')); - * }); - * }); - * }); - * - * test('callback passing test', (t, done) => { - * // done() is the callback function. When the setImmediate() runs, it invokes - * // done() with no arguments. - * setImmediate(done); - * }); - * - * test('callback failing test', (t, done) => { - * // When the setImmediate() runs, done() is invoked with an Error object and - * // the test fails. - * setImmediate(() => { - * done(new Error('callback failure')); - * }); - * }); - * ``` - * - * If any tests fail, the process exit code is set to `1`. - * @since v18.0.0, v16.17.0 - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/test.js) - */ -declare module "node:test" { - import { AssertMethodNames } from "node:assert"; - import { Readable } from "node:stream"; - import TestFn = test.TestFn; - import TestOptions = test.TestOptions; - /** - * The `test()` function is the value imported from the `test` module. Each - * invocation of this function results in reporting the test to the `TestsStream`. - * - * The `TestContext` object passed to the `fn` argument can be used to perform - * actions related to the current test. Examples include skipping the test, adding - * additional diagnostic information, or creating subtests. - * - * `test()` returns a `Promise` that fulfills once the test completes. - * if `test()` is called within a suite, it fulfills immediately. - * The return value can usually be discarded for top level tests. - * However, the return value from subtests should be used to prevent the parent - * test from finishing first and cancelling the subtest - * as shown in the following example. - * - * ```js - * test('top level test', async (t) => { - * // The setTimeout() in the following subtest would cause it to outlive its - * // parent test if 'await' is removed on the next line. Once the parent test - * // completes, it will cancel any outstanding subtests. - * await t.test('longer running subtest', async (t) => { - * return new Promise((resolve, reject) => { - * setTimeout(resolve, 1000); - * }); - * }); - * }); - * ``` - * - * The `timeout` option can be used to fail the test if it takes longer than `timeout` milliseconds to complete. However, it is not a reliable mechanism for - * canceling tests because a running test might block the application thread and - * thus prevent the scheduled cancellation. - * @since v18.0.0, v16.17.0 - * @param name The name of the test, which is displayed when reporting test results. - * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. - * @param options Configuration options for the test. - * @param fn The function under test. The first argument to this function is a {@link TestContext} object. - * If the test uses callbacks, the callback function is passed as the second argument. - * @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within a suite. - */ - function test(name?: string, fn?: TestFn): Promise; - function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function test(options?: TestOptions, fn?: TestFn): Promise; - function test(fn?: TestFn): Promise; - namespace test { - export { test }; - export { suite as describe, test as it }; - } - namespace test { - /** - * **Note:** `shard` is used to horizontally parallelize test running across - * machines or processes, ideal for large-scale executions across varied - * environments. It's incompatible with `watch` mode, tailored for rapid - * code iteration by automatically rerunning tests on file changes. - * - * ```js - * import { tap } from 'node:test/reporters'; - * import { run } from 'node:test'; - * import process from 'node:process'; - * import path from 'node:path'; - * - * run({ files: [path.resolve('./tests/test.js')] }) - * .compose(tap) - * .pipe(process.stdout); - * ``` - * @since v18.9.0, v16.19.0 - * @param options Configuration options for running tests. - */ - function run(options?: RunOptions): TestsStream; - /** - * The `suite()` function is imported from the `node:test` module. - * @param name The name of the suite, which is displayed when reporting test results. - * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. - * @param options Configuration options for the suite. This supports the same options as {@link test}. - * @param fn The suite function declaring nested tests and suites. The first argument to this function is a {@link SuiteContext} object. - * @return Immediately fulfilled with `undefined`. - * @since v20.13.0 - */ - function suite(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function suite(name?: string, fn?: SuiteFn): Promise; - function suite(options?: TestOptions, fn?: SuiteFn): Promise; - function suite(fn?: SuiteFn): Promise; - namespace suite { - /** - * Shorthand for skipping a suite. This is the same as calling {@link suite} with `options.skip` set to `true`. - * @since v20.13.0 - */ - function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function skip(name?: string, fn?: SuiteFn): Promise; - function skip(options?: TestOptions, fn?: SuiteFn): Promise; - function skip(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `TODO`. This is the same as calling {@link suite} with `options.todo` set to `true`. - * @since v20.13.0 - */ - function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function todo(name?: string, fn?: SuiteFn): Promise; - function todo(options?: TestOptions, fn?: SuiteFn): Promise; - function todo(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `only`. This is the same as calling {@link suite} with `options.only` set to `true`. - * @since v20.13.0 - */ - function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function only(name?: string, fn?: SuiteFn): Promise; - function only(options?: TestOptions, fn?: SuiteFn): Promise; - function only(fn?: SuiteFn): Promise; - } - /** - * Shorthand for skipping a test. This is the same as calling {@link test} with `options.skip` set to `true`. - * @since v20.2.0 - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`. This is the same as calling {@link test} with `options.todo` set to `true`. - * @since v20.2.0 - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`. This is the same as calling {@link test} with `options.only` set to `true`. - * @since v20.2.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - /** - * The type of a function passed to {@link test}. The first argument to this function is a {@link TestContext} object. - * If the test uses callbacks, the callback function is passed as the second argument. - */ - type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; - /** - * The type of a suite test function. The argument to this function is a {@link SuiteContext} object. - */ - type SuiteFn = (s: SuiteContext) => void | Promise; - interface TestShard { - /** - * A positive integer between 1 and `total` that specifies the index of the shard to run. - */ - index: number; - /** - * A positive integer that specifies the total number of shards to split the test files to. - */ - total: number; - } - interface RunOptions { - /** - * If a number is provided, then that many test processes would run in parallel, where each process corresponds to one test file. - * If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time. - * @default false - */ - concurrency?: number | boolean | undefined; - /** - * An array containing the list of files to run. If omitted, files are run according to the - * [test runner execution model](https://nodejs.org/docs/latest-v20.x/api/test.html#test-runner-execution-model). - */ - files?: readonly string[] | undefined; - /** - * Configures the test runner to exit the process once all known - * tests have finished executing even if the event loop would - * otherwise remain active. - * @default false - */ - forceExit?: boolean | undefined; - /** - * Sets inspector port of test child process. - * If a nullish value is provided, each process gets its own port, - * incremented from the primary's `process.debugPort`. - * @default undefined - */ - inspectPort?: number | (() => number) | undefined; - /** - * If truthy, the test context will only run tests that have the `only` option set - */ - only?: boolean | undefined; - /** - * A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run. - * @default undefined - */ - setup?: ((reporter: TestsStream) => void | Promise) | undefined; - /** - * Allows aborting an in-progress test execution. - */ - signal?: AbortSignal | undefined; - /** - * If provided, only run tests whose name matches the provided pattern. - * Strings are interpreted as JavaScript regular expressions. - * @default undefined - */ - testNamePatterns?: string | RegExp | ReadonlyArray | undefined; - /** - * The number of milliseconds after which the test execution will fail. - * If unspecified, subtests inherit this value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - /** - * Whether to run in watch mode or not. - * @default false - */ - watch?: boolean | undefined; - /** - * Running tests in a specific shard. - * @default undefined - */ - shard?: TestShard | undefined; - } - /** - * A successful call to `run()` will return a new `TestsStream` object, streaming a series of events representing the execution of the tests. - * - * Some of the events are guaranteed to be emitted in the same order as the tests are defined, while others are emitted in the order that the tests execute. - * @since v18.9.0, v16.19.0 - */ - interface TestsStream extends Readable { - addListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - addListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - addListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - addListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - addListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - addListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - addListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - addListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - addListener(event: "test:start", listener: (data: EventData.TestStart) => void): this; - addListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - addListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - addListener(event: "test:watch:drained", listener: () => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: "test:coverage", data: EventData.TestCoverage): boolean; - emit(event: "test:complete", data: EventData.TestComplete): boolean; - emit(event: "test:dequeue", data: EventData.TestDequeue): boolean; - emit(event: "test:diagnostic", data: EventData.TestDiagnostic): boolean; - emit(event: "test:enqueue", data: EventData.TestEnqueue): boolean; - emit(event: "test:fail", data: EventData.TestFail): boolean; - emit(event: "test:pass", data: EventData.TestPass): boolean; - emit(event: "test:plan", data: EventData.TestPlan): boolean; - emit(event: "test:start", data: EventData.TestStart): boolean; - emit(event: "test:stderr", data: EventData.TestStderr): boolean; - emit(event: "test:stdout", data: EventData.TestStdout): boolean; - emit(event: "test:watch:drained"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - on(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - on(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - on(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - on(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - on(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - on(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - on(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - on(event: "test:start", listener: (data: EventData.TestStart) => void): this; - on(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - on(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - on(event: "test:watch:drained", listener: () => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - once(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - once(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - once(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - once(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - once(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - once(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - once(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - once(event: "test:start", listener: (data: EventData.TestStart) => void): this; - once(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - once(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - once(event: "test:watch:drained", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - prependListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - prependListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - prependListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - prependListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - prependListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - prependListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - prependListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - prependListener(event: "test:start", listener: (data: EventData.TestStart) => void): this; - prependListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - prependListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - prependListener(event: "test:watch:drained", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this; - prependOnceListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this; - prependOnceListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this; - prependOnceListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this; - prependOnceListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this; - prependOnceListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this; - prependOnceListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this; - prependOnceListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this; - prependOnceListener(event: "test:start", listener: (data: EventData.TestStart) => void): this; - prependOnceListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this; - prependOnceListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this; - prependOnceListener(event: "test:watch:drained", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - } - namespace EventData { - interface Error extends globalThis.Error { - cause: globalThis.Error; - } - interface LocationInfo { - /** - * The column number where the test is defined, or - * `undefined` if the test was run through the REPL. - */ - column?: number; - /** - * The path of the test file, `undefined` if test was run through the REPL. - */ - file?: string; - /** - * The line number where the test is defined, or `undefined` if the test was run through the REPL. - */ - line?: number; - } - interface TestDiagnostic extends LocationInfo { - /** - * The diagnostic message. - */ - message: string; - /** - * The nesting level of the test. - */ - nesting: number; - } - interface TestCoverage { - /** - * An object containing the coverage report. - */ - summary: { - /** - * An array of coverage reports for individual files. - */ - files: Array<{ - /** - * The absolute path of the file. - */ - path: string; - /** - * The total number of lines. - */ - totalLineCount: number; - /** - * The total number of branches. - */ - totalBranchCount: number; - /** - * The total number of functions. - */ - totalFunctionCount: number; - /** - * The number of covered lines. - */ - coveredLineCount: number; - /** - * The number of covered branches. - */ - coveredBranchCount: number; - /** - * The number of covered functions. - */ - coveredFunctionCount: number; - /** - * The percentage of lines covered. - */ - coveredLinePercent: number; - /** - * The percentage of branches covered. - */ - coveredBranchPercent: number; - /** - * The percentage of functions covered. - */ - coveredFunctionPercent: number; - /** - * An array of functions representing function coverage. - */ - functions: Array<{ - /** - * The name of the function. - */ - name: string; - /** - * The line number where the function is defined. - */ - line: number; - /** - * The number of times the function was called. - */ - count: number; - }>; - /** - * An array of branches representing branch coverage. - */ - branches: Array<{ - /** - * The line number where the branch is defined. - */ - line: number; - /** - * The number of times the branch was taken. - */ - count: number; - }>; - /** - * An array of lines representing line numbers and the number of times they were covered. - */ - lines: Array<{ - /** - * The line number. - */ - line: number; - /** - * The number of times the line was covered. - */ - count: number; - }>; - }>; - /** - * An object containing a summary of coverage for all files. - */ - totals: { - /** - * The total number of lines. - */ - totalLineCount: number; - /** - * The total number of branches. - */ - totalBranchCount: number; - /** - * The total number of functions. - */ - totalFunctionCount: number; - /** - * The number of covered lines. - */ - coveredLineCount: number; - /** - * The number of covered branches. - */ - coveredBranchCount: number; - /** - * The number of covered functions. - */ - coveredFunctionCount: number; - /** - * The percentage of lines covered. - */ - coveredLinePercent: number; - /** - * The percentage of branches covered. - */ - coveredBranchPercent: number; - /** - * The percentage of functions covered. - */ - coveredFunctionPercent: number; - }; - /** - * The working directory when code coverage began. This - * is useful for displaying relative path names in case - * the tests changed the working directory of the Node.js process. - */ - workingDirectory: string; - }; - /** - * The nesting level of the test. - */ - nesting: number; - } - interface TestComplete extends LocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * Whether the test passed or not. - */ - passed: boolean; - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * An error wrapping the error thrown by the test if it did not pass. - */ - error?: Error; - /** - * The type of the test, used to denote whether this is a suite. - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; - } - interface TestDequeue extends LocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - } - interface TestEnqueue extends LocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - } - interface TestFail extends LocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * An error wrapping the error thrown by the test. - */ - error: Error; - /** - * The type of the test, used to denote whether this is a suite. - * @since v20.0.0, v19.9.0, v18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; - } - interface TestPass extends LocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; - } - interface TestPlan extends LocationInfo { - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The number of subtests that have ran. - */ - count: number; - } - interface TestStart extends LocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - } - interface TestStderr { - /** - * The path of the test file. - */ - file: string; - /** - * The message written to `stderr`. - */ - message: string; - } - interface TestStdout { - /** - * The path of the test file. - */ - file: string; - /** - * The message written to `stdout`. - */ - message: string; - } - } - /** - * An instance of `TestContext` is passed to each test function in order to - * interact with the test runner. However, the `TestContext` constructor is not - * exposed as part of the API. - * @since v18.0.0, v16.17.0 - */ - interface TestContext { - /** - * An object containing assertion methods bound to the test context. - * The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans. - * - * **Note:** Some of the functions from `node:assert` contain type assertions. If these are called via the - * TestContext `assert` object, then the context parameter in the test's function signature **must be explicitly typed** - * (ie. the parameter must have a type annotation), otherwise an error will be raised by the TypeScript compiler: - * ```ts - * import { test, type TestContext } from 'node:test'; - * - * // The test function's context parameter must have a type annotation. - * test('example', (t: TestContext) => { - * t.assert.deepStrictEqual(actual, expected); - * }); - * - * // Omitting the type annotation will result in a compilation error. - * test('example', t => { - * t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation. - * }); - * ``` - * @since v20.15.0 - */ - readonly assert: TestContextAssert; - /** - * This function is used to create a hook running before subtest of the current test. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v20.1.0, v18.17.0 - */ - before(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running before each subtest of the current test. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - beforeEach(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to create a hook that runs after the current test finishes. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v18.13.0 - */ - after(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running after each subtest of the current test. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - afterEach(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to write diagnostics to the output. Any diagnostic - * information is included at the end of the test's results. This function does - * not return a value. - * - * ```js - * test('top level test', (t) => { - * t.diagnostic('A diagnostic message'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Message to be reported. - */ - diagnostic(message: string): void; - /** - * The name of the test and each of its ancestors, separated by `>`. - * @since v20.16.0 - */ - readonly fullName: string; - /** - * The name of the test. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * Used to set the number of assertions and subtests that are expected to run within the test. - * If the number of assertions and subtests that run does not match the expected count, the test will fail. - * - * To make sure assertions are tracked, the assert functions on `context.assert` must be used, - * instead of importing from the `node:assert` module. - * ```js - * test('top level test', (t) => { - * t.plan(2); - * t.assert.ok('some relevant assertion here'); - * t.test('subtest', () => {}); - * }); - * ``` - * - * When working with asynchronous code, the `plan` function can be used to ensure that the correct number of assertions are run: - * ```js - * test('planning with streams', (t, done) => { - * function* generate() { - * yield 'a'; - * yield 'b'; - * yield 'c'; - * } - * const expected = ['a', 'b', 'c']; - * t.plan(expected.length); - * const stream = Readable.from(generate()); - * stream.on('data', (chunk) => { - * t.assert.strictEqual(chunk, expected.shift()); - * }); - * stream.on('end', () => { - * done(); - * }); - * }); - * ``` - * @since v20.15.0 - */ - plan(count: number): void; - /** - * If `shouldRunOnlyTests` is truthy, the test context will only run tests that - * have the `only` option set. Otherwise, all tests are run. If Node.js was not - * started with the `--test-only` command-line option, this function is a - * no-op. - * - * ```js - * test('top level test', (t) => { - * // The test context can be set to run subtests with the 'only' option. - * t.runOnly(true); - * return Promise.all([ - * t.test('this subtest is now skipped'), - * t.test('this subtest is run', { only: true }), - * ]); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param shouldRunOnlyTests Whether or not to run `only` tests. - */ - runOnly(shouldRunOnlyTests: boolean): void; - /** - * ```js - * test('top level test', async (t) => { - * await fetch('some/uri', { signal: t.signal }); - * }); - * ``` - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - /** - * This function causes the test's output to indicate the test as skipped. If `message` is provided, it is included in the output. Calling `skip()` does - * not terminate execution of the test function. This function does not return a - * value. - * - * ```js - * test('top level test', (t) => { - * // Make sure to return here as well if the test contains additional logic. - * t.skip('this is skipped'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional skip message. - */ - skip(message?: string): void; - /** - * This function adds a `TODO` directive to the test's output. If `message` is - * provided, it is included in the output. Calling `todo()` does not terminate - * execution of the test function. This function does not return a value. - * - * ```js - * test('top level test', (t) => { - * // This test is marked as `TODO` - * t.todo('this is a todo'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional `TODO` message. - */ - todo(message?: string): void; - /** - * This function is used to create subtests under the current test. This function behaves in - * the same fashion as the top level {@link test} function. - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. - * @param options Configuration options for the test. - * @param fn The function under test. This first argument to this function is a {@link TestContext} object. - * If the test uses callbacks, the callback function is passed as the second argument. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - test: typeof test; - /** - * Each test provides its own MockTracker instance. - */ - readonly mock: MockTracker; - } - interface TestContextAssert extends Pick {} - /** - * An instance of `SuiteContext` is passed to each suite function in order to - * interact with the test runner. However, the `SuiteContext` constructor is not - * exposed as part of the API. - * @since v18.7.0, v16.17.0 - */ - interface SuiteContext { - /** - * The name of the suite. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * Can be used to abort test subtasks when the test has been aborted. - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - } - interface TestOptions { - /** - * If a number is provided, then that many tests would run in parallel. - * If truthy, it would run (number of cpu cores - 1) tests in parallel. - * For subtests, it will be `Infinity` tests in parallel. - * If falsy, it would only run one test at a time. - * If unspecified, subtests inherit this value from their parent. - * @default false - */ - concurrency?: number | boolean | undefined; - /** - * If truthy, and the test context is configured to run `only` tests, then this test will be - * run. Otherwise, the test is skipped. - * @default false - */ - only?: boolean | undefined; - /** - * Allows aborting an in-progress test. - * @since v18.8.0 - */ - signal?: AbortSignal | undefined; - /** - * If truthy, the test is skipped. If a string is provided, that string is displayed in the - * test results as the reason for skipping the test. - * @default false - */ - skip?: boolean | string | undefined; - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - * @since v18.7.0 - */ - timeout?: number | undefined; - /** - * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in - * the test results as the reason why the test is `TODO`. - * @default false - */ - todo?: boolean | string | undefined; - /** - * The number of assertions and subtests expected to be run in the test. - * If the number of assertions run in the test does not match the number - * specified in the plan, the test will fail. - * @default undefined - * @since v20.15.0 - */ - plan?: number | undefined; - } - /** - * This function creates a hook that runs before executing a suite. - * - * ```js - * describe('tests', async () => { - * before(() => console.log('about to run some test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function before(fn?: HookFn, options?: HookOptions): void; - /** - * This function creates a hook that runs after executing a suite. - * - * ```js - * describe('tests', async () => { - * after(() => console.log('finished running tests')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function after(fn?: HookFn, options?: HookOptions): void; - /** - * This function creates a hook that runs before each test in the current suite. - * - * ```js - * describe('tests', async () => { - * beforeEach(() => console.log('about to run a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function beforeEach(fn?: HookFn, options?: HookOptions): void; - /** - * This function creates a hook that runs after each test in the current suite. - * The `afterEach()` hook is run even if the test fails. - * - * ```js - * describe('tests', async () => { - * afterEach(() => console.log('finished running a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function afterEach(fn?: HookFn, options?: HookOptions): void; - /** - * The hook function. The first argument is the context in which the hook is called. - * If the hook uses callbacks, the callback function is passed as the second argument. - */ - type HookFn = (c: TestContext | SuiteContext, done: (result?: any) => void) => any; - /** - * The hook function. The first argument is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - */ - type TestContextHookFn = (t: TestContext, done: (result?: any) => void) => any; - /** - * Configuration options for hooks. - * @since v18.8.0 - */ - interface HookOptions { - /** - * Allows aborting an in-progress hook. - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - } - interface MockFunctionOptions { - /** - * The number of times that the mock will use the behavior of `implementation`. - * Once the mock function has been called `times` times, - * it will automatically restore the behavior of `original`. - * This value must be an integer greater than zero. - * @default Infinity - */ - times?: number | undefined; - } - interface MockMethodOptions extends MockFunctionOptions { - /** - * If `true`, `object[methodName]` is treated as a getter. - * This option cannot be used with the `setter` option. - */ - getter?: boolean | undefined; - /** - * If `true`, `object[methodName]` is treated as a setter. - * This option cannot be used with the `getter` option. - */ - setter?: boolean | undefined; - } - type Mock = F & { - mock: MockFunctionContext; - }; - interface MockModuleOptions { - /** - * If false, each call to `require()` or `import()` generates a new mock module. - * If true, subsequent calls will return the same module mock, and the mock module is inserted into the CommonJS cache. - * @default false - */ - cache?: boolean | undefined; - /** - * The value to use as the mocked module's default export. - * - * If this value is not provided, ESM mocks do not include a default export. - * If the mock is a CommonJS or builtin module, this setting is used as the value of `module.exports`. - * If this value is not provided, CJS and builtin mocks use an empty object as the value of `module.exports`. - */ - defaultExport?: any; - /** - * An object whose keys and values are used to create the named exports of the mock module. - * - * If the mock is a CommonJS or builtin module, these values are copied onto `module.exports`. - * Therefore, if a mock is created with both named exports and a non-object default export, - * the mock will throw an exception when used as a CJS or builtin module. - */ - namedExports?: object | undefined; - } - /** - * The `MockTracker` class is used to manage mocking functionality. The test runner - * module provides a top level `mock` export which is a `MockTracker` instance. - * Each test also provides its own `MockTracker` instance via the test context's `mock` property. - * @since v19.1.0, v18.13.0 - */ - interface MockTracker { - /** - * This function is used to create a mock function. - * - * The following example creates a mock function that increments a counter by one - * on each invocation. The `times` option is used to modify the mock behavior such - * that the first two invocations add two to the counter instead of one. - * - * ```js - * test('mocks a counting function', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne, addTwo, { times: 2 }); - * - * assert.strictEqual(fn(), 2); - * assert.strictEqual(fn(), 4); - * assert.strictEqual(fn(), 5); - * assert.strictEqual(fn(), 6); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param original An optional function to create a mock on. - * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and - * then restore the behavior of `original`. - * @param options Optional configuration options for the mock function. - * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked function. - */ - fn undefined>( - original?: F, - options?: MockFunctionOptions, - ): Mock; - fn undefined, Implementation extends Function = F>( - original?: F, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock; - /** - * This function is used to create a mock on an existing object method. The - * following example demonstrates how a mock is created on an existing object - * method. - * - * ```js - * test('spies on an object method', (t) => { - * const number = { - * value: 5, - * subtract(a) { - * return this.value - a; - * }, - * }; - * - * t.mock.method(number, 'subtract'); - * assert.strictEqual(number.subtract.mock.calls.length, 0); - * assert.strictEqual(number.subtract(3), 2); - * assert.strictEqual(number.subtract.mock.calls.length, 1); - * - * const call = number.subtract.mock.calls[0]; - * - * assert.deepStrictEqual(call.arguments, [3]); - * assert.strictEqual(call.result, 2); - * assert.strictEqual(call.error, undefined); - * assert.strictEqual(call.target, undefined); - * assert.strictEqual(call.this, number); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param object The object whose method is being mocked. - * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown. - * @param implementation An optional function used as the mock implementation for `object[methodName]`. - * @param options Optional configuration options for the mock method. - * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked method. - */ - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation: Implementation, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method( - object: MockedObject, - methodName: keyof MockedObject, - options: MockMethodOptions, - ): Mock; - method( - object: MockedObject, - methodName: keyof MockedObject, - implementation: Function, - options: MockMethodOptions, - ): Mock; - /** - * This function is syntax sugar for `MockTracker.method` with `options.getter` set to `true`. - * @since v19.3.0, v18.13.0 - */ - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<() => MockedObject[MethodName]>; - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<(() => MockedObject[MethodName]) | Implementation>; - /** - * This function is syntax sugar for `MockTracker.method` with `options.setter` set to `true`. - * @since v19.3.0, v18.13.0 - */ - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<(value: MockedObject[MethodName]) => void>; - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; - /** - * This function is used to mock the exports of ECMAScript modules, CommonJS modules, and Node.js builtin modules. - * Any references to the original module prior to mocking are not impacted. - * - * Only available through the [--experimental-test-module-mocks](https://nodejs.org/api/cli.html#--experimental-test-module-mocks) flag. - * @since v20.18.0 - * @experimental - * @param specifier A string identifying the module to mock. - * @param options Optional configuration options for the mock module. - */ - module(specifier: string, options?: MockModuleOptions): MockModuleContext; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker` and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used, but the `MockTracker` instance can no longer be - * used to reset their behavior or - * otherwise interact with them. - * - * After each test completes, this function is called on the test context's `MockTracker`. If the global `MockTracker` is used extensively, calling this - * function manually is recommended. - * @since v19.1.0, v18.13.0 - */ - reset(): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does - * not disassociate the mocks from the `MockTracker` instance. - * @since v19.1.0, v18.13.0 - */ - restoreAll(): void; - readonly timers: MockTimers; - } - const mock: MockTracker; - interface MockFunctionCall< - F extends Function, - ReturnType = F extends (...args: any) => infer T ? T - : F extends abstract new(...args: any) => infer T ? T - : unknown, - Args = F extends (...args: infer Y) => any ? Y - : F extends abstract new(...args: infer Y) => any ? Y - : unknown[], - > { - /** - * An array of the arguments passed to the mock function. - */ - arguments: Args; - /** - * If the mocked function threw then this property contains the thrown value. - */ - error: unknown | undefined; - /** - * The value returned by the mocked function. - * - * If the mocked function threw, it will be `undefined`. - */ - result: ReturnType | undefined; - /** - * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation. - */ - stack: Error; - /** - * If the mocked function is a constructor, this field contains the class being constructed. - * Otherwise this will be `undefined`. - */ - target: F extends abstract new(...args: any) => any ? F : undefined; - /** - * The mocked function's `this` value. - */ - this: unknown; - } - /** - * The `MockFunctionContext` class is used to inspect or manipulate the behavior of - * mocks created via the `MockTracker` APIs. - * @since v19.1.0, v18.13.0 - */ - interface MockFunctionContext { - /** - * A getter that returns a copy of the internal array used to track calls to the - * mock. Each entry in the array is an object with the following properties. - * @since v19.1.0, v18.13.0 - */ - readonly calls: MockFunctionCall[]; - /** - * This function returns the number of times that this mock has been invoked. This - * function is more efficient than checking `ctx.calls.length` because `ctx.calls` is a getter that creates a copy of the internal call tracking array. - * @since v19.1.0, v18.13.0 - * @return The number of times that this mock has been invoked. - */ - callCount(): number; - /** - * This function is used to change the behavior of an existing mock. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, and then changes the mock implementation to a different function. - * - * ```js - * test('changes a mock behavior', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementation(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 5); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's new implementation. - */ - mockImplementation(implementation: F): void; - /** - * This function is used to change the behavior of an existing mock for a single - * invocation. Once invocation `onCall` has occurred, the mock will revert to - * whatever behavior it would have used had `mockImplementationOnce()` not been - * called. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, changes the mock implementation to a different function for the - * next invocation, and then resumes its previous behavior. - * - * ```js - * test('changes a mock behavior once', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementationOnce(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 4); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. - * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. - */ - mockImplementationOnce(implementation: F, onCall?: number): void; - /** - * Resets the call history of the mock function. - * @since v19.3.0, v18.13.0 - */ - resetCalls(): void; - /** - * Resets the implementation of the mock function to its original behavior. The - * mock can still be used after calling this function. - * @since v19.1.0, v18.13.0 - */ - restore(): void; - } - /** - * @since v20.18.0 - * @experimental - */ - interface MockModuleContext { - /** - * Resets the implementation of the mock module. - * @since v20.18.0 - */ - restore(): void; - } - interface MockTimersOptions { - apis: ReadonlyArray<"setInterval" | "setTimeout" | "setImmediate" | "Date">; - now?: number | Date | undefined; - } - /** - * Mocking timers is a technique commonly used in software testing to simulate and - * control the behavior of timers, such as `setInterval` and `setTimeout`, - * without actually waiting for the specified time intervals. - * - * The MockTimers API also allows for mocking of the `Date` constructor and - * `setImmediate`/`clearImmediate` functions. - * - * The `MockTracker` provides a top-level `timers` export - * which is a `MockTimers` instance. - * @since v20.4.0 - * @experimental - */ - interface MockTimers { - /** - * Enables timer mocking for the specified timers. - * - * **Note:** When you enable mocking for a specific timer, its associated - * clear function will also be implicitly mocked. - * - * **Note:** Mocking `Date` will affect the behavior of the mocked timers - * as they use the same internal clock. - * - * Example usage without setting initial time: - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 }); - * ``` - * - * The above example enables mocking for the `Date` constructor, `setInterval` timer and - * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`, - * `setInterval` and `clearInterval` functions from `node:timers`, `node:timers/promises`, and `globalThis` will be mocked. - * - * Example usage with initial time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: 1000 }); - * ``` - * - * Example usage with initial Date object as time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: new Date() }); - * ``` - * - * Alternatively, if you call `mock.timers.enable()` without any parameters: - * - * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`) - * will be mocked. - * - * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`, - * and `globalThis` will be mocked. - * The `Date` constructor from `globalThis` will be mocked. - * - * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can - * set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date - * object. It can either be a positive integer, or another Date object. - * @since v20.4.0 - */ - enable(options?: MockTimersOptions): void; - /** - * You can use the `.setTime()` method to manually move the mocked date to another time. This method only accepts a positive integer. - * Note: This method will execute any mocked timers that are in the past from the new time. - * In the below example we are setting a new time for the mocked date. - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * test('sets the time of a date object', (context) => { - * // Optionally choose what to mock - * context.mock.timers.enable({ apis: ['Date'], now: 100 }); - * assert.strictEqual(Date.now(), 100); - * // Advance in time will also advance the date - * context.mock.timers.setTime(1000); - * context.mock.timers.tick(200); - * assert.strictEqual(Date.now(), 1200); - * }); - * ``` - */ - setTime(time: number): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTimers` instance and disassociates the mocks - * from the `MockTracker` instance. - * - * **Note:** After each test completes, this function is called on - * the test context's `MockTracker`. - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.reset(); - * ``` - * @since v20.4.0 - */ - reset(): void; - /** - * Advances time for all mocked timers. - * - * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts - * only positive numbers. In Node.js, `setTimeout` with negative numbers is - * only supported for web compatibility reasons. - * - * The following example mocks a `setTimeout` function and - * by using `.tick` advances in - * time triggering all pending timers. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Alternativelly, the `.tick` function can be called many times - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * const nineSecs = 9000; - * setTimeout(fn, nineSecs); - * - * const twoSeconds = 3000; - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Advancing time using `.tick` will also advance the time for any `Date` object - * created after the mock was enabled (if `Date` was also set to be mocked). - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * assert.strictEqual(Date.now(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * assert.strictEqual(fn.mock.callCount(), 1); - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * @since v20.4.0 - */ - tick(milliseconds: number): void; - /** - * Triggers all pending mocked timers immediately. If the `Date` object is also - * mocked, it will also advance the `Date` object to the furthest timer's time. - * - * The example below triggers all pending timers immediately, - * causing them to execute without any delay. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('runAll functions following the given order', (context) => { - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * const results = []; - * setTimeout(() => results.push(1), 9999); - * - * // Notice that if both timers have the same timeout, - * // the order of execution is guaranteed - * setTimeout(() => results.push(3), 8888); - * setTimeout(() => results.push(2), 8888); - * - * assert.deepStrictEqual(results, []); - * - * context.mock.timers.runAll(); - * assert.deepStrictEqual(results, [3, 2, 1]); - * // The Date object is also advanced to the furthest timer's time - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * - * **Note:** The `runAll()` function is specifically designed for - * triggering timers in the context of timer mocking. - * It does not have any effect on real-time system - * clocks or actual timers outside of the mocking environment. - * @since v20.4.0 - */ - runAll(): void; - /** - * Calls {@link MockTimers.reset()}. - */ - [Symbol.dispose](): void; - } - } - type FunctionPropertyNames = { - [K in keyof T]: T[K] extends Function ? K : never; - }[keyof T]; - export = test; -} - -/** - * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. - * To access it: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'test/reporters'; - * ``` - * @since v19.9.0 - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/test/reporters.js) - */ -declare module "node:test/reporters" { - import { Transform, TransformOptions } from "node:stream"; - import { EventData } from "node:test"; - - type TestEvent = - | { type: "test:coverage"; data: EventData.TestCoverage } - | { type: "test:complete"; data: EventData.TestComplete } - | { type: "test:dequeue"; data: EventData.TestDequeue } - | { type: "test:diagnostic"; data: EventData.TestDiagnostic } - | { type: "test:enqueue"; data: EventData.TestEnqueue } - | { type: "test:fail"; data: EventData.TestFail } - | { type: "test:pass"; data: EventData.TestPass } - | { type: "test:plan"; data: EventData.TestPlan } - | { type: "test:start"; data: EventData.TestStart } - | { type: "test:stderr"; data: EventData.TestStderr } - | { type: "test:stdout"; data: EventData.TestStdout } - | { type: "test:watch:drained"; data: undefined }; - type TestEventGenerator = AsyncGenerator; - - /** - * The `dot` reporter outputs the test results in a compact format, - * where each passing test is represented by a `.`, - * and each failing test is represented by a `X`. - * @since v20.0.0 - */ - function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>; - /** - * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. - * @since v20.0.0 - */ - function tap(source: TestEventGenerator): AsyncGenerator; - /** - * The `spec` reporter outputs the test results in a human-readable format. - * @since v20.0.0 - */ - class SpecReporter extends Transform { - constructor(); - } - /** - * The `junit` reporter outputs test results in a jUnit XML format. - * @since v21.0.0 - */ - function junit(source: TestEventGenerator): AsyncGenerator; - class LcovReporter extends Transform { - constructor(opts?: Omit); - } - /** - * The `lcov` reporter outputs test coverage when used with the - * [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--experimental-test-coverage) flag. - * @since v22.0.0 - */ - const lcov: LcovReporter; - - export { dot, junit, lcov, SpecReporter as spec, tap, TestEvent }; -} diff --git a/node_modules/@types/node/timers.d.ts b/node_modules/@types/node/timers.d.ts deleted file mode 100644 index 57a8d9f..0000000 --- a/node_modules/@types/node/timers.d.ts +++ /dev/null @@ -1,286 +0,0 @@ -/** - * The `timer` module exposes a global API for scheduling functions to - * be called at some future period of time. Because the timer functions are - * globals, there is no need to import `node:timers` to use the API. - * - * The timer functions within Node.js implement a similar API as the timers API - * provided by Web Browsers but use a different internal implementation that is - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v20.x/lib/timers.js) - */ -declare module "timers" { - import { Abortable } from "node:events"; - import * as promises from "node:timers/promises"; - export interface TimerOptions extends Abortable { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - ref?: boolean | undefined; - } - global { - namespace NodeJS { - /** - * This object is created internally and is returned from `setImmediate()`. It - * can be passed to `clearImmediate()` in order to cancel the scheduled - * actions. - * - * By default, when an immediate is scheduled, the Node.js event loop will continue - * running as long as the immediate is active. The `Immediate` object returned by - * `setImmediate()` exports both `immediate.ref()` and `immediate.unref()` - * functions that can be used to control this default behavior. - */ - interface Immediate extends RefCounted, Disposable { - /** - * If true, the `Immediate` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * When called, requests that the Node.js event loop _not_ exit so long as the - * `Immediate` is active. Calling `immediate.ref()` multiple times will have no - * effect. - * - * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary - * to call `immediate.ref()` unless `immediate.unref()` had been called previously. - * @since v9.7.0 - * @returns a reference to `immediate` - */ - ref(): this; - /** - * When called, the active `Immediate` object will not require the Node.js event - * loop to remain active. If there is no other activity keeping the event loop - * running, the process may exit before the `Immediate` object's callback is - * invoked. Calling `immediate.unref()` multiple times will have no effect. - * @since v9.7.0 - * @returns a reference to `immediate` - */ - unref(): this; - /** - * Cancels the immediate. This is similar to calling `clearImmediate()`. - * @since v20.5.0, v18.18.0 - * @experimental - */ - [Symbol.dispose](): void; - _onImmediate(...args: any[]): void; - } - // Legacy interface used in Node.js v9 and prior - /** @deprecated Use `NodeJS.Timeout` instead. */ - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - [Symbol.toPrimitive](): number; - } - /** - * This object is created internally and is returned from `setTimeout()` and - * `setInterval()`. It can be passed to either `clearTimeout()` or - * `clearInterval()` in order to cancel the scheduled actions. - * - * By default, when a timer is scheduled using either `setTimeout()` or - * `setInterval()`, the Node.js event loop will continue running as long as the - * timer is active. Each of the `Timeout` objects returned by these functions - * export both `timeout.ref()` and `timeout.unref()` functions that can be used to - * control this default behavior. - */ - interface Timeout extends RefCounted, Disposable, Timer { - /** - * Cancels the timeout. - * @since v0.9.1 - * @legacy Use `clearTimeout()` instead. - * @returns a reference to `timeout` - */ - close(): this; - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * When called, requests that the Node.js event loop _not_ exit so long as the - * `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. - * - * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary - * to call `timeout.ref()` unless `timeout.unref()` had been called previously. - * @since v0.9.1 - * @returns a reference to `timeout` - */ - ref(): this; - /** - * Sets the timer's start time to the current time, and reschedules the timer to - * call its callback at the previously specified duration adjusted to the current - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @returns a reference to `timeout` - */ - refresh(): this; - /** - * When called, the active `Timeout` object will not require the Node.js event loop - * to remain active. If there is no other activity keeping the event loop running, - * the process may exit before the `Timeout` object's callback is invoked. Calling - * `timeout.unref()` multiple times will have no effect. - * @since v0.9.1 - * @returns a reference to `timeout` - */ - unref(): this; - /** - * Coerce a `Timeout` to a primitive. The primitive can be used to - * clear the `Timeout`. The primitive can only be used in the - * same thread where the timeout was created. Therefore, to use it - * across `worker_threads` it must first be passed to the correct - * thread. This allows enhanced compatibility with browser - * `setTimeout()` and `setInterval()` implementations. - * @since v14.9.0, v12.19.0 - */ - [Symbol.toPrimitive](): number; - /** - * Cancels the timeout. - * @since v20.5.0, v18.18.0 - * @experimental - */ - [Symbol.dispose](): void; - _onTimeout(...args: any[]): void; - } - } - /** - * Schedules the "immediate" execution of the `callback` after I/O events' - * callbacks. - * - * When multiple calls to `setImmediate()` are made, the `callback` functions are - * queued for execution in the order in which they are created. The entire callback - * queue is processed every event loop iteration. If an immediate timer is queued - * from inside an executing callback, that timer will not be triggered until the - * next event loop iteration. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using - * `timersPromises.setImmediate()`. - * @since v0.9.1 - * @param callback The function to call at the end of this turn of - * the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout) - * @param args Optional arguments to pass when the `callback` is called. - * @returns for use with `clearImmediate()` - */ - function setImmediate( - callback: (...args: TArgs) => void, - ...args: TArgs - ): NodeJS.Immediate; - // Allow a single void-accepting argument to be optional in arguments lists. - // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258) - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setImmediate(callback: (_: void) => void): NodeJS.Immediate; - namespace setImmediate { - import __promisify__ = promises.setImmediate; - export { __promisify__ }; - } - /** - * Schedules repeated execution of `callback` every `delay` milliseconds. - * - * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be - * set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using - * `timersPromises.setInterval()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param delay The number of milliseconds to wait before calling the - * `callback`. **Default:** `1`. - * @param args Optional arguments to pass when the `callback` is called. - * @returns for use with `clearInterval()` - */ - function setInterval( - callback: (...args: TArgs) => void, - delay?: number, - ...args: TArgs - ): NodeJS.Timeout; - // Allow a single void-accepting argument to be optional in arguments lists. - // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258) - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout; - /** - * Schedules execution of a one-time `callback` after `delay` milliseconds. - * - * The `callback` will likely not be invoked in precisely `delay` milliseconds. - * Node.js makes no guarantees about the exact timing of when callbacks will fire, - * nor of their ordering. The callback will be called as close as possible to the - * time specified. - * - * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay` - * will be set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using - * `timersPromises.setTimeout()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param delay The number of milliseconds to wait before calling the - * `callback`. **Default:** `1`. - * @param args Optional arguments to pass when the `callback` is called. - * @returns for use with `clearTimeout()` - */ - function setTimeout( - callback: (...args: TArgs) => void, - delay?: number, - ...args: TArgs - ): NodeJS.Timeout; - // Allow a single void-accepting argument to be optional in arguments lists. - // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258) - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout; - namespace setTimeout { - import __promisify__ = promises.setTimeout; - export { __promisify__ }; - } - /** - * Cancels an `Immediate` object created by `setImmediate()`. - * @since v0.9.1 - * @param immediate An `Immediate` object as returned by `setImmediate()`. - */ - function clearImmediate(immediate: NodeJS.Immediate | undefined): void; - /** - * Cancels a `Timeout` object created by `setInterval()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by `setInterval()` - * or the primitive of the `Timeout` object as a string or a number. - */ - function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void; - /** - * Cancels a `Timeout` object created by `setTimeout()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by `setTimeout()` - * or the primitive of the `Timeout` object as a string or a number. - */ - function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void; - /** - * The `queueMicrotask()` method queues a microtask to invoke `callback`. If - * `callback` throws an exception, the `process` object `'uncaughtException'` - * event will be emitted. - * - * The microtask queue is managed by V8 and may be used in a similar manner to - * the `process.nextTick()` queue, which is managed by Node.js. The - * `process.nextTick()` queue is always processed before the microtask queue - * within each turn of the Node.js event loop. - * @since v11.0.0 - * @param callback Function to be queued. - */ - function queueMicrotask(callback: () => void): void; - } - import clearImmediate = globalThis.clearImmediate; - import clearInterval = globalThis.clearInterval; - import clearTimeout = globalThis.clearTimeout; - import setImmediate = globalThis.setImmediate; - import setInterval = globalThis.setInterval; - import setTimeout = globalThis.setTimeout; - export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout }; -} -declare module "node:timers" { - export * from "timers"; -} diff --git a/node_modules/@types/node/timers/promises.d.ts b/node_modules/@types/node/timers/promises.d.ts deleted file mode 100644 index 29d7ff0..0000000 --- a/node_modules/@types/node/timers/promises.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via - * `require('node:timers/promises')`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'node:timers/promises'; - * ``` - * @since v15.0.0 - * @see [source](https://github.com/nodejs/node/blob/v20.x/lib/timers/promises.js) - */ -declare module "timers/promises" { - import { TimerOptions } from "node:timers"; - /** - * ```js - * import { - * setTimeout, - * } from 'node:timers/promises'; - * - * const res = await setTimeout(100, 'result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param delay The number of milliseconds to wait before fulfilling the - * promise. **Default:** `1`. - * @param value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'node:timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * If `ref` is `true`, you need to call `next()` of async iterator explicitly - * or implicitly to keep the event loop alive. - * - * ```js - * import { - * setInterval, - * } from 'node:timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - * @param delay The number of milliseconds to wait between iterations. - * **Default:** `1`. - * @param value A value with which the iterator returns. - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): NodeJS.AsyncIterator; - interface Scheduler { - /** - * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification - * being developed as a standard Web Platform API. - * - * Calling `timersPromises.scheduler.wait(delay, options)` is roughly equivalent - * to calling `timersPromises.setTimeout(delay, undefined, options)` except that - * the `ref` option is not supported. - * - * ```js - * import { scheduler } from 'node:timers/promises'; - * - * await scheduler.wait(1000); // Wait one second before continuing - * ``` - * @since v17.3.0, v16.14.0 - * @experimental - * @param delay The number of milliseconds to wait before resolving the - * promise. - */ - wait(delay: number, options?: { signal?: AbortSignal }): Promise; - /** - * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification - * being developed as a standard Web Platform API. - * - * Calling `timersPromises.scheduler.yield()` is equivalent to calling - * `timersPromises.setImmediate()` with no arguments. - * @since v17.3.0, v16.14.0 - * @experimental - */ - yield(): Promise; - } - const scheduler: Scheduler; -} -declare module "node:timers/promises" { - export * from "timers/promises"; -} diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts deleted file mode 100644 index 0b819a1..0000000 --- a/node_modules/@types/node/tls.d.ts +++ /dev/null @@ -1,1259 +0,0 @@ -/** - * The `node:tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * import tls from 'node:tls'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/tls.js) - */ -declare module "tls" { - import { NonSharedBuffer } from "node:buffer"; - import { X509Certificate } from "node:crypto"; - import * as net from "node:net"; - import * as stream from "stream"; - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - interface PeerCertificate { - /** - * `true` if a Certificate Authority (CA), `false` otherwise. - * @since v18.13.0 - */ - ca: boolean; - /** - * The DER encoded X.509 certificate data. - */ - raw: NonSharedBuffer; - /** - * The certificate subject. - */ - subject: Certificate; - /** - * The certificate issuer, described in the same terms as the `subject`. - */ - issuer: Certificate; - /** - * The date-time the certificate is valid from. - */ - valid_from: string; - /** - * The date-time the certificate is valid to. - */ - valid_to: string; - /** - * The certificate serial number, as a hex string. - */ - serialNumber: string; - /** - * The SHA-1 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint: string; - /** - * The SHA-256 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint256: string; - /** - * The SHA-512 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint512: string; - /** - * The extended key usage, a set of OIDs. - */ - ext_key_usage?: string[]; - /** - * A string containing concatenated names for the subject, - * an alternative to the `subject` names. - */ - subjectaltname?: string; - /** - * An array describing the AuthorityInfoAccess, used with OCSP. - */ - infoAccess?: NodeJS.Dict; - /** - * For RSA keys: The RSA bit size. - * - * For EC keys: The key size in bits. - */ - bits?: number; - /** - * The RSA exponent, as a string in hexadecimal number notation. - */ - exponent?: string; - /** - * The RSA modulus, as a hexadecimal string. - */ - modulus?: string; - /** - * The public key. - */ - pubkey?: NonSharedBuffer; - /** - * The ASN.1 name of the OID of the elliptic curve. - * Well-known curves are identified by an OID. - * While it is unusual, it is possible that the curve - * is identified by its mathematical properties, - * in which case it will not have an OID. - */ - asn1Curve?: string; - /** - * The NIST name for the elliptic curve, if it has one - * (not all well-known curves have been assigned names by NIST). - */ - nistCurve?: string; - } - interface DetailedPeerCertificate extends PeerCertificate { - /** - * The issuer certificate object. - * For self-signed certificates, this may be a circular reference. - */ - issuerCertificate: DetailedPeerCertificate; - } - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions); - /** - * This property is `true` if the peer certificate was signed by one of the CAs - * specified when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: true; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * String containing the server name requested via SNI (Server Name Indication) TLS extension. - */ - servername: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example, a TLSv1.2 protocol with AES256-SHA cipher: - * - * ```json - * { - * "name": "AES256-SHA", - * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA", - * "version": "SSLv3" - * } - * ``` - * - * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The `name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. - */ - getFinished(): NonSharedBuffer | undefined; - /** - * Returns an object representing the peer's certificate. If the peer does not - * provide a certificate, an empty object will be returned. If the socket has been - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so - * far. - */ - getPeerFinished(): NonSharedBuffer | undefined; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the - * current connection. The value `'unknown'` will be returned for connected - * sockets that have not completed the handshaking process. The value `null` will - * be returned for server sockets or disconnected client sockets. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): NonSharedBuffer | undefined; - /** - * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. - * @since v12.11.0 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): NonSharedBuffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after `handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void, - ): undefined | boolean; - /** - * The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket. - * This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`. - * @since v22.5.0, v20.17.0 - * @param context An object containing at least `key` and `cert` properties from the {@link createSecureContext()} `options`, - * or a TLS context object created with {@link createSecureContext()} itself. - */ - setKeyCert(context: SecureContextOptions | SecureContext): void; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * fragments are buffered by the TLS layer until the entire fragment is received - * and its integrity is verified; large fragments can span multiple roundtrips - * and their processing can be delayed due to packet loss or reordering. However, - * smaller fragments add extra TLS framing bytes and CPU overhead, which may - * decrease overall server throughput. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by - * OpenSSL's `SSL_trace()` function, the format is undocumented, can change - * without notice, and should not be relied on. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * /* - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - addListener(event: "secureConnect", listener: () => void): this; - addListener(event: "session", listener: (session: NonSharedBuffer) => void): this; - addListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "OCSPResponse", response: NonSharedBuffer): boolean; - emit(event: "secureConnect"): boolean; - emit(event: "session", session: NonSharedBuffer): boolean; - emit(event: "keylog", line: NonSharedBuffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - on(event: "secureConnect", listener: () => void): this; - on(event: "session", listener: (session: NonSharedBuffer) => void): this; - on(event: "keylog", listener: (line: NonSharedBuffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - once(event: "secureConnect", listener: () => void): this; - once(event: "session", listener: (session: NonSharedBuffer) => void): this; - once(event: "keylog", listener: (line: NonSharedBuffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - prependListener(event: "secureConnect", listener: () => void): this; - prependListener(event: "session", listener: (session: NonSharedBuffer) => void): this; - prependListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this; - prependOnceListener(event: "secureConnect", listener: () => void): this; - prependOnceListener(event: "session", listener: (session: NonSharedBuffer) => void): this; - prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this; - } - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: NodeJS.ArrayBufferView; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created - * with {@link createSecureContext} itself. - */ - addContext(hostname: string, context: SecureContextOptions | SecureContext): void; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): NonSharedBuffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; - emit( - event: "newSession", - sessionId: NonSharedBuffer, - sessionData: NonSharedBuffer, - callback: () => void, - ): boolean; - emit( - event: "OCSPRequest", - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ): boolean; - emit( - event: "resumeSession", - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ): boolean; - emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; - emit(event: "keylog", line: NonSharedBuffer, tlsSocket: TLSSocket): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - on( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: NonSharedBuffer, - issuer: NonSharedBuffer, - callback: (err: Error | null, resp: Buffer | null) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: ( - sessionId: NonSharedBuffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this; - } - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1"; - interface SecureContextOptions { - /** - * If set, this will be called when a client opens a connection using the ALPN extension. - * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, - * respectively containing the server name from the SNI extension (if any) and an array of - * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, - * which will be returned to the client as the selected ALPN protocol, or `undefined`, - * to reject the connection with a fatal alert. If a string is returned that does not match one of - * the client's ALPN protocols, an error will be thrown. - * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. - */ - ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; - /** - * Treat intermediate (non-self-signed) - * certificates in the trust CA certificate list as trusted. - * @since v22.9.0, v20.18.0 - */ - allowPartialTrustChain?: boolean | undefined; - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. - * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. - * ECDHE-based perfect forward secrecy will still be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - */ - privateKeyEngine?: string | undefined; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - */ - privateKeyIdentifier?: string | undefined; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion | undefined; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as - * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. - * - * This function can be overwritten by providing an alternative function as the `options.checkServerIdentity` option that is passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * - * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name - * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use - * a custom `options.checkServerIdentity` function that implements the desired behavior. - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `node:cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * import tls from 'node:tls'; - * import fs from 'node:fs'; - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ], - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * import tls from 'node:tls'; - * import fs from 'node:fs'; - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect( - port: number, - host?: string, - options?: ConnectionOptions, - secureConnectListener?: () => void, - ): TLSSocket; - function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - /** - * Creates a new secure pair object with two streams, one of which reads and writes - * the encrypted data and the other of which reads and writes the cleartext data. - * Generally, the encrypted stream is piped to/from an incoming encrypted data - * stream and the cleartext one is used as a replacement for the initial encrypted - * stream. - * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and `encrypted` stream properties. - * - * Using `cleartext` has the same API as {@link TLSSocket}. - * - * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: - * - * ```js - * pair = tls.createSecurePair(// ... ); - * pair.encrypted.pipe(socket); - * socket.pipe(pair.encrypted); - * ``` - * - * can be replaced by: - * - * ```js - * secureSocket = tls.TLSSocket(socket, options); - * ``` - * - * where `secureSocket` has the same API as `pair.cleartext`. - * @since v0.3.2 - * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. - * @param context A secure context object as returned by `tls.createSecureContext()` - * @param isServer `true` to specify that this TLS connection should be opened as a server. - * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. - * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. - */ - function createSecurePair( - context?: SecureContext, - isServer?: boolean, - requestCert?: boolean, - rejectUnauthorized?: boolean, - ): SecurePair; - /** - * `{@link createServer}` sets the default value of the `honorCipherOrder` option - * to `true`, other APIs that create secure contexts leave it unset. - * - * `{@link createServer}` uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as `server.addContext()`, - * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. - * - * A key is _required_ for ciphers that use certificates. Either `key` or `pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * - * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto' `option. When set to `'auto'`, well-known DHE parameters of sufficient strength - * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can - * be used to create custom parameters. The key length must be greater than or - * equal to 1024 bits or else an error will be thrown. Although 1024 bits is - * permissible, use 2048 bits or larger for stronger security. - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * Returns an array with the names of the supported TLS ciphers. The names are - * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of `{@link createSecureContext}`. - * - * Not all supported ciphers are enabled by default. See - * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v20.x/api/tls.html#modifying-the-default-tls-cipher-suite). - * - * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for - * TLSv1.2 and below. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is `'auto'`. See `{@link createSecureContext()}` for further - * information. - * @since v0.11.13 - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the `maxVersion` option of `{@link createSecureContext()}`. - * It can be assigned any of the supported TLS protocol versions, - * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.3'`, unless - * changed using CLI options. Using `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using - * `--tls-max-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options - * are provided, the highest maximum is used. - * @since v11.4.0 - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the `minVersion` option of `{@link createSecureContext()}`. - * It can be assigned any of the supported TLS protocol versions, - * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.2'`, unless - * changed using CLI options. Using `--tls-min-v1.0` sets the default to - * `'TLSv1'`. Using `--tls-min-v1.1` sets the default to `'TLSv1.1'`. Using - * `--tls-min-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options - * are provided, the lowest minimum is used. - * @since v11.4.0 - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * The default value of the `ciphers` option of `{@link createSecureContext()}`. - * It can be assigned any of the supported OpenSSL ciphers. - * Defaults to the content of `crypto.constants.defaultCoreCipherList`, unless - * changed using CLI options using `--tls-default-ciphers`. - * @since v19.8.0 - */ - let DEFAULT_CIPHERS: string; - /** - * An immutable array of strings representing the root certificates (in PEM format) - * from the bundled Mozilla CA store as supplied by the current Node.js version. - * - * The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store - * that is fixed at release time. It is identical on all supported platforms. - * @since v12.3.0 - */ - const rootCertificates: readonly string[]; -} -declare module "node:tls" { - export * from "tls"; -} diff --git a/node_modules/@types/node/trace_events.d.ts b/node_modules/@types/node/trace_events.d.ts deleted file mode 100644 index 6d4aece..0000000 --- a/node_modules/@types/node/trace_events.d.ts +++ /dev/null @@ -1,197 +0,0 @@ -/** - * The `node:trace_events` module provides a mechanism to centralize tracing information - * generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html) trace data. - * The [`async_hooks`](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()` output. - * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.net.native`: Enables capture of trace data for network. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods. - * * `node.fs.async`: Enables capture of trace data for file system async methods. - * * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods. - * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v20.x/api/perf_hooks.html) measurements. - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing - * measures and marks. - * * `node.perf.timerify`: Enables capture of only Performance API timerify - * measurements. - * * `node.promises.rejections`: Enables capture of trace data tracking the number - * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The [V8](https://nodejs.org/docs/latest-v20.x/api/v8.html) events are GC, compiling, and execution related. - * * `node.http`: Enables capture of trace data for http request / response. - * - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled` flag to enable trace events. This requirement has been removed. However, the `--trace-events-enabled` flag _may_ still be - * used and will enable the `node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `node:trace_events` module: - * - * ```js - * import trace_events from 'node:trace_events'; - * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); - * tracing.enable(); // Enable trace event capture for the 'node.perf' category - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where `${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * To guarantee that the log file is properly generated after signal events like `SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers - * in your code, such as: - * - * ```js - * process.on('SIGINT', function onSigint() { - * console.info('Received SIGINT.'); - * process.exit(130); // Or applicable exit code depending on OS and signal - * }); - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * However the trace-event timestamps are expressed in microseconds, - * unlike `process.hrtime()` which returns nanoseconds. - * - * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html#class-worker) threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/trace_events.js) - */ -declare module "trace_events" { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - * @since v10.0.0 - */ - readonly categories: string; - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - * - * ```js - * import trace_events from 'node:trace_events'; - * const t1 = trace_events.createTracing({ categories: ['node', 'v8'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf', 'node'] }); - * t1.enable(); - * t2.enable(); - * - * // Prints 'node,node.perf,v8' - * console.log(trace_events.getEnabledCategories()); - * - * t2.disable(); // Will only disable emission of the 'node.perf' category - * - * // Prints 'node,v8' - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - disable(): void; - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - * @since v10.0.0 - */ - enable(): void; - /** - * `true` only if the `Tracing` object has been enabled. - * @since v10.0.0 - */ - readonly enabled: boolean; - } - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - /** - * Creates and returns a `Tracing` object for the given set of `categories`. - * - * ```js - * import trace_events from 'node:trace_events'; - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - */ - function createTracing(options: CreateTracingOptions): Tracing; - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is determined - * by the _union_ of all currently-enabled `Tracing` objects and any categories - * enabled using the `--trace-event-categories` flag. - * - * Given the file `test.js` below, the command `node --trace-event-categories node.perf test.js` will print `'node.async_hooks,node.perf'` to the console. - * - * ```js - * import trace_events from 'node:trace_events'; - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); - * const t3 = trace_events.createTracing({ categories: ['v8'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module "node:trace_events" { - export * from "trace_events"; -} diff --git a/node_modules/@types/node/ts5.6/buffer.buffer.d.ts b/node_modules/@types/node/ts5.6/buffer.buffer.d.ts deleted file mode 100644 index a5f67d7..0000000 --- a/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +++ /dev/null @@ -1,468 +0,0 @@ -declare module "buffer" { - global { - interface BufferConstructor { - // see ../buffer.d.ts for implementation shared with all TypeScript versions - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new(str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new(size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: ArrayLike): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new(arrayBuffer: ArrayBufferLike): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * If `array` is an `Array`-like object (that is, one with a `length` property of - * type `number`), it is treated as if it is an array, unless it is a `Buffer` or - * a `Uint8Array`. This means all other `TypedArray` variants get treated as an - * `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use - * `Buffer.copyBytesFrom()`. - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal - * `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from(array: WithImplicitCoercion>): Buffer; - /** - * This creates a view of the `ArrayBuffer` without copying the underlying - * memory. For example, when passed a reference to the `.buffer` property of a - * `TypedArray` instance, the newly created `Buffer` will share the same - * allocated memory as the `TypedArray`'s underlying `ArrayBuffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const arr = new Uint16Array(2); - * - * arr[0] = 5000; - * arr[1] = 4000; - * - * // Shares memory with `arr`. - * const buf = Buffer.from(arr.buffer); - * - * console.log(buf); - * // Prints: - * - * // Changing the original Uint16Array changes the Buffer also. - * arr[1] = 6000; - * - * console.log(buf); - * // Prints: - * ``` - * - * The optional `byteOffset` and `length` arguments specify a memory range within - * the `arrayBuffer` that will be shared by the `Buffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const ab = new ArrayBuffer(10); - * const buf = Buffer.from(ab, 0, 2); - * - * console.log(buf.length); - * // Prints: 2 - * ``` - * - * A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a - * `SharedArrayBuffer` or another type appropriate for `Buffer.from()` - * variants. - * - * It is important to remember that a backing `ArrayBuffer` can cover a range - * of memory that extends beyond the bounds of a `TypedArray` view. A new - * `Buffer` created using the `buffer` property of a `TypedArray` may extend - * beyond the range of the `TypedArray`: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements - * const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements - * console.log(arrA.buffer === arrB.buffer); // true - * - * const buf = Buffer.from(arrB.buffer); - * console.log(buf); - * // Prints: - * ``` - * @since v5.10.0 - * @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the - * `.buffer` property of a `TypedArray`. - * @param byteOffset Index of first byte to expose. **Default:** `0`. - * @param length Number of bytes to expose. **Default:** - * `arrayBuffer.byteLength - byteOffset`. - */ - from( - arrayBuffer: WithImplicitCoercion, - byteOffset?: number, - length?: number, - ): Buffer; - /** - * Creates a new `Buffer` containing `string`. The `encoding` parameter identifies - * the character encoding to be used when converting `string` into bytes. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('this is a tést'); - * const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); - * - * console.log(buf1.toString()); - * // Prints: this is a tést - * console.log(buf2.toString()); - * // Prints: this is a tést - * console.log(buf1.toString('latin1')); - * // Prints: this is a tést - * ``` - * - * A `TypeError` will be thrown if `string` is not a string or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(string)` may also use the internal `Buffer` pool like - * `Buffer.allocUnsafe()` does. - * @since v5.10.0 - * @param string A string to encode. - * @param encoding The encoding of `string`. **Default:** `'utf8'`. - */ - from(string: WithImplicitCoercion, encoding?: BufferEncoding): Buffer; - from(arrayOrString: WithImplicitCoercion | string>): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: readonly Uint8Array[], totalLength?: number): Buffer; - /** - * Copies the underlying memory of `view` into a new `Buffer`. - * - * ```js - * const u16 = new Uint16Array([0, 0xffff]); - * const buf = Buffer.copyBytesFrom(u16, 1, 1); - * u16[1] = 0; - * console.log(buf.length); // 2 - * console.log(buf[0]); // 255 - * console.log(buf[1]); // 255 - * ``` - * @since v19.8.0 - * @param view The {TypedArray} to copy. - * @param [offset=0] The starting offset within `view`. - * @param [length=view.length - offset] The number of elements from `view` to copy. - */ - copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if - * `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - } - interface Buffer extends Uint8Array { - // see ../buffer.d.ts for implementation shared with all TypeScript versions - - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * - * // With buf.slice(), the original buffer is modified. - * const notReallyCopiedBuf = buf.slice(); - * notReallyCopiedBuf[0]++; - * console.log(notReallyCopiedBuf.toString()); - * // Prints: cuffer - * console.log(buf.toString()); - * // Also prints: cuffer (!) - * ``` - * @since v0.3.0 - * @deprecated Use `subarray` instead. - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - } - /** - * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports - * TypeScript versions earlier than 5.7. - */ - type NonSharedBuffer = Buffer; - /** - * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports - * TypeScript versions earlier than 5.7. - */ - type AllowSharedBuffer = Buffer; - } - /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */ - var SlowBuffer: { - /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */ - new(size: number): Buffer; - prototype: Buffer; - }; -} diff --git a/node_modules/@types/node/ts5.6/globals.typedarray.d.ts b/node_modules/@types/node/ts5.6/globals.typedarray.d.ts deleted file mode 100644 index f1c444d..0000000 --- a/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -export {}; // Make this a module - -declare global { - namespace NodeJS { - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - type NonSharedUint8Array = Uint8Array; - type NonSharedUint8ClampedArray = Uint8ClampedArray; - type NonSharedUint16Array = Uint16Array; - type NonSharedUint32Array = Uint32Array; - type NonSharedInt8Array = Int8Array; - type NonSharedInt16Array = Int16Array; - type NonSharedInt32Array = Int32Array; - type NonSharedBigUint64Array = BigUint64Array; - type NonSharedBigInt64Array = BigInt64Array; - type NonSharedFloat32Array = Float32Array; - type NonSharedFloat64Array = Float64Array; - type NonSharedDataView = DataView; - type NonSharedTypedArray = TypedArray; - type NonSharedArrayBufferView = ArrayBufferView; - } -} diff --git a/node_modules/@types/node/ts5.6/index.d.ts b/node_modules/@types/node/ts5.6/index.d.ts deleted file mode 100644 index 291308f..0000000 --- a/node_modules/@types/node/ts5.6/index.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6. - -// Reference required TypeScript libs: -/// - -// TypeScript backwards-compatibility definitions: -/// - -// Definitions specific to TypeScript 4.9 through 5.6: -/// -/// - -// Definitions for Node.js modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// diff --git a/node_modules/@types/node/tty.d.ts b/node_modules/@types/node/tty.d.ts deleted file mode 100644 index d4b9313..0000000 --- a/node_modules/@types/node/tty.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -/** - * The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. In most cases, it will not be necessary or possible to use this module - * directly. However, it can be accessed using: - * - * ```js - * import tty from 'node:tty'; - * ``` - * - * When Node.js detects that it is being run with a text terminal ("TTY") - * attached, `process.stdin` will, by default, be initialized as an instance of `tty.ReadStream` and both `process.stdout` and `process.stderr` will, by - * default, be instances of `tty.WriteStream`. The preferred method of determining - * whether Node.js is being run within a TTY context is to check that the value of - * the `process.stdout.isTTY` property is `true`: - * - * ```console - * $ node -p -e "Boolean(process.stdout.isTTY)" - * true - * $ node -p -e "Boolean(process.stdout.isTTY)" | cat - * false - * ``` - * - * In most cases, there should be little to no reason for an application to - * manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes. - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/tty.js) - */ -declare module "tty" { - import * as net from "node:net"; - /** - * The `tty.isatty()` method returns `true` if the given `fd` is associated with - * a TTY and `false` if it is not, including whenever `fd` is not a non-negative - * integer. - * @since v0.5.8 - * @param fd A numeric file descriptor - */ - function isatty(fd: number): boolean; - /** - * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js - * process and there should be no reason to create additional instances. - * @since v0.5.8 - */ - class ReadStream extends net.Socket { - constructor(fd: number, options?: net.SocketConstructorOpts); - /** - * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. - * - * This flag is always `false` when a process starts, even if the terminal is - * operating in raw mode. Its value will change with subsequent calls to `setRawMode`. - * @since v0.7.7 - */ - isRaw: boolean; - /** - * Allows configuration of `tty.ReadStream` so that it operates as a raw device. - * - * When in raw mode, input is always available character-by-character, not - * including modifiers. Additionally, all special processing of characters by the - * terminal is disabled, including echoing input - * characters. Ctrl+C will no longer cause a `SIGINT` when - * in this mode. - * @since v0.7.7 - * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` - * property will be set to the resulting mode. - * @return The read stream instance. - */ - setRawMode(mode: boolean): this; - /** - * A `boolean` that is always `true` for `tty.ReadStream` instances. - * @since v0.5.8 - */ - isTTY: boolean; - } - /** - * -1 - to the left from cursor - * 0 - the entire line - * 1 - to the right from cursor - */ - type Direction = -1 | 0 | 1; - /** - * Represents the writable side of a TTY. In normal circumstances, `process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there - * should be no reason to create additional instances. - * @since v0.5.8 - */ - class WriteStream extends net.Socket { - constructor(fd: number); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "resize", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "resize"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "resize", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "resize", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "resize", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "resize", listener: () => void): this; - /** - * `writeStream.clearLine()` clears the current line of this `WriteStream` in a - * direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearLine(dir: Direction, callback?: () => void): boolean; - /** - * `writeStream.clearScreenDown()` clears this `WriteStream` from the current - * cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearScreenDown(callback?: () => void): boolean; - /** - * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified - * position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - cursorTo(x: number, y?: number, callback?: () => void): boolean; - cursorTo(x: number, callback: () => void): boolean; - /** - * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its - * current position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - moveCursor(dx: number, dy: number, callback?: () => void): boolean; - /** - * Returns: - * - * * `1` for 2, - * * `4` for 16, - * * `8` for 256, - * * `24` for 16,777,216 colors supported. - * - * Use this to determine what colors the terminal supports. Due to the nature of - * colors in terminals it is possible to either have false positives or false - * negatives. It depends on process information and the environment variables that - * may lie about what terminal is used. - * It is possible to pass in an `env` object to simulate the usage of a specific - * terminal. This can be useful to check how specific environment settings behave. - * - * To enforce a specific color support, use one of the below environment settings. - * - * * 2 colors: `FORCE_COLOR = 0` (Disables colors) - * * 16 colors: `FORCE_COLOR = 1` - * * 256 colors: `FORCE_COLOR = 2` - * * 16,777,216 colors: `FORCE_COLOR = 3` - * - * Disabling color support is also possible by using the `NO_COLOR` and `NODE_DISABLE_COLORS` environment variables. - * @since v9.9.0 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - getColorDepth(env?: object): number; - /** - * Returns `true` if the `writeStream` supports at least as many colors as provided - * in `count`. Minimum support is 2 (black and white). - * - * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. - * - * ```js - * process.stdout.hasColors(); - * // Returns true or false depending on if `stdout` supports at least 16 colors. - * process.stdout.hasColors(256); - * // Returns true or false depending on if `stdout` supports at least 256 colors. - * process.stdout.hasColors({ TMUX: '1' }); - * // Returns true. - * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); - * // Returns false (the environment setting pretends to support 2 ** 8 colors). - * ``` - * @since v11.13.0, v10.16.0 - * @param [count=16] The number of colors that are requested (minimum 2). - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - hasColors(count?: number): boolean; - hasColors(env?: object): boolean; - hasColors(count: number, env?: object): boolean; - /** - * `writeStream.getWindowSize()` returns the size of the TTY - * corresponding to this `WriteStream`. The array is of the type `[numColumns, numRows]` where `numColumns` and `numRows` represent the number - * of columns and rows in the corresponding TTY. - * @since v0.7.7 - */ - getWindowSize(): [number, number]; - /** - * A `number` specifying the number of columns the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - columns: number; - /** - * A `number` specifying the number of rows the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - rows: number; - /** - * A `boolean` that is always `true`. - * @since v0.5.8 - */ - isTTY: boolean; - } -} -declare module "node:tty" { - export * from "tty"; -} diff --git a/node_modules/@types/node/url.d.ts b/node_modules/@types/node/url.d.ts deleted file mode 100644 index 4d83629..0000000 --- a/node_modules/@types/node/url.d.ts +++ /dev/null @@ -1,964 +0,0 @@ -/** - * The `node:url` module provides utilities for URL resolution and parsing. It can - * be accessed using: - * - * ```js - * import url from 'node:url'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/url.js) - */ -declare module "url" { - import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer"; - import { ClientRequestArgs } from "node:http"; - import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring"; - // Input to `url.format` - interface UrlObject { - auth?: string | null | undefined; - hash?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - href?: string | null | undefined; - pathname?: string | null | undefined; - protocol?: string | null | undefined; - search?: string | null | undefined; - slashes?: boolean | null | undefined; - port?: string | number | null | undefined; - query?: string | null | ParsedUrlQueryInput | undefined; - } - // Output of `url.parse` - interface Url { - auth: string | null; - hash: string | null; - host: string | null; - hostname: string | null; - href: string; - path: string | null; - pathname: string | null; - protocol: string | null; - search: string | null; - slashes: boolean | null; - port: string | null; - query: string | null | ParsedUrlQuery; - } - interface UrlWithParsedQuery extends Url { - query: ParsedUrlQuery; - } - interface UrlWithStringQuery extends Url { - query: string | null; - } - interface FileUrlToPathOptions { - /** - * `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default. - * @default undefined - */ - windows?: boolean | undefined; - } - interface PathToFileUrlOptions extends FileUrlToPathOptions {} - /** - * The `url.parse()` method takes a URL string, parses it, and returns a URL - * object. - * - * A `TypeError` is thrown if `urlString` is not a string. - * - * A `URIError` is thrown if the `auth` property is present but cannot be decoded. - * - * `url.parse()` uses a lenient, non-standard algorithm for parsing URL - * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted - * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead. - * @since v0.1.25 - * @deprecated Use the WHATWG URL API instead. - * @param urlString The URL string to parse. - * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property - * on the returned URL object will be an unparsed, undecoded string. - * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the - * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. - */ - function parse(urlString: string): UrlWithStringQuery; - function parse( - urlString: string, - parseQueryString: false | undefined, - slashesDenoteHost?: boolean, - ): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; - function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; - /** - * The `url.format()` method returns a formatted URL string derived from `urlObject`. - * - * ```js - * import url from 'node:url'; - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json', - * }, - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//` will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`; - * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string - * and appended to `result` followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to `result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the - * `querystring` module's `stringify()` method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search` _does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: URL, options?: URLFormatOptions): string; - /** - * The `url.format()` method returns a formatted URL string derived from `urlObject`. - * - * ```js - * import url from 'node:url'; - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json', - * }, - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//` will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`; - * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string - * and appended to `result` followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to `result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the - * `querystring` module's `stringify()` method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search` _does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: UrlObject | string): string; - /** - * The `url.resolve()` method resolves a target URL relative to a base URL in a - * manner similar to that of a web browser resolving an anchor tag. - * - * ```js - * import url from 'node:url'; - * url.resolve('/one/two/three', 'four'); // '/one/two/four' - * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' - * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * - * To achieve the same result using the WHATWG URL API: - * - * ```js - * function resolve(from, to) { - * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); - * if (resolvedUrl.protocol === 'resolve:') { - * // `from` is a relative URL. - * const { pathname, search, hash } = resolvedUrl; - * return pathname + search + hash; - * } - * return resolvedUrl.toString(); - * } - * - * resolve('/one/two/three', 'four'); // '/one/two/four' - * resolve('http://example.com/', '/one'); // 'http://example.com/one' - * resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param from The base URL to use if `to` is a relative URL. - * @param to The target URL to resolve. - */ - function resolve(from: string, to: string): string; - /** - * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an - * invalid domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToUnicode}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToASCII('español.com')); - * // Prints xn--espaol-zwa.com - * console.log(url.domainToASCII('中文.com')); - * // Prints xn--fiq228c.com - * console.log(url.domainToASCII('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToASCII(domain: string): string; - /** - * Returns the Unicode serialization of the `domain`. If `domain` is an invalid - * domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToASCII}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToUnicode('xn--espaol-zwa.com')); - * // Prints español.com - * console.log(url.domainToUnicode('xn--fiq228c.com')); - * // Prints 中文.com - * console.log(url.domainToUnicode('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToUnicode(domain: string): string; - /** - * This function ensures the correct decodings of percent-encoded characters as - * well as ensuring a cross-platform valid absolute path string. - * - * ```js - * import { fileURLToPath } from 'node:url'; - * - * const __filename = fileURLToPath(import.meta.url); - * - * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ - * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) - * - * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt - * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) - * - * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt - * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) - * - * new URL('file:///hello world').pathname; // Incorrect: /hello%20world - * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) - * ``` - * @since v10.12.0 - * @param url The file URL string or URL object to convert to a path. - * @return The fully-resolved platform-specific Node.js file path. - */ - function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string; - /** - * This function ensures that `path` is resolved absolutely, and that the URL - * control characters are correctly encoded when converting into a File URL. - * - * ```js - * import { pathToFileURL } from 'node:url'; - * - * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 - * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) - * - * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c - * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) - * ``` - * @since v10.12.0 - * @param path The path to convert to a File URL. - * @return The file URL object. - */ - function pathToFileURL(path: string, options?: PathToFileUrlOptions): URL; - /** - * This utility function converts a URL object into an ordinary options object as - * expected by the `http.request()` and `https.request()` APIs. - * - * ```js - * import { urlToHttpOptions } from 'node:url'; - * const myURL = new URL('https://a:b@測試?abc#foo'); - * - * console.log(urlToHttpOptions(myURL)); - * /* - * { - * protocol: 'https:', - * hostname: 'xn--g6w251d', - * hash: '#foo', - * search: '?abc', - * pathname: '/', - * path: '/?abc', - * href: 'https://a:b@xn--g6w251d/?abc#foo', - * auth: 'a:b' - * } - * - * ``` - * @since v15.7.0, v14.18.0 - * @param url The `WHATWG URL` object to convert to an options object. - * @return Options object - */ - function urlToHttpOptions(url: URL): ClientRequestArgs; - interface URLFormatOptions { - /** - * `true` if the serialized URL string should include the username and password, `false` otherwise. - * @default true - */ - auth?: boolean | undefined; - /** - * `true` if the serialized URL string should include the fragment, `false` otherwise. - * @default true - */ - fragment?: boolean | undefined; - /** - * `true` if the serialized URL string should include the search query, `false` otherwise. - * @default true - */ - search?: boolean | undefined; - /** - * `true` if Unicode characters appearing in the host component of the URL string should be encoded directly as opposed to - * being Punycode encoded. - * @default false - */ - unicode?: boolean | undefined; - } - /** - * Browser-compatible `URL` class, implemented by following the WHATWG URL - * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. - * The `URL` class is also available on the global object. - * - * In accordance with browser conventions, all properties of `URL` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. Thus, unlike `legacy urlObject`s, - * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still - * return `true`. - * @since v7.0.0, v6.13.0 - */ - class URL { - /** - * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. - * - * ```js - * import { - * Blob, - * resolveObjectURL, - * } from 'node:buffer'; - * - * const blob = new Blob(['hello']); - * const id = URL.createObjectURL(blob); - * - * // later... - * - * const otherBlob = resolveObjectURL(id); - * console.log(otherBlob.size); - * ``` - * - * The data stored by the registered `Blob` will be retained in memory until `URL.revokeObjectURL()` is called to remove it. - * - * `Blob` objects are registered within the current thread. If using Worker - * Threads, `Blob` objects registered within one Worker will not be available - * to other workers or the main thread. - * @since v16.7.0 - * @experimental - */ - static createObjectURL(blob: NodeBlob): string; - /** - * Removes the stored `Blob` identified by the given ID. Attempting to revoke a - * ID that isn't registered will silently fail. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - static revokeObjectURL(id: string): void; - /** - * Checks if an `input` relative to the `base` can be parsed to a `URL`. - * - * ```js - * const isValid = URL.canParse('/foo', 'https://example.org/'); // true - * - * const isNotValid = URL.canParse('/foo'); // false - * ``` - * @since v19.9.0 - * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is - * `converted to a string` first. - * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first. - */ - static canParse(input: string, base?: string): boolean; - /** - * Parses a string as a URL. If `base` is provided, it will be used as the base URL for the purpose of resolving non-absolute `input` URLs. - * Returns `null` if `input` is not a valid. - * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is - * `converted to a string` first. - * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first. - * @since v20.18.0 - */ - static parse(input: string, base?: string): URL | null; - constructor(input: string | { toString: () => string }, base?: string | URL); - /** - * Gets and sets the fragment portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/foo#bar'); - * console.log(myURL.hash); - * // Prints #bar - * - * myURL.hash = 'baz'; - * console.log(myURL.href); - * // Prints https://example.org/foo#baz - * ``` - * - * Invalid URL characters included in the value assigned to the `hash` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - hash: string; - /** - * Gets and sets the host portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.host); - * // Prints example.org:81 - * - * myURL.host = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:82/foo - * ``` - * - * Invalid host values assigned to the `host` property are ignored. - */ - host: string; - /** - * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the - * port. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.hostname); - * // Prints example.org - * - * // Setting the hostname does not change the port - * myURL.hostname = 'example.com'; - * console.log(myURL.href); - * // Prints https://example.com:81/foo - * - * // Use myURL.host to change the hostname and port - * myURL.host = 'example.org:82'; - * console.log(myURL.href); - * // Prints https://example.org:82/foo - * ``` - * - * Invalid host name values assigned to the `hostname` property are ignored. - */ - hostname: string; - /** - * Gets and sets the serialized URL. - * - * ```js - * const myURL = new URL('https://example.org/foo'); - * console.log(myURL.href); - * // Prints https://example.org/foo - * - * myURL.href = 'https://example.com/bar'; - * console.log(myURL.href); - * // Prints https://example.com/bar - * ``` - * - * Getting the value of the `href` property is equivalent to calling {@link toString}. - * - * Setting the value of this property to a new value is equivalent to creating a - * new `URL` object using `new URL(value)`. Each of the `URL` object's properties will be modified. - * - * If the value assigned to the `href` property is not a valid URL, a `TypeError` will be thrown. - */ - href: string; - /** - * Gets the read-only serialization of the URL's origin. - * - * ```js - * const myURL = new URL('https://example.org/foo/bar?baz'); - * console.log(myURL.origin); - * // Prints https://example.org - * ``` - * - * ```js - * const idnURL = new URL('https://測試'); - * console.log(idnURL.origin); - * // Prints https://xn--g6w251d - * - * console.log(idnURL.hostname); - * // Prints xn--g6w251d - * ``` - */ - readonly origin: string; - /** - * Gets and sets the password portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.password); - * // Prints xyz - * - * myURL.password = '123'; - * console.log(myURL.href); - * // Prints https://abc:123@example.com/ - * ``` - * - * Invalid URL characters included in the value assigned to the `password` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - password: string; - /** - * Gets and sets the path portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc/xyz?123'); - * console.log(myURL.pathname); - * // Prints /abc/xyz - * - * myURL.pathname = '/abcdef'; - * console.log(myURL.href); - * // Prints https://example.org/abcdef?123 - * ``` - * - * Invalid URL characters included in the value assigned to the `pathname` property are `percent-encoded`. The selection of which characters - * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - pathname: string; - /** - * Gets and sets the port portion of the URL. - * - * The port value may be a number or a string containing a number in the range `0` to `65535` (inclusive). Setting the value to the default port of the `URL` objects given `protocol` will - * result in the `port` value becoming - * the empty string (`''`). - * - * The port value can be an empty string in which case the port depends on - * the protocol/scheme: - * - * - * - * Upon assigning a value to the port, the value will first be converted to a - * string using `.toString()`. - * - * If that string is invalid but it begins with a number, the leading number is - * assigned to `port`. - * If the number lies outside the range denoted above, it is ignored. - * - * ```js - * const myURL = new URL('https://example.org:8888'); - * console.log(myURL.port); - * // Prints 8888 - * - * // Default ports are automatically transformed to the empty string - * // (HTTPS protocol's default port is 443) - * myURL.port = '443'; - * console.log(myURL.port); - * // Prints the empty string - * console.log(myURL.href); - * // Prints https://example.org/ - * - * myURL.port = 1234; - * console.log(myURL.port); - * // Prints 1234 - * console.log(myURL.href); - * // Prints https://example.org:1234/ - * - * // Completely invalid port strings are ignored - * myURL.port = 'abcd'; - * console.log(myURL.port); - * // Prints 1234 - * - * // Leading numbers are treated as a port number - * myURL.port = '5678abcd'; - * console.log(myURL.port); - * // Prints 5678 - * - * // Non-integers are truncated - * myURL.port = 1234.5678; - * console.log(myURL.port); - * // Prints 1234 - * - * // Out-of-range numbers which are not represented in scientific notation - * // will be ignored. - * myURL.port = 1e10; // 10000000000, will be range-checked as described below - * console.log(myURL.port); - * // Prints 1234 - * ``` - * - * Numbers which contain a decimal point, - * such as floating-point numbers or numbers in scientific notation, - * are not an exception to this rule. - * Leading numbers up to the decimal point will be set as the URL's port, - * assuming they are valid: - * - * ```js - * myURL.port = 4.567e21; - * console.log(myURL.port); - * // Prints 4 (because it is the leading number in the string '4.567e21') - * ``` - */ - port: string; - /** - * Gets and sets the protocol portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org'); - * console.log(myURL.protocol); - * // Prints https: - * - * myURL.protocol = 'ftp'; - * console.log(myURL.href); - * // Prints ftp://example.org/ - * ``` - * - * Invalid URL protocol values assigned to the `protocol` property are ignored. - */ - protocol: string; - /** - * Gets and sets the serialized query portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc?123'); - * console.log(myURL.search); - * // Prints ?123 - * - * myURL.search = 'abc=xyz'; - * console.log(myURL.href); - * // Prints https://example.org/abc?abc=xyz - * ``` - * - * Any invalid URL characters appearing in the value assigned the `search` property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - search: string; - /** - * Gets the `URLSearchParams` object representing the query parameters of the - * URL. This property is read-only but the `URLSearchParams` object it provides - * can be used to mutate the URL instance; to replace the entirety of query - * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. - * - * Use care when using `.searchParams` to modify the `URL` because, - * per the WHATWG specification, the `URLSearchParams` object uses - * different rules to determine which characters to percent-encode. For - * instance, the `URL` object will not percent encode the ASCII tilde (`~`) - * character, while `URLSearchParams` will always encode it: - * - * ```js - * const myURL = new URL('https://example.org/abc?foo=~bar'); - * - * console.log(myURL.search); // prints ?foo=~bar - * - * // Modify the URL via searchParams... - * myURL.searchParams.sort(); - * - * console.log(myURL.search); // prints ?foo=%7Ebar - * ``` - */ - readonly searchParams: URLSearchParams; - /** - * Gets and sets the username portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.username); - * // Prints abc - * - * myURL.username = '123'; - * console.log(myURL.href); - * // Prints https://123:xyz@example.com/ - * ``` - * - * Any invalid URL characters appearing in the value assigned the `username` property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - username: string; - /** - * The `toString()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toJSON}. - */ - toString(): string; - /** - * The `toJSON()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toString}. - * - * This method is automatically called when an `URL` object is serialized - * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). - * - * ```js - * const myURLs = [ - * new URL('https://www.example.com'), - * new URL('https://test.example.org'), - * ]; - * console.log(JSON.stringify(myURLs)); - * // Prints ["https://www.example.com/","https://test.example.org/"] - * ``` - */ - toJSON(): string; - } - interface URLSearchParamsIterator extends NodeJS.Iterator { - [Symbol.iterator](): URLSearchParamsIterator; - } - /** - * The `URLSearchParams` API provides read and write access to the query of a `URL`. The `URLSearchParams` class can also be used standalone with one of the - * four following constructors. - * The `URLSearchParams` class is also available on the global object. - * - * The WHATWG `URLSearchParams` interface and the `querystring` module have - * similar purpose, but the purpose of the `querystring` module is more - * general, as it allows the customization of delimiter characters (`&` and `=`). - * On the other hand, this API is designed purely for URL query strings. - * - * ```js - * const myURL = new URL('https://example.org/?abc=123'); - * console.log(myURL.searchParams.get('abc')); - * // Prints 123 - * - * myURL.searchParams.append('abc', 'xyz'); - * console.log(myURL.href); - * // Prints https://example.org/?abc=123&abc=xyz - * - * myURL.searchParams.delete('abc'); - * myURL.searchParams.set('a', 'b'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * - * const newSearchParams = new URLSearchParams(myURL.searchParams); - * // The above is equivalent to - * // const newSearchParams = new URLSearchParams(myURL.search); - * - * newSearchParams.append('a', 'c'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * console.log(newSearchParams.toString()); - * // Prints a=b&a=c - * - * // newSearchParams.toString() is implicitly called - * myURL.search = newSearchParams; - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * newSearchParams.delete('a'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * ``` - * @since v7.5.0, v6.13.0 - */ - class URLSearchParams implements Iterable<[string, string]> { - constructor( - init?: - | URLSearchParams - | string - | Record - | Iterable<[string, string]> - | ReadonlyArray<[string, string]>, - ); - /** - * Append a new name-value pair to the query string. - */ - append(name: string, value: string): void; - /** - * If `value` is provided, removes all name-value pairs - * where name is `name` and value is `value`. - * - * If `value` is not provided, removes all name-value pairs whose name is `name`. - */ - delete(name: string, value?: string): void; - /** - * Returns an ES6 `Iterator` over each of the name-value pairs in the query. - * Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`. - * - * Alias for `urlSearchParams[@@iterator]()`. - */ - entries(): URLSearchParamsIterator<[string, string]>; - /** - * Iterates over each name-value pair in the query and invokes the given function. - * - * ```js - * const myURL = new URL('https://example.org/?a=b&c=d'); - * myURL.searchParams.forEach((value, name, searchParams) => { - * console.log(name, value, myURL.searchParams === searchParams); - * }); - * // Prints: - * // a b true - * // c d true - * ``` - * @param fn Invoked for each name-value pair in the query - * @param thisArg To be used as `this` value for when `fn` is called - */ - forEach( - fn: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, - thisArg?: TThis, - ): void; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns the values of all name-value pairs whose name is `name`. If there are - * no such pairs, an empty array is returned. - */ - getAll(name: string): string[]; - /** - * Checks if the `URLSearchParams` object contains key-value pair(s) based on `name` and an optional `value` argument. - * - * If `value` is provided, returns `true` when name-value pair with - * same `name` and `value` exists. - * - * If `value` is not provided, returns `true` if there is at least one name-value - * pair whose name is `name`. - */ - has(name: string, value?: string): boolean; - /** - * Returns an ES6 `Iterator` over the names of each name-value pair. - * - * ```js - * const params = new URLSearchParams('foo=bar&foo=baz'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // foo - * ``` - */ - keys(): URLSearchParamsIterator; - /** - * Sets the value in the `URLSearchParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value` and remove all others. If not, - * append the name-value pair to the query string. - * - * ```js - * const params = new URLSearchParams(); - * params.append('foo', 'bar'); - * params.append('foo', 'baz'); - * params.append('abc', 'def'); - * console.log(params.toString()); - * // Prints foo=bar&foo=baz&abc=def - * - * params.set('foo', 'def'); - * params.set('xyz', 'opq'); - * console.log(params.toString()); - * // Prints foo=def&abc=def&xyz=opq - * ``` - */ - set(name: string, value: string): void; - /** - * The total number of parameter entries. - * @since v19.8.0 - */ - readonly size: number; - /** - * Sort all existing name-value pairs in-place by their names. Sorting is done - * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs - * with the same name is preserved. - * - * This method can be used, in particular, to increase cache hits. - * - * ```js - * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); - * params.sort(); - * console.log(params.toString()); - * // Prints query%5B%5D=abc&query%5B%5D=123&type=search - * ``` - * @since v7.7.0, v6.13.0 - */ - sort(): void; - /** - * Returns the search parameters serialized as a string, with characters - * percent-encoded where necessary. - */ - toString(): string; - /** - * Returns an ES6 `Iterator` over the values of each name-value pair. - */ - values(): URLSearchParamsIterator; - [Symbol.iterator](): URLSearchParamsIterator<[string, string]>; - } - import { URL as _URL, URLSearchParams as _URLSearchParams } from "url"; - global { - interface URLSearchParams extends _URLSearchParams {} - interface URL extends _URL {} - interface Global { - URL: typeof _URL; - URLSearchParams: typeof _URLSearchParams; - } - /** - * `URL` class is a global reference for `import { URL } from 'node:url'` - * https://nodejs.org/api/url.html#the-whatwg-url-api - * @since v10.0.0 - */ - var URL: typeof globalThis extends { - onmessage: any; - URL: infer T; - } ? T - : typeof _URL; - /** - * `URLSearchParams` class is a global reference for `import { URLSearchParams } from 'node:url'` - * https://nodejs.org/api/url.html#class-urlsearchparams - * @since v10.0.0 - */ - var URLSearchParams: typeof globalThis extends { - onmessage: any; - URLSearchParams: infer T; - } ? T - : typeof _URLSearchParams; - } -} -declare module "node:url" { - export * from "url"; -} diff --git a/node_modules/@types/node/util.d.ts b/node_modules/@types/node/util.d.ts deleted file mode 100644 index e5e2cb6..0000000 --- a/node_modules/@types/node/util.d.ts +++ /dev/null @@ -1,2331 +0,0 @@ -/** - * The `node:util` module supports the needs of Node.js internal APIs. Many of the - * utilities are useful for application and module developers as well. To access - * it: - * - * ```js - * import util from 'node:util'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/util.js) - */ -declare module "util" { - import * as types from "node:util/types"; - export interface InspectOptions { - /** - * If `true`, object's non-enumerable symbols and properties are included in the formatted result. - * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties). - * @default false - */ - showHidden?: boolean | undefined; - /** - * Specifies the number of times to recurse while formatting object. - * This is useful for inspecting large objects. - * To recurse up to the maximum call stack size pass `Infinity` or `null`. - * @default 2 - */ - depth?: number | null | undefined; - /** - * If `true`, the output is styled with ANSI color codes. Colors are customizable. - */ - colors?: boolean | undefined; - /** - * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked. - * @default true - */ - customInspect?: boolean | undefined; - /** - * If `true`, `Proxy` inspection includes the target and handler objects. - * @default false - */ - showProxy?: boolean | undefined; - /** - * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements - * to include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no elements. - * @default 100 - */ - maxArrayLength?: number | null | undefined; - /** - * Specifies the maximum number of characters to - * include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no characters. - * @default 10000 - */ - maxStringLength?: number | null | undefined; - /** - * The length at which input values are split across multiple lines. - * Set to `Infinity` to format the input as a single line - * (in combination with `compact` set to `true` or any number >= `1`). - * @default 80 - */ - breakLength?: number | undefined; - /** - * Setting this to `false` causes each object key - * to be displayed on a new line. It will also add new lines to text that is - * longer than `breakLength`. If set to a number, the most `n` inner elements - * are united on a single line as long as all properties fit into - * `breakLength`. Short array elements are also grouped together. Note that no - * text will be reduced below 16 characters, no matter the `breakLength` size. - * For more information, see the example below. - * @default true - */ - compact?: boolean | number | undefined; - /** - * If set to `true` or a function, all properties of an object, and `Set` and `Map` - * entries are sorted in the resulting string. - * If set to `true` the default sort is used. - * If set to a function, it is used as a compare function. - */ - sorted?: boolean | ((a: string, b: string) => number) | undefined; - /** - * If set to `true`, getters are going to be - * inspected as well. If set to `'get'` only getters without setter are going - * to be inspected. If set to `'set'` only getters having a corresponding - * setter are going to be inspected. This might cause side effects depending on - * the getter function. - * @default false - */ - getters?: "get" | "set" | boolean | undefined; - /** - * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers. - * @default false - */ - numericSeparator?: boolean | undefined; - } - export type Style = - | "special" - | "number" - | "bigint" - | "boolean" - | "undefined" - | "null" - | "string" - | "symbol" - | "date" - | "regexp" - | "module"; - export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect - export interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; - } - /** - * The `util.format()` method returns a formatted string using the first argument - * as a `printf`-like format string which can contain zero or more format - * specifiers. Each specifier is replaced with the converted value from the - * corresponding argument. Supported specifiers are: - * - * If a specifier does not have a corresponding argument, it is not replaced: - * - * ```js - * util.format('%s:%s', 'foo'); - * // Returns: 'foo:%s' - * ``` - * - * Values that are not part of the format string are formatted using `util.inspect()` if their type is not `string`. - * - * If there are more arguments passed to the `util.format()` method than the - * number of specifiers, the extra arguments are concatenated to the returned - * string, separated by spaces: - * - * ```js - * util.format('%s:%s', 'foo', 'bar', 'baz'); - * // Returns: 'foo:bar baz' - * ``` - * - * If the first argument does not contain a valid format specifier, `util.format()` returns a string that is the concatenation of all arguments separated by spaces: - * - * ```js - * util.format(1, 2, 3); - * // Returns: '1 2 3' - * ``` - * - * If only one argument is passed to `util.format()`, it is returned as it is - * without any formatting: - * - * ```js - * util.format('%% %s'); - * // Returns: '%% %s' - * ``` - * - * `util.format()` is a synchronous method that is intended as a debugging tool. - * Some input values can have a significant performance overhead that can block the - * event loop. Use this function with care and never in a hot code path. - * @since v0.5.3 - * @param format A `printf`-like format string. - */ - export function format(format?: any, ...param: any[]): string; - /** - * This function is identical to {@link format}, except in that it takes - * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. - * - * ```js - * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); - * // Returns 'See object { foo: 42 }', where `42` is colored as a number - * // when printed to a terminal. - * ``` - * @since v10.0.0 - */ - export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; - /** - * Returns the string name for a numeric error code that comes from a Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const name = util.getSystemErrorName(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v9.7.0 - */ - export function getSystemErrorName(err: number): string; - /** - * Returns a Map of all system error codes available from the Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const errorMap = util.getSystemErrorMap(); - * const name = errorMap.get(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v16.0.0, v14.17.0 - */ - export function getSystemErrorMap(): Map; - /** - * The `util.log()` method prints the given `string` to `stdout` with an included - * timestamp. - * - * ```js - * import util from 'node:util'; - * - * util.log('Timestamped message.'); - * ``` - * @since v0.3.0 - * @deprecated Since v6.0.0 - Use a third party module instead. - */ - export function log(string: string): void; - /** - * Returns the `string` after replacing any surrogate code points - * (or equivalently, any unpaired surrogate code units) with the - * Unicode "replacement character" U+FFFD. - * @since v16.8.0, v14.18.0 - */ - export function toUSVString(string: string): string; - /** - * Creates and returns an `AbortController` instance whose `AbortSignal` is marked - * as transferable and can be used with `structuredClone()` or `postMessage()`. - * @since v18.11.0 - * @experimental - * @returns A transferable AbortController - */ - export function transferableAbortController(): AbortController; - /** - * Marks the given `AbortSignal` as transferable so that it can be used with`structuredClone()` and `postMessage()`. - * - * ```js - * const signal = transferableAbortSignal(AbortSignal.timeout(100)); - * const channel = new MessageChannel(); - * channel.port2.postMessage(signal, [signal]); - * ``` - * @since v18.11.0 - * @experimental - * @param signal The AbortSignal - * @returns The same AbortSignal - */ - export function transferableAbortSignal(signal: AbortSignal): AbortSignal; - /** - * Listens to abort event on the provided `signal` and - * returns a promise that is fulfilled when the `signal` is - * aborted. If the passed `resource` is garbage collected before the `signal` is - * aborted, the returned promise shall remain pending indefinitely. - * - * ```js - * import { aborted } from 'node:util'; - * - * const dependent = obtainSomethingAbortable(); - * - * aborted(dependent.signal, dependent).then(() => { - * // Do something when dependent is aborted. - * }); - * - * dependent.on('event', () => { - * dependent.abort(); - * }); - * ``` - * @since v19.7.0 - * @experimental - * @param resource Any non-null entity, reference to which is held weakly. - */ - export function aborted(signal: AbortSignal, resource: any): Promise; - /** - * The `util.inspect()` method returns a string representation of `object` that is - * intended for debugging. The output of `util.inspect` may change at any time - * and should not be depended upon programmatically. Additional `options` may be - * passed that alter the result. `util.inspect()` will use the constructor's name and/or `@@toStringTag` to make - * an identifiable tag for an inspected value. - * - * ```js - * class Foo { - * get [Symbol.toStringTag]() { - * return 'bar'; - * } - * } - * - * class Bar {} - * - * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); - * - * util.inspect(new Foo()); // 'Foo [bar] {}' - * util.inspect(new Bar()); // 'Bar {}' - * util.inspect(baz); // '[foo] {}' - * ``` - * - * Circular references point to their anchor by using a reference index: - * - * ```js - * import { inspect } from 'node:util'; - * - * const obj = {}; - * obj.a = [obj]; - * obj.b = {}; - * obj.b.inner = obj.b; - * obj.b.obj = obj; - * - * console.log(inspect(obj)); - * // { - * // a: [ [Circular *1] ], - * // b: { inner: [Circular *2], obj: [Circular *1] } - * // } - * ``` - * - * The following example inspects all properties of the `util` object: - * - * ```js - * import util from 'node:util'; - * - * console.log(util.inspect(util, { showHidden: true, depth: null })); - * ``` - * - * The following example highlights the effect of the `compact` option: - * - * ```js - * import util from 'node:util'; - * - * const o = { - * a: [1, 2, [[ - * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + - * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', - * 'test', - * 'foo']], 4], - * b: new Map([['za', 1], ['zb', 'test']]), - * }; - * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); - * - * // { a: - * // [ 1, - * // 2, - * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line - * // 'test', - * // 'foo' ] ], - * // 4 ], - * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } - * - * // Setting `compact` to false or an integer creates more reader friendly output. - * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); - * - * // { - * // a: [ - * // 1, - * // 2, - * // [ - * // [ - * // 'Lorem ipsum dolor sit amet,\n' + - * // 'consectetur adipiscing elit, sed do eiusmod \n' + - * // 'tempor incididunt ut labore et dolore magna aliqua.', - * // 'test', - * // 'foo' - * // ] - * // ], - * // 4 - * // ], - * // b: Map(2) { - * // 'za' => 1, - * // 'zb' => 'test' - * // } - * // } - * - * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a - * // single line. - * ``` - * - * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and - * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be - * inspected. If there are more entries than `maxArrayLength`, there is no - * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may - * result in different output. Furthermore, entries - * with no remaining strong references may be garbage collected at any time. - * - * ```js - * import { inspect } from 'node:util'; - * - * const obj = { a: 1 }; - * const obj2 = { b: 2 }; - * const weakSet = new WeakSet([obj, obj2]); - * - * console.log(inspect(weakSet, { showHidden: true })); - * // WeakSet { { a: 1 }, { b: 2 } } - * ``` - * - * The `sorted` option ensures that an object's property insertion order does not - * impact the result of `util.inspect()`. - * - * ```js - * import { inspect } from 'node:util'; - * import assert from 'node:assert'; - * - * const o1 = { - * b: [2, 3, 1], - * a: '`a` comes before `b`', - * c: new Set([2, 3, 1]), - * }; - * console.log(inspect(o1, { sorted: true })); - * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } - * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); - * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } - * - * const o2 = { - * c: new Set([2, 1, 3]), - * a: '`a` comes before `b`', - * b: [2, 3, 1], - * }; - * assert.strict.equal( - * inspect(o1, { sorted: true }), - * inspect(o2, { sorted: true }), - * ); - * ``` - * - * The `numericSeparator` option adds an underscore every three digits to all - * numbers. - * - * ```js - * import { inspect } from 'node:util'; - * - * const thousand = 1_000; - * const million = 1_000_000; - * const bigNumber = 123_456_789n; - * const bigDecimal = 1_234.123_45; - * - * console.log(inspect(thousand, { numericSeparator: true })); - * // 1_000 - * console.log(inspect(million, { numericSeparator: true })); - * // 1_000_000 - * console.log(inspect(bigNumber, { numericSeparator: true })); - * // 123_456_789n - * console.log(inspect(bigDecimal, { numericSeparator: true })); - * // 1_234.123_45 - * ``` - * - * `util.inspect()` is a synchronous method intended for debugging. Its maximum - * output length is approximately 128 MiB. Inputs that result in longer output will - * be truncated. - * @since v0.3.0 - * @param object Any JavaScript primitive or `Object`. - * @return The representation of `object`. - */ - export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; - export function inspect(object: any, options?: InspectOptions): string; - export namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string; - }; - let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ - let replDefaults: InspectOptions; - /** - * That can be used to declare custom inspect functions. - */ - const custom: unique symbol; - } - /** - * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). - * - * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isArray([]); - * // Returns: true - * util.isArray(new Array()); - * // Returns: true - * util.isArray({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use `isArray` instead. - */ - export function isArray(object: unknown): object is unknown[]; - /** - * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isRegExp(/some regexp/); - * // Returns: true - * util.isRegExp(new RegExp('another regexp')); - * // Returns: true - * util.isRegExp({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Deprecated - */ - export function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isDate(new Date()); - * // Returns: true - * util.isDate(Date()); - * // false (without 'new' returns a String) - * util.isDate({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. - */ - export function isDate(object: unknown): object is Date; - /** - * Returns `true` if the given `object` is an `Error`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isError(new Error()); - * // Returns: true - * util.isError(new TypeError()); - * // Returns: true - * util.isError({ name: 'Error', message: 'an error occurred' }); - * // Returns: false - * ``` - * - * This method relies on `Object.prototype.toString()` behavior. It is - * possible to obtain an incorrect result when the `object` argument manipulates `@@toStringTag`. - * - * ```js - * import util from 'node:util'; - * const obj = { name: 'Error', message: 'an error occurred' }; - * - * util.isError(obj); - * // Returns: false - * obj[Symbol.toStringTag] = 'Error'; - * util.isError(obj); - * // Returns: true - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. - */ - export function isError(object: unknown): object is Error; - /** - * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and `extends` keywords to get language level inheritance support. Also note - * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). - * - * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The - * prototype of `constructor` will be set to a new object created from `superConstructor`. - * - * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. - * As an additional convenience, `superConstructor` will be accessible - * through the `constructor.super_` property. - * - * ```js - * import util from 'node:util'; - * import EventEmitter from 'node:events'; - * - * function MyStream() { - * EventEmitter.call(this); - * } - * - * util.inherits(MyStream, EventEmitter); - * - * MyStream.prototype.write = function(data) { - * this.emit('data', data); - * }; - * - * const stream = new MyStream(); - * - * console.log(stream instanceof EventEmitter); // true - * console.log(MyStream.super_ === EventEmitter); // true - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('It works!'); // Received data: "It works!" - * ``` - * - * ES6 example using `class` and `extends`: - * - * ```js - * import EventEmitter from 'node:events'; - * - * class MyStream extends EventEmitter { - * write(data) { - * this.emit('data', data); - * } - * } - * - * const stream = new MyStream(); - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('With ES6'); - * ``` - * @since v0.3.0 - * @legacy Use ES2015 class syntax and `extends` keyword instead. - */ - export function inherits(constructor: unknown, superConstructor: unknown): void; - export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; - export interface DebugLogger extends DebugLoggerFunction { - enabled: boolean; - } - /** - * The `util.debuglog()` method is used to create a function that conditionally - * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that - * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. - * - * ```js - * import util from 'node:util'; - * const debuglog = util.debuglog('foo'); - * - * debuglog('hello from foo [%d]', 123); - * ``` - * - * If this program is run with `NODE_DEBUG=foo` in the environment, then - * it will output something like: - * - * ```console - * FOO 3245: hello from foo [123] - * ``` - * - * where `3245` is the process id. If it is not run with that - * environment variable set, then it will not print anything. - * - * The `section` supports wildcard also: - * - * ```js - * import util from 'node:util'; - * const debuglog = util.debuglog('foo-bar'); - * - * debuglog('hi there, it\'s foo-bar [%d]', 2333); - * ``` - * - * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output - * something like: - * - * ```console - * FOO-BAR 3257: hi there, it's foo-bar [2333] - * ``` - * - * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. - * - * The optional `callback` argument can be used to replace the logging function - * with a different function that doesn't have any initialization or - * unnecessary wrapping. - * - * ```js - * import util from 'node:util'; - * let debuglog = util.debuglog('internals', (debug) => { - * // Replace with a logging function that optimizes out - * // testing if the section is enabled - * debuglog = debug; - * }); - * ``` - * @since v0.11.3 - * @param section A string identifying the portion of the application for which the `debuglog` function is being created. - * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. - * @return The logging function - */ - export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; - export const debug: typeof debuglog; - /** - * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isBoolean(1); - * // Returns: false - * util.isBoolean(0); - * // Returns: false - * util.isBoolean(false); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. - */ - export function isBoolean(object: unknown): object is boolean; - /** - * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isBuffer({ length: 0 }); - * // Returns: false - * util.isBuffer([]); - * // Returns: false - * util.isBuffer(Buffer.from('hello world')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `isBuffer` instead. - */ - export function isBuffer(object: unknown): object is Buffer; - /** - * Returns `true` if the given `object` is a `Function`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * function Foo() {} - * const Bar = () => {}; - * - * util.isFunction({}); - * // Returns: false - * util.isFunction(Foo); - * // Returns: true - * util.isFunction(Bar); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. - */ - export function isFunction(object: unknown): boolean; - /** - * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. - * - * ```js - * import util from 'node:util'; - * - * util.isNull(0); - * // Returns: false - * util.isNull(undefined); - * // Returns: false - * util.isNull(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === null` instead. - */ - export function isNull(object: unknown): object is null; - /** - * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, - * returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isNullOrUndefined(0); - * // Returns: false - * util.isNullOrUndefined(undefined); - * // Returns: true - * util.isNullOrUndefined(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. - */ - export function isNullOrUndefined(object: unknown): object is null | undefined; - /** - * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isNumber(false); - * // Returns: false - * util.isNumber(Infinity); - * // Returns: true - * util.isNumber(0); - * // Returns: true - * util.isNumber(NaN); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. - */ - export function isNumber(object: unknown): object is number; - /** - * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). - * Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isObject(5); - * // Returns: false - * util.isObject(null); - * // Returns: false - * util.isObject({}); - * // Returns: true - * util.isObject(() => {}); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value !== null && typeof value === 'object'` instead. - */ - export function isObject(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. - * - * ```js - * import util from 'node:util'; - * - * util.isPrimitive(5); - * // Returns: true - * util.isPrimitive('foo'); - * // Returns: true - * util.isPrimitive(false); - * // Returns: true - * util.isPrimitive(null); - * // Returns: true - * util.isPrimitive(undefined); - * // Returns: true - * util.isPrimitive({}); - * // Returns: false - * util.isPrimitive(() => {}); - * // Returns: false - * util.isPrimitive(/^$/); - * // Returns: false - * util.isPrimitive(new Date()); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. - */ - export function isPrimitive(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isString(''); - * // Returns: true - * util.isString('foo'); - * // Returns: true - * util.isString(String('foo')); - * // Returns: true - * util.isString(5); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. - */ - export function isString(object: unknown): object is string; - /** - * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isSymbol(5); - * // Returns: false - * util.isSymbol('foo'); - * // Returns: false - * util.isSymbol(Symbol('foo')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. - */ - export function isSymbol(object: unknown): object is symbol; - /** - * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * const foo = undefined; - * util.isUndefined(5); - * // Returns: false - * util.isUndefined(foo); - * // Returns: true - * util.isUndefined(null); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined` instead. - */ - export function isUndefined(object: unknown): object is undefined; - /** - * The `util.deprecate()` method wraps `fn` (which may be a function or class) in - * such a way that it is marked as deprecated. - * - * ```js - * import util from 'node:util'; - * - * exports.obsoleteFunction = util.deprecate(() => { - * // Do something here. - * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); - * ``` - * - * When called, `util.deprecate()` will return a function that will emit a `DeprecationWarning` using the `'warning'` event. The warning will - * be emitted and printed to `stderr` the first time the returned function is - * called. After the warning is emitted, the wrapped function is called without - * emitting a warning. - * - * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, - * the warning will be emitted only once for that `code`. - * - * ```js - * import util from 'node:util'; - * - * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); - * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); - * fn1(); // Emits a deprecation warning with code DEP0001 - * fn2(); // Does not emit a deprecation warning because it has the same code - * ``` - * - * If either the `--no-deprecation` or `--no-warnings` command-line flags are - * used, or if the `process.noDeprecation` property is set to `true`_prior_ to - * the first deprecation warning, the `util.deprecate()` method does nothing. - * - * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, - * or the `process.traceDeprecation` property is set to `true`, a warning and a - * stack trace are printed to `stderr` the first time the deprecated function is - * called. - * - * If the `--throw-deprecation` command-line flag is set, or the `process.throwDeprecation` property is set to `true`, then an exception will be - * thrown when the deprecated function is called. - * - * The `--throw-deprecation` command-line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation` and `process.traceDeprecation`. - * @since v0.8.0 - * @param fn The function that is being deprecated. - * @param msg A warning message to display when the deprecated function is invoked. - * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. - * @return The deprecated function wrapped to emit a warning. - */ - export function deprecate(fn: T, msg: string, code?: string): T; - /** - * Returns `true` if there is deep strict equality between `val1` and `val2`. - * Otherwise, returns `false`. - * - * See `assert.deepStrictEqual()` for more information about deep strict - * equality. - * @since v9.0.0 - */ - export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; - /** - * Returns `str` with any ANSI escape codes removed. - * - * ```js - * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); - * // Prints "value" - * ``` - * @since v16.11.0 - */ - export function stripVTControlCharacters(str: string): string; - /** - * Takes an `async` function (or a function that returns a `Promise`) and returns a - * function following the error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument. In the callback, the - * first argument will be the rejection reason (or `null` if the `Promise` resolved), and the second argument will be the resolved value. - * - * ```js - * import util from 'node:util'; - * - * async function fn() { - * return 'hello world'; - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * if (err) throw err; - * console.log(ret); - * }); - * ``` - * - * Will print: - * - * ```text - * hello world - * ``` - * - * The callback is executed asynchronously, and will have a limited stack trace. - * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. - * - * Since `null` has a special meaning as the first argument to a callback, if a - * wrapped function rejects a `Promise` with a falsy value as a reason, the value - * is wrapped in an `Error` with the original value stored in a field named `reason`. - * - * ```js - * function fn() { - * return Promise.reject(null); - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * // When the Promise was rejected with `null` it is wrapped with an Error and - * // the original value is stored in `reason`. - * err && Object.hasOwn(err, 'reason') && err.reason === null; // true - * }); - * ``` - * @since v8.2.0 - * @param fn An `async` function - * @return a callback style function - */ - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: () => Promise, - ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export interface CustomPromisifyLegacy extends Function { - __promisify__: TCustom; - } - export interface CustomPromisifySymbol extends Function { - [promisify.custom]: TCustom; - } - export type CustomPromisify = - | CustomPromisifySymbol - | CustomPromisifyLegacy; - /** - * Takes a function following the common error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument, and returns a version - * that returns promises. - * - * ```js - * import util from 'node:util'; - * import fs from 'node:fs'; - * - * const stat = util.promisify(fs.stat); - * stat('.').then((stats) => { - * // Do something with `stats` - * }).catch((error) => { - * // Handle the error. - * }); - * ``` - * - * Or, equivalently using `async function`s: - * - * ```js - * import util from 'node:util'; - * import fs from 'node:fs'; - * - * const stat = util.promisify(fs.stat); - * - * async function callStat() { - * const stats = await stat('.'); - * console.log(`This directory is owned by ${stats.uid}`); - * } - * - * callStat(); - * ``` - * - * If there is an `original[util.promisify.custom]` property present, `promisify` will return its value, see `Custom promisified functions`. - * - * `promisify()` assumes that `original` is a function taking a callback as its - * final argument in all cases. If `original` is not a function, `promisify()` will throw an error. If `original` is a function but its last argument is not - * an error-first callback, it will still be passed an error-first - * callback as its last argument. - * - * Using `promisify()` on class methods or other methods that use `this` may not - * work as expected unless handled specially: - * - * ```js - * import util from 'node:util'; - * - * class Foo { - * constructor() { - * this.a = 42; - * } - * - * bar(callback) { - * callback(null, this.a); - * } - * } - * - * const foo = new Foo(); - * - * const naiveBar = util.promisify(foo.bar); - * // TypeError: Cannot read property 'a' of undefined - * // naiveBar().then(a => console.log(a)); - * - * naiveBar.call(foo).then((a) => console.log(a)); // '42' - * - * const bindBar = naiveBar.bind(foo); - * bindBar().then((a) => console.log(a)); // '42' - * ``` - * @since v8.0.0 - */ - export function promisify(fn: CustomPromisify): TCustom; - export function promisify( - fn: (callback: (err: any, result: TResult) => void) => void, - ): () => Promise; - export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; - export function promisify( - fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: Function): Function; - export namespace promisify { - /** - * That can be used to declare custom promisified variants of functions. - */ - const custom: unique symbol; - } - /** - * Stability: 1.1 - Active development - * Given an example `.env` file: - * - * ```js - * import { parseEnv } from 'node:util'; - * - * parseEnv('HELLO=world\nHELLO=oh my\n'); - * // Returns: { HELLO: 'oh my' } - * ``` - * @param content The raw contents of a `.env` file. - * @since v20.12.0 - */ - export function parseEnv(content: string): NodeJS.Dict; - // https://nodejs.org/docs/latest/api/util.html#foreground-colors - type ForegroundColors = - | "black" - | "blackBright" - | "blue" - | "blueBright" - | "cyan" - | "cyanBright" - | "gray" - | "green" - | "greenBright" - | "grey" - | "magenta" - | "magentaBright" - | "red" - | "redBright" - | "white" - | "whiteBright" - | "yellow" - | "yellowBright"; - // https://nodejs.org/docs/latest/api/util.html#background-colors - type BackgroundColors = - | "bgBlack" - | "bgBlackBright" - | "bgBlue" - | "bgBlueBright" - | "bgCyan" - | "bgCyanBright" - | "bgGray" - | "bgGreen" - | "bgGreenBright" - | "bgGrey" - | "bgMagenta" - | "bgMagentaBright" - | "bgRed" - | "bgRedBright" - | "bgWhite" - | "bgWhiteBright" - | "bgYellow" - | "bgYellowBright"; - // https://nodejs.org/docs/latest/api/util.html#modifiers - type Modifiers = - | "blink" - | "bold" - | "dim" - | "doubleunderline" - | "framed" - | "hidden" - | "inverse" - | "italic" - | "overlined" - | "reset" - | "strikethrough" - | "underline"; - export interface StyleTextOptions { - /** - * When true, `stream` is checked to see if it can handle colors. - * @default true - */ - validateStream?: boolean | undefined; - /** - * A stream that will be validated if it can be colored. - * @default process.stdout - */ - stream?: NodeJS.WritableStream | undefined; - } - /** - * Stability: 1.1 - Active development - * - * This function returns a formatted text considering the `format` passed. - * - * ```js - * import { styleText } from 'node:util'; - * const errorMessage = styleText('red', 'Error! Error!'); - * console.log(errorMessage); - * ``` - * - * `util.inspect.colors` also provides text formats such as `italic`, and `underline` and you can combine both: - * - * ```js - * console.log( - * util.styleText(['underline', 'italic'], 'My italic underlined message'), - * ); - * ``` - * - * When passing an array of formats, the order of the format applied is left to right so the following style - * might overwrite the previous one. - * - * ```js - * console.log( - * util.styleText(['red', 'green'], 'text'), // green - * ); - * ``` - * - * The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v20.x/api/util.html#modifiers). - * @param format A text format or an Array of text formats defined in `util.inspect.colors`. - * @param text The text to to be formatted. - * @since v20.12.0 - */ - export function styleText( - format: - | ForegroundColors - | BackgroundColors - | Modifiers - | Array, - text: string, - options?: StyleTextOptions, - ): string; - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API. - * - * ```js - * const decoder = new TextDecoder(); - * const u8arr = new Uint8Array([72, 101, 108, 108, 111]); - * console.log(decoder.decode(u8arr)); // Hello - * ``` - * @since v8.3.0 - */ - export class TextDecoder { - /** - * The encoding supported by the `TextDecoder` instance. - */ - readonly encoding: string; - /** - * The value will be `true` if decoding errors result in a `TypeError` being - * thrown. - */ - readonly fatal: boolean; - /** - * The value will be `true` if the decoding result will include the byte order - * mark. - */ - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { - fatal?: boolean | undefined; - ignoreBOM?: boolean | undefined; - }, - ); - /** - * Decodes the `input` and returns a string. If `options.stream` is `true`, any - * incomplete byte sequences occurring at the end of the `input` are buffered - * internally and emitted after the next call to `textDecoder.decode()`. - * - * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a `TypeError` being thrown. - * @param input An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data. - */ - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { - stream?: boolean | undefined; - }, - ): string; - } - export interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - export { types }; - - //// TextEncoder/Decoder - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All - * instances of `TextEncoder` only support UTF-8 encoding. - * - * ```js - * const encoder = new TextEncoder(); - * const uint8array = encoder.encode('this is some data'); - * ``` - * - * The `TextEncoder` class is also available on the global object. - * @since v8.3.0 - */ - export class TextEncoder { - /** - * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. - */ - readonly encoding: string; - /** - * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the - * encoded bytes. - * @param [input='an empty string'] The text to encode. - */ - encode(input?: string): NodeJS.NonSharedUint8Array; - /** - * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object - * containing the read Unicode code units and written UTF-8 bytes. - * - * ```js - * const encoder = new TextEncoder(); - * const src = 'this is some data'; - * const dest = new Uint8Array(10); - * const { read, written } = encoder.encodeInto(src, dest); - * ``` - * @param src The text to encode. - * @param dest The array to hold the encode result. - */ - encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; - } - import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util"; - global { - /** - * `TextDecoder` class is a global reference for `import { TextDecoder } from 'node:util'` - * https://nodejs.org/api/globals.html#textdecoder - * @since v11.0.0 - */ - var TextDecoder: typeof globalThis extends { - onmessage: any; - TextDecoder: infer TextDecoder; - } ? TextDecoder - : typeof _TextDecoder; - /** - * `TextEncoder` class is a global reference for `import { TextEncoder } from 'node:util'` - * https://nodejs.org/api/globals.html#textencoder - * @since v11.0.0 - */ - var TextEncoder: typeof globalThis extends { - onmessage: any; - TextEncoder: infer TextEncoder; - } ? TextEncoder - : typeof _TextEncoder; - } - - //// parseArgs - /** - * Provides a higher level API for command-line argument parsing than interacting - * with `process.argv` directly. Takes a specification for the expected arguments - * and returns a structured object with the parsed options and positionals. - * - * ```js - * import { parseArgs } from 'node:util'; - * const args = ['-f', '--bar', 'b']; - * const options = { - * foo: { - * type: 'boolean', - * short: 'f', - * }, - * bar: { - * type: 'string', - * }, - * }; - * const { - * values, - * positionals, - * } = parseArgs({ args, options }); - * console.log(values, positionals); - * // Prints: [Object: null prototype] { foo: true, bar: 'b' } [] - * ``` - * @since v18.3.0, v16.17.0 - * @param config Used to provide arguments for parsing and to configure the parser. `config` supports the following properties: - * @return The parsed command line arguments: - */ - export function parseArgs(config?: T): ParsedResults; - interface ParseArgsOptionConfig { - /** - * Type of argument. - */ - type: "string" | "boolean"; - /** - * Whether this option can be provided multiple times. - * If `true`, all values will be collected in an array. - * If `false`, values for the option are last-wins. - * @default false. - */ - multiple?: boolean | undefined; - /** - * A single character alias for the option. - */ - short?: string | undefined; - /** - * The default option value when it is not set by args. - * It must be of the same type as the the `type` property. - * When `multiple` is `true`, it must be an array. - * @since v18.11.0 - */ - default?: string | boolean | string[] | boolean[] | undefined; - } - interface ParseArgsOptionsConfig { - [longOption: string]: ParseArgsOptionConfig; - } - export interface ParseArgsConfig { - /** - * Array of argument strings. - */ - args?: readonly string[] | undefined; - /** - * Used to describe arguments known to the parser. - */ - options?: ParseArgsOptionsConfig | undefined; - /** - * Should an error be thrown when unknown arguments are encountered, - * or when arguments are passed that do not match the `type` configured in `options`. - * @default true - */ - strict?: boolean | undefined; - /** - * Whether this command accepts positional arguments. - */ - allowPositionals?: boolean | undefined; - /** - * If `true`, allows explicitly setting boolean options to `false` by prefixing the option name with `--no-`. - * @default false - * @since v20.16.0 - */ - allowNegative?: boolean | undefined; - /** - * Return the parsed tokens. This is useful for extending the built-in behavior, - * from adding additional checks through to reprocessing the tokens in different ways. - * @default false - */ - tokens?: boolean | undefined; - } - /* - IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties. - TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936 - This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present". - But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present. - So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value. - This is technically incorrect but is a much nicer UX for the common case. - The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false. - */ - type IfDefaultsTrue = T extends true ? IfTrue - : T extends false ? IfFalse - : IfTrue; - - // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` - type IfDefaultsFalse = T extends false ? IfFalse - : T extends true ? IfTrue - : IfFalse; - - type ExtractOptionValue = IfDefaultsTrue< - T["strict"], - O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean, - string | boolean - >; - - type ApplyOptionalModifiers> = ( - & { -readonly [LongOption in keyof O]?: V[LongOption] } - & { [LongOption in keyof O as O[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption] } - ) extends infer P ? { [K in keyof P]: P[K] } : never; // resolve intersection to object - - type ParsedValues = - & IfDefaultsTrue - & (T["options"] extends ParseArgsOptionsConfig ? ApplyOptionalModifiers< - T["options"], - { - [LongOption in keyof T["options"]]: IfDefaultsFalse< - T["options"][LongOption]["multiple"], - Array>, - ExtractOptionValue - >; - } - > - : {}); - - type ParsedPositionals = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type PreciseTokenForOptions< - K extends string, - O extends ParseArgsOptionConfig, - > = O["type"] extends "string" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: string; - inlineValue: boolean; - } - : O["type"] extends "boolean" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: undefined; - inlineValue: undefined; - } - : OptionToken & { name: K }; - - type TokenForOptions< - T extends ParseArgsConfig, - K extends keyof T["options"] = keyof T["options"], - > = K extends unknown - ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions - : OptionToken - : never; - - type ParsedOptionToken = IfDefaultsTrue, OptionToken>; - - type ParsedPositionalToken = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type ParsedTokens = Array< - ParsedOptionToken | ParsedPositionalToken | { kind: "option-terminator"; index: number } - >; - - type PreciseParsedResults = IfDefaultsFalse< - T["tokens"], - { - values: ParsedValues; - positionals: ParsedPositionals; - tokens: ParsedTokens; - }, - { - values: ParsedValues; - positionals: ParsedPositionals; - } - >; - - type OptionToken = - | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean } - | { - kind: "option"; - index: number; - name: string; - rawName: string; - value: undefined; - inlineValue: undefined; - }; - - type Token = - | OptionToken - | { kind: "positional"; index: number; value: string } - | { kind: "option-terminator"; index: number }; - - // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. - // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. - type ParsedResults = ParseArgsConfig extends T ? { - values: { - [longOption: string]: undefined | string | boolean | Array; - }; - positionals: string[]; - tokens?: Token[]; - } - : PreciseParsedResults; - - /** - * An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/). - * - * In accordance with browser conventions, all properties of `MIMEType` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. - * - * A MIME string is a structured string containing multiple meaningful - * components. When parsed, a `MIMEType` object is returned containing - * properties for each of these components. - * @since v19.1.0, v18.13.0 - * @experimental - */ - export class MIMEType { - /** - * Creates a new MIMEType object by parsing the input. - * - * A `TypeError` will be thrown if the `input` is not a valid MIME. - * Note that an effort will be made to coerce the given values into strings. - * @param input The input MIME to parse. - */ - constructor(input: string | { toString: () => string }); - - /** - * Gets and sets the type portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript'); - * console.log(myMIME.type); - * // Prints: text - * myMIME.type = 'application'; - * console.log(myMIME.type); - * // Prints: application - * console.log(String(myMIME)); - * // Prints: application/javascript - * ``` - */ - type: string; - /** - * Gets and sets the subtype portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/ecmascript'); - * console.log(myMIME.subtype); - * // Prints: ecmascript - * myMIME.subtype = 'javascript'; - * console.log(myMIME.subtype); - * // Prints: javascript - * console.log(String(myMIME)); - * // Prints: text/javascript - * ``` - */ - subtype: string; - /** - * Gets the essence of the MIME. This property is read only. - * Use `mime.type` or `mime.subtype` to alter the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript;key=value'); - * console.log(myMIME.essence); - * // Prints: text/javascript - * myMIME.type = 'application'; - * console.log(myMIME.essence); - * // Prints: application/javascript - * console.log(String(myMIME)); - * // Prints: application/javascript;key=value - * ``` - */ - readonly essence: string; - /** - * Gets the `MIMEParams` object representing the - * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details. - */ - readonly params: MIMEParams; - /** - * The `toString()` method on the `MIMEType` object returns the serialized MIME. - * - * Because of the need for standard compliance, this method does not allow users - * to customize the serialization process of the MIME. - */ - toString(): string; - } - /** - * The `MIMEParams` API provides read and write access to the parameters of a `MIMEType`. - * @since v19.1.0, v18.13.0 - */ - export class MIMEParams { - /** - * Remove all name-value pairs whose name is `name`. - */ - delete(name: string): void; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - * Each item of the iterator is a JavaScript `Array`. The first item of the array - * is the `name`, the second item of the array is the `value`. - */ - entries(): NodeJS.Iterator<[name: string, value: string]>; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns `true` if there is at least one name-value pair whose name is `name`. - */ - has(name: string): boolean; - /** - * Returns an iterator over the names of each name-value pair. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // bar - * ``` - */ - keys(): NodeJS.Iterator; - /** - * Sets the value in the `MIMEParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value`. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * params.set('foo', 'def'); - * params.set('baz', 'xyz'); - * console.log(params.toString()); - * // Prints: foo=def;bar=1;baz=xyz - * ``` - */ - set(name: string, value: string): void; - /** - * Returns an iterator over the values of each name-value pair. - */ - values(): NodeJS.Iterator; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - */ - [Symbol.iterator](): NodeJS.Iterator<[name: string, value: string]>; - } -} -declare module "util/types" { - import { KeyObject, webcrypto } from "node:crypto"; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or - * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * - * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. - * - * ```js - * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; - /** - * Returns `true` if the value is an `arguments` object. - * - * ```js - * function foo() { - * util.types.isArgumentsObject(arguments); // Returns true - * } - * ``` - * @since v10.0.0 - */ - function isArgumentsObject(object: unknown): object is IArguments; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. - * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false - * ``` - * @since v10.0.0 - */ - function isArrayBuffer(object: unknown): object is ArrayBuffer; - /** - * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed - * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to - * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * - * ```js - * util.types.isArrayBufferView(new Int8Array()); // true - * util.types.isArrayBufferView(Buffer.from('hello world')); // true - * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true - * util.types.isArrayBufferView(new ArrayBuffer()); // false - * ``` - * @since v10.0.0 - */ - function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; - /** - * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isAsyncFunction(function foo() {}); // Returns false - * util.types.isAsyncFunction(async function foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isAsyncFunction(object: unknown): boolean; - /** - * Returns `true` if the value is a `BigInt64Array` instance. - * - * ```js - * util.types.isBigInt64Array(new BigInt64Array()); // Returns true - * util.types.isBigInt64Array(new BigUint64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isBigInt64Array(value: unknown): value is BigInt64Array; - /** - * Returns `true` if the value is a BigInt object, e.g. created - * by `Object(BigInt(123))`. - * - * ```js - * util.types.isBigIntObject(Object(BigInt(123))); // Returns true - * util.types.isBigIntObject(BigInt(123)); // Returns false - * util.types.isBigIntObject(123); // Returns false - * ``` - * @since v10.4.0 - */ - function isBigIntObject(object: unknown): object is BigInt; - /** - * Returns `true` if the value is a `BigUint64Array` instance. - * - * ```js - * util.types.isBigUint64Array(new BigInt64Array()); // Returns false - * util.types.isBigUint64Array(new BigUint64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isBigUint64Array(value: unknown): value is BigUint64Array; - /** - * Returns `true` if the value is a boolean object, e.g. created - * by `new Boolean()`. - * - * ```js - * util.types.isBooleanObject(false); // Returns false - * util.types.isBooleanObject(true); // Returns false - * util.types.isBooleanObject(new Boolean(false)); // Returns true - * util.types.isBooleanObject(new Boolean(true)); // Returns true - * util.types.isBooleanObject(Boolean(false)); // Returns false - * util.types.isBooleanObject(Boolean(true)); // Returns false - * ``` - * @since v10.0.0 - */ - function isBooleanObject(object: unknown): object is Boolean; - /** - * Returns `true` if the value is any boxed primitive object, e.g. created - * by `new Boolean()`, `new String()` or `Object(Symbol())`. - * - * For example: - * - * ```js - * util.types.isBoxedPrimitive(false); // Returns false - * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true - * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false - * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true - * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true - * ``` - * @since v10.11.0 - */ - function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; - /** - * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. - * - * ```js - * const ab = new ArrayBuffer(20); - * util.types.isDataView(new DataView(ab)); // Returns true - * util.types.isDataView(new Float64Array()); // Returns false - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isDataView(object: unknown): object is DataView; - /** - * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - * - * ```js - * util.types.isDate(new Date()); // Returns true - * ``` - * @since v10.0.0 - */ - function isDate(object: unknown): object is Date; - /** - * Returns `true` if the value is a native `External` value. - * - * A native `External` value is a special type of object that contains a - * raw C++ pointer (`void*`) for access from native code, and has no other - * properties. Such objects are created either by Node.js internals or native - * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. - * - * ```c - * #include - * #include - * napi_value result; - * static napi_value MyNapi(napi_env env, napi_callback_info info) { - * int* raw = (int*) malloc(1024); - * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); - * if (status != napi_ok) { - * napi_throw_error(env, NULL, "napi_create_external failed"); - * return NULL; - * } - * return result; - * } - * ... - * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) - * ... - * ``` - * - * ```js - * const native =require('napi_addon.node'); - * const data = native.myNapi(); - * util.types.isExternal(data); // returns true - * util.types.isExternal(0); // returns false - * util.types.isExternal(new String('foo')); // returns false - * ``` - * - * For further information on `napi_create_external`, refer to `napi_create_external()`. - * @since v10.0.0 - */ - function isExternal(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. - * - * ```js - * util.types.isFloat32Array(new ArrayBuffer()); // Returns false - * util.types.isFloat32Array(new Float32Array()); // Returns true - * util.types.isFloat32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isFloat32Array(object: unknown): object is Float32Array; - /** - * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. - * - * ```js - * util.types.isFloat64Array(new ArrayBuffer()); // Returns false - * util.types.isFloat64Array(new Uint8Array()); // Returns false - * util.types.isFloat64Array(new Float64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isFloat64Array(object: unknown): object is Float64Array; - /** - * Returns `true` if the value is a generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isGeneratorFunction(function foo() {}); // Returns false - * util.types.isGeneratorFunction(function* foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorFunction(object: unknown): object is GeneratorFunction; - /** - * Returns `true` if the value is a generator object as returned from a - * built-in generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * function* foo() {} - * const generator = foo(); - * util.types.isGeneratorObject(generator); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorObject(object: unknown): object is Generator; - /** - * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. - * - * ```js - * util.types.isInt8Array(new ArrayBuffer()); // Returns false - * util.types.isInt8Array(new Int8Array()); // Returns true - * util.types.isInt8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt8Array(object: unknown): object is Int8Array; - /** - * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. - * - * ```js - * util.types.isInt16Array(new ArrayBuffer()); // Returns false - * util.types.isInt16Array(new Int16Array()); // Returns true - * util.types.isInt16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt16Array(object: unknown): object is Int16Array; - /** - * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. - * - * ```js - * util.types.isInt32Array(new ArrayBuffer()); // Returns false - * util.types.isInt32Array(new Int32Array()); // Returns true - * util.types.isInt32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt32Array(object: unknown): object is Int32Array; - /** - * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * util.types.isMap(new Map()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMap( - object: T | {}, - ): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) - : Map; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * const map = new Map(); - * util.types.isMapIterator(map.keys()); // Returns true - * util.types.isMapIterator(map.values()); // Returns true - * util.types.isMapIterator(map.entries()); // Returns true - * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMapIterator(object: unknown): boolean; - /** - * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). - * - * ```js - * import * as ns from './a.js'; - * - * util.types.isModuleNamespaceObject(ns); // Returns true - * ``` - * @since v10.0.0 - */ - function isModuleNamespaceObject(value: unknown): boolean; - /** - * Returns `true` if the value was returned by the constructor of a [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). - * - * ```js - * console.log(util.types.isNativeError(new Error())); // true - * console.log(util.types.isNativeError(new TypeError())); // true - * console.log(util.types.isNativeError(new RangeError())); // true - * ``` - * - * Subclasses of the native error types are also native errors: - * - * ```js - * class MyError extends Error {} - * console.log(util.types.isNativeError(new MyError())); // true - * ``` - * - * A value being `instanceof` a native error class is not equivalent to `isNativeError()` returning `true` for that value. `isNativeError()` returns `true` for errors - * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false` for these errors: - * - * ```js - * import vm from 'node:vm'; - * const context = vm.createContext({}); - * const myError = vm.runInContext('new Error()', context); - * console.log(util.types.isNativeError(myError)); // true - * console.log(myError instanceof Error); // false - * ``` - * - * Conversely, `isNativeError()` returns `false` for all objects which were not - * returned by the constructor of a native error. That includes values - * which are `instanceof` native errors: - * - * ```js - * const myError = { __proto__: Error.prototype }; - * console.log(util.types.isNativeError(myError)); // false - * console.log(myError instanceof Error); // true - * ``` - * @since v10.0.0 - */ - function isNativeError(object: unknown): object is Error; - /** - * Returns `true` if the value is a number object, e.g. created - * by `new Number()`. - * - * ```js - * util.types.isNumberObject(0); // Returns false - * util.types.isNumberObject(new Number(0)); // Returns true - * ``` - * @since v10.0.0 - */ - function isNumberObject(object: unknown): object is Number; - /** - * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * ```js - * util.types.isPromise(Promise.resolve(42)); // Returns true - * ``` - * @since v10.0.0 - */ - function isPromise(object: unknown): object is Promise; - /** - * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. - * - * ```js - * const target = {}; - * const proxy = new Proxy(target, {}); - * util.types.isProxy(target); // Returns false - * util.types.isProxy(proxy); // Returns true - * ``` - * @since v10.0.0 - */ - function isProxy(object: unknown): boolean; - /** - * Returns `true` if the value is a regular expression object. - * - * ```js - * util.types.isRegExp(/abc/); // Returns true - * util.types.isRegExp(new RegExp('abc')); // Returns true - * ``` - * @since v10.0.0 - */ - function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * util.types.isSet(new Set()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSet( - object: T | {}, - ): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * const set = new Set(); - * util.types.isSetIterator(set.keys()); // Returns true - * util.types.isSetIterator(set.values()); // Returns true - * util.types.isSetIterator(set.entries()); // Returns true - * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSetIterator(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false - * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; - /** - * Returns `true` if the value is a string object, e.g. created - * by `new String()`. - * - * ```js - * util.types.isStringObject('foo'); // Returns false - * util.types.isStringObject(new String('foo')); // Returns true - * ``` - * @since v10.0.0 - */ - function isStringObject(object: unknown): object is String; - /** - * Returns `true` if the value is a symbol object, created - * by calling `Object()` on a `Symbol` primitive. - * - * ```js - * const symbol = Symbol('foo'); - * util.types.isSymbolObject(symbol); // Returns false - * util.types.isSymbolObject(Object(symbol)); // Returns true - * ``` - * @since v10.0.0 - */ - function isSymbolObject(object: unknown): object is Symbol; - /** - * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. - * - * ```js - * util.types.isTypedArray(new ArrayBuffer()); // Returns false - * util.types.isTypedArray(new Uint8Array()); // Returns true - * util.types.isTypedArray(new Float64Array()); // Returns true - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isTypedArray(object: unknown): object is NodeJS.TypedArray; - /** - * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. - * - * ```js - * util.types.isUint8Array(new ArrayBuffer()); // Returns false - * util.types.isUint8Array(new Uint8Array()); // Returns true - * util.types.isUint8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8Array(object: unknown): object is Uint8Array; - /** - * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. - * - * ```js - * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false - * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true - * util.types.isUint8ClampedArray(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; - /** - * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. - * - * ```js - * util.types.isUint16Array(new ArrayBuffer()); // Returns false - * util.types.isUint16Array(new Uint16Array()); // Returns true - * util.types.isUint16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint16Array(object: unknown): object is Uint16Array; - /** - * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. - * - * ```js - * util.types.isUint32Array(new ArrayBuffer()); // Returns false - * util.types.isUint32Array(new Uint32Array()); // Returns true - * util.types.isUint32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint32Array(object: unknown): object is Uint32Array; - /** - * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. - * - * ```js - * util.types.isWeakMap(new WeakMap()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakMap(object: unknown): object is WeakMap; - /** - * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. - * - * ```js - * util.types.isWeakSet(new WeakSet()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakSet(object: unknown): object is WeakSet; - /** - * Returns `true` if `value` is a `KeyObject`, `false` otherwise. - * @since v16.2.0 - */ - function isKeyObject(object: unknown): object is KeyObject; - /** - * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. - * @since v16.2.0 - */ - function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; -} -declare module "node:util" { - export * from "util"; -} -declare module "node:util/types" { - export * from "util/types"; -} diff --git a/node_modules/@types/node/v8.d.ts b/node_modules/@types/node/v8.d.ts deleted file mode 100644 index 8b0e965..0000000 --- a/node_modules/@types/node/v8.d.ts +++ /dev/null @@ -1,809 +0,0 @@ -/** - * The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using: - * - * ```js - * import v8 from 'node:v8'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/v8.js) - */ -declare module "v8" { - import { NonSharedBuffer } from "node:buffer"; - import { Readable } from "node:stream"; - interface HeapSpaceInfo { - space_name: string; - space_size: number; - space_used_size: number; - space_available_size: number; - physical_space_size: number; - } - // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ - type DoesZapCodeSpaceFlag = 0 | 1; - interface HeapInfo { - total_heap_size: number; - total_heap_size_executable: number; - total_physical_size: number; - total_available_size: number; - used_heap_size: number; - heap_size_limit: number; - malloced_memory: number; - peak_malloced_memory: number; - does_zap_garbage: DoesZapCodeSpaceFlag; - number_of_native_contexts: number; - number_of_detached_contexts: number; - total_global_handles_size: number; - used_global_handles_size: number; - external_memory: number; - } - interface HeapCodeStatistics { - code_and_metadata_size: number; - bytecode_and_metadata_size: number; - external_script_source_size: number; - } - interface HeapSnapshotOptions { - /** - * If true, expose internals in the heap snapshot. - * @default false - */ - exposeInternals?: boolean | undefined; - /** - * If true, expose numeric values in artificial fields. - * @default false - */ - exposeNumericValues?: boolean | undefined; - } - /** - * Returns an integer representing a version tag derived from the V8 version, - * command-line flags, and detected CPU features. This is useful for determining - * whether a `vm.Script` `cachedData` buffer is compatible with this instance - * of V8. - * - * ```js - * console.log(v8.cachedDataVersionTag()); // 3947234607 - * // The value returned by v8.cachedDataVersionTag() is derived from the V8 - * // version, command-line flags, and detected CPU features. Test that the value - * // does indeed update when flags are toggled. - * v8.setFlagsFromString('--allow_natives_syntax'); - * console.log(v8.cachedDataVersionTag()); // 183726201 - * ``` - * @since v8.0.0 - */ - function cachedDataVersionTag(): number; - /** - * Returns an object with the following properties: - * - * `does_zap_garbage` is a 0/1 boolean, which signifies whether the `--zap_code_space` option is enabled or not. This makes V8 overwrite heap - * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger - * because it continuously touches all heap pages and that makes them less likely - * to get swapped out by the operating system. - * - * `number_of_native_contexts` The value of native\_context is the number of the - * top-level contexts currently active. Increase of this number over time indicates - * a memory leak. - * - * `number_of_detached_contexts` The value of detached\_context is the number - * of contexts that were detached and not yet garbage collected. This number - * being non-zero indicates a potential memory leak. - * - * `total_global_handles_size` The value of total\_global\_handles\_size is the - * total memory size of V8 global handles. - * - * `used_global_handles_size` The value of used\_global\_handles\_size is the - * used memory size of V8 global handles. - * - * `external_memory` The value of external\_memory is the memory size of array - * buffers and external strings. - * - * ```js - * { - * total_heap_size: 7326976, - * total_heap_size_executable: 4194304, - * total_physical_size: 7326976, - * total_available_size: 1152656, - * used_heap_size: 3476208, - * heap_size_limit: 1535115264, - * malloced_memory: 16384, - * peak_malloced_memory: 1127496, - * does_zap_garbage: 0, - * number_of_native_contexts: 1, - * number_of_detached_contexts: 0, - * total_global_handles_size: 8192, - * used_global_handles_size: 3296, - * external_memory: 318824 - * } - * ``` - * @since v1.0.0 - */ - function getHeapStatistics(): HeapInfo; - /** - * Returns statistics about the V8 heap spaces, i.e. the segments which make up - * the V8 heap. Neither the ordering of heap spaces, nor the availability of a - * heap space can be guaranteed as the statistics are provided via the - * V8 [`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the - * next. - * - * The value returned is an array of objects containing the following properties: - * - * ```json - * [ - * { - * "space_name": "new_space", - * "space_size": 2063872, - * "space_used_size": 951112, - * "space_available_size": 80824, - * "physical_space_size": 2063872 - * }, - * { - * "space_name": "old_space", - * "space_size": 3090560, - * "space_used_size": 2493792, - * "space_available_size": 0, - * "physical_space_size": 3090560 - * }, - * { - * "space_name": "code_space", - * "space_size": 1260160, - * "space_used_size": 644256, - * "space_available_size": 960, - * "physical_space_size": 1260160 - * }, - * { - * "space_name": "map_space", - * "space_size": 1094160, - * "space_used_size": 201608, - * "space_available_size": 0, - * "physical_space_size": 1094160 - * }, - * { - * "space_name": "large_object_space", - * "space_size": 0, - * "space_used_size": 0, - * "space_available_size": 1490980608, - * "physical_space_size": 0 - * } - * ] - * ``` - * @since v6.0.0 - */ - function getHeapSpaceStatistics(): HeapSpaceInfo[]; - /** - * The `v8.setFlagsFromString()` method can be used to programmatically set - * V8 command-line flags. This method should be used with care. Changing settings - * after the VM has started may result in unpredictable behavior, including - * crashes and data loss; or it may simply do nothing. - * - * The V8 options available for a version of Node.js may be determined by running `node --v8-options`. - * - * Usage: - * - * ```js - * // Print GC events to stdout for one minute. - * import v8 from 'node:v8'; - * v8.setFlagsFromString('--trace_gc'); - * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); - * ``` - * @since v1.0.0 - */ - function setFlagsFromString(flags: string): void; - /** - * This is similar to the [`queryObjects()` console API](https://developer.chrome.com/docs/devtools/console/utilities#queryObjects-function) - * provided by the Chromium DevTools console. It can be used to search for objects that have the matching constructor on its prototype chain - * in the heap after a full garbage collection, which can be useful for memory leak regression tests. To avoid surprising results, users should - * avoid using this API on constructors whose implementation they don't control, or on constructors that can be invoked by other parties in the - * application. - * - * To avoid accidental leaks, this API does not return raw references to the objects found. By default, it returns the count of the objects - * found. If `options.format` is `'summary'`, it returns an array containing brief string representations for each object. The visibility provided - * in this API is similar to what the heap snapshot provides, while users can save the cost of serialization and parsing and directly filter the - * target objects during the search. - * - * Only objects created in the current execution context are included in the results. - * - * ```js - * import { queryObjects } from 'node:v8'; - * class A { foo = 'bar'; } - * console.log(queryObjects(A)); // 0 - * const a = new A(); - * console.log(queryObjects(A)); // 1 - * // [ "A { foo: 'bar' }" ] - * console.log(queryObjects(A, { format: 'summary' })); - * - * class B extends A { bar = 'qux'; } - * const b = new B(); - * console.log(queryObjects(B)); // 1 - * // [ "B { foo: 'bar', bar: 'qux' }" ] - * console.log(queryObjects(B, { format: 'summary' })); - * - * // Note that, when there are child classes inheriting from a constructor, - * // the constructor also shows up in the prototype chain of the child - * // classes's prototoype, so the child classes's prototoype would also be - * // included in the result. - * console.log(queryObjects(A)); // 3 - * // [ "B { foo: 'bar', bar: 'qux' }", 'A {}', "A { foo: 'bar' }" ] - * console.log(queryObjects(A, { format: 'summary' })); - * ``` - * @param ctor The constructor that can be used to search on the prototype chain in order to filter target objects in the heap. - * @since v20.13.0 - * @experimental - */ - function queryObjects(ctor: Function): number | string[]; - function queryObjects(ctor: Function, options: { format: "count" }): number; - function queryObjects(ctor: Function, options: { format: "summary" }): string[]; - /** - * Generates a snapshot of the current V8 heap and returns a Readable - * Stream that may be used to read the JSON serialized representation. - * This JSON stream format is intended to be used with tools such as - * Chrome DevTools. The JSON schema is undocumented and specific to the - * V8 engine. Therefore, the schema may change from one version of V8 to the next. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * // Print heap snapshot to the console - * import v8 from 'node:v8'; - * const stream = v8.getHeapSnapshot(); - * stream.pipe(process.stdout); - * ``` - * @since v11.13.0 - * @return A Readable containing the V8 heap snapshot. - */ - function getHeapSnapshot(options?: HeapSnapshotOptions): Readable; - /** - * Generates a snapshot of the current V8 heap and writes it to a JSON - * file. This file is intended to be used with tools such as Chrome - * DevTools. The JSON schema is undocumented and specific to the V8 - * engine, and may change from one version of V8 to the next. - * - * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will - * not contain any information about the workers, and vice versa. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * import { writeHeapSnapshot } from 'node:v8'; - * import { - * Worker, - * isMainThread, - * parentPort, - * } from 'node:worker_threads'; - * - * if (isMainThread) { - * const worker = new Worker(__filename); - * - * worker.once('message', (filename) => { - * console.log(`worker heapdump: ${filename}`); - * // Now get a heapdump for the main thread. - * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); - * }); - * - * // Tell the worker to create a heapdump. - * worker.postMessage('heapdump'); - * } else { - * parentPort.once('message', (message) => { - * if (message === 'heapdump') { - * // Generate a heapdump for the worker - * // and return the filename to the parent. - * parentPort.postMessage(writeHeapSnapshot()); - * } - * }); - * } - * ``` - * @since v11.13.0 - * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be - * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a - * worker thread. - * @return The filename where the snapshot was saved. - */ - function writeHeapSnapshot(filename?: string, options?: HeapSnapshotOptions): string; - /** - * Get statistics about code and its metadata in the heap, see - * V8 [`GetHeapCodeAndMetadataStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866) API. Returns an object with the - * following properties: - * - * ```js - * { - * code_and_metadata_size: 212208, - * bytecode_and_metadata_size: 161368, - * external_script_source_size: 1410794, - * cpu_profiler_metadata_size: 0, - * } - * ``` - * @since v12.8.0 - */ - function getHeapCodeStatistics(): HeapCodeStatistics; - /** - * @since v8.0.0 - */ - class Serializer { - /** - * Writes out a header, which includes the serialization format version. - */ - writeHeader(): void; - /** - * Serializes a JavaScript value and adds the serialized representation to the - * internal buffer. - * - * This throws an error if `value` cannot be serialized. - */ - writeValue(val: any): boolean; - /** - * Returns the stored internal buffer. This serializer should not be used once - * the buffer is released. Calling this method results in undefined behavior - * if a previous write has failed. - */ - releaseBuffer(): NonSharedBuffer; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Write a raw 32-bit unsigned integer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint32(value: number): void; - /** - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint64(hi: number, lo: number): void; - /** - * Write a JS `number` value. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeDouble(value: number): void; - /** - * Write raw bytes into the serializer's internal buffer. The deserializer - * will require a way to compute the length of the buffer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeRawBytes(buffer: NodeJS.ArrayBufferView): void; - } - /** - * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only - * stores the part of their underlying `ArrayBuffer`s that they are referring to. - * @since v8.0.0 - */ - class DefaultSerializer extends Serializer {} - /** - * @since v8.0.0 - */ - class Deserializer { - constructor(data: NodeJS.TypedArray); - /** - * Reads and validates a header (including the format version). - * May, for example, reject an invalid or unsupported wire format. In that case, - * an `Error` is thrown. - */ - readHeader(): boolean; - /** - * Deserializes a JavaScript value from the buffer and returns it. - */ - readValue(): any; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of - * `SharedArrayBuffer`s). - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Reads the underlying wire format version. Likely mostly to be useful to - * legacy code reading old wire format versions. May not be called before `.readHeader()`. - */ - getWireFormatVersion(): number; - /** - * Read a raw 32-bit unsigned integer and return it. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint32(): number; - /** - * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]` with two 32-bit unsigned integer entries. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint64(): [number, number]; - /** - * Read a JS `number` value. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readDouble(): number; - /** - * Read raw bytes from the deserializer's internal buffer. The `length` parameter - * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readRawBytes(length: number): Buffer; - } - /** - * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. - * @since v8.0.0 - */ - class DefaultDeserializer extends Deserializer {} - /** - * Uses a `DefaultSerializer` to serialize `value` into a buffer. - * - * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to - * serialize a huge object which requires buffer - * larger than `buffer.constants.MAX_LENGTH`. - * @since v8.0.0 - */ - function serialize(value: any): NonSharedBuffer; - /** - * Uses a `DefaultDeserializer` with default options to read a JS value - * from a buffer. - * @since v8.0.0 - * @param buffer A buffer returned by {@link serialize}. - */ - function deserialize(buffer: NodeJS.ArrayBufferView): any; - /** - * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple - * times during the lifetime of the process. Each time the execution counter will - * be reset and a new coverage report will be written to the directory specified - * by `NODE_V8_COVERAGE`. - * - * When the process is about to exit, one last coverage will still be written to - * disk unless {@link stopCoverage} is invoked before the process exits. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function takeCoverage(): void; - /** - * The `v8.stopCoverage()` method allows the user to stop the coverage collection - * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count - * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function stopCoverage(): void; - /** - * The API is a no-op if `--heapsnapshot-near-heap-limit` is already set from the command line or the API is called more than once. - * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information. - * @experimental - * @since v18.10.0, v16.18.0 - */ - function setHeapSnapshotNearHeapLimit(limit: number): void; - /** - * This API collects GC data in current thread. - * @since v19.6.0, v18.15.0 - */ - class GCProfiler { - /** - * Start collecting GC data. - * @since v19.6.0, v18.15.0 - */ - start(): void; - /** - * Stop collecting GC data and return an object. The content of object - * is as follows. - * - * ```json - * { - * "version": 1, - * "startTime": 1674059033862, - * "statistics": [ - * { - * "gcType": "Scavenge", - * "beforeGC": { - * "heapStatistics": { - * "totalHeapSize": 5005312, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5226496, - * "totalAvailableSize": 4341325216, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4883840, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * }, - * "cost": 1574.14, - * "afterGC": { - * "heapStatistics": { - * "totalHeapSize": 6053888, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5500928, - * "totalAvailableSize": 4341101384, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4059096, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * } - * } - * ], - * "endTime": 1674059036865 - * } - * ``` - * - * Here's an example. - * - * ```js - * import { GCProfiler } from 'node:v8'; - * const profiler = new GCProfiler(); - * profiler.start(); - * setTimeout(() => { - * console.log(profiler.stop()); - * }, 1000); - * ``` - * @since v19.6.0, v18.15.0 - */ - stop(): GCProfilerResult; - } - interface GCProfilerResult { - version: number; - startTime: number; - endTime: number; - statistics: Array<{ - gcType: string; - cost: number; - beforeGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - afterGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - }>; - } - interface HeapStatistics { - totalHeapSize: number; - totalHeapSizeExecutable: number; - totalPhysicalSize: number; - totalAvailableSize: number; - totalGlobalHandlesSize: number; - usedGlobalHandlesSize: number; - usedHeapSize: number; - heapSizeLimit: number; - mallocedMemory: number; - externalMemory: number; - peakMallocedMemory: number; - } - interface HeapSpaceStatistics { - spaceName: string; - spaceSize: number; - spaceUsedSize: number; - spaceAvailableSize: number; - physicalSpaceSize: number; - } - /** - * Called when a promise is constructed. This does not mean that corresponding before/after events will occur, only that the possibility exists. This will - * happen if a promise is created without ever getting a continuation. - * @since v17.1.0, v16.14.0 - * @param promise The promise being created. - * @param parent The promise continued from, if applicable. - */ - interface Init { - (promise: Promise, parent: Promise): void; - } - /** - * Called before a promise continuation executes. This can be in the form of `then()`, `catch()`, or `finally()` handlers or an await resuming. - * - * The before callback will be called 0 to N times. The before callback will typically be called 0 times if no continuation was ever made for the promise. - * The before callback may be called many times in the case where many continuations have been made from the same promise. - * @since v17.1.0, v16.14.0 - */ - interface Before { - (promise: Promise): void; - } - /** - * Called immediately after a promise continuation executes. This may be after a `then()`, `catch()`, or `finally()` handler or before an await after another await. - * @since v17.1.0, v16.14.0 - */ - interface After { - (promise: Promise): void; - } - /** - * Called when the promise receives a resolution or rejection value. This may occur synchronously in the case of {@link Promise.resolve()} or - * {@link Promise.reject()}. - * @since v17.1.0, v16.14.0 - */ - interface Settled { - (promise: Promise): void; - } - /** - * Key events in the lifetime of a promise have been categorized into four areas: creation of a promise, before/after a continuation handler is called or - * around an await, and when the promise resolves or rejects. - * - * Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and - * `settled()` callbacks must not be async functions as they create more promises which would produce an infinite loop. - * @since v17.1.0, v16.14.0 - */ - interface HookCallbacks { - init?: Init; - before?: Before; - after?: After; - settled?: Settled; - } - interface PromiseHooks { - /** - * The `init` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param init The {@link Init | `init` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onInit: (init: Init) => Function; - /** - * The `settled` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param settled The {@link Settled | `settled` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onSettled: (settled: Settled) => Function; - /** - * The `before` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param before The {@link Before | `before` callback} to call before a promise continuation executes. - * @return Call to stop the hook. - */ - onBefore: (before: Before) => Function; - /** - * The `after` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param after The {@link After | `after` callback} to call after a promise continuation executes. - * @return Call to stop the hook. - */ - onAfter: (after: After) => Function; - /** - * Registers functions to be called for different lifetime events of each promise. - * The callbacks `init()`/`before()`/`after()`/`settled()` are called for the respective events during a promise's lifetime. - * All callbacks are optional. For example, if only promise creation needs to be tracked, then only the init callback needs to be passed. - * The hook callbacks must be plain functions. Providing async functions will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param callbacks The {@link HookCallbacks | Hook Callbacks} to register - * @return Used for disabling hooks - */ - createHook: (callbacks: HookCallbacks) => Function; - } - /** - * The `promiseHooks` interface can be used to track promise lifecycle events. - * @since v17.1.0, v16.14.0 - */ - const promiseHooks: PromiseHooks; - type StartupSnapshotCallbackFn = (args: any) => any; - interface StartupSnapshot { - /** - * Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit. - * This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization. - * @since v18.6.0, v16.17.0 - */ - addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void; - /** - * Add a callback that will be called when the Node.js instance is deserialized from a snapshot. - * The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or - * to re-acquire resources that the application needs when the application is restarted from the snapshot. - * @since v18.6.0, v16.17.0 - */ - addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void; - /** - * This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script. - * If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized - * data (if provided), otherwise an entry point script still needs to be provided to the deserialized application. - * @since v18.6.0, v16.17.0 - */ - setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void; - /** - * Returns true if the Node.js instance is run to build a snapshot. - * @since v18.6.0, v16.17.0 - */ - isBuildingSnapshot(): boolean; - } - /** - * The `v8.startupSnapshot` interface can be used to add serialization and deserialization hooks for custom startup snapshots. - * - * ```bash - * $ node --snapshot-blob snapshot.blob --build-snapshot entry.js - * # This launches a process with the snapshot - * $ node --snapshot-blob snapshot.blob - * ``` - * - * In the example above, `entry.js` can use methods from the `v8.startupSnapshot` interface to specify how to save information for custom objects - * in the snapshot during serialization and how the information can be used to synchronize these objects during deserialization of the snapshot. - * For example, if the `entry.js` contains the following script: - * - * ```js - * 'use strict'; - * - * import fs from 'node:fs'; - * import zlib from 'node:zlib'; - * import path from 'node:path'; - * import assert from 'node:assert'; - * - * import v8 from 'node:v8'; - * - * class BookShelf { - * storage = new Map(); - * - * // Reading a series of files from directory and store them into storage. - * constructor(directory, books) { - * for (const book of books) { - * this.storage.set(book, fs.readFileSync(path.join(directory, book))); - * } - * } - * - * static compressAll(shelf) { - * for (const [ book, content ] of shelf.storage) { - * shelf.storage.set(book, zlib.gzipSync(content)); - * } - * } - * - * static decompressAll(shelf) { - * for (const [ book, content ] of shelf.storage) { - * shelf.storage.set(book, zlib.gunzipSync(content)); - * } - * } - * } - * - * // __dirname here is where the snapshot script is placed - * // during snapshot building time. - * const shelf = new BookShelf(__dirname, [ - * 'book1.en_US.txt', - * 'book1.es_ES.txt', - * 'book2.zh_CN.txt', - * ]); - * - * assert(v8.startupSnapshot.isBuildingSnapshot()); - * // On snapshot serialization, compress the books to reduce size. - * v8.startupSnapshot.addSerializeCallback(BookShelf.compressAll, shelf); - * // On snapshot deserialization, decompress the books. - * v8.startupSnapshot.addDeserializeCallback(BookShelf.decompressAll, shelf); - * v8.startupSnapshot.setDeserializeMainFunction((shelf) => { - * // process.env and process.argv are refreshed during snapshot - * // deserialization. - * const lang = process.env.BOOK_LANG || 'en_US'; - * const book = process.argv[1]; - * const name = `${book}.${lang}.txt`; - * console.log(shelf.storage.get(name)); - * }, shelf); - * ``` - * - * The resulted binary will get print the data deserialized from the snapshot during start up, using the refreshed `process.env` and `process.argv` of the launched process: - * - * ```bash - * $ BOOK_LANG=es_ES node --snapshot-blob snapshot.blob book1 - * # Prints content of book1.es_ES.txt deserialized from the snapshot. - * ``` - * - * Currently the application deserialized from a user-land snapshot cannot be snapshotted again, so these APIs are only available to applications that are not deserialized from a user-land snapshot. - * - * @experimental - * @since v18.6.0, v16.17.0 - */ - const startupSnapshot: StartupSnapshot; -} -declare module "node:v8" { - export * from "v8"; -} diff --git a/node_modules/@types/node/vm.d.ts b/node_modules/@types/node/vm.d.ts deleted file mode 100644 index 313240a..0000000 --- a/node_modules/@types/node/vm.d.ts +++ /dev/null @@ -1,1001 +0,0 @@ -/** - * The `node:vm` module enables compiling and running code within V8 Virtual - * Machine contexts. - * - * **The `node:vm` module is not a security** - * **mechanism. Do not use it to run untrusted code.** - * - * JavaScript code can be compiled and run immediately or - * compiled, saved, and run later. - * - * A common use case is to run the code in a different V8 Context. This means - * invoked code has a different global object than the invoking code. - * - * One can provide the context by `contextifying` an - * object. The invoked code treats any property in the context like a - * global variable. Any changes to global variables caused by the invoked - * code are reflected in the context object. - * - * ```js - * import vm from 'node:vm'; - * - * const x = 1; - * - * const context = { x: 2 }; - * vm.createContext(context); // Contextify the object. - * - * const code = 'x += 40; var y = 17;'; - * // `x` and `y` are global variables in the context. - * // Initially, x has the value 2 because that is the value of context.x. - * vm.runInContext(code, context); - * - * console.log(context.x); // 42 - * console.log(context.y); // 17 - * - * console.log(x); // 1; y is not defined. - * ``` - * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/vm.js) - */ -declare module "vm" { - import { NonSharedBuffer } from "node:buffer"; - import { ImportAttributes } from "node:module"; - interface Context extends NodeJS.Dict {} - interface BaseOptions { - /** - * Specifies the filename used in stack traces produced by this script. - * @default '' - */ - filename?: string | undefined; - /** - * Specifies the line number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - lineOffset?: number | undefined; - /** - * Specifies the column number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - columnOffset?: number | undefined; - } - type DynamicModuleLoader = ( - specifier: string, - referrer: T, - importAttributes: ImportAttributes, - ) => Module | Promise; - interface ScriptOptions extends BaseOptions { - /** - * Provides an optional data with V8's code cache data for the supplied source. - */ - cachedData?: NodeJS.ArrayBufferView | undefined; - /** @deprecated in favor of `script.createCachedData()` */ - produceCachedData?: boolean | undefined; - /** - * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is - * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see - * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v20.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). - */ - importModuleDynamically?: - | DynamicModuleLoader`; - if (buffer) { - buffer[0] = `${appendStyleScript}${buffer[0]}`; - return; - } - return Promise.resolve(appendStyleScript); - }; - const addClassNameToContext = ({ context }) => { - if (!contextMap.has(context)) { - contextMap.set(context, [{}, {}]); - } - const [toAdd, added] = contextMap.get(context); - let allAdded = true; - if (!added[cssClassName[import_common.SELECTOR]]) { - allAdded = false; - toAdd[cssClassName[import_common.SELECTOR]] = cssClassName[import_common.STYLE_STRING]; - } - cssClassName[import_common.SELECTORS].forEach( - ({ [import_common.CLASS_NAME]: className2, [import_common.STYLE_STRING]: styleString }) => { - if (!added[className2]) { - allAdded = false; - toAdd[className2] = styleString; - } - } - ); - if (allAdded) { - return; - } - return Promise.resolve((0, import_html.raw)("", [appendStyle])); - }; - const className = new String(cssClassName[import_common.CLASS_NAME]); - Object.assign(className, cssClassName); - className.isEscaped = true; - className.callbacks = [addClassNameToContext]; - const promise = Promise.resolve(className); - Object.assign(promise, cssClassName); - promise.toString = cssJsxDomObject.toString; - return promise; - }; - const css2 = (strings, ...values) => { - return newCssClassNameObject((0, import_common.cssCommon)(strings, values)); - }; - const cx2 = (...args) => { - args = (0, import_common.cxCommon)(args); - return css2(Array(args.length).fill(""), ...args); - }; - const keyframes2 = import_common.keyframesCommon; - const viewTransition2 = ((strings, ...values) => { - return newCssClassNameObject((0, import_common.viewTransitionCommon)(strings, values)); - }); - const Style2 = ({ children, nonce } = {}) => (0, import_html.raw)( - ``, - [ - ({ context }) => { - nonceMap.set(context, nonce); - return void 0; - } - ] - ); - Style2[import_constants.DOM_RENDERER] = StyleRenderToDom; - return { - css: css2, - cx: cx2, - keyframes: keyframes2, - viewTransition: viewTransition2, - Style: Style2 - }; -}; -const defaultContext = createCssContext({ - id: import_common.DEFAULT_STYLE_ID -}); -const css = defaultContext.css; -const cx = defaultContext.cx; -const keyframes = defaultContext.keyframes; -const viewTransition = defaultContext.viewTransition; -const Style = defaultContext.Style; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Style, - createCssContext, - css, - cx, - keyframes, - rawCssString, - viewTransition -}); diff --git a/node_modules/hono/dist/cjs/helper/dev/index.js b/node_modules/hono/dist/cjs/helper/dev/index.js deleted file mode 100644 index 4e22ded..0000000 --- a/node_modules/hono/dist/cjs/helper/dev/index.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var dev_exports = {}; -__export(dev_exports, { - getRouterName: () => getRouterName, - inspectRoutes: () => inspectRoutes, - showRoutes: () => showRoutes -}); -module.exports = __toCommonJS(dev_exports); -var import_color = require("../../utils/color"); -var import_handler = require("../../utils/handler"); -const handlerName = (handler) => { - return handler.name || ((0, import_handler.isMiddleware)(handler) ? "[middleware]" : "[handler]"); -}; -const inspectRoutes = (hono) => { - return hono.routes.map(({ path, method, handler }) => { - const targetHandler = (0, import_handler.findTargetHandler)(handler); - return { - path, - method, - name: handlerName(targetHandler), - isMiddleware: (0, import_handler.isMiddleware)(targetHandler) - }; - }); -}; -const showRoutes = (hono, opts) => { - const colorEnabled = opts?.colorize ?? (0, import_color.getColorEnabled)(); - const routeData = {}; - let maxMethodLength = 0; - let maxPathLength = 0; - inspectRoutes(hono).filter(({ isMiddleware: isMiddleware2 }) => opts?.verbose || !isMiddleware2).map((route) => { - const key = `${route.method}-${route.path}`; - (routeData[key] ||= []).push(route); - if (routeData[key].length > 1) { - return; - } - maxMethodLength = Math.max(maxMethodLength, route.method.length); - maxPathLength = Math.max(maxPathLength, route.path.length); - return { method: route.method, path: route.path, routes: routeData[key] }; - }).forEach((data) => { - if (!data) { - return; - } - const { method, path, routes } = data; - const methodStr = colorEnabled ? `\x1B[32m${method}\x1B[0m` : method; - console.log(`${methodStr} ${" ".repeat(maxMethodLength - method.length)} ${path}`); - if (!opts?.verbose) { - return; - } - routes.forEach(({ name }) => { - console.log(`${" ".repeat(maxMethodLength + 3)} ${name}`); - }); - }); -}; -const getRouterName = (app) => { - app.router.match("GET", "/"); - return app.router.name; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - getRouterName, - inspectRoutes, - showRoutes -}); diff --git a/node_modules/hono/dist/cjs/helper/factory/index.js b/node_modules/hono/dist/cjs/helper/factory/index.js deleted file mode 100644 index 0e14635..0000000 --- a/node_modules/hono/dist/cjs/helper/factory/index.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var factory_exports = {}; -__export(factory_exports, { - Factory: () => Factory, - createFactory: () => createFactory, - createMiddleware: () => createMiddleware -}); -module.exports = __toCommonJS(factory_exports); -var import_hono = require("../../hono"); -class Factory { - initApp; - #defaultAppOptions; - constructor(init) { - this.initApp = init?.initApp; - this.#defaultAppOptions = init?.defaultAppOptions; - } - createApp = (options) => { - const app = new import_hono.Hono( - options && this.#defaultAppOptions ? { ...this.#defaultAppOptions, ...options } : options ?? this.#defaultAppOptions - ); - if (this.initApp) { - this.initApp(app); - } - return app; - }; - createMiddleware = (middleware) => middleware; - createHandlers = (...handlers) => { - return handlers.filter((handler) => handler !== void 0); - }; -} -const createFactory = (init) => new Factory(init); -const createMiddleware = (middleware) => middleware; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Factory, - createFactory, - createMiddleware -}); diff --git a/node_modules/hono/dist/cjs/helper/html/index.js b/node_modules/hono/dist/cjs/helper/html/index.js deleted file mode 100644 index faa3baa..0000000 --- a/node_modules/hono/dist/cjs/helper/html/index.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var html_exports = {}; -__export(html_exports, { - html: () => html, - raw: () => import_html.raw -}); -module.exports = __toCommonJS(html_exports); -var import_html = require("../../utils/html"); -const html = (strings, ...values) => { - const buffer = [""]; - for (let i = 0, len = strings.length - 1; i < len; i++) { - buffer[0] += strings[i]; - const children = Array.isArray(values[i]) ? values[i].flat(Infinity) : [values[i]]; - for (let i2 = 0, len2 = children.length; i2 < len2; i2++) { - const child = children[i2]; - if (typeof child === "string") { - (0, import_html.escapeToBuffer)(child, buffer); - } else if (typeof child === "number") { - ; - buffer[0] += child; - } else if (typeof child === "boolean" || child === null || child === void 0) { - continue; - } else if (typeof child === "object" && child.isEscaped) { - if (child.callbacks) { - buffer.unshift("", child); - } else { - const tmp = child.toString(); - if (tmp instanceof Promise) { - buffer.unshift("", tmp); - } else { - buffer[0] += tmp; - } - } - } else if (child instanceof Promise) { - buffer.unshift("", child); - } else { - (0, import_html.escapeToBuffer)(child.toString(), buffer); - } - } - } - buffer[0] += strings.at(-1); - return buffer.length === 1 ? "callbacks" in buffer ? (0, import_html.raw)((0, import_html.resolveCallbackSync)((0, import_html.raw)(buffer[0], buffer.callbacks))) : (0, import_html.raw)(buffer[0]) : (0, import_html.stringBufferToString)(buffer, buffer.callbacks); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - html, - raw -}); diff --git a/node_modules/hono/dist/cjs/helper/proxy/index.js b/node_modules/hono/dist/cjs/helper/proxy/index.js deleted file mode 100644 index 2c74f17..0000000 --- a/node_modules/hono/dist/cjs/helper/proxy/index.js +++ /dev/null @@ -1,112 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var proxy_exports = {}; -__export(proxy_exports, { - proxy: () => proxy -}); -module.exports = __toCommonJS(proxy_exports); -var import_http_exception = require("../../http-exception"); -const hopByHopHeaders = [ - "connection", - "keep-alive", - "proxy-authenticate", - "proxy-authorization", - "te", - "trailer", - "transfer-encoding", - "upgrade" -]; -const ALLOWED_TOKEN_PATTERN = /^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/; -const buildRequestInitFromRequest = (request, strictConnectionProcessing) => { - if (!request) { - return {}; - } - const headers = new Headers(request.headers); - if (strictConnectionProcessing) { - const connectionValue = headers.get("connection"); - if (connectionValue) { - const headerNames = connectionValue.split(",").map((h) => h.trim()); - const invalidHeaders = headerNames.filter((h) => !ALLOWED_TOKEN_PATTERN.test(h)); - if (invalidHeaders.length > 0) { - throw new import_http_exception.HTTPException(400, { - message: `Invalid Connection header value: ${invalidHeaders.join(", ")}` - }); - } - headerNames.forEach((headerName) => { - headers.delete(headerName); - }); - } - } - hopByHopHeaders.forEach((header) => { - headers.delete(header); - }); - return { - method: request.method, - body: request.body, - duplex: request.body ? "half" : void 0, - headers, - signal: request.signal - }; -}; -const preprocessRequestInit = (requestInit) => { - if (!requestInit.headers || Array.isArray(requestInit.headers) || requestInit.headers instanceof Headers) { - return requestInit; - } - const headers = new Headers(); - for (const [key, value] of Object.entries(requestInit.headers)) { - if (value == null) { - headers.delete(key); - } else { - headers.set(key, value); - } - } - requestInit.headers = headers; - return requestInit; -}; -const proxy = async (input, proxyInit) => { - const { - raw, - customFetch, - strictConnectionProcessing = false, - ...requestInit - } = proxyInit instanceof Request ? { raw: proxyInit } : proxyInit ?? {}; - const req = new Request(input, { - ...buildRequestInitFromRequest(raw, strictConnectionProcessing), - ...preprocessRequestInit(requestInit) - }); - req.headers.delete("accept-encoding"); - const res = await (customFetch || fetch)(req); - const resHeaders = new Headers(res.headers); - hopByHopHeaders.forEach((header) => { - resHeaders.delete(header); - }); - if (resHeaders.has("content-encoding")) { - resHeaders.delete("content-encoding"); - resHeaders.delete("content-length"); - } - return new Response(res.body, { - status: res.status, - statusText: res.statusText, - headers: resHeaders - }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - proxy -}); diff --git a/node_modules/hono/dist/cjs/helper/route/index.js b/node_modules/hono/dist/cjs/helper/route/index.js deleted file mode 100644 index 95769db..0000000 --- a/node_modules/hono/dist/cjs/helper/route/index.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var route_exports = {}; -__export(route_exports, { - basePath: () => basePath, - baseRoutePath: () => baseRoutePath, - matchedRoutes: () => matchedRoutes, - routePath: () => routePath -}); -module.exports = __toCommonJS(route_exports); -var import_constants = require("../../request/constants"); -var import_url = require("../../utils/url"); -const matchedRoutes = (c) => ( - // @ts-expect-error c.req[GET_MATCH_RESULT] is not typed - c.req[import_constants.GET_MATCH_RESULT][0].map(([[, route]]) => route) -); -const routePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.path ?? ""; -const baseRoutePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.basePath ?? ""; -const basePathCacheMap = /* @__PURE__ */ new WeakMap(); -const basePath = (c, index) => { - index ??= c.req.routeIndex; - const cache = basePathCacheMap.get(c) || []; - if (typeof cache[index] === "string") { - return cache[index]; - } - let result; - const rp = baseRoutePath(c, index); - if (!/[:*]/.test(rp)) { - result = rp; - } else { - const paths = (0, import_url.splitRoutingPath)(rp); - const reqPath = c.req.path; - let basePathLength = 0; - for (let i = 0, len = paths.length; i < len; i++) { - const pattern = (0, import_url.getPattern)(paths[i], paths[i + 1]); - if (pattern) { - const re = pattern[2] === true || pattern === "*" ? /[^\/]+/ : pattern[2]; - basePathLength += reqPath.substring(basePathLength + 1).match(re)?.[0].length || 0; - } else { - basePathLength += paths[i].length; - } - basePathLength += 1; - } - result = reqPath.substring(0, basePathLength); - } - cache[index] = result; - basePathCacheMap.set(c, cache); - return result; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - basePath, - baseRoutePath, - matchedRoutes, - routePath -}); diff --git a/node_modules/hono/dist/cjs/helper/ssg/index.js b/node_modules/hono/dist/cjs/helper/ssg/index.js deleted file mode 100644 index 4969d06..0000000 --- a/node_modules/hono/dist/cjs/helper/ssg/index.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var ssg_exports = {}; -__export(ssg_exports, { - X_HONO_DISABLE_SSG_HEADER_KEY: () => import_middleware.X_HONO_DISABLE_SSG_HEADER_KEY, - disableSSG: () => import_middleware.disableSSG, - isSSGContext: () => import_middleware.isSSGContext, - onlySSG: () => import_middleware.onlySSG, - ssgParams: () => import_middleware.ssgParams -}); -module.exports = __toCommonJS(ssg_exports); -__reExport(ssg_exports, require("./ssg"), module.exports); -var import_middleware = require("./middleware"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - X_HONO_DISABLE_SSG_HEADER_KEY, - disableSSG, - isSSGContext, - onlySSG, - ssgParams, - ...require("./ssg") -}); diff --git a/node_modules/hono/dist/cjs/helper/ssg/middleware.js b/node_modules/hono/dist/cjs/helper/ssg/middleware.js deleted file mode 100644 index fcab031..0000000 --- a/node_modules/hono/dist/cjs/helper/ssg/middleware.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var middleware_exports = {}; -__export(middleware_exports, { - SSG_CONTEXT: () => SSG_CONTEXT, - SSG_DISABLED_RESPONSE: () => SSG_DISABLED_RESPONSE, - X_HONO_DISABLE_SSG_HEADER_KEY: () => X_HONO_DISABLE_SSG_HEADER_KEY, - disableSSG: () => disableSSG, - isSSGContext: () => isSSGContext, - onlySSG: () => onlySSG, - ssgParams: () => ssgParams -}); -module.exports = __toCommonJS(middleware_exports); -var import_utils = require("./utils"); -const SSG_CONTEXT = "HONO_SSG_CONTEXT"; -const X_HONO_DISABLE_SSG_HEADER_KEY = "x-hono-disable-ssg"; -const SSG_DISABLED_RESPONSE = (() => { - try { - return new Response("SSG is disabled", { - status: 404, - headers: { [X_HONO_DISABLE_SSG_HEADER_KEY]: "true" } - }); - } catch { - return null; - } -})(); -const ssgParams = (params) => async (c, next) => { - if ((0, import_utils.isDynamicRoute)(c.req.path)) { - ; - c.req.raw.ssgParams = Array.isArray(params) ? params : await params(c); - return c.notFound(); - } - await next(); -}; -const isSSGContext = (c) => !!c.env?.[SSG_CONTEXT]; -const disableSSG = () => async function disableSSG2(c, next) { - if (isSSGContext(c)) { - c.header(X_HONO_DISABLE_SSG_HEADER_KEY, "true"); - return c.notFound(); - } - await next(); -}; -const onlySSG = () => async function onlySSG2(c, next) { - if (!isSSGContext(c)) { - return c.notFound(); - } - await next(); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - SSG_CONTEXT, - SSG_DISABLED_RESPONSE, - X_HONO_DISABLE_SSG_HEADER_KEY, - disableSSG, - isSSGContext, - onlySSG, - ssgParams -}); diff --git a/node_modules/hono/dist/cjs/helper/ssg/ssg.js b/node_modules/hono/dist/cjs/helper/ssg/ssg.js deleted file mode 100644 index 0a4493a..0000000 --- a/node_modules/hono/dist/cjs/helper/ssg/ssg.js +++ /dev/null @@ -1,326 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var ssg_exports = {}; -__export(ssg_exports, { - DEFAULT_OUTPUT_DIR: () => DEFAULT_OUTPUT_DIR, - combineAfterGenerateHooks: () => combineAfterGenerateHooks, - combineAfterResponseHooks: () => combineAfterResponseHooks, - combineBeforeRequestHooks: () => combineBeforeRequestHooks, - defaultExtensionMap: () => defaultExtensionMap, - defaultPlugin: () => defaultPlugin, - fetchRoutesContent: () => fetchRoutesContent, - saveContentToFile: () => saveContentToFile, - toSSG: () => toSSG -}); -module.exports = __toCommonJS(ssg_exports); -var import_utils = require("../../client/utils"); -var import_concurrent = require("../../utils/concurrent"); -var import_mime = require("../../utils/mime"); -var import_middleware = require("./middleware"); -var import_utils2 = require("./utils"); -const DEFAULT_CONCURRENCY = 2; -const DEFAULT_CONTENT_TYPE = "text/plain"; -const DEFAULT_OUTPUT_DIR = "./static"; -const generateFilePath = (routePath, outDir, mimeType, extensionMap) => { - const extension = determineExtension(mimeType, extensionMap); - if (routePath.endsWith(`.${extension}`)) { - return (0, import_utils2.joinPaths)(outDir, routePath); - } - if (routePath === "/") { - return (0, import_utils2.joinPaths)(outDir, `index.${extension}`); - } - if (routePath.endsWith("/")) { - return (0, import_utils2.joinPaths)(outDir, routePath, `index.${extension}`); - } - return (0, import_utils2.joinPaths)(outDir, `${routePath}.${extension}`); -}; -const parseResponseContent = async (response) => { - const contentType = response.headers.get("Content-Type"); - try { - if (contentType?.includes("text") || contentType?.includes("json")) { - return await response.text(); - } else { - return await response.arrayBuffer(); - } - } catch (error) { - throw new Error( - `Error processing response: ${error instanceof Error ? error.message : "Unknown error"}` - ); - } -}; -const defaultExtensionMap = { - "text/html": "html", - "text/xml": "xml", - "application/xml": "xml", - "application/yaml": "yaml" -}; -const determineExtension = (mimeType, userExtensionMap) => { - const extensionMap = userExtensionMap || defaultExtensionMap; - if (mimeType in extensionMap) { - return extensionMap[mimeType]; - } - return (0, import_mime.getExtension)(mimeType) || "html"; -}; -const combineBeforeRequestHooks = (hooks) => { - if (!Array.isArray(hooks)) { - return hooks; - } - return async (req) => { - let currentReq = req; - for (const hook of hooks) { - const result = await hook(currentReq); - if (result === false) { - return false; - } - if (result instanceof Request) { - currentReq = result; - } - } - return currentReq; - }; -}; -const combineAfterResponseHooks = (hooks) => { - if (!Array.isArray(hooks)) { - return hooks; - } - return async (res) => { - let currentRes = res; - for (const hook of hooks) { - const result = await hook(currentRes); - if (result === false) { - return false; - } - if (result instanceof Response) { - currentRes = result; - } - } - return currentRes; - }; -}; -const combineAfterGenerateHooks = (hooks, fsModule, options) => { - if (!Array.isArray(hooks)) { - return hooks; - } - return async (result) => { - for (const hook of hooks) { - await hook(result, fsModule, options); - } - }; -}; -const fetchRoutesContent = function* (app, beforeRequestHook, afterResponseHook, concurrency) { - const baseURL = "http://localhost"; - const pool = (0, import_concurrent.createPool)({ concurrency }); - for (const route of (0, import_utils2.filterStaticGenerateRoutes)(app)) { - const thisRouteBaseURL = new URL(route.path, baseURL).toString(); - let forGetInfoURLRequest = new Request(thisRouteBaseURL); - yield new Promise(async (resolveGetInfo, rejectGetInfo) => { - try { - if (beforeRequestHook) { - const maybeRequest = await beforeRequestHook(forGetInfoURLRequest); - if (!maybeRequest) { - resolveGetInfo(void 0); - return; - } - forGetInfoURLRequest = maybeRequest; - } - await pool.run(() => app.fetch(forGetInfoURLRequest)); - if (!forGetInfoURLRequest.ssgParams) { - if ((0, import_utils2.isDynamicRoute)(route.path)) { - resolveGetInfo(void 0); - return; - } - forGetInfoURLRequest.ssgParams = [{}]; - } - const requestInit = { - method: forGetInfoURLRequest.method, - headers: forGetInfoURLRequest.headers - }; - resolveGetInfo( - (function* () { - for (const param of forGetInfoURLRequest.ssgParams) { - yield new Promise(async (resolveReq, rejectReq) => { - try { - const replacedUrlParam = (0, import_utils.replaceUrlParam)(route.path, param); - let response = await pool.run( - () => app.request(replacedUrlParam, requestInit, { - [import_middleware.SSG_CONTEXT]: true - }) - ); - if (response.headers.get(import_middleware.X_HONO_DISABLE_SSG_HEADER_KEY)) { - resolveReq(void 0); - return; - } - if (afterResponseHook) { - const maybeResponse = await afterResponseHook(response); - if (!maybeResponse) { - resolveReq(void 0); - return; - } - response = maybeResponse; - } - const mimeType = response.headers.get("Content-Type")?.split(";")[0] || DEFAULT_CONTENT_TYPE; - const content = await parseResponseContent(response); - resolveReq({ - routePath: replacedUrlParam, - mimeType, - content - }); - } catch (error) { - rejectReq(error); - } - }); - } - })() - ); - } catch (error) { - rejectGetInfo(error); - } - }); - } -}; -const createdDirs = /* @__PURE__ */ new Set(); -const saveContentToFile = async (data, fsModule, outDir, extensionMap) => { - const awaitedData = await data; - if (!awaitedData) { - return; - } - const { routePath, content, mimeType } = awaitedData; - const filePath = generateFilePath(routePath, outDir, mimeType, extensionMap); - const dirPath = (0, import_utils2.dirname)(filePath); - if (!createdDirs.has(dirPath)) { - await fsModule.mkdir(dirPath, { recursive: true }); - createdDirs.add(dirPath); - } - if (typeof content === "string") { - await fsModule.writeFile(filePath, content); - } else if (content instanceof ArrayBuffer) { - await fsModule.writeFile(filePath, new Uint8Array(content)); - } - return filePath; -}; -const defaultPlugin = { - afterResponseHook: (res) => { - if (res.status !== 200) { - return false; - } - return res; - } -}; -const toSSG = async (app, fs, options) => { - let result; - const getInfoPromises = []; - const savePromises = []; - const plugins = options?.plugins || [defaultPlugin]; - const beforeRequestHooks = []; - const afterResponseHooks = []; - const afterGenerateHooks = []; - if (options?.beforeRequestHook) { - beforeRequestHooks.push( - ...Array.isArray(options.beforeRequestHook) ? options.beforeRequestHook : [options.beforeRequestHook] - ); - } - if (options?.afterResponseHook) { - afterResponseHooks.push( - ...Array.isArray(options.afterResponseHook) ? options.afterResponseHook : [options.afterResponseHook] - ); - } - if (options?.afterGenerateHook) { - afterGenerateHooks.push( - ...Array.isArray(options.afterGenerateHook) ? options.afterGenerateHook : [options.afterGenerateHook] - ); - } - for (const plugin of plugins) { - if (plugin.beforeRequestHook) { - beforeRequestHooks.push( - ...Array.isArray(plugin.beforeRequestHook) ? plugin.beforeRequestHook : [plugin.beforeRequestHook] - ); - } - if (plugin.afterResponseHook) { - afterResponseHooks.push( - ...Array.isArray(plugin.afterResponseHook) ? plugin.afterResponseHook : [plugin.afterResponseHook] - ); - } - if (plugin.afterGenerateHook) { - afterGenerateHooks.push( - ...Array.isArray(plugin.afterGenerateHook) ? plugin.afterGenerateHook : [plugin.afterGenerateHook] - ); - } - } - try { - const outputDir = options?.dir ?? DEFAULT_OUTPUT_DIR; - const concurrency = options?.concurrency ?? DEFAULT_CONCURRENCY; - const combinedBeforeRequestHook = combineBeforeRequestHooks( - beforeRequestHooks.length > 0 ? beforeRequestHooks : [(req) => req] - ); - const combinedAfterResponseHook = combineAfterResponseHooks( - afterResponseHooks.length > 0 ? afterResponseHooks : [(req) => req] - ); - const getInfoGen = fetchRoutesContent( - app, - combinedBeforeRequestHook, - combinedAfterResponseHook, - concurrency - ); - for (const getInfo of getInfoGen) { - getInfoPromises.push( - getInfo.then((getContentGen) => { - if (!getContentGen) { - return; - } - for (const content of getContentGen) { - savePromises.push( - saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e) - ); - } - }) - ); - } - await Promise.all(getInfoPromises); - const files = []; - for (const savePromise of savePromises) { - const fileOrError = await savePromise; - if (typeof fileOrError === "string") { - files.push(fileOrError); - } else if (fileOrError) { - throw fileOrError; - } - } - result = { success: true, files }; - } catch (error) { - const errorObj = error instanceof Error ? error : new Error(String(error)); - result = { success: false, files: [], error: errorObj }; - } - if (afterGenerateHooks.length > 0) { - const combinedAfterGenerateHooks = combineAfterGenerateHooks(afterGenerateHooks, fs, options); - await combinedAfterGenerateHooks(result, fs, options); - } - return result; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - DEFAULT_OUTPUT_DIR, - combineAfterGenerateHooks, - combineAfterResponseHooks, - combineBeforeRequestHooks, - defaultExtensionMap, - defaultPlugin, - fetchRoutesContent, - saveContentToFile, - toSSG -}); diff --git a/node_modules/hono/dist/cjs/helper/ssg/utils.js b/node_modules/hono/dist/cjs/helper/ssg/utils.js deleted file mode 100644 index 8cb13af..0000000 --- a/node_modules/hono/dist/cjs/helper/ssg/utils.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var utils_exports = {}; -__export(utils_exports, { - dirname: () => dirname, - filterStaticGenerateRoutes: () => filterStaticGenerateRoutes, - isDynamicRoute: () => isDynamicRoute, - joinPaths: () => joinPaths -}); -module.exports = __toCommonJS(utils_exports); -var import_router = require("../../router"); -var import_handler = require("../../utils/handler"); -const dirname = (path) => { - const separatedPath = path.split(/[\/\\]/); - return separatedPath.slice(0, -1).join("/"); -}; -const normalizePath = (path) => { - return path.replace(/(\\)/g, "/").replace(/\/$/g, ""); -}; -const handleParent = (resultPaths, beforeParentFlag) => { - if (resultPaths.length === 0 || beforeParentFlag) { - resultPaths.push(".."); - } else { - resultPaths.pop(); - } -}; -const handleNonDot = (path, resultPaths) => { - path = path.replace(/^\.(?!.)/, ""); - if (path !== "") { - resultPaths.push(path); - } -}; -const handleSegments = (paths, resultPaths) => { - let beforeParentFlag = false; - for (const path of paths) { - if (path === "..") { - handleParent(resultPaths, beforeParentFlag); - beforeParentFlag = true; - } else { - handleNonDot(path, resultPaths); - beforeParentFlag = false; - } - } -}; -const joinPaths = (...paths) => { - paths = paths.map(normalizePath); - const resultPaths = []; - handleSegments(paths.join("/").split("/"), resultPaths); - return (paths[0][0] === "/" ? "/" : "") + resultPaths.join("/"); -}; -const filterStaticGenerateRoutes = (hono) => { - return hono.routes.reduce((acc, { method, handler, path }) => { - const targetHandler = (0, import_handler.findTargetHandler)(handler); - if (["GET", import_router.METHOD_NAME_ALL].includes(method) && !(0, import_handler.isMiddleware)(targetHandler)) { - acc.push({ path }); - } - return acc; - }, []); -}; -const isDynamicRoute = (path) => { - return path.split("/").some((segment) => segment.startsWith(":") || segment.includes("*")); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - dirname, - filterStaticGenerateRoutes, - isDynamicRoute, - joinPaths -}); diff --git a/node_modules/hono/dist/cjs/helper/streaming/index.js b/node_modules/hono/dist/cjs/helper/streaming/index.js deleted file mode 100644 index b343d99..0000000 --- a/node_modules/hono/dist/cjs/helper/streaming/index.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var streaming_exports = {}; -__export(streaming_exports, { - SSEStreamingApi: () => import_sse.SSEStreamingApi, - stream: () => import_stream.stream, - streamSSE: () => import_sse.streamSSE, - streamText: () => import_text.streamText -}); -module.exports = __toCommonJS(streaming_exports); -var import_stream = require("./stream"); -var import_sse = require("./sse"); -var import_text = require("./text"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - SSEStreamingApi, - stream, - streamSSE, - streamText -}); diff --git a/node_modules/hono/dist/cjs/helper/streaming/sse.js b/node_modules/hono/dist/cjs/helper/streaming/sse.js deleted file mode 100644 index 2cf3598..0000000 --- a/node_modules/hono/dist/cjs/helper/streaming/sse.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var sse_exports = {}; -__export(sse_exports, { - SSEStreamingApi: () => SSEStreamingApi, - streamSSE: () => streamSSE -}); -module.exports = __toCommonJS(sse_exports); -var import_html = require("../../utils/html"); -var import_stream = require("../../utils/stream"); -var import_utils = require("./utils"); -class SSEStreamingApi extends import_stream.StreamingApi { - constructor(writable, readable) { - super(writable, readable); - } - async writeSSE(message) { - const data = await (0, import_html.resolveCallback)(message.data, import_html.HtmlEscapedCallbackPhase.Stringify, false, {}); - const dataLines = data.split(/\r\n|\r|\n/).map((line) => { - return `data: ${line}`; - }).join("\n"); - const sseData = [ - message.event && `event: ${message.event}`, - dataLines, - message.id && `id: ${message.id}`, - message.retry && `retry: ${message.retry}` - ].filter(Boolean).join("\n") + "\n\n"; - await this.write(sseData); - } -} -const run = async (stream, cb, onError) => { - try { - await cb(stream); - } catch (e) { - if (e instanceof Error && onError) { - await onError(e, stream); - await stream.writeSSE({ - event: "error", - data: e.message - }); - } else { - console.error(e); - } - } finally { - stream.close(); - } -}; -const contextStash = /* @__PURE__ */ new WeakMap(); -const streamSSE = (c, cb, onError) => { - const { readable, writable } = new TransformStream(); - const stream = new SSEStreamingApi(writable, readable); - if ((0, import_utils.isOldBunVersion)()) { - c.req.raw.signal.addEventListener("abort", () => { - if (!stream.closed) { - stream.abort(); - } - }); - } - contextStash.set(stream.responseReadable, c); - c.header("Transfer-Encoding", "chunked"); - c.header("Content-Type", "text/event-stream"); - c.header("Cache-Control", "no-cache"); - c.header("Connection", "keep-alive"); - run(stream, cb, onError); - return c.newResponse(stream.responseReadable); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - SSEStreamingApi, - streamSSE -}); diff --git a/node_modules/hono/dist/cjs/helper/streaming/stream.js b/node_modules/hono/dist/cjs/helper/streaming/stream.js deleted file mode 100644 index 29d3dd8..0000000 --- a/node_modules/hono/dist/cjs/helper/streaming/stream.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var stream_exports = {}; -__export(stream_exports, { - stream: () => stream -}); -module.exports = __toCommonJS(stream_exports); -var import_stream = require("../../utils/stream"); -var import_utils = require("./utils"); -const contextStash = /* @__PURE__ */ new WeakMap(); -const stream = (c, cb, onError) => { - const { readable, writable } = new TransformStream(); - const stream2 = new import_stream.StreamingApi(writable, readable); - if ((0, import_utils.isOldBunVersion)()) { - c.req.raw.signal.addEventListener("abort", () => { - if (!stream2.closed) { - stream2.abort(); - } - }); - } - contextStash.set(stream2.responseReadable, c); - (async () => { - try { - await cb(stream2); - } catch (e) { - if (e === void 0) { - } else if (e instanceof Error && onError) { - await onError(e, stream2); - } else { - console.error(e); - } - } finally { - stream2.close(); - } - })(); - return c.newResponse(stream2.responseReadable); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - stream -}); diff --git a/node_modules/hono/dist/cjs/helper/streaming/text.js b/node_modules/hono/dist/cjs/helper/streaming/text.js deleted file mode 100644 index c4fba1d..0000000 --- a/node_modules/hono/dist/cjs/helper/streaming/text.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var text_exports = {}; -__export(text_exports, { - streamText: () => streamText -}); -module.exports = __toCommonJS(text_exports); -var import_context = require("../../context"); -var import__ = require("./"); -const streamText = (c, cb, onError) => { - c.header("Content-Type", import_context.TEXT_PLAIN); - c.header("X-Content-Type-Options", "nosniff"); - c.header("Transfer-Encoding", "chunked"); - return (0, import__.stream)(c, cb, onError); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - streamText -}); diff --git a/node_modules/hono/dist/cjs/helper/streaming/utils.js b/node_modules/hono/dist/cjs/helper/streaming/utils.js deleted file mode 100644 index ff818c1..0000000 --- a/node_modules/hono/dist/cjs/helper/streaming/utils.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var utils_exports = {}; -__export(utils_exports, { - isOldBunVersion: () => isOldBunVersion -}); -module.exports = __toCommonJS(utils_exports); -let isOldBunVersion = () => { - const version = typeof Bun !== "undefined" ? Bun.version : void 0; - if (version === void 0) { - return false; - } - const result = version.startsWith("1.1") || version.startsWith("1.0") || version.startsWith("0."); - isOldBunVersion = () => result; - return result; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - isOldBunVersion -}); diff --git a/node_modules/hono/dist/cjs/helper/testing/index.js b/node_modules/hono/dist/cjs/helper/testing/index.js deleted file mode 100644 index 6e9e432..0000000 --- a/node_modules/hono/dist/cjs/helper/testing/index.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var testing_exports = {}; -__export(testing_exports, { - testClient: () => testClient -}); -module.exports = __toCommonJS(testing_exports); -var import_client = require("../../client"); -const testClient = (app, Env, executionCtx, options) => { - const customFetch = (input, init) => { - return app.request(input, init, Env, executionCtx); - }; - return (0, import_client.hc)("http://localhost", { ...options, fetch: customFetch }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - testClient -}); diff --git a/node_modules/hono/dist/cjs/helper/websocket/index.js b/node_modules/hono/dist/cjs/helper/websocket/index.js deleted file mode 100644 index ee33b65..0000000 --- a/node_modules/hono/dist/cjs/helper/websocket/index.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var websocket_exports = {}; -__export(websocket_exports, { - WSContext: () => WSContext, - createWSMessageEvent: () => createWSMessageEvent, - defineWebSocketHelper: () => defineWebSocketHelper -}); -module.exports = __toCommonJS(websocket_exports); -class WSContext { - #init; - constructor(init) { - this.#init = init; - this.raw = init.raw; - this.url = init.url ? new URL(init.url) : null; - this.protocol = init.protocol ?? null; - } - send(source, options) { - this.#init.send(source, options ?? {}); - } - raw; - binaryType = "arraybuffer"; - get readyState() { - return this.#init.readyState; - } - url; - protocol; - close(code, reason) { - this.#init.close(code, reason); - } -} -const createWSMessageEvent = (source) => { - return new MessageEvent("message", { - data: source - }); -}; -const defineWebSocketHelper = (handler) => { - return ((...args) => { - if (typeof args[0] === "function") { - const [createEvents, options] = args; - return async function upgradeWebSocket(c, next) { - const events = await createEvents(c); - const result = await handler(c, events, options); - if (result) { - return result; - } - await next(); - }; - } else { - const [c, events, options] = args; - return (async () => { - const upgraded = await handler(c, events, options); - if (!upgraded) { - throw new Error("Failed to upgrade WebSocket"); - } - return upgraded; - })(); - } - }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - WSContext, - createWSMessageEvent, - defineWebSocketHelper -}); diff --git a/node_modules/hono/dist/cjs/hono-base.js b/node_modules/hono/dist/cjs/hono-base.js deleted file mode 100644 index 63eebce..0000000 --- a/node_modules/hono/dist/cjs/hono-base.js +++ /dev/null @@ -1,401 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var hono_base_exports = {}; -__export(hono_base_exports, { - HonoBase: () => Hono -}); -module.exports = __toCommonJS(hono_base_exports); -var import_compose = require("./compose"); -var import_context = require("./context"); -var import_router = require("./router"); -var import_constants = require("./utils/constants"); -var import_url = require("./utils/url"); -const notFoundHandler = (c) => { - return c.text("404 Not Found", 404); -}; -const errorHandler = (err, c) => { - if ("getResponse" in err) { - const res = err.getResponse(); - return c.newResponse(res.body, res); - } - console.error(err); - return c.text("Internal Server Error", 500); -}; -class Hono { - get; - post; - put; - delete; - options; - patch; - all; - on; - use; - /* - This class is like an abstract class and does not have a router. - To use it, inherit the class and implement router in the constructor. - */ - router; - getPath; - // Cannot use `#` because it requires visibility at JavaScript runtime. - _basePath = "/"; - #path = "/"; - routes = []; - constructor(options = {}) { - const allMethods = [...import_router.METHODS, import_router.METHOD_NAME_ALL_LOWERCASE]; - allMethods.forEach((method) => { - this[method] = (args1, ...args) => { - if (typeof args1 === "string") { - this.#path = args1; - } else { - this.#addRoute(method, this.#path, args1); - } - args.forEach((handler) => { - this.#addRoute(method, this.#path, handler); - }); - return this; - }; - }); - this.on = (method, path, ...handlers) => { - for (const p of [path].flat()) { - this.#path = p; - for (const m of [method].flat()) { - handlers.map((handler) => { - this.#addRoute(m.toUpperCase(), this.#path, handler); - }); - } - } - return this; - }; - this.use = (arg1, ...handlers) => { - if (typeof arg1 === "string") { - this.#path = arg1; - } else { - this.#path = "*"; - handlers.unshift(arg1); - } - handlers.forEach((handler) => { - this.#addRoute(import_router.METHOD_NAME_ALL, this.#path, handler); - }); - return this; - }; - const { strict, ...optionsWithoutStrict } = options; - Object.assign(this, optionsWithoutStrict); - this.getPath = strict ?? true ? options.getPath ?? import_url.getPath : import_url.getPathNoStrict; - } - #clone() { - const clone = new Hono({ - router: this.router, - getPath: this.getPath - }); - clone.errorHandler = this.errorHandler; - clone.#notFoundHandler = this.#notFoundHandler; - clone.routes = this.routes; - return clone; - } - #notFoundHandler = notFoundHandler; - // Cannot use `#` because it requires visibility at JavaScript runtime. - errorHandler = errorHandler; - /** - * `.route()` allows grouping other Hono instance in routes. - * - * @see {@link https://hono.dev/docs/api/routing#grouping} - * - * @param {string} path - base Path - * @param {Hono} app - other Hono instance - * @returns {Hono} routed Hono instance - * - * @example - * ```ts - * const app = new Hono() - * const app2 = new Hono() - * - * app2.get("/user", (c) => c.text("user")) - * app.route("/api", app2) // GET /api/user - * ``` - */ - route(path, app) { - const subApp = this.basePath(path); - app.routes.map((r) => { - let handler; - if (app.errorHandler === errorHandler) { - handler = r.handler; - } else { - handler = async (c, next) => (await (0, import_compose.compose)([], app.errorHandler)(c, () => r.handler(c, next))).res; - handler[import_constants.COMPOSED_HANDLER] = r.handler; - } - subApp.#addRoute(r.method, r.path, handler); - }); - return this; - } - /** - * `.basePath()` allows base paths to be specified. - * - * @see {@link https://hono.dev/docs/api/routing#base-path} - * - * @param {string} path - base Path - * @returns {Hono} changed Hono instance - * - * @example - * ```ts - * const api = new Hono().basePath('/api') - * ``` - */ - basePath(path) { - const subApp = this.#clone(); - subApp._basePath = (0, import_url.mergePath)(this._basePath, path); - return subApp; - } - /** - * `.onError()` handles an error and returns a customized Response. - * - * @see {@link https://hono.dev/docs/api/hono#error-handling} - * - * @param {ErrorHandler} handler - request Handler for error - * @returns {Hono} changed Hono instance - * - * @example - * ```ts - * app.onError((err, c) => { - * console.error(`${err}`) - * return c.text('Custom Error Message', 500) - * }) - * ``` - */ - onError = (handler) => { - this.errorHandler = handler; - return this; - }; - /** - * `.notFound()` allows you to customize a Not Found Response. - * - * @see {@link https://hono.dev/docs/api/hono#not-found} - * - * @param {NotFoundHandler} handler - request handler for not-found - * @returns {Hono} changed Hono instance - * - * @example - * ```ts - * app.notFound((c) => { - * return c.text('Custom 404 Message', 404) - * }) - * ``` - */ - notFound = (handler) => { - this.#notFoundHandler = handler; - return this; - }; - /** - * `.mount()` allows you to mount applications built with other frameworks into your Hono application. - * - * @see {@link https://hono.dev/docs/api/hono#mount} - * - * @param {string} path - base Path - * @param {Function} applicationHandler - other Request Handler - * @param {MountOptions} [options] - options of `.mount()` - * @returns {Hono} mounted Hono instance - * - * @example - * ```ts - * import { Router as IttyRouter } from 'itty-router' - * import { Hono } from 'hono' - * // Create itty-router application - * const ittyRouter = IttyRouter() - * // GET /itty-router/hello - * ittyRouter.get('/hello', () => new Response('Hello from itty-router')) - * - * const app = new Hono() - * app.mount('/itty-router', ittyRouter.handle) - * ``` - * - * @example - * ```ts - * const app = new Hono() - * // Send the request to another application without modification. - * app.mount('/app', anotherApp, { - * replaceRequest: (req) => req, - * }) - * ``` - */ - mount(path, applicationHandler, options) { - let replaceRequest; - let optionHandler; - if (options) { - if (typeof options === "function") { - optionHandler = options; - } else { - optionHandler = options.optionHandler; - if (options.replaceRequest === false) { - replaceRequest = (request) => request; - } else { - replaceRequest = options.replaceRequest; - } - } - } - const getOptions = optionHandler ? (c) => { - const options2 = optionHandler(c); - return Array.isArray(options2) ? options2 : [options2]; - } : (c) => { - let executionContext = void 0; - try { - executionContext = c.executionCtx; - } catch { - } - return [c.env, executionContext]; - }; - replaceRequest ||= (() => { - const mergedPath = (0, import_url.mergePath)(this._basePath, path); - const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length; - return (request) => { - const url = new URL(request.url); - url.pathname = url.pathname.slice(pathPrefixLength) || "/"; - return new Request(url, request); - }; - })(); - const handler = async (c, next) => { - const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c)); - if (res) { - return res; - } - await next(); - }; - this.#addRoute(import_router.METHOD_NAME_ALL, (0, import_url.mergePath)(path, "*"), handler); - return this; - } - #addRoute(method, path, handler) { - method = method.toUpperCase(); - path = (0, import_url.mergePath)(this._basePath, path); - const r = { basePath: this._basePath, path, method, handler }; - this.router.add(method, path, [handler, r]); - this.routes.push(r); - } - #handleError(err, c) { - if (err instanceof Error) { - return this.errorHandler(err, c); - } - throw err; - } - #dispatch(request, executionCtx, env, method) { - if (method === "HEAD") { - return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))(); - } - const path = this.getPath(request, { env }); - const matchResult = this.router.match(method, path); - const c = new import_context.Context(request, { - path, - matchResult, - env, - executionCtx, - notFoundHandler: this.#notFoundHandler - }); - if (matchResult[0].length === 1) { - let res; - try { - res = matchResult[0][0][0][0](c, async () => { - c.res = await this.#notFoundHandler(c); - }); - } catch (err) { - return this.#handleError(err, c); - } - return res instanceof Promise ? res.then( - (resolved) => resolved || (c.finalized ? c.res : this.#notFoundHandler(c)) - ).catch((err) => this.#handleError(err, c)) : res ?? this.#notFoundHandler(c); - } - const composed = (0, import_compose.compose)(matchResult[0], this.errorHandler, this.#notFoundHandler); - return (async () => { - try { - const context = await composed(c); - if (!context.finalized) { - throw new Error( - "Context is not finalized. Did you forget to return a Response object or `await next()`?" - ); - } - return context.res; - } catch (err) { - return this.#handleError(err, c); - } - })(); - } - /** - * `.fetch()` will be entry point of your app. - * - * @see {@link https://hono.dev/docs/api/hono#fetch} - * - * @param {Request} request - request Object of request - * @param {Env} Env - env Object - * @param {ExecutionContext} - context of execution - * @returns {Response | Promise} response of request - * - */ - fetch = (request, ...rest) => { - return this.#dispatch(request, rest[1], rest[0], request.method); - }; - /** - * `.request()` is a useful method for testing. - * You can pass a URL or pathname to send a GET request. - * app will return a Response object. - * ```ts - * test('GET /hello is ok', async () => { - * const res = await app.request('/hello') - * expect(res.status).toBe(200) - * }) - * ``` - * @see https://hono.dev/docs/api/hono#request - */ - request = (input, requestInit, Env, executionCtx) => { - if (input instanceof Request) { - return this.fetch(requestInit ? new Request(input, requestInit) : input, Env, executionCtx); - } - input = input.toString(); - return this.fetch( - new Request( - /^https?:\/\//.test(input) ? input : `http://localhost${(0, import_url.mergePath)("/", input)}`, - requestInit - ), - Env, - executionCtx - ); - }; - /** - * `.fire()` automatically adds a global fetch event listener. - * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers. - * @deprecated - * Use `fire` from `hono/service-worker` instead. - * ```ts - * import { Hono } from 'hono' - * import { fire } from 'hono/service-worker' - * - * const app = new Hono() - * // ... - * fire(app) - * ``` - * @see https://hono.dev/docs/api/hono#fire - * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API - * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ - */ - fire = () => { - addEventListener("fetch", (event) => { - event.respondWith(this.#dispatch(event.request, event, void 0, event.request.method)); - }); - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HonoBase -}); diff --git a/node_modules/hono/dist/cjs/hono.js b/node_modules/hono/dist/cjs/hono.js deleted file mode 100644 index 06d59a2..0000000 --- a/node_modules/hono/dist/cjs/hono.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var hono_exports = {}; -__export(hono_exports, { - Hono: () => Hono -}); -module.exports = __toCommonJS(hono_exports); -var import_hono_base = require("./hono-base"); -var import_reg_exp_router = require("./router/reg-exp-router"); -var import_smart_router = require("./router/smart-router"); -var import_trie_router = require("./router/trie-router"); -class Hono extends import_hono_base.HonoBase { - /** - * Creates an instance of the Hono class. - * - * @param options - Optional configuration options for the Hono instance. - */ - constructor(options = {}) { - super(options); - this.router = options.router ?? new import_smart_router.SmartRouter({ - routers: [new import_reg_exp_router.RegExpRouter(), new import_trie_router.TrieRouter()] - }); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Hono -}); diff --git a/node_modules/hono/dist/cjs/http-exception.js b/node_modules/hono/dist/cjs/http-exception.js deleted file mode 100644 index 3ad00c5..0000000 --- a/node_modules/hono/dist/cjs/http-exception.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var http_exception_exports = {}; -__export(http_exception_exports, { - HTTPException: () => HTTPException -}); -module.exports = __toCommonJS(http_exception_exports); -class HTTPException extends Error { - res; - status; - /** - * Creates an instance of `HTTPException`. - * @param status - HTTP status code for the exception. Defaults to 500. - * @param options - Additional options for the exception. - */ - constructor(status = 500, options) { - super(options?.message, { cause: options?.cause }); - this.res = options?.res; - this.status = status; - } - /** - * Returns the response object associated with the exception. - * If a response object is not provided, a new response is created with the error message and status code. - * @returns The response object. - */ - getResponse() { - if (this.res) { - const newResponse = new Response(this.res.body, { - status: this.status, - headers: this.res.headers - }); - return newResponse; - } - return new Response(this.message, { - status: this.status - }); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HTTPException -}); diff --git a/node_modules/hono/dist/cjs/index.js b/node_modules/hono/dist/cjs/index.js deleted file mode 100644 index 256c738..0000000 --- a/node_modules/hono/dist/cjs/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var index_exports = {}; -__export(index_exports, { - Hono: () => import_hono.Hono -}); -module.exports = __toCommonJS(index_exports); -var import_hono = require("./hono"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Hono -}); diff --git a/node_modules/hono/dist/cjs/jsx/base.js b/node_modules/hono/dist/cjs/jsx/base.js deleted file mode 100644 index 48578a1..0000000 --- a/node_modules/hono/dist/cjs/jsx/base.js +++ /dev/null @@ -1,375 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var base_exports = {}; -__export(base_exports, { - Fragment: () => Fragment, - JSXFragmentNode: () => JSXFragmentNode, - JSXNode: () => JSXNode, - booleanAttributes: () => booleanAttributes, - cloneElement: () => cloneElement, - getNameSpaceContext: () => getNameSpaceContext, - isValidElement: () => isValidElement, - jsx: () => jsx, - jsxFn: () => jsxFn, - memo: () => memo, - reactAPICompatVersion: () => reactAPICompatVersion, - shallowEqual: () => shallowEqual -}); -module.exports = __toCommonJS(base_exports); -var import_html = require("../helper/html"); -var import_html2 = require("../utils/html"); -var import_constants = require("./constants"); -var import_context = require("./context"); -var import_common = require("./intrinsic-element/common"); -var intrinsicElementTags = __toESM(require("./intrinsic-element/components"), 1); -var import_utils = require("./utils"); -let nameSpaceContext = void 0; -const getNameSpaceContext = () => nameSpaceContext; -const toSVGAttributeName = (key) => /[A-Z]/.test(key) && // Presentation attributes are findable in style object. "clip-path", "font-size", "stroke-width", etc. -// Or other un-deprecated kebab-case attributes. "overline-position", "paint-order", "strikethrough-position", etc. -key.match( - /^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/ -) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key; -const emptyTags = [ - "area", - "base", - "br", - "col", - "embed", - "hr", - "img", - "input", - "keygen", - "link", - "meta", - "param", - "source", - "track", - "wbr" -]; -const booleanAttributes = [ - "allowfullscreen", - "async", - "autofocus", - "autoplay", - "checked", - "controls", - "default", - "defer", - "disabled", - "download", - "formnovalidate", - "hidden", - "inert", - "ismap", - "itemscope", - "loop", - "multiple", - "muted", - "nomodule", - "novalidate", - "open", - "playsinline", - "readonly", - "required", - "reversed", - "selected" -]; -const childrenToStringToBuffer = (children, buffer) => { - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if (typeof child === "string") { - (0, import_html2.escapeToBuffer)(child, buffer); - } else if (typeof child === "boolean" || child === null || child === void 0) { - continue; - } else if (child instanceof JSXNode) { - child.toStringToBuffer(buffer); - } else if (typeof child === "number" || child.isEscaped) { - ; - buffer[0] += child; - } else if (child instanceof Promise) { - buffer.unshift("", child); - } else { - childrenToStringToBuffer(child, buffer); - } - } -}; -class JSXNode { - tag; - props; - key; - children; - isEscaped = true; - localContexts; - constructor(tag, props, children) { - this.tag = tag; - this.props = props; - this.children = children; - } - get type() { - return this.tag; - } - // Added for compatibility with libraries that rely on React's internal structure - // eslint-disable-next-line @typescript-eslint/no-explicit-any - get ref() { - return this.props.ref || null; - } - toString() { - const buffer = [""]; - this.localContexts?.forEach(([context, value]) => { - context.values.push(value); - }); - try { - this.toStringToBuffer(buffer); - } finally { - this.localContexts?.forEach(([context]) => { - context.values.pop(); - }); - } - return buffer.length === 1 ? "callbacks" in buffer ? (0, import_html2.resolveCallbackSync)((0, import_html.raw)(buffer[0], buffer.callbacks)).toString() : buffer[0] : (0, import_html2.stringBufferToString)(buffer, buffer.callbacks); - } - toStringToBuffer(buffer) { - const tag = this.tag; - const props = this.props; - let { children } = this; - buffer[0] += `<${tag}`; - const normalizeKey = nameSpaceContext && (0, import_context.useContext)(nameSpaceContext) === "svg" ? (key) => toSVGAttributeName((0, import_utils.normalizeIntrinsicElementKey)(key)) : (key) => (0, import_utils.normalizeIntrinsicElementKey)(key); - for (let [key, v] of Object.entries(props)) { - key = normalizeKey(key); - if (key === "children") { - } else if (key === "style" && typeof v === "object") { - let styleStr = ""; - (0, import_utils.styleObjectForEach)(v, (property, value) => { - if (value != null) { - styleStr += `${styleStr ? ";" : ""}${property}:${value}`; - } - }); - buffer[0] += ' style="'; - (0, import_html2.escapeToBuffer)(styleStr, buffer); - buffer[0] += '"'; - } else if (typeof v === "string") { - buffer[0] += ` ${key}="`; - (0, import_html2.escapeToBuffer)(v, buffer); - buffer[0] += '"'; - } else if (v === null || v === void 0) { - } else if (typeof v === "number" || v.isEscaped) { - buffer[0] += ` ${key}="${v}"`; - } else if (typeof v === "boolean" && booleanAttributes.includes(key)) { - if (v) { - buffer[0] += ` ${key}=""`; - } - } else if (key === "dangerouslySetInnerHTML") { - if (children.length > 0) { - throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."); - } - children = [(0, import_html.raw)(v.__html)]; - } else if (v instanceof Promise) { - buffer[0] += ` ${key}="`; - buffer.unshift('"', v); - } else if (typeof v === "function") { - if (!key.startsWith("on") && key !== "ref") { - throw new Error(`Invalid prop '${key}' of type 'function' supplied to '${tag}'.`); - } - } else { - buffer[0] += ` ${key}="`; - (0, import_html2.escapeToBuffer)(v.toString(), buffer); - buffer[0] += '"'; - } - } - if (emptyTags.includes(tag) && children.length === 0) { - buffer[0] += "/>"; - return; - } - buffer[0] += ">"; - childrenToStringToBuffer(children, buffer); - buffer[0] += ``; - } -} -class JSXFunctionNode extends JSXNode { - toStringToBuffer(buffer) { - const { children } = this; - const props = { ...this.props }; - if (children.length) { - props.children = children.length === 1 ? children[0] : children; - } - const res = this.tag.call(null, props); - if (typeof res === "boolean" || res == null) { - return; - } else if (res instanceof Promise) { - if (import_context.globalContexts.length === 0) { - buffer.unshift("", res); - } else { - const currentContexts = import_context.globalContexts.map((c) => [c, c.values.at(-1)]); - buffer.unshift( - "", - res.then((childRes) => { - if (childRes instanceof JSXNode) { - childRes.localContexts = currentContexts; - } - return childRes; - }) - ); - } - } else if (res instanceof JSXNode) { - res.toStringToBuffer(buffer); - } else if (typeof res === "number" || res.isEscaped) { - buffer[0] += res; - if (res.callbacks) { - buffer.callbacks ||= []; - buffer.callbacks.push(...res.callbacks); - } - } else { - (0, import_html2.escapeToBuffer)(res, buffer); - } - } -} -class JSXFragmentNode extends JSXNode { - toStringToBuffer(buffer) { - childrenToStringToBuffer(this.children, buffer); - } -} -const jsx = (tag, props, ...children) => { - props ??= {}; - if (children.length) { - props.children = children.length === 1 ? children[0] : children; - } - const key = props.key; - delete props["key"]; - const node = jsxFn(tag, props, children); - node.key = key; - return node; -}; -let initDomRenderer = false; -const jsxFn = (tag, props, children) => { - if (!initDomRenderer) { - for (const k in import_common.domRenderers) { - ; - intrinsicElementTags[k][import_constants.DOM_RENDERER] = import_common.domRenderers[k]; - } - initDomRenderer = true; - } - if (typeof tag === "function") { - return new JSXFunctionNode(tag, props, children); - } else if (intrinsicElementTags[tag]) { - return new JSXFunctionNode( - intrinsicElementTags[tag], - props, - children - ); - } else if (tag === "svg" || tag === "head") { - nameSpaceContext ||= (0, import_context.createContext)(""); - return new JSXNode(tag, props, [ - new JSXFunctionNode( - nameSpaceContext, - { - value: tag - }, - children - ) - ]); - } else { - return new JSXNode(tag, props, children); - } -}; -const shallowEqual = (a, b) => { - if (a === b) { - return true; - } - const aKeys = Object.keys(a).sort(); - const bKeys = Object.keys(b).sort(); - if (aKeys.length !== bKeys.length) { - return false; - } - for (let i = 0, len = aKeys.length; i < len; i++) { - if (aKeys[i] === "children" && bKeys[i] === "children" && !a.children?.length && !b.children?.length) { - continue; - } else if (a[aKeys[i]] !== b[aKeys[i]]) { - return false; - } - } - return true; -}; -const memo = (component, propsAreEqual = shallowEqual) => { - let computed = null; - let prevProps = void 0; - const wrapper = ((props) => { - if (prevProps && !propsAreEqual(prevProps, props)) { - computed = null; - } - prevProps = props; - return computed ||= component(props); - }); - wrapper[import_constants.DOM_MEMO] = propsAreEqual; - wrapper[import_constants.DOM_RENDERER] = component; - return wrapper; -}; -const Fragment = ({ - children -}) => { - return new JSXFragmentNode( - "", - { - children - }, - Array.isArray(children) ? children : children ? [children] : [] - ); -}; -const isValidElement = (element) => { - return !!(element && typeof element === "object" && "tag" in element && "props" in element); -}; -const cloneElement = (element, props, ...children) => { - let childrenToClone; - if (children.length > 0) { - childrenToClone = children; - } else { - const c = element.props.children; - childrenToClone = Array.isArray(c) ? c : [c]; - } - return jsx( - element.tag, - { ...element.props, ...props }, - ...childrenToClone - ); -}; -const reactAPICompatVersion = "19.0.0-hono-jsx"; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Fragment, - JSXFragmentNode, - JSXNode, - booleanAttributes, - cloneElement, - getNameSpaceContext, - isValidElement, - jsx, - jsxFn, - memo, - reactAPICompatVersion, - shallowEqual -}); diff --git a/node_modules/hono/dist/cjs/jsx/children.js b/node_modules/hono/dist/cjs/jsx/children.js deleted file mode 100644 index 0820d84..0000000 --- a/node_modules/hono/dist/cjs/jsx/children.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var children_exports = {}; -__export(children_exports, { - Children: () => Children, - toArray: () => toArray -}); -module.exports = __toCommonJS(children_exports); -const toArray = (children) => Array.isArray(children) ? children : [children]; -const Children = { - map: (children, fn) => toArray(children).map(fn), - forEach: (children, fn) => { - toArray(children).forEach(fn); - }, - count: (children) => toArray(children).length, - only: (_children) => { - const children = toArray(_children); - if (children.length !== 1) { - throw new Error("Children.only() expects only one child"); - } - return children[0]; - }, - toArray -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Children, - toArray -}); diff --git a/node_modules/hono/dist/cjs/jsx/components.js b/node_modules/hono/dist/cjs/jsx/components.js deleted file mode 100644 index bc4fa55..0000000 --- a/node_modules/hono/dist/cjs/jsx/components.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var components_exports = {}; -__export(components_exports, { - ErrorBoundary: () => ErrorBoundary, - childrenToString: () => childrenToString -}); -module.exports = __toCommonJS(components_exports); -var import_html = require("../helper/html"); -var import_html2 = require("../utils/html"); -var import_base = require("./base"); -var import_constants = require("./constants"); -var import_context = require("./context"); -var import_components = require("./dom/components"); -var import_streaming = require("./streaming"); -let errorBoundaryCounter = 0; -const childrenToString = async (children) => { - try { - return children.flat().map((c) => c == null || typeof c === "boolean" ? "" : c.toString()); - } catch (e) { - if (e instanceof Promise) { - await e; - return childrenToString(children); - } else { - throw e; - } - } -}; -const resolveChildEarly = (c) => { - if (c == null || typeof c === "boolean") { - return ""; - } else if (typeof c === "string") { - return c; - } else { - const str = c.toString(); - if (!(str instanceof Promise)) { - return (0, import_html.raw)(str); - } else { - return str; - } - } -}; -const ErrorBoundary = async ({ children, fallback, fallbackRender, onError }) => { - if (!children) { - return (0, import_html.raw)(""); - } - if (!Array.isArray(children)) { - children = [children]; - } - const nonce = (0, import_context.useContext)(import_streaming.StreamingContext)?.scriptNonce; - let fallbackStr; - const resolveFallbackStr = async () => { - const awaitedFallback = await fallback; - if (typeof awaitedFallback === "string") { - fallbackStr = awaitedFallback; - } else { - fallbackStr = await awaitedFallback?.toString(); - if (typeof fallbackStr === "string") { - fallbackStr = (0, import_html.raw)(fallbackStr); - } - } - }; - const fallbackRes = (error) => { - onError?.(error); - return fallbackStr || fallbackRender && (0, import_base.jsx)(import_base.Fragment, {}, fallbackRender(error)) || ""; - }; - let resArray = []; - try { - resArray = children.map(resolveChildEarly); - } catch (e) { - await resolveFallbackStr(); - if (e instanceof Promise) { - resArray = [ - e.then(() => childrenToString(children)).catch((e2) => fallbackRes(e2)) - ]; - } else { - resArray = [fallbackRes(e)]; - } - } - if (resArray.some((res) => res instanceof Promise)) { - await resolveFallbackStr(); - const index = errorBoundaryCounter++; - const replaceRe = RegExp(`(.*?)(.*?)()`); - const caught = false; - const catchCallback = async ({ error: error2, buffer }) => { - if (caught) { - return ""; - } - const fallbackResString = await (0, import_base.Fragment)({ - children: fallbackRes(error2) - }).toString(); - if (buffer) { - buffer[0] = buffer[0].replace(replaceRe, fallbackResString); - } - return buffer ? "" : ``; - }; - let error; - const promiseAll = Promise.all(resArray).catch((e) => error = e); - return (0, import_html.raw)(``, [ - ({ phase, buffer, context }) => { - if (phase === import_html2.HtmlEscapedCallbackPhase.BeforeStream) { - return; - } - return promiseAll.then(async (htmlArray) => { - if (error) { - throw error; - } - htmlArray = htmlArray.flat(); - const content = htmlArray.join(""); - let html = buffer ? "" : ` -((d,c) => { -c=d.currentScript.previousSibling -d=d.getElementById('E:${index}') -if(!d)return -d.parentElement.insertBefore(c.content,d.nextSibling) -})(document) -`; - if (htmlArray.every((html2) => !html2.callbacks?.length)) { - if (buffer) { - buffer[0] = buffer[0].replace(replaceRe, content); - } - return html; - } - if (buffer) { - buffer[0] = buffer[0].replace( - replaceRe, - (_all, pre, _, post) => `${pre}${content}${post}` - ); - } - const callbacks = htmlArray.map((html2) => html2.callbacks || []).flat(); - if (phase === import_html2.HtmlEscapedCallbackPhase.Stream) { - html = await (0, import_html2.resolveCallback)( - html, - import_html2.HtmlEscapedCallbackPhase.BeforeStream, - true, - context - ); - } - let resolvedCount = 0; - const promises = callbacks.map( - (c) => (...args) => c(...args)?.then((content2) => { - resolvedCount++; - if (buffer) { - if (resolvedCount === callbacks.length) { - buffer[0] = buffer[0].replace(replaceRe, (_all, _pre, content3) => content3); - } - buffer[0] += content2; - return (0, import_html.raw)("", content2.callbacks); - } - return (0, import_html.raw)( - content2 + (resolvedCount !== callbacks.length ? "" : ``), - content2.callbacks - ); - }).catch((error2) => catchCallback({ error: error2, buffer })) - ); - return (0, import_html.raw)(html, promises); - }).catch((error2) => catchCallback({ error: error2, buffer })); - } - ]); - } else { - return (0, import_base.Fragment)({ children: resArray }); - } -}; -ErrorBoundary[import_constants.DOM_RENDERER] = import_components.ErrorBoundary; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - ErrorBoundary, - childrenToString -}); diff --git a/node_modules/hono/dist/cjs/jsx/constants.js b/node_modules/hono/dist/cjs/jsx/constants.js deleted file mode 100644 index 35e4eae..0000000 --- a/node_modules/hono/dist/cjs/jsx/constants.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var constants_exports = {}; -__export(constants_exports, { - DOM_ERROR_HANDLER: () => DOM_ERROR_HANDLER, - DOM_INTERNAL_TAG: () => DOM_INTERNAL_TAG, - DOM_MEMO: () => DOM_MEMO, - DOM_RENDERER: () => DOM_RENDERER, - DOM_STASH: () => DOM_STASH, - PERMALINK: () => PERMALINK -}); -module.exports = __toCommonJS(constants_exports); -const DOM_RENDERER = /* @__PURE__ */ Symbol("RENDERER"); -const DOM_ERROR_HANDLER = /* @__PURE__ */ Symbol("ERROR_HANDLER"); -const DOM_STASH = /* @__PURE__ */ Symbol("STASH"); -const DOM_INTERNAL_TAG = /* @__PURE__ */ Symbol("INTERNAL"); -const DOM_MEMO = /* @__PURE__ */ Symbol("MEMO"); -const PERMALINK = /* @__PURE__ */ Symbol("PERMALINK"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - DOM_ERROR_HANDLER, - DOM_INTERNAL_TAG, - DOM_MEMO, - DOM_RENDERER, - DOM_STASH, - PERMALINK -}); diff --git a/node_modules/hono/dist/cjs/jsx/context.js b/node_modules/hono/dist/cjs/jsx/context.js deleted file mode 100644 index 0fcd2c6..0000000 --- a/node_modules/hono/dist/cjs/jsx/context.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var context_exports = {}; -__export(context_exports, { - createContext: () => createContext, - globalContexts: () => globalContexts, - useContext: () => useContext -}); -module.exports = __toCommonJS(context_exports); -var import_html = require("../helper/html"); -var import_base = require("./base"); -var import_constants = require("./constants"); -var import_context = require("./dom/context"); -const globalContexts = []; -const createContext = (defaultValue) => { - const values = [defaultValue]; - const context = ((props) => { - values.push(props.value); - let string; - try { - string = props.children ? (Array.isArray(props.children) ? new import_base.JSXFragmentNode("", {}, props.children) : props.children).toString() : ""; - } catch (e) { - values.pop(); - throw e; - } - if (string instanceof Promise) { - return string.finally(() => values.pop()).then((resString) => (0, import_html.raw)(resString, resString.callbacks)); - } else { - values.pop(); - return (0, import_html.raw)(string); - } - }); - context.values = values; - context.Provider = context; - context[import_constants.DOM_RENDERER] = (0, import_context.createContextProviderFunction)(values); - globalContexts.push(context); - return context; -}; -const useContext = (context) => { - return context.values.at(-1); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createContext, - globalContexts, - useContext -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/client.js b/node_modules/hono/dist/cjs/jsx/dom/client.js deleted file mode 100644 index d48651d..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/client.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var client_exports = {}; -__export(client_exports, { - createRoot: () => createRoot, - default: () => client_default, - hydrateRoot: () => hydrateRoot -}); -module.exports = __toCommonJS(client_exports); -var import_hooks = require("../hooks"); -var import_render = require("./render"); -const createRoot = (element, options = {}) => { - let setJsxNode = ( - // unmounted - void 0 - ); - if (Object.keys(options).length > 0) { - console.warn("createRoot options are not supported yet"); - } - return { - render(jsxNode) { - if (setJsxNode === null) { - throw new Error("Cannot update an unmounted root"); - } - if (setJsxNode) { - setJsxNode(jsxNode); - } else { - (0, import_render.renderNode)( - (0, import_render.buildNode)({ - tag: () => { - const [_jsxNode, _setJsxNode] = (0, import_hooks.useState)(jsxNode); - setJsxNode = _setJsxNode; - return _jsxNode; - }, - props: {} - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }), - element - ); - } - }, - unmount() { - setJsxNode?.(null); - setJsxNode = null; - } - }; -}; -const hydrateRoot = (element, reactNode, options = {}) => { - const root = createRoot(element, options); - root.render(reactNode); - return root; -}; -var client_default = { - createRoot, - hydrateRoot -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createRoot, - hydrateRoot -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/components.js b/node_modules/hono/dist/cjs/jsx/dom/components.js deleted file mode 100644 index e5afb7f..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/components.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var components_exports = {}; -__export(components_exports, { - ErrorBoundary: () => ErrorBoundary, - Suspense: () => Suspense -}); -module.exports = __toCommonJS(components_exports); -var import_constants = require("../constants"); -var import_jsx_runtime = require("./jsx-runtime"); -const ErrorBoundary = (({ children, fallback, fallbackRender, onError }) => { - const res = (0, import_jsx_runtime.Fragment)({ children }); - res[import_constants.DOM_ERROR_HANDLER] = (err) => { - if (err instanceof Promise) { - throw err; - } - onError?.(err); - return fallbackRender?.(err) || fallback; - }; - return res; -}); -const Suspense = (({ - children, - fallback -}) => { - const res = (0, import_jsx_runtime.Fragment)({ children }); - res[import_constants.DOM_ERROR_HANDLER] = (err, retry) => { - if (!(err instanceof Promise)) { - throw err; - } - err.finally(retry); - return fallback; - }; - return res; -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - ErrorBoundary, - Suspense -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/context.js b/node_modules/hono/dist/cjs/jsx/dom/context.js deleted file mode 100644 index 547f033..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/context.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var context_exports = {}; -__export(context_exports, { - createContext: () => createContext, - createContextProviderFunction: () => createContextProviderFunction -}); -module.exports = __toCommonJS(context_exports); -var import_constants = require("../constants"); -var import_context = require("../context"); -var import_utils = require("./utils"); -const createContextProviderFunction = (values) => ({ value, children }) => { - if (!children) { - return void 0; - } - const props = { - children: [ - { - tag: (0, import_utils.setInternalTagFlag)(() => { - values.push(value); - }), - props: {} - } - ] - }; - if (Array.isArray(children)) { - props.children.push(...children.flat()); - } else { - props.children.push(children); - } - props.children.push({ - tag: (0, import_utils.setInternalTagFlag)(() => { - values.pop(); - }), - props: {} - }); - const res = { tag: "", props, type: "" }; - res[import_constants.DOM_ERROR_HANDLER] = (err) => { - values.pop(); - throw err; - }; - return res; -}; -const createContext = (defaultValue) => { - const values = [defaultValue]; - const context = createContextProviderFunction(values); - context.values = values; - context.Provider = context; - import_context.globalContexts.push(context); - return context; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createContext, - createContextProviderFunction -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/css.js b/node_modules/hono/dist/cjs/jsx/dom/css.js deleted file mode 100644 index f004291..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/css.js +++ /dev/null @@ -1,162 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var css_exports = {}; -__export(css_exports, { - Style: () => Style, - createCssContext: () => createCssContext, - createCssJsxDomObjects: () => createCssJsxDomObjects, - css: () => css, - cx: () => cx, - keyframes: () => keyframes, - rawCssString: () => import_common2.rawCssString, - viewTransition: () => viewTransition -}); -module.exports = __toCommonJS(css_exports); -var import_common = require("../../helper/css/common"); -var import_common2 = require("../../helper/css/common"); -const splitRule = (rule) => { - const result = []; - let startPos = 0; - let depth = 0; - for (let i = 0, len = rule.length; i < len; i++) { - const char = rule[i]; - if (char === "'" || char === '"') { - const quote = char; - i++; - for (; i < len; i++) { - if (rule[i] === "\\") { - i++; - continue; - } - if (rule[i] === quote) { - break; - } - } - continue; - } - if (char === "{") { - depth++; - continue; - } - if (char === "}") { - depth--; - if (depth === 0) { - result.push(rule.slice(startPos, i + 1)); - startPos = i + 1; - } - continue; - } - } - return result; -}; -const createCssJsxDomObjects = ({ id }) => { - let styleSheet = void 0; - const findStyleSheet = () => { - if (!styleSheet) { - styleSheet = document.querySelector(`style#${id}`)?.sheet; - if (styleSheet) { - ; - styleSheet.addedStyles = /* @__PURE__ */ new Set(); - } - } - return styleSheet ? [styleSheet, styleSheet.addedStyles] : []; - }; - const insertRule = (className, styleString) => { - const [sheet, addedStyles] = findStyleSheet(); - if (!sheet || !addedStyles) { - Promise.resolve().then(() => { - if (!findStyleSheet()[0]) { - throw new Error("style sheet not found"); - } - insertRule(className, styleString); - }); - return; - } - if (!addedStyles.has(className)) { - addedStyles.add(className); - (className.startsWith(import_common.PSEUDO_GLOBAL_SELECTOR) ? splitRule(styleString) : [`${className[0] === "@" ? "" : "."}${className}{${styleString}}`]).forEach((rule) => { - sheet.insertRule(rule, sheet.cssRules.length); - }); - } - }; - const cssObject = { - toString() { - const selector = this[import_common.SELECTOR]; - insertRule(selector, this[import_common.STYLE_STRING]); - this[import_common.SELECTORS].forEach(({ [import_common.CLASS_NAME]: className, [import_common.STYLE_STRING]: styleString }) => { - insertRule(className, styleString); - }); - return this[import_common.CLASS_NAME]; - } - }; - const Style2 = ({ children, nonce }) => ({ - tag: "style", - props: { - id, - nonce, - children: children && (Array.isArray(children) ? children : [children]).map( - (c) => c[import_common.STYLE_STRING] - ) - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }); - return [cssObject, Style2]; -}; -const createCssContext = ({ id }) => { - const [cssObject, Style2] = createCssJsxDomObjects({ id }); - const newCssClassNameObject = (cssClassName) => { - cssClassName.toString = cssObject.toString; - return cssClassName; - }; - const css2 = (strings, ...values) => { - return newCssClassNameObject((0, import_common.cssCommon)(strings, values)); - }; - const cx2 = (...args) => { - args = (0, import_common.cxCommon)(args); - return css2(Array(args.length).fill(""), ...args); - }; - const keyframes2 = import_common.keyframesCommon; - const viewTransition2 = ((strings, ...values) => { - return newCssClassNameObject((0, import_common.viewTransitionCommon)(strings, values)); - }); - return { - css: css2, - cx: cx2, - keyframes: keyframes2, - viewTransition: viewTransition2, - Style: Style2 - }; -}; -const defaultContext = createCssContext({ id: import_common.DEFAULT_STYLE_ID }); -const css = defaultContext.css; -const cx = defaultContext.cx; -const keyframes = defaultContext.keyframes; -const viewTransition = defaultContext.viewTransition; -const Style = defaultContext.Style; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Style, - createCssContext, - createCssJsxDomObjects, - css, - cx, - keyframes, - rawCssString, - viewTransition -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js b/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js deleted file mode 100644 index 1ce3b77..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var hooks_exports = {}; -__export(hooks_exports, { - FormContext: () => FormContext, - registerAction: () => registerAction, - useActionState: () => useActionState, - useFormStatus: () => useFormStatus, - useOptimistic: () => useOptimistic -}); -module.exports = __toCommonJS(hooks_exports); -var import_constants = require("../../constants"); -var import_context = require("../../context"); -var import_hooks = require("../../hooks"); -var import_context2 = require("../context"); -const FormContext = (0, import_context2.createContext)({ - pending: false, - data: null, - method: null, - action: null -}); -const actions = /* @__PURE__ */ new Set(); -const registerAction = (action) => { - actions.add(action); - action.finally(() => actions.delete(action)); -}; -const useFormStatus = () => { - return (0, import_context.useContext)(FormContext); -}; -const useOptimistic = (state, updateState) => { - const [optimisticState, setOptimisticState] = (0, import_hooks.useState)(state); - if (actions.size > 0) { - Promise.all(actions).finally(() => { - setOptimisticState(state); - }); - } else { - setOptimisticState(state); - } - const cb = (0, import_hooks.useCallback)((newData) => { - setOptimisticState((currentState) => updateState(currentState, newData)); - }, []); - return [optimisticState, cb]; -}; -const useActionState = (fn, initialState, permalink) => { - const [state, setState] = (0, import_hooks.useState)(initialState); - const actionState = async (data) => { - setState(await fn(state, data)); - }; - actionState[import_constants.PERMALINK] = permalink; - return [state, actionState]; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - FormContext, - registerAction, - useActionState, - useFormStatus, - useOptimistic -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/index.js b/node_modules/hono/dist/cjs/jsx/dom/index.js deleted file mode 100644 index d01dd10..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/index.js +++ /dev/null @@ -1,182 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var dom_exports = {}; -__export(dom_exports, { - Children: () => import_children.Children, - ErrorBoundary: () => import_components.ErrorBoundary, - Fragment: () => import_jsx_runtime.Fragment, - StrictMode: () => import_jsx_runtime.Fragment, - Suspense: () => import_components.Suspense, - cloneElement: () => cloneElement, - createContext: () => import_context2.createContext, - createElement: () => createElement, - createPortal: () => import_render.createPortal, - createRef: () => import_hooks.createRef, - default: () => dom_default, - flushSync: () => import_render.flushSync, - forwardRef: () => import_hooks.forwardRef, - isValidElement: () => import_base.isValidElement, - jsx: () => createElement, - memo: () => memo, - render: () => import_render2.render, - startTransition: () => import_hooks.startTransition, - startViewTransition: () => import_hooks.startViewTransition, - use: () => import_hooks.use, - useActionState: () => import_hooks2.useActionState, - useCallback: () => import_hooks.useCallback, - useContext: () => import_context.useContext, - useDebugValue: () => import_hooks.useDebugValue, - useDeferredValue: () => import_hooks.useDeferredValue, - useEffect: () => import_hooks.useEffect, - useFormStatus: () => import_hooks2.useFormStatus, - useId: () => import_hooks.useId, - useImperativeHandle: () => import_hooks.useImperativeHandle, - useInsertionEffect: () => import_hooks.useInsertionEffect, - useLayoutEffect: () => import_hooks.useLayoutEffect, - useMemo: () => import_hooks.useMemo, - useOptimistic: () => import_hooks2.useOptimistic, - useReducer: () => import_hooks.useReducer, - useRef: () => import_hooks.useRef, - useState: () => import_hooks.useState, - useSyncExternalStore: () => import_hooks.useSyncExternalStore, - useTransition: () => import_hooks.useTransition, - useViewTransition: () => import_hooks.useViewTransition, - version: () => import_base.reactAPICompatVersion -}); -module.exports = __toCommonJS(dom_exports); -var import_base = require("../base"); -var import_children = require("../children"); -var import_constants = require("../constants"); -var import_context = require("../context"); -var import_hooks = require("../hooks"); -var import_components = require("./components"); -var import_context2 = require("./context"); -var import_hooks2 = require("./hooks"); -var import_jsx_runtime = require("./jsx-runtime"); -var import_render = require("./render"); -var import_render2 = require("./render"); -const createElement = (tag, props, ...children) => { - const jsxProps = props ? { ...props } : {}; - if (children.length) { - jsxProps.children = children.length === 1 ? children[0] : children; - } - let key = void 0; - if ("key" in jsxProps) { - key = jsxProps.key; - delete jsxProps.key; - } - return (0, import_jsx_runtime.jsx)(tag, jsxProps, key); -}; -const cloneElement = (element, props, ...children) => { - return (0, import_jsx_runtime.jsx)( - element.tag, - { - ...element.props, - ...props, - children: children.length ? children : element.props.children - }, - element.key - ); -}; -const memo = (component, propsAreEqual = import_base.shallowEqual) => { - const wrapper = ((props) => component(props)); - wrapper[import_constants.DOM_MEMO] = propsAreEqual; - return wrapper; -}; -var dom_default = { - version: import_base.reactAPICompatVersion, - useState: import_hooks.useState, - useEffect: import_hooks.useEffect, - useRef: import_hooks.useRef, - useCallback: import_hooks.useCallback, - use: import_hooks.use, - startTransition: import_hooks.startTransition, - useTransition: import_hooks.useTransition, - useDeferredValue: import_hooks.useDeferredValue, - startViewTransition: import_hooks.startViewTransition, - useViewTransition: import_hooks.useViewTransition, - useMemo: import_hooks.useMemo, - useLayoutEffect: import_hooks.useLayoutEffect, - useInsertionEffect: import_hooks.useInsertionEffect, - useReducer: import_hooks.useReducer, - useId: import_hooks.useId, - useDebugValue: import_hooks.useDebugValue, - createRef: import_hooks.createRef, - forwardRef: import_hooks.forwardRef, - useImperativeHandle: import_hooks.useImperativeHandle, - useSyncExternalStore: import_hooks.useSyncExternalStore, - useFormStatus: import_hooks2.useFormStatus, - useActionState: import_hooks2.useActionState, - useOptimistic: import_hooks2.useOptimistic, - Suspense: import_components.Suspense, - ErrorBoundary: import_components.ErrorBoundary, - createContext: import_context2.createContext, - useContext: import_context.useContext, - memo, - isValidElement: import_base.isValidElement, - createElement, - cloneElement, - Children: import_children.Children, - Fragment: import_jsx_runtime.Fragment, - StrictMode: import_jsx_runtime.Fragment, - flushSync: import_render.flushSync, - createPortal: import_render.createPortal -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Children, - ErrorBoundary, - Fragment, - StrictMode, - Suspense, - cloneElement, - createContext, - createElement, - createPortal, - createRef, - flushSync, - forwardRef, - isValidElement, - jsx, - memo, - render, - startTransition, - startViewTransition, - use, - useActionState, - useCallback, - useContext, - useDebugValue, - useDeferredValue, - useEffect, - useFormStatus, - useId, - useImperativeHandle, - useInsertionEffect, - useLayoutEffect, - useMemo, - useOptimistic, - useReducer, - useRef, - useState, - useSyncExternalStore, - useTransition, - useViewTransition, - version -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js b/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js deleted file mode 100644 index d355395..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js +++ /dev/null @@ -1,369 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var components_exports = {}; -__export(components_exports, { - button: () => button, - clearCache: () => clearCache, - composeRef: () => composeRef, - form: () => form, - input: () => input, - link: () => link, - meta: () => meta, - script: () => script, - style: () => style, - title: () => title -}); -module.exports = __toCommonJS(components_exports); -var import_context = require("../../context"); -var import_hooks = require("../../hooks"); -var import_common = require("../../intrinsic-element/common"); -var import_hooks2 = require("../hooks"); -var import_render = require("../render"); -const clearCache = () => { - blockingPromiseMap = /* @__PURE__ */ Object.create(null); - createdElements = /* @__PURE__ */ Object.create(null); -}; -const composeRef = (ref, cb) => { - return (0, import_hooks.useMemo)( - () => (e) => { - let refCleanup; - if (ref) { - if (typeof ref === "function") { - refCleanup = ref(e) || (() => { - ref(null); - }); - } else if (ref && "current" in ref) { - ref.current = e; - refCleanup = () => { - ref.current = null; - }; - } - } - const cbCleanup = cb(e); - return () => { - cbCleanup?.(); - refCleanup?.(); - }; - }, - [ref] - ); -}; -let blockingPromiseMap = /* @__PURE__ */ Object.create(null); -let createdElements = /* @__PURE__ */ Object.create(null); -const documentMetadataTag = (tag, props, preserveNodeType, supportSort, supportBlocking) => { - if (props?.itemProp) { - return { - tag, - props, - type: tag, - ref: props.ref - }; - } - const head = document.head; - let { onLoad, onError, precedence, blocking, ...restProps } = props; - let element = null; - let created = false; - const deDupeKeys = import_common.deDupeKeyMap[tag]; - let existingElements = void 0; - if (deDupeKeys.length > 0) { - const tags = head.querySelectorAll(tag); - LOOP: for (const e of tags) { - for (const key of import_common.deDupeKeyMap[tag]) { - if (e.getAttribute(key) === props[key]) { - element = e; - break LOOP; - } - } - } - if (!element) { - const cacheKey = deDupeKeys.reduce( - (acc, key) => props[key] === void 0 ? acc : `${acc}-${key}-${props[key]}`, - tag - ); - created = !createdElements[cacheKey]; - element = createdElements[cacheKey] ||= (() => { - const e = document.createElement(tag); - for (const key of deDupeKeys) { - if (props[key] !== void 0) { - e.setAttribute(key, props[key]); - } - if (props.rel) { - e.setAttribute("rel", props.rel); - } - } - return e; - })(); - } - } else { - existingElements = head.querySelectorAll(tag); - } - precedence = supportSort ? precedence ?? "" : void 0; - if (supportSort) { - restProps[import_common.dataPrecedenceAttr] = precedence; - } - const insert = (0, import_hooks.useCallback)( - (e) => { - if (deDupeKeys.length > 0) { - let found = false; - for (const existingElement of head.querySelectorAll(tag)) { - if (found && existingElement.getAttribute(import_common.dataPrecedenceAttr) !== precedence) { - head.insertBefore(e, existingElement); - return; - } - if (existingElement.getAttribute(import_common.dataPrecedenceAttr) === precedence) { - found = true; - } - } - head.appendChild(e); - } else if (existingElements) { - let found = false; - for (const existingElement of existingElements) { - if (existingElement === e) { - found = true; - break; - } - } - if (!found) { - head.insertBefore( - e, - head.contains(existingElements[0]) ? existingElements[0] : head.querySelector(tag) - ); - } - existingElements = void 0; - } - }, - [precedence] - ); - const ref = composeRef(props.ref, (e) => { - const key = deDupeKeys[0]; - if (preserveNodeType === 2) { - e.innerHTML = ""; - } - if (created || existingElements) { - insert(e); - } - if (!onError && !onLoad) { - return; - } - let promise = blockingPromiseMap[e.getAttribute(key)] ||= new Promise( - (resolve, reject) => { - e.addEventListener("load", resolve); - e.addEventListener("error", reject); - } - ); - if (onLoad) { - promise = promise.then(onLoad); - } - if (onError) { - promise = promise.catch(onError); - } - promise.catch(() => { - }); - }); - if (supportBlocking && blocking === "render") { - const key = import_common.deDupeKeyMap[tag][0]; - if (props[key]) { - const value = props[key]; - const promise = blockingPromiseMap[value] ||= new Promise((resolve, reject) => { - insert(element); - element.addEventListener("load", resolve); - element.addEventListener("error", reject); - }); - (0, import_hooks.use)(promise); - } - } - const jsxNode = { - tag, - type: tag, - props: { - ...restProps, - ref - }, - ref - }; - jsxNode.p = preserveNodeType; - if (element) { - jsxNode.e = element; - } - return (0, import_render.createPortal)( - jsxNode, - head - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ); -}; -const title = (props) => { - const nameSpaceContext = (0, import_render.getNameSpaceContext)(); - const ns = nameSpaceContext && (0, import_context.useContext)(nameSpaceContext); - if (ns?.endsWith("svg")) { - return { - tag: "title", - props, - type: "title", - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ref: props.ref - }; - } - return documentMetadataTag("title", props, void 0, false, false); -}; -const script = (props) => { - if (!props || ["src", "async"].some((k) => !props[k])) { - return { - tag: "script", - props, - type: "script", - ref: props.ref - }; - } - return documentMetadataTag("script", props, 1, false, true); -}; -const style = (props) => { - if (!props || !["href", "precedence"].every((k) => k in props)) { - return { - tag: "style", - props, - type: "style", - ref: props.ref - }; - } - props["data-href"] = props.href; - delete props.href; - return documentMetadataTag("style", props, 2, true, true); -}; -const link = (props) => { - if (!props || ["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) { - return { - tag: "link", - props, - type: "link", - ref: props.ref - }; - } - return documentMetadataTag("link", props, 1, "precedence" in props, true); -}; -const meta = (props) => { - return documentMetadataTag("meta", props, void 0, false, false); -}; -const customEventFormAction = /* @__PURE__ */ Symbol(); -const form = (props) => { - const { action, ...restProps } = props; - if (typeof action !== "function") { - ; - restProps.action = action; - } - const [state, setState] = (0, import_hooks.useState)([null, false]); - const onSubmit = (0, import_hooks.useCallback)( - async (ev) => { - const currentAction = ev.isTrusted ? action : ev.detail[customEventFormAction]; - if (typeof currentAction !== "function") { - return; - } - ev.preventDefault(); - const formData = new FormData(ev.target); - setState([formData, true]); - const actionRes = currentAction(formData); - if (actionRes instanceof Promise) { - (0, import_hooks2.registerAction)(actionRes); - await actionRes; - } - setState([null, true]); - }, - [] - ); - const ref = composeRef(props.ref, (el) => { - el.addEventListener("submit", onSubmit); - return () => { - el.removeEventListener("submit", onSubmit); - }; - }); - const [data, isDirty] = state; - state[1] = false; - return { - tag: import_hooks2.FormContext, - props: { - value: { - pending: data !== null, - data, - method: data ? "post" : null, - action: data ? action : null - }, - children: { - tag: "form", - props: { - ...restProps, - ref - }, - type: "form", - ref - } - }, - f: isDirty - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }; -}; -const formActionableElement = (tag, { - formAction, - ...props -}) => { - if (typeof formAction === "function") { - const onClick = (0, import_hooks.useCallback)((ev) => { - ev.preventDefault(); - ev.currentTarget.form.dispatchEvent( - new CustomEvent("submit", { detail: { [customEventFormAction]: formAction } }) - ); - }, []); - props.ref = composeRef(props.ref, (el) => { - el.addEventListener("click", onClick); - return () => { - el.removeEventListener("click", onClick); - }; - }); - } - return { - tag, - props, - type: tag, - ref: props.ref - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }; -}; -const input = (props) => formActionableElement("input", props); -const button = (props) => formActionableElement("button", props); -Object.assign(import_common.domRenderers, { - title, - script, - style, - link, - meta, - form, - input, - button -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - button, - clearCache, - composeRef, - form, - input, - link, - meta, - script, - style, - title -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js b/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js deleted file mode 100644 index 24faf6c..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jsx_dev_runtime_exports = {}; -__export(jsx_dev_runtime_exports, { - Fragment: () => Fragment, - jsxDEV: () => jsxDEV -}); -module.exports = __toCommonJS(jsx_dev_runtime_exports); -var intrinsicElementTags = __toESM(require("./intrinsic-element/components"), 1); -const jsxDEV = (tag, props, key) => { - if (typeof tag === "string" && intrinsicElementTags[tag]) { - tag = intrinsicElementTags[tag]; - } - return { - tag, - type: tag, - props, - key, - ref: props.ref - }; -}; -const Fragment = (props) => jsxDEV("", props, void 0); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Fragment, - jsxDEV -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js b/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js deleted file mode 100644 index be6fe82..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jsx_runtime_exports = {}; -__export(jsx_runtime_exports, { - Fragment: () => import_jsx_dev_runtime.Fragment, - jsx: () => import_jsx_dev_runtime.jsxDEV, - jsxs: () => import_jsx_dev_runtime2.jsxDEV -}); -module.exports = __toCommonJS(jsx_runtime_exports); -var import_jsx_dev_runtime = require("./jsx-dev-runtime"); -var import_jsx_dev_runtime2 = require("./jsx-dev-runtime"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Fragment, - jsx, - jsxs -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/render.js b/node_modules/hono/dist/cjs/jsx/dom/render.js deleted file mode 100644 index e5b579a..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/render.js +++ /dev/null @@ -1,618 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var render_exports = {}; -__export(render_exports, { - build: () => build, - buildDataStack: () => buildDataStack, - buildNode: () => buildNode, - createPortal: () => createPortal, - flushSync: () => flushSync, - getNameSpaceContext: () => getNameSpaceContext, - render: () => render, - renderNode: () => renderNode, - update: () => update -}); -module.exports = __toCommonJS(render_exports); -var import_children = require("../children"); -var import_constants = require("../constants"); -var import_context = require("../context"); -var import_hooks = require("../hooks"); -var import_utils = require("../utils"); -var import_context2 = require("./context"); -const HONO_PORTAL_ELEMENT = "_hp"; -const eventAliasMap = { - Change: "Input", - DoubleClick: "DblClick" -}; -const nameSpaceMap = { - svg: "2000/svg", - math: "1998/Math/MathML" -}; -const buildDataStack = []; -const refCleanupMap = /* @__PURE__ */ new WeakMap(); -let nameSpaceContext = void 0; -const getNameSpaceContext = () => nameSpaceContext; -const isNodeString = (node) => "t" in node; -const eventCache = { - // pre-define events that are used very frequently - onClick: ["click", false] -}; -const getEventSpec = (key) => { - if (!key.startsWith("on")) { - return void 0; - } - if (eventCache[key]) { - return eventCache[key]; - } - const match = key.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/); - if (match) { - const [, eventName, capture] = match; - return eventCache[key] = [(eventAliasMap[eventName] || eventName).toLowerCase(), !!capture]; - } - return void 0; -}; -const toAttributeName = (element, key) => nameSpaceContext && element instanceof SVGElement && /[A-Z]/.test(key) && (key in element.style || // Presentation attributes are findable in style object. "clip-path", "font-size", "stroke-width", etc. -key.match(/^(?:o|pai|str|u|ve)/)) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key; -const applyProps = (container, attributes, oldAttributes) => { - attributes ||= {}; - for (let key in attributes) { - const value = attributes[key]; - if (key !== "children" && (!oldAttributes || oldAttributes[key] !== value)) { - key = (0, import_utils.normalizeIntrinsicElementKey)(key); - const eventSpec = getEventSpec(key); - if (eventSpec) { - if (oldAttributes?.[key] !== value) { - if (oldAttributes) { - container.removeEventListener(eventSpec[0], oldAttributes[key], eventSpec[1]); - } - if (value != null) { - if (typeof value !== "function") { - throw new Error(`Event handler for "${key}" is not a function`); - } - container.addEventListener(eventSpec[0], value, eventSpec[1]); - } - } - } else if (key === "dangerouslySetInnerHTML" && value) { - container.innerHTML = value.__html; - } else if (key === "ref") { - let cleanup; - if (typeof value === "function") { - cleanup = value(container) || (() => value(null)); - } else if (value && "current" in value) { - value.current = container; - cleanup = () => value.current = null; - } - refCleanupMap.set(container, cleanup); - } else if (key === "style") { - const style = container.style; - if (typeof value === "string") { - style.cssText = value; - } else { - style.cssText = ""; - if (value != null) { - (0, import_utils.styleObjectForEach)(value, style.setProperty.bind(style)); - } - } - } else { - if (key === "value") { - const nodeName = container.nodeName; - if (nodeName === "INPUT" || nodeName === "TEXTAREA" || nodeName === "SELECT") { - ; - container.value = value === null || value === void 0 || value === false ? null : value; - if (nodeName === "TEXTAREA") { - container.textContent = value; - continue; - } else if (nodeName === "SELECT") { - if (container.selectedIndex === -1) { - ; - container.selectedIndex = 0; - } - continue; - } - } - } else if (key === "checked" && container.nodeName === "INPUT" || key === "selected" && container.nodeName === "OPTION") { - ; - container[key] = value; - } - const k = toAttributeName(container, key); - if (value === null || value === void 0 || value === false) { - container.removeAttribute(k); - } else if (value === true) { - container.setAttribute(k, ""); - } else if (typeof value === "string" || typeof value === "number") { - container.setAttribute(k, value); - } else { - container.setAttribute(k, value.toString()); - } - } - } - } - if (oldAttributes) { - for (let key in oldAttributes) { - const value = oldAttributes[key]; - if (key !== "children" && !(key in attributes)) { - key = (0, import_utils.normalizeIntrinsicElementKey)(key); - const eventSpec = getEventSpec(key); - if (eventSpec) { - container.removeEventListener(eventSpec[0], value, eventSpec[1]); - } else if (key === "ref") { - refCleanupMap.get(container)?.(); - } else { - container.removeAttribute(toAttributeName(container, key)); - } - } - } - } -}; -const invokeTag = (context, node) => { - node[import_constants.DOM_STASH][0] = 0; - buildDataStack.push([context, node]); - const func = node.tag[import_constants.DOM_RENDERER] || node.tag; - const props = func.defaultProps ? { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ...func.defaultProps, - ...node.props - } : node.props; - try { - return [func.call(null, props)]; - } finally { - buildDataStack.pop(); - } -}; -const getNextChildren = (node, container, nextChildren, childrenToRemove, callbacks) => { - if (node.vR?.length) { - childrenToRemove.push(...node.vR); - delete node.vR; - } - if (typeof node.tag === "function") { - node[import_constants.DOM_STASH][1][import_hooks.STASH_EFFECT]?.forEach((data) => callbacks.push(data)); - } - node.vC.forEach((child) => { - if (isNodeString(child)) { - nextChildren.push(child); - } else { - if (typeof child.tag === "function" || child.tag === "") { - child.c = container; - const currentNextChildrenIndex = nextChildren.length; - getNextChildren(child, container, nextChildren, childrenToRemove, callbacks); - if (child.s) { - for (let i = currentNextChildrenIndex; i < nextChildren.length; i++) { - nextChildren[i].s = true; - } - child.s = false; - } - } else { - nextChildren.push(child); - if (child.vR?.length) { - childrenToRemove.push(...child.vR); - delete child.vR; - } - } - } - }); -}; -const findInsertBefore = (node) => { - while (node && (node.tag === HONO_PORTAL_ELEMENT || !node.e)) { - node = node.tag === HONO_PORTAL_ELEMENT || !node.vC?.[0] ? node.nN : node.vC[0]; - } - return node?.e; -}; -const removeNode = (node) => { - if (!isNodeString(node)) { - node[import_constants.DOM_STASH]?.[1][import_hooks.STASH_EFFECT]?.forEach((data) => data[2]?.()); - refCleanupMap.get(node.e)?.(); - if (node.p === 2) { - node.vC?.forEach((n) => n.p = 2); - } - node.vC?.forEach(removeNode); - } - if (!node.p) { - node.e?.remove(); - delete node.e; - } - if (typeof node.tag === "function") { - updateMap.delete(node); - fallbackUpdateFnArrayMap.delete(node); - delete node[import_constants.DOM_STASH][3]; - node.a = true; - } -}; -const apply = (node, container, isNew) => { - node.c = container; - applyNodeObject(node, container, isNew); -}; -const findChildNodeIndex = (childNodes, child) => { - if (!child) { - return; - } - for (let i = 0, len = childNodes.length; i < len; i++) { - if (childNodes[i] === child) { - return i; - } - } - return; -}; -const cancelBuild = /* @__PURE__ */ Symbol(); -const applyNodeObject = (node, container, isNew) => { - const next = []; - const remove = []; - const callbacks = []; - getNextChildren(node, container, next, remove, callbacks); - remove.forEach(removeNode); - const childNodes = isNew ? void 0 : container.childNodes; - let offset; - let insertBeforeNode = null; - if (isNew) { - offset = -1; - } else if (!childNodes.length) { - offset = 0; - } else { - const offsetByNextNode = findChildNodeIndex(childNodes, findInsertBefore(node.nN)); - if (offsetByNextNode !== void 0) { - insertBeforeNode = childNodes[offsetByNextNode]; - offset = offsetByNextNode; - } else { - offset = findChildNodeIndex(childNodes, next.find((n) => n.tag !== HONO_PORTAL_ELEMENT && n.e)?.e) ?? -1; - } - if (offset === -1) { - isNew = true; - } - } - for (let i = 0, len = next.length; i < len; i++, offset++) { - const child = next[i]; - let el; - if (child.s && child.e) { - el = child.e; - child.s = false; - } else { - const isNewLocal = isNew || !child.e; - if (isNodeString(child)) { - if (child.e && child.d) { - child.e.textContent = child.t; - } - child.d = false; - el = child.e ||= document.createTextNode(child.t); - } else { - el = child.e ||= child.n ? document.createElementNS(child.n, child.tag) : document.createElement(child.tag); - applyProps(el, child.props, child.pP); - applyNodeObject(child, el, isNewLocal); - } - } - if (child.tag === HONO_PORTAL_ELEMENT) { - offset--; - } else if (isNew) { - if (!el.parentNode) { - container.appendChild(el); - } - } else if (childNodes[offset] !== el && childNodes[offset - 1] !== el) { - if (childNodes[offset + 1] === el) { - container.appendChild(childNodes[offset]); - } else { - container.insertBefore(el, insertBeforeNode || childNodes[offset] || null); - } - } - } - if (node.pP) { - node.pP = void 0; - } - if (callbacks.length) { - const useLayoutEffectCbs = []; - const useEffectCbs = []; - callbacks.forEach(([, useLayoutEffectCb, , useEffectCb, useInsertionEffectCb]) => { - if (useLayoutEffectCb) { - useLayoutEffectCbs.push(useLayoutEffectCb); - } - if (useEffectCb) { - useEffectCbs.push(useEffectCb); - } - useInsertionEffectCb?.(); - }); - useLayoutEffectCbs.forEach((cb) => cb()); - if (useEffectCbs.length) { - requestAnimationFrame(() => { - useEffectCbs.forEach((cb) => cb()); - }); - } - } -}; -const isSameContext = (oldContexts, newContexts) => !!(oldContexts && oldContexts.length === newContexts.length && oldContexts.every((ctx, i) => ctx[1] === newContexts[i][1])); -const fallbackUpdateFnArrayMap = /* @__PURE__ */ new WeakMap(); -const build = (context, node, children) => { - const buildWithPreviousChildren = !children && node.pC; - if (children) { - node.pC ||= node.vC; - } - let foundErrorHandler; - try { - children ||= typeof node.tag == "function" ? invokeTag(context, node) : (0, import_children.toArray)(node.props.children); - if (children[0]?.tag === "" && children[0][import_constants.DOM_ERROR_HANDLER]) { - foundErrorHandler = children[0][import_constants.DOM_ERROR_HANDLER]; - context[5].push([context, foundErrorHandler, node]); - } - const oldVChildren = buildWithPreviousChildren ? [...node.pC] : node.vC ? [...node.vC] : void 0; - const vChildren = []; - let prevNode; - for (let i = 0; i < children.length; i++) { - if (Array.isArray(children[i])) { - children.splice(i, 1, ...children[i].flat()); - } - let child = buildNode(children[i]); - if (child) { - if (typeof child.tag === "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any - !child.tag[import_constants.DOM_INTERNAL_TAG]) { - if (import_context.globalContexts.length > 0) { - child[import_constants.DOM_STASH][2] = import_context.globalContexts.map((c) => [c, c.values.at(-1)]); - } - if (context[5]?.length) { - child[import_constants.DOM_STASH][3] = context[5].at(-1); - } - } - let oldChild; - if (oldVChildren && oldVChildren.length) { - const i2 = oldVChildren.findIndex( - isNodeString(child) ? (c) => isNodeString(c) : child.key !== void 0 ? (c) => c.key === child.key && c.tag === child.tag : (c) => c.tag === child.tag - ); - if (i2 !== -1) { - oldChild = oldVChildren[i2]; - oldVChildren.splice(i2, 1); - } - } - if (oldChild) { - if (isNodeString(child)) { - if (oldChild.t !== child.t) { - ; - oldChild.t = child.t; - oldChild.d = true; - } - child = oldChild; - } else { - const pP = oldChild.pP = oldChild.props; - oldChild.props = child.props; - oldChild.f ||= child.f || node.f; - if (typeof child.tag === "function") { - const oldContexts = oldChild[import_constants.DOM_STASH][2]; - oldChild[import_constants.DOM_STASH][2] = child[import_constants.DOM_STASH][2] || []; - oldChild[import_constants.DOM_STASH][3] = child[import_constants.DOM_STASH][3]; - if (!oldChild.f && ((oldChild.o || oldChild) === child.o || // The code generated by the react compiler is memoized under this condition. - oldChild.tag[import_constants.DOM_MEMO]?.(pP, oldChild.props)) && // The `memo` function is memoized under this condition. - isSameContext(oldContexts, oldChild[import_constants.DOM_STASH][2])) { - oldChild.s = true; - } - } - child = oldChild; - } - } else if (!isNodeString(child) && nameSpaceContext) { - const ns = (0, import_context.useContext)(nameSpaceContext); - if (ns) { - child.n = ns; - } - } - if (!isNodeString(child) && !child.s) { - build(context, child); - delete child.f; - } - vChildren.push(child); - if (prevNode && !prevNode.s && !child.s) { - for (let p = prevNode; p && !isNodeString(p); p = p.vC?.at(-1)) { - p.nN = child; - } - } - prevNode = child; - } - } - node.vR = buildWithPreviousChildren ? [...node.vC, ...oldVChildren || []] : oldVChildren || []; - node.vC = vChildren; - if (buildWithPreviousChildren) { - delete node.pC; - } - } catch (e) { - node.f = true; - if (e === cancelBuild) { - if (foundErrorHandler) { - return; - } else { - throw e; - } - } - const [errorHandlerContext, errorHandler, errorHandlerNode] = node[import_constants.DOM_STASH]?.[3] || []; - if (errorHandler) { - const fallbackUpdateFn = () => update([0, false, context[2]], errorHandlerNode); - const fallbackUpdateFnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode) || []; - fallbackUpdateFnArray.push(fallbackUpdateFn); - fallbackUpdateFnArrayMap.set(errorHandlerNode, fallbackUpdateFnArray); - const fallback = errorHandler(e, () => { - const fnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode); - if (fnArray) { - const i = fnArray.indexOf(fallbackUpdateFn); - if (i !== -1) { - fnArray.splice(i, 1); - return fallbackUpdateFn(); - } - } - }); - if (fallback) { - if (context[0] === 1) { - context[1] = true; - } else { - build(context, errorHandlerNode, [fallback]); - if ((errorHandler.length === 1 || context !== errorHandlerContext) && errorHandlerNode.c) { - apply(errorHandlerNode, errorHandlerNode.c, false); - return; - } - } - throw cancelBuild; - } - } - throw e; - } finally { - if (foundErrorHandler) { - context[5].pop(); - } - } -}; -const buildNode = (node) => { - if (node === void 0 || node === null || typeof node === "boolean") { - return void 0; - } else if (typeof node === "string" || typeof node === "number") { - return { t: node.toString(), d: true }; - } else { - if ("vR" in node) { - node = { - tag: node.tag, - props: node.props, - key: node.key, - f: node.f, - type: node.tag, - ref: node.props.ref, - o: node.o || node - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }; - } - if (typeof node.tag === "function") { - ; - node[import_constants.DOM_STASH] = [0, []]; - } else { - const ns = nameSpaceMap[node.tag]; - if (ns) { - nameSpaceContext ||= (0, import_context2.createContext)(""); - node.props.children = [ - { - tag: nameSpaceContext, - props: { - value: node.n = `http://www.w3.org/${ns}`, - children: node.props.children - } - } - ]; - } - } - return node; - } -}; -const replaceContainer = (node, from, to) => { - if (node.c === from) { - node.c = to; - node.vC.forEach((child) => replaceContainer(child, from, to)); - } -}; -const updateSync = (context, node) => { - node[import_constants.DOM_STASH][2]?.forEach(([c, v]) => { - c.values.push(v); - }); - try { - build(context, node, void 0); - } catch { - return; - } - if (node.a) { - delete node.a; - return; - } - node[import_constants.DOM_STASH][2]?.forEach(([c]) => { - c.values.pop(); - }); - if (context[0] !== 1 || !context[1]) { - apply(node, node.c, false); - } -}; -const updateMap = /* @__PURE__ */ new WeakMap(); -const currentUpdateSets = []; -const update = async (context, node) => { - context[5] ||= []; - const existing = updateMap.get(node); - if (existing) { - existing[0](void 0); - } - let resolve; - const promise = new Promise((r) => resolve = r); - updateMap.set(node, [ - resolve, - () => { - if (context[2]) { - context[2](context, node, (context2) => { - updateSync(context2, node); - }).then(() => resolve(node)); - } else { - updateSync(context, node); - resolve(node); - } - } - ]); - if (currentUpdateSets.length) { - ; - currentUpdateSets.at(-1).add(node); - } else { - await Promise.resolve(); - const latest = updateMap.get(node); - if (latest) { - updateMap.delete(node); - latest[1](); - } - } - return promise; -}; -const renderNode = (node, container) => { - const context = []; - context[5] = []; - context[4] = true; - build(context, node, void 0); - context[4] = false; - const fragment = document.createDocumentFragment(); - apply(node, fragment, true); - replaceContainer(node, fragment, container); - container.replaceChildren(fragment); -}; -const render = (jsxNode, container) => { - renderNode(buildNode({ tag: "", props: { children: jsxNode } }), container); -}; -const flushSync = (callback) => { - const set = /* @__PURE__ */ new Set(); - currentUpdateSets.push(set); - callback(); - set.forEach((node) => { - const latest = updateMap.get(node); - if (latest) { - updateMap.delete(node); - latest[1](); - } - }); - currentUpdateSets.pop(); -}; -const createPortal = (children, container, key) => ({ - tag: HONO_PORTAL_ELEMENT, - props: { - children - }, - key, - e: container, - p: 1 - // eslint-disable-next-line @typescript-eslint/no-explicit-any -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - build, - buildDataStack, - buildNode, - createPortal, - flushSync, - getNameSpaceContext, - render, - renderNode, - update -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/server.js b/node_modules/hono/dist/cjs/jsx/dom/server.js deleted file mode 100644 index 58f12ed..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/server.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var server_exports = {}; -__export(server_exports, { - default: () => server_default, - renderToReadableStream: () => renderToReadableStream, - renderToString: () => renderToString, - version: () => import__.default -}); -module.exports = __toCommonJS(server_exports); -var import_streaming = require("../streaming"); -var import__ = __toESM(require("./"), 1); -const renderToString = (element, options = {}) => { - if (Object.keys(options).length > 0) { - console.warn("options are not supported yet"); - } - const res = element?.toString() ?? ""; - if (typeof res !== "string") { - throw new Error("Async component is not supported in renderToString"); - } - return res; -}; -const renderToReadableStream = async (element, options = {}) => { - if (Object.keys(options).some((key) => key !== "onError")) { - console.warn("options are not supported yet, except onError"); - } - if (!element || typeof element !== "object") { - element = element?.toString() ?? ""; - } - return (0, import_streaming.renderToReadableStream)(element, options.onError); -}; -var server_default = { - renderToString, - renderToReadableStream, - version: import__.default -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - renderToReadableStream, - renderToString, - version -}); diff --git a/node_modules/hono/dist/cjs/jsx/dom/utils.js b/node_modules/hono/dist/cjs/jsx/dom/utils.js deleted file mode 100644 index 47d6fb6..0000000 --- a/node_modules/hono/dist/cjs/jsx/dom/utils.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var utils_exports = {}; -__export(utils_exports, { - setInternalTagFlag: () => setInternalTagFlag -}); -module.exports = __toCommonJS(utils_exports); -var import_constants = require("../constants"); -const setInternalTagFlag = (fn) => { - ; - fn[import_constants.DOM_INTERNAL_TAG] = true; - return fn; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - setInternalTagFlag -}); diff --git a/node_modules/hono/dist/cjs/jsx/hooks/index.js b/node_modules/hono/dist/cjs/jsx/hooks/index.js deleted file mode 100644 index 948bd75..0000000 --- a/node_modules/hono/dist/cjs/jsx/hooks/index.js +++ /dev/null @@ -1,371 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var hooks_exports = {}; -__export(hooks_exports, { - STASH_EFFECT: () => STASH_EFFECT, - createRef: () => createRef, - forwardRef: () => forwardRef, - startTransition: () => startTransition, - startViewTransition: () => startViewTransition, - use: () => use, - useCallback: () => useCallback, - useDebugValue: () => useDebugValue, - useDeferredValue: () => useDeferredValue, - useEffect: () => useEffect, - useId: () => useId, - useImperativeHandle: () => useImperativeHandle, - useInsertionEffect: () => useInsertionEffect, - useLayoutEffect: () => useLayoutEffect, - useMemo: () => useMemo, - useReducer: () => useReducer, - useRef: () => useRef, - useState: () => useState, - useSyncExternalStore: () => useSyncExternalStore, - useTransition: () => useTransition, - useViewTransition: () => useViewTransition -}); -module.exports = __toCommonJS(hooks_exports); -var import_constants = require("../constants"); -var import_render = require("../dom/render"); -const STASH_SATE = 0; -const STASH_EFFECT = 1; -const STASH_CALLBACK = 2; -const STASH_MEMO = 3; -const STASH_REF = 4; -const resolvedPromiseValueMap = /* @__PURE__ */ new WeakMap(); -const isDepsChanged = (prevDeps, deps) => !prevDeps || !deps || prevDeps.length !== deps.length || deps.some((dep, i) => dep !== prevDeps[i]); -let viewTransitionState = void 0; -const documentStartViewTransition = (cb) => { - if (document?.startViewTransition) { - return document.startViewTransition(cb); - } else { - cb(); - return { finished: Promise.resolve() }; - } -}; -let updateHook = void 0; -const viewTransitionHook = (context, node, cb) => { - const state = [true, false]; - let lastVC = node.vC; - return documentStartViewTransition(() => { - if (lastVC === node.vC) { - viewTransitionState = state; - cb(context); - viewTransitionState = void 0; - lastVC = node.vC; - } - }).finished.then(() => { - if (state[1] && lastVC === node.vC) { - state[0] = false; - viewTransitionState = state; - cb(context); - viewTransitionState = void 0; - } - }); -}; -const startViewTransition = (callback) => { - updateHook = viewTransitionHook; - try { - callback(); - } finally { - updateHook = void 0; - } -}; -const useViewTransition = () => { - const buildData = import_render.buildDataStack.at(-1); - if (!buildData) { - return [false, () => { - }]; - } - if (viewTransitionState) { - viewTransitionState[1] = true; - } - return [!!viewTransitionState?.[0], startViewTransition]; -}; -const pendingStack = []; -const runCallback = (type, callback) => { - let resolve; - const promise = new Promise((r) => resolve = r); - pendingStack.push([type, promise]); - try { - const res = callback(); - if (res instanceof Promise) { - res.then(resolve, resolve); - } else { - resolve(); - } - } finally { - pendingStack.pop(); - } -}; -const startTransition = (callback) => { - runCallback(1, callback); -}; -const startTransitionHook = (callback) => { - runCallback(2, callback); -}; -const useTransition = () => { - const buildData = import_render.buildDataStack.at(-1); - if (!buildData) { - return [false, () => { - }]; - } - const [error, setError] = useState(); - const [state, updateState] = useState(); - if (error) { - throw error[0]; - } - const startTransitionLocalHook = useCallback( - (callback) => { - startTransitionHook(() => { - updateState((state2) => !state2); - let res = callback(); - if (res instanceof Promise) { - res = res.catch((e) => { - setError([e]); - }); - } - return res; - }); - }, - [state] - ); - const [context] = buildData; - return [context[0] === 2, startTransitionLocalHook]; -}; -const useDeferredValue = (value, ...rest) => { - const [values, setValues] = useState( - rest.length ? [rest[0], rest[0]] : [value, value] - ); - if (Object.is(values[1], value)) { - return values[1]; - } - pendingStack.push([3, Promise.resolve()]); - updateHook = async (context, _, cb) => { - cb(context); - values[0] = value; - }; - setValues([values[0], value]); - updateHook = void 0; - pendingStack.pop(); - return values[0]; -}; -const useState = (initialState) => { - const resolveInitialState = () => typeof initialState === "function" ? initialState() : initialState; - const buildData = import_render.buildDataStack.at(-1); - if (!buildData) { - return [resolveInitialState(), () => { - }]; - } - const [, node] = buildData; - const stateArray = node[import_constants.DOM_STASH][1][STASH_SATE] ||= []; - const hookIndex = node[import_constants.DOM_STASH][0]++; - return stateArray[hookIndex] ||= [ - resolveInitialState(), - (newState) => { - const localUpdateHook = updateHook; - const stateData = stateArray[hookIndex]; - if (typeof newState === "function") { - newState = newState(stateData[0]); - } - if (!Object.is(newState, stateData[0])) { - stateData[0] = newState; - if (pendingStack.length) { - const [pendingType, pendingPromise] = pendingStack.at(-1); - Promise.all([ - pendingType === 3 ? node : (0, import_render.update)([pendingType, false, localUpdateHook], node), - pendingPromise - ]).then(([node2]) => { - if (!node2 || !(pendingType === 2 || pendingType === 3)) { - return; - } - const lastVC = node2.vC; - const addUpdateTask = () => { - setTimeout(() => { - if (lastVC !== node2.vC) { - return; - } - (0, import_render.update)([pendingType === 3 ? 1 : 0, false, localUpdateHook], node2); - }); - }; - requestAnimationFrame(addUpdateTask); - }); - } else { - (0, import_render.update)([0, false, localUpdateHook], node); - } - } - } - ]; -}; -const useReducer = (reducer, initialArg, init) => { - const handler = useCallback( - (action) => { - setState((state2) => reducer(state2, action)); - }, - [reducer] - ); - const [state, setState] = useState(() => init ? init(initialArg) : initialArg); - return [state, handler]; -}; -const useEffectCommon = (index, effect, deps) => { - const buildData = import_render.buildDataStack.at(-1); - if (!buildData) { - return; - } - const [, node] = buildData; - const effectDepsArray = node[import_constants.DOM_STASH][1][STASH_EFFECT] ||= []; - const hookIndex = node[import_constants.DOM_STASH][0]++; - const [prevDeps, , prevCleanup] = effectDepsArray[hookIndex] ||= []; - if (isDepsChanged(prevDeps, deps)) { - if (prevCleanup) { - prevCleanup(); - } - const runner = () => { - data[index] = void 0; - data[2] = effect(); - }; - const data = [deps, void 0, void 0, void 0, void 0]; - data[index] = runner; - effectDepsArray[hookIndex] = data; - } -}; -const useEffect = (effect, deps) => useEffectCommon(3, effect, deps); -const useLayoutEffect = (effect, deps) => useEffectCommon(1, effect, deps); -const useInsertionEffect = (effect, deps) => useEffectCommon(4, effect, deps); -const useCallback = (callback, deps) => { - const buildData = import_render.buildDataStack.at(-1); - if (!buildData) { - return callback; - } - const [, node] = buildData; - const callbackArray = node[import_constants.DOM_STASH][1][STASH_CALLBACK] ||= []; - const hookIndex = node[import_constants.DOM_STASH][0]++; - const prevDeps = callbackArray[hookIndex]; - if (isDepsChanged(prevDeps?.[1], deps)) { - callbackArray[hookIndex] = [callback, deps]; - } else { - callback = callbackArray[hookIndex][0]; - } - return callback; -}; -const useRef = (initialValue) => { - const buildData = import_render.buildDataStack.at(-1); - if (!buildData) { - return { current: initialValue }; - } - const [, node] = buildData; - const refArray = node[import_constants.DOM_STASH][1][STASH_REF] ||= []; - const hookIndex = node[import_constants.DOM_STASH][0]++; - return refArray[hookIndex] ||= { current: initialValue }; -}; -const use = (promise) => { - const cachedRes = resolvedPromiseValueMap.get(promise); - if (cachedRes) { - if (cachedRes.length === 2) { - throw cachedRes[1]; - } - return cachedRes[0]; - } - promise.then( - (res) => resolvedPromiseValueMap.set(promise, [res]), - (e) => resolvedPromiseValueMap.set(promise, [void 0, e]) - ); - throw promise; -}; -const useMemo = (factory, deps) => { - const buildData = import_render.buildDataStack.at(-1); - if (!buildData) { - return factory(); - } - const [, node] = buildData; - const memoArray = node[import_constants.DOM_STASH][1][STASH_MEMO] ||= []; - const hookIndex = node[import_constants.DOM_STASH][0]++; - const prevDeps = memoArray[hookIndex]; - if (isDepsChanged(prevDeps?.[1], deps)) { - memoArray[hookIndex] = [factory(), deps]; - } - return memoArray[hookIndex][0]; -}; -let idCounter = 0; -const useId = () => useMemo(() => `:r${(idCounter++).toString(32)}:`, []); -const useDebugValue = (_value, _formatter) => { -}; -const createRef = () => { - return { current: null }; -}; -const forwardRef = (Component) => { - return (props) => { - const { ref, ...rest } = props; - return Component(rest, ref); - }; -}; -const useImperativeHandle = (ref, createHandle, deps) => { - useEffect(() => { - ref.current = createHandle(); - return () => { - ref.current = null; - }; - }, deps); -}; -const useSyncExternalStore = (subscribe, getSnapshot, getServerSnapshot) => { - const buildData = import_render.buildDataStack.at(-1); - if (!buildData) { - if (!getServerSnapshot) { - throw new Error("getServerSnapshot is required for server side rendering"); - } - return getServerSnapshot(); - } - const [serverSnapshotIsUsed] = useState(!!(buildData[0][4] && getServerSnapshot)); - const [state, setState] = useState( - () => serverSnapshotIsUsed ? getServerSnapshot() : getSnapshot() - ); - useEffect(() => { - if (serverSnapshotIsUsed) { - setState(getSnapshot()); - } - return subscribe(() => { - setState(getSnapshot()); - }); - }, []); - return state; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - STASH_EFFECT, - createRef, - forwardRef, - startTransition, - startViewTransition, - use, - useCallback, - useDebugValue, - useDeferredValue, - useEffect, - useId, - useImperativeHandle, - useInsertionEffect, - useLayoutEffect, - useMemo, - useReducer, - useRef, - useState, - useSyncExternalStore, - useTransition, - useViewTransition -}); diff --git a/node_modules/hono/dist/cjs/jsx/index.js b/node_modules/hono/dist/cjs/jsx/index.js deleted file mode 100644 index d750bb0..0000000 --- a/node_modules/hono/dist/cjs/jsx/index.js +++ /dev/null @@ -1,139 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jsx_exports = {}; -__export(jsx_exports, { - Children: () => import_children.Children, - ErrorBoundary: () => import_components.ErrorBoundary, - Fragment: () => import_base.Fragment, - StrictMode: () => import_base.Fragment, - Suspense: () => import_streaming.Suspense, - cloneElement: () => import_base.cloneElement, - createContext: () => import_context.createContext, - createElement: () => import_base.jsx, - createRef: () => import_hooks2.createRef, - default: () => jsx_default, - forwardRef: () => import_hooks2.forwardRef, - isValidElement: () => import_base.isValidElement, - jsx: () => import_base.jsx, - memo: () => import_base.memo, - startTransition: () => import_hooks2.startTransition, - startViewTransition: () => import_hooks2.startViewTransition, - use: () => import_hooks2.use, - useActionState: () => import_hooks.useActionState, - useCallback: () => import_hooks2.useCallback, - useContext: () => import_context.useContext, - useDebugValue: () => import_hooks2.useDebugValue, - useDeferredValue: () => import_hooks2.useDeferredValue, - useEffect: () => import_hooks2.useEffect, - useId: () => import_hooks2.useId, - useImperativeHandle: () => import_hooks2.useImperativeHandle, - useInsertionEffect: () => import_hooks2.useInsertionEffect, - useLayoutEffect: () => import_hooks2.useLayoutEffect, - useMemo: () => import_hooks2.useMemo, - useOptimistic: () => import_hooks.useOptimistic, - useReducer: () => import_hooks2.useReducer, - useRef: () => import_hooks2.useRef, - useState: () => import_hooks2.useState, - useSyncExternalStore: () => import_hooks2.useSyncExternalStore, - useTransition: () => import_hooks2.useTransition, - useViewTransition: () => import_hooks2.useViewTransition, - version: () => import_base.reactAPICompatVersion -}); -module.exports = __toCommonJS(jsx_exports); -var import_base = require("./base"); -var import_children = require("./children"); -var import_components = require("./components"); -var import_context = require("./context"); -var import_hooks = require("./dom/hooks"); -var import_hooks2 = require("./hooks"); -var import_streaming = require("./streaming"); -var jsx_default = { - version: import_base.reactAPICompatVersion, - memo: import_base.memo, - Fragment: import_base.Fragment, - StrictMode: import_base.Fragment, - isValidElement: import_base.isValidElement, - createElement: import_base.jsx, - cloneElement: import_base.cloneElement, - ErrorBoundary: import_components.ErrorBoundary, - createContext: import_context.createContext, - useContext: import_context.useContext, - useState: import_hooks2.useState, - useEffect: import_hooks2.useEffect, - useRef: import_hooks2.useRef, - useCallback: import_hooks2.useCallback, - useReducer: import_hooks2.useReducer, - useId: import_hooks2.useId, - useDebugValue: import_hooks2.useDebugValue, - use: import_hooks2.use, - startTransition: import_hooks2.startTransition, - useTransition: import_hooks2.useTransition, - useDeferredValue: import_hooks2.useDeferredValue, - startViewTransition: import_hooks2.startViewTransition, - useViewTransition: import_hooks2.useViewTransition, - useMemo: import_hooks2.useMemo, - useLayoutEffect: import_hooks2.useLayoutEffect, - useInsertionEffect: import_hooks2.useInsertionEffect, - createRef: import_hooks2.createRef, - forwardRef: import_hooks2.forwardRef, - useImperativeHandle: import_hooks2.useImperativeHandle, - useSyncExternalStore: import_hooks2.useSyncExternalStore, - useActionState: import_hooks.useActionState, - useOptimistic: import_hooks.useOptimistic, - Suspense: import_streaming.Suspense, - Children: import_children.Children -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Children, - ErrorBoundary, - Fragment, - StrictMode, - Suspense, - cloneElement, - createContext, - createElement, - createRef, - forwardRef, - isValidElement, - jsx, - memo, - startTransition, - startViewTransition, - use, - useActionState, - useCallback, - useContext, - useDebugValue, - useDeferredValue, - useEffect, - useId, - useImperativeHandle, - useInsertionEffect, - useLayoutEffect, - useMemo, - useOptimistic, - useReducer, - useRef, - useState, - useSyncExternalStore, - useTransition, - useViewTransition, - version -}); diff --git a/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js b/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js deleted file mode 100644 index c01838f..0000000 --- a/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var common_exports = {}; -__export(common_exports, { - dataPrecedenceAttr: () => dataPrecedenceAttr, - deDupeKeyMap: () => deDupeKeyMap, - domRenderers: () => domRenderers -}); -module.exports = __toCommonJS(common_exports); -const deDupeKeyMap = { - title: [], - script: ["src"], - style: ["data-href"], - link: ["href"], - meta: ["name", "httpEquiv", "charset", "itemProp"] -}; -const domRenderers = {}; -const dataPrecedenceAttr = "data-precedence"; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - dataPrecedenceAttr, - deDupeKeyMap, - domRenderers -}); diff --git a/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js b/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js deleted file mode 100644 index a945c46..0000000 --- a/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +++ /dev/null @@ -1,183 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var components_exports = {}; -__export(components_exports, { - button: () => button, - form: () => form, - input: () => input, - link: () => link, - meta: () => meta, - script: () => script, - style: () => style, - title: () => title -}); -module.exports = __toCommonJS(components_exports); -var import_html = require("../../helper/html"); -var import_base = require("../base"); -var import_children = require("../children"); -var import_constants = require("../constants"); -var import_context = require("../context"); -var import_common = require("./common"); -const metaTagMap = /* @__PURE__ */ new WeakMap(); -const insertIntoHead = (tagName, tag, props, precedence) => ({ buffer, context }) => { - if (!buffer) { - return; - } - const map = metaTagMap.get(context) || {}; - metaTagMap.set(context, map); - const tags = map[tagName] ||= []; - let duped = false; - const deDupeKeys = import_common.deDupeKeyMap[tagName]; - if (deDupeKeys.length > 0) { - LOOP: for (const [, tagProps] of tags) { - for (const key of deDupeKeys) { - if ((tagProps?.[key] ?? null) === props?.[key]) { - duped = true; - break LOOP; - } - } - } - } - if (duped) { - buffer[0] = buffer[0].replaceAll(tag, ""); - } else if (deDupeKeys.length > 0) { - tags.push([tag, props, precedence]); - } else { - tags.unshift([tag, props, precedence]); - } - if (buffer[0].indexOf("") !== -1) { - let insertTags; - if (precedence === void 0) { - insertTags = tags.map(([tag2]) => tag2); - } else { - const precedences = []; - insertTags = tags.map(([tag2, , precedence2]) => { - let order = precedences.indexOf(precedence2); - if (order === -1) { - precedences.push(precedence2); - order = precedences.length - 1; - } - return [tag2, order]; - }).sort((a, b) => a[1] - b[1]).map(([tag2]) => tag2); - } - insertTags.forEach((tag2) => { - buffer[0] = buffer[0].replaceAll(tag2, ""); - }); - buffer[0] = buffer[0].replace(/(?=<\/head>)/, insertTags.join("")); - } -}; -const returnWithoutSpecialBehavior = (tag, children, props) => (0, import_html.raw)(new import_base.JSXNode(tag, props, (0, import_children.toArray)(children ?? [])).toString()); -const documentMetadataTag = (tag, children, props, sort) => { - if ("itemProp" in props) { - return returnWithoutSpecialBehavior(tag, children, props); - } - let { precedence, blocking, ...restProps } = props; - precedence = sort ? precedence ?? "" : void 0; - if (sort) { - restProps[import_common.dataPrecedenceAttr] = precedence; - } - const string = new import_base.JSXNode(tag, restProps, (0, import_children.toArray)(children || [])).toString(); - if (string instanceof Promise) { - return string.then( - (resString) => (0, import_html.raw)(string, [ - ...resString.callbacks || [], - insertIntoHead(tag, resString, restProps, precedence) - ]) - ); - } else { - return (0, import_html.raw)(string, [insertIntoHead(tag, string, restProps, precedence)]); - } -}; -const title = ({ children, ...props }) => { - const nameSpaceContext = (0, import_base.getNameSpaceContext)(); - if (nameSpaceContext) { - const context = (0, import_context.useContext)(nameSpaceContext); - if (context === "svg" || context === "head") { - return new import_base.JSXNode( - "title", - props, - (0, import_children.toArray)(children ?? []) - ); - } - } - return documentMetadataTag("title", children, props, false); -}; -const script = ({ - children, - ...props -}) => { - const nameSpaceContext = (0, import_base.getNameSpaceContext)(); - if (["src", "async"].some((k) => !props[k]) || nameSpaceContext && (0, import_context.useContext)(nameSpaceContext) === "head") { - return returnWithoutSpecialBehavior("script", children, props); - } - return documentMetadataTag("script", children, props, false); -}; -const style = ({ - children, - ...props -}) => { - if (!["href", "precedence"].every((k) => k in props)) { - return returnWithoutSpecialBehavior("style", children, props); - } - props["data-href"] = props.href; - delete props.href; - return documentMetadataTag("style", children, props, true); -}; -const link = ({ children, ...props }) => { - if (["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) { - return returnWithoutSpecialBehavior("link", children, props); - } - return documentMetadataTag("link", children, props, "precedence" in props); -}; -const meta = ({ children, ...props }) => { - const nameSpaceContext = (0, import_base.getNameSpaceContext)(); - if (nameSpaceContext && (0, import_context.useContext)(nameSpaceContext) === "head") { - return returnWithoutSpecialBehavior("meta", children, props); - } - return documentMetadataTag("meta", children, props, false); -}; -const newJSXNode = (tag, { children, ...props }) => ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - new import_base.JSXNode(tag, props, (0, import_children.toArray)(children ?? [])) -); -const form = (props) => { - if (typeof props.action === "function") { - props.action = import_constants.PERMALINK in props.action ? props.action[import_constants.PERMALINK] : void 0; - } - return newJSXNode("form", props); -}; -const formActionableElement = (tag, props) => { - if (typeof props.formAction === "function") { - props.formAction = import_constants.PERMALINK in props.formAction ? props.formAction[import_constants.PERMALINK] : void 0; - } - return newJSXNode(tag, props); -}; -const input = (props) => formActionableElement("input", props); -const button = (props) => formActionableElement("button", props); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - button, - form, - input, - link, - meta, - script, - style, - title -}); diff --git a/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js b/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js deleted file mode 100644 index c0053b0..0000000 --- a/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var intrinsic_elements_exports = {}; -module.exports = __toCommonJS(intrinsic_elements_exports); diff --git a/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js b/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js deleted file mode 100644 index a5ee5ef..0000000 --- a/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jsx_dev_runtime_exports = {}; -__export(jsx_dev_runtime_exports, { - Fragment: () => import_base2.Fragment, - jsxDEV: () => jsxDEV -}); -module.exports = __toCommonJS(jsx_dev_runtime_exports); -var import_base = require("./base"); -var import_base2 = require("./base"); -function jsxDEV(tag, props, key) { - let node; - if (!props || !("children" in props)) { - node = (0, import_base.jsxFn)(tag, props, []); - } else { - const children = props.children; - node = Array.isArray(children) ? (0, import_base.jsxFn)(tag, props, children) : (0, import_base.jsxFn)(tag, props, [children]); - } - node.key = key; - return node; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Fragment, - jsxDEV -}); diff --git a/node_modules/hono/dist/cjs/jsx/jsx-runtime.js b/node_modules/hono/dist/cjs/jsx/jsx-runtime.js deleted file mode 100644 index c1f4306..0000000 --- a/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jsx_runtime_exports = {}; -__export(jsx_runtime_exports, { - Fragment: () => import_jsx_dev_runtime.Fragment, - jsx: () => import_jsx_dev_runtime.jsxDEV, - jsxAttr: () => jsxAttr, - jsxEscape: () => jsxEscape, - jsxTemplate: () => import_html.html, - jsxs: () => import_jsx_dev_runtime2.jsxDEV -}); -module.exports = __toCommonJS(jsx_runtime_exports); -var import_jsx_dev_runtime = require("./jsx-dev-runtime"); -var import_jsx_dev_runtime2 = require("./jsx-dev-runtime"); -var import_html = require("../helper/html"); -var import_html2 = require("../utils/html"); -var import_utils = require("./utils"); -const jsxAttr = (key, v) => { - const buffer = [`${key}="`]; - if (key === "style" && typeof v === "object") { - let styleStr = ""; - (0, import_utils.styleObjectForEach)(v, (property, value) => { - if (value != null) { - styleStr += `${styleStr ? ";" : ""}${property}:${value}`; - } - }); - (0, import_html2.escapeToBuffer)(styleStr, buffer); - buffer[0] += '"'; - } else if (typeof v === "string") { - (0, import_html2.escapeToBuffer)(v, buffer); - buffer[0] += '"'; - } else if (v === null || v === void 0) { - return (0, import_html.raw)(""); - } else if (typeof v === "number" || v.isEscaped) { - buffer[0] += `${v}"`; - } else if (v instanceof Promise) { - buffer.unshift('"', v); - } else { - (0, import_html2.escapeToBuffer)(v.toString(), buffer); - buffer[0] += '"'; - } - return buffer.length === 1 ? (0, import_html.raw)(buffer[0]) : (0, import_html2.stringBufferToString)(buffer, void 0); -}; -const jsxEscape = (value) => value; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Fragment, - jsx, - jsxAttr, - jsxEscape, - jsxTemplate, - jsxs -}); diff --git a/node_modules/hono/dist/cjs/jsx/streaming.js b/node_modules/hono/dist/cjs/jsx/streaming.js deleted file mode 100644 index fe1ecaf..0000000 --- a/node_modules/hono/dist/cjs/jsx/streaming.js +++ /dev/null @@ -1,168 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var streaming_exports = {}; -__export(streaming_exports, { - StreamingContext: () => StreamingContext, - Suspense: () => Suspense, - renderToReadableStream: () => renderToReadableStream -}); -module.exports = __toCommonJS(streaming_exports); -var import_html = require("../helper/html"); -var import_html2 = require("../utils/html"); -var import_base = require("./base"); -var import_components = require("./components"); -var import_constants = require("./constants"); -var import_context = require("./context"); -var import_components2 = require("./dom/components"); -var import_render = require("./dom/render"); -const StreamingContext = (0, import_context.createContext)(null); -let suspenseCounter = 0; -const Suspense = async ({ - children, - fallback -}) => { - if (!Array.isArray(children)) { - children = [children]; - } - const nonce = (0, import_context.useContext)(StreamingContext)?.scriptNonce; - let resArray = []; - const stackNode = { [import_constants.DOM_STASH]: [0, []] }; - const popNodeStack = (value) => { - import_render.buildDataStack.pop(); - return value; - }; - try { - stackNode[import_constants.DOM_STASH][0] = 0; - import_render.buildDataStack.push([[], stackNode]); - resArray = children.map( - (c) => c == null || typeof c === "boolean" ? "" : c.toString() - ); - } catch (e) { - if (e instanceof Promise) { - resArray = [ - e.then(() => { - stackNode[import_constants.DOM_STASH][0] = 0; - import_render.buildDataStack.push([[], stackNode]); - return (0, import_components.childrenToString)(children).then(popNodeStack); - }) - ]; - } else { - throw e; - } - } finally { - popNodeStack(); - } - if (resArray.some((res) => res instanceof Promise)) { - const index = suspenseCounter++; - const fallbackStr = await fallback.toString(); - return (0, import_html.raw)(`${fallbackStr}`, [ - ...fallbackStr.callbacks || [], - ({ phase, buffer, context }) => { - if (phase === import_html2.HtmlEscapedCallbackPhase.BeforeStream) { - return; - } - return Promise.all(resArray).then(async (htmlArray) => { - htmlArray = htmlArray.flat(); - const content = htmlArray.join(""); - if (buffer) { - buffer[0] = buffer[0].replace( - new RegExp(`.*?`), - content - ); - } - let html = buffer ? "" : ` -((d,c,n) => { -c=d.currentScript.previousSibling -d=d.getElementById('H:${index}') -if(!d)return -do{n=d.nextSibling;n.remove()}while(n.nodeType!=8||n.nodeValue!='/$') -d.replaceWith(c.content) -})(document) -`; - const callbacks = htmlArray.map((html2) => html2.callbacks || []).flat(); - if (!callbacks.length) { - return html; - } - if (phase === import_html2.HtmlEscapedCallbackPhase.Stream) { - html = await (0, import_html2.resolveCallback)(html, import_html2.HtmlEscapedCallbackPhase.BeforeStream, true, context); - } - return (0, import_html.raw)(html, callbacks); - }); - } - ]); - } else { - return (0, import_html.raw)(resArray.join("")); - } -}; -Suspense[import_constants.DOM_RENDERER] = import_components2.Suspense; -const textEncoder = new TextEncoder(); -const renderToReadableStream = (content, onError = console.trace) => { - const reader = new ReadableStream({ - async start(controller) { - try { - if (content instanceof import_base.JSXNode) { - content = content.toString(); - } - const context = typeof content === "object" ? content : {}; - const resolved = await (0, import_html2.resolveCallback)( - content, - import_html2.HtmlEscapedCallbackPhase.BeforeStream, - true, - context - ); - controller.enqueue(textEncoder.encode(resolved)); - let resolvedCount = 0; - const callbacks = []; - const then = (promise) => { - callbacks.push( - promise.catch((err) => { - console.log(err); - onError(err); - return ""; - }).then(async (res) => { - res = await (0, import_html2.resolveCallback)( - res, - import_html2.HtmlEscapedCallbackPhase.BeforeStream, - true, - context - ); - res.callbacks?.map((c) => c({ phase: import_html2.HtmlEscapedCallbackPhase.Stream, context })).filter(Boolean).forEach(then); - resolvedCount++; - controller.enqueue(textEncoder.encode(res)); - }) - ); - }; - resolved.callbacks?.map((c) => c({ phase: import_html2.HtmlEscapedCallbackPhase.Stream, context })).filter(Boolean).forEach(then); - while (resolvedCount !== callbacks.length) { - await Promise.all(callbacks); - } - } catch (e) { - onError(e); - } - controller.close(); - } - }); - return reader; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - StreamingContext, - Suspense, - renderToReadableStream -}); diff --git a/node_modules/hono/dist/cjs/jsx/types.js b/node_modules/hono/dist/cjs/jsx/types.js deleted file mode 100644 index 43ae536..0000000 --- a/node_modules/hono/dist/cjs/jsx/types.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var types_exports = {}; -module.exports = __toCommonJS(types_exports); diff --git a/node_modules/hono/dist/cjs/jsx/utils.js b/node_modules/hono/dist/cjs/jsx/utils.js deleted file mode 100644 index 7dcfe0d..0000000 --- a/node_modules/hono/dist/cjs/jsx/utils.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var utils_exports = {}; -__export(utils_exports, { - normalizeIntrinsicElementKey: () => normalizeIntrinsicElementKey, - styleObjectForEach: () => styleObjectForEach -}); -module.exports = __toCommonJS(utils_exports); -const normalizeElementKeyMap = /* @__PURE__ */ new Map([ - ["className", "class"], - ["htmlFor", "for"], - ["crossOrigin", "crossorigin"], - ["httpEquiv", "http-equiv"], - ["itemProp", "itemprop"], - ["fetchPriority", "fetchpriority"], - ["noModule", "nomodule"], - ["formAction", "formaction"] -]); -const normalizeIntrinsicElementKey = (key) => normalizeElementKeyMap.get(key) || key; -const styleObjectForEach = (style, fn) => { - for (const [k, v] of Object.entries(style)) { - const key = k[0] === "-" || !/[A-Z]/.test(k) ? k : k.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`); - fn( - key, - v == null ? null : typeof v === "number" ? !key.match( - /^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/ - ) ? `${v}px` : `${v}` : v - ); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - normalizeIntrinsicElementKey, - styleObjectForEach -}); diff --git a/node_modules/hono/dist/cjs/middleware/basic-auth/index.js b/node_modules/hono/dist/cjs/middleware/basic-auth/index.js deleted file mode 100644 index 8560493..0000000 --- a/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var basic_auth_exports = {}; -__export(basic_auth_exports, { - basicAuth: () => basicAuth -}); -module.exports = __toCommonJS(basic_auth_exports); -var import_http_exception = require("../../http-exception"); -var import_basic_auth = require("../../utils/basic-auth"); -var import_buffer = require("../../utils/buffer"); -const basicAuth = (options, ...users) => { - const usernamePasswordInOptions = "username" in options && "password" in options; - const verifyUserInOptions = "verifyUser" in options; - if (!(usernamePasswordInOptions || verifyUserInOptions)) { - throw new Error( - 'basic auth middleware requires options for "username and password" or "verifyUser"' - ); - } - if (!options.realm) { - options.realm = "Secure Area"; - } - if (!options.invalidUserMessage) { - options.invalidUserMessage = "Unauthorized"; - } - if (usernamePasswordInOptions) { - users.unshift({ username: options.username, password: options.password }); - } - return async function basicAuth2(ctx, next) { - const requestUser = (0, import_basic_auth.auth)(ctx.req.raw); - if (requestUser) { - if (verifyUserInOptions) { - if (await options.verifyUser(requestUser.username, requestUser.password, ctx)) { - await next(); - return; - } - } else { - for (const user of users) { - const [usernameEqual, passwordEqual] = await Promise.all([ - (0, import_buffer.timingSafeEqual)(user.username, requestUser.username, options.hashFunction), - (0, import_buffer.timingSafeEqual)(user.password, requestUser.password, options.hashFunction) - ]); - if (usernameEqual && passwordEqual) { - await next(); - return; - } - } - } - } - const status = 401; - const headers = { - "WWW-Authenticate": 'Basic realm="' + options.realm?.replace(/"/g, '\\"') + '"' - }; - const responseMessage = typeof options.invalidUserMessage === "function" ? await options.invalidUserMessage(ctx) : options.invalidUserMessage; - const res = typeof responseMessage === "string" ? new Response(responseMessage, { status, headers }) : new Response(JSON.stringify(responseMessage), { - status, - headers: { - ...headers, - "content-type": "application/json" - } - }); - throw new import_http_exception.HTTPException(status, { res }); - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - basicAuth -}); diff --git a/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js b/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js deleted file mode 100644 index 0362b12..0000000 --- a/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var bearer_auth_exports = {}; -__export(bearer_auth_exports, { - bearerAuth: () => bearerAuth -}); -module.exports = __toCommonJS(bearer_auth_exports); -var import_http_exception = require("../../http-exception"); -var import_buffer = require("../../utils/buffer"); -const TOKEN_STRINGS = "[A-Za-z0-9._~+/-]+=*"; -const PREFIX = "Bearer"; -const HEADER = "Authorization"; -const bearerAuth = (options) => { - if (!("token" in options || "verifyToken" in options)) { - throw new Error('bearer auth middleware requires options for "token"'); - } - if (!options.realm) { - options.realm = ""; - } - if (options.prefix === void 0) { - options.prefix = PREFIX; - } - const realm = options.realm?.replace(/"/g, '\\"'); - const prefixRegexStr = options.prefix === "" ? "" : `${options.prefix} +`; - const regexp = new RegExp(`^${prefixRegexStr}(${TOKEN_STRINGS}) *$`, "i"); - const wwwAuthenticatePrefix = options.prefix === "" ? "" : `${options.prefix} `; - const throwHTTPException = async (c, status, wwwAuthenticateHeader, messageOption) => { - const wwwAuthenticateHeaderValue = typeof wwwAuthenticateHeader === "function" ? await wwwAuthenticateHeader(c) : wwwAuthenticateHeader; - const headers = { - "WWW-Authenticate": typeof wwwAuthenticateHeaderValue === "string" ? wwwAuthenticateHeaderValue : `${wwwAuthenticatePrefix}${Object.entries(wwwAuthenticateHeaderValue).map(([key, value]) => `${key}="${value}"`).join(",")}` - }; - const responseMessage = typeof messageOption === "function" ? await messageOption(c) : messageOption; - const res = typeof responseMessage === "string" ? new Response(responseMessage, { status, headers }) : new Response(JSON.stringify(responseMessage), { - status, - headers: { - ...headers, - "content-type": "application/json" - } - }); - throw new import_http_exception.HTTPException(status, { res }); - }; - return async function bearerAuth2(c, next) { - const headerToken = c.req.header(options.headerName || HEADER); - if (!headerToken) { - await throwHTTPException( - c, - 401, - options.noAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}realm="${realm}"`, - options.noAuthenticationHeader?.message || options.noAuthenticationHeaderMessage || "Unauthorized" - ); - } else { - const match = regexp.exec(headerToken); - if (!match) { - await throwHTTPException( - c, - 400, - options.invalidAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_request"`, - options.invalidAuthenticationHeader?.message || options.invalidAuthenticationHeaderMessage || "Bad Request" - ); - } else { - let equal = false; - if ("verifyToken" in options) { - equal = await options.verifyToken(match[1], c); - } else if (typeof options.token === "string") { - equal = await (0, import_buffer.timingSafeEqual)(options.token, match[1], options.hashFunction); - } else if (Array.isArray(options.token) && options.token.length > 0) { - for (const token of options.token) { - if (await (0, import_buffer.timingSafeEqual)(token, match[1], options.hashFunction)) { - equal = true; - break; - } - } - } - if (!equal) { - await throwHTTPException( - c, - 401, - options.invalidToken?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_token"`, - options.invalidToken?.message || options.invalidTokenMessage || "Unauthorized" - ); - } - } - } - await next(); - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - bearerAuth -}); diff --git a/node_modules/hono/dist/cjs/middleware/body-limit/index.js b/node_modules/hono/dist/cjs/middleware/body-limit/index.js deleted file mode 100644 index 6d65ab6..0000000 --- a/node_modules/hono/dist/cjs/middleware/body-limit/index.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var body_limit_exports = {}; -__export(body_limit_exports, { - bodyLimit: () => bodyLimit -}); -module.exports = __toCommonJS(body_limit_exports); -var import_http_exception = require("../../http-exception"); -const ERROR_MESSAGE = "Payload Too Large"; -class BodyLimitError extends Error { - constructor(message) { - super(message); - this.name = "BodyLimitError"; - } -} -const bodyLimit = (options) => { - const onError = options.onError || (() => { - const res = new Response(ERROR_MESSAGE, { - status: 413 - }); - throw new import_http_exception.HTTPException(413, { res }); - }); - const maxSize = options.maxSize; - return async function bodyLimit2(c, next) { - if (!c.req.raw.body) { - return next(); - } - const hasTransferEncoding = c.req.raw.headers.has("transfer-encoding"); - const hasContentLength = c.req.raw.headers.has("content-length"); - if (hasTransferEncoding && hasContentLength) { - } - if (hasContentLength && !hasTransferEncoding) { - const contentLength = parseInt(c.req.raw.headers.get("content-length") || "0", 10); - return contentLength > maxSize ? onError(c) : next(); - } - let size = 0; - const rawReader = c.req.raw.body.getReader(); - const reader = new ReadableStream({ - async start(controller) { - try { - for (; ; ) { - const { done, value } = await rawReader.read(); - if (done) { - break; - } - size += value.length; - if (size > maxSize) { - controller.error(new BodyLimitError(ERROR_MESSAGE)); - break; - } - controller.enqueue(value); - } - } finally { - controller.close(); - } - } - }); - const requestInit = { body: reader, duplex: "half" }; - c.req.raw = new Request(c.req.raw, requestInit); - await next(); - if (c.error instanceof BodyLimitError) { - c.res = await onError(c); - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - bodyLimit -}); diff --git a/node_modules/hono/dist/cjs/middleware/cache/index.js b/node_modules/hono/dist/cjs/middleware/cache/index.js deleted file mode 100644 index b293a33..0000000 --- a/node_modules/hono/dist/cjs/middleware/cache/index.js +++ /dev/null @@ -1,112 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var cache_exports = {}; -__export(cache_exports, { - cache: () => cache -}); -module.exports = __toCommonJS(cache_exports); -const defaultCacheableStatusCodes = [200]; -const shouldSkipCache = (res) => { - const vary = res.headers.get("Vary"); - if (vary && vary.includes("*")) { - return true; - } - const cacheControl = res.headers.get("Cache-Control"); - if (cacheControl && /(?:^|,\s*)(?:private|no-(?:store|cache))(?:\s*(?:=|,|$))/i.test(cacheControl)) { - return true; - } - if (res.headers.has("Set-Cookie")) { - return true; - } - return false; -}; -const cache = (options) => { - if (!globalThis.caches) { - console.log("Cache Middleware is not enabled because caches is not defined."); - return async (_c, next) => await next(); - } - if (options.wait === void 0) { - options.wait = false; - } - const cacheControlDirectives = options.cacheControl?.split(",").map((directive) => directive.toLowerCase()); - const varyDirectives = Array.isArray(options.vary) ? options.vary : options.vary?.split(",").map((directive) => directive.trim()); - if (options.vary?.includes("*")) { - throw new Error( - 'Middleware vary configuration cannot include "*", as it disallows effective caching.' - ); - } - const cacheableStatusCodes = new Set( - options.cacheableStatusCodes ?? defaultCacheableStatusCodes - ); - const addHeader = (c) => { - if (cacheControlDirectives) { - const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0]) ?? []; - for (const directive of cacheControlDirectives) { - let [name, value] = directive.trim().split("=", 2); - name = name.toLowerCase(); - if (!existingDirectives.includes(name)) { - c.header("Cache-Control", `${name}${value ? `=${value}` : ""}`, { append: true }); - } - } - } - if (varyDirectives) { - const existingDirectives = c.res.headers.get("Vary")?.split(",").map((d) => d.trim()) ?? []; - const vary = Array.from( - new Set( - [...existingDirectives, ...varyDirectives].map((directive) => directive.toLowerCase()) - ) - ).sort(); - if (vary.includes("*")) { - c.header("Vary", "*"); - } else { - c.header("Vary", vary.join(", ")); - } - } - }; - return async function cache2(c, next) { - let key = c.req.url; - if (options.keyGenerator) { - key = await options.keyGenerator(c); - } - const cacheName = typeof options.cacheName === "function" ? await options.cacheName(c) : options.cacheName; - const cache3 = await caches.open(cacheName); - const response = await cache3.match(key); - if (response) { - return new Response(response.body, response); - } - await next(); - if (!cacheableStatusCodes.has(c.res.status)) { - return; - } - addHeader(c); - if (shouldSkipCache(c.res)) { - return; - } - const res = c.res.clone(); - if (options.wait) { - await cache3.put(key, res); - } else { - c.executionCtx.waitUntil(cache3.put(key, res)); - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - cache -}); diff --git a/node_modules/hono/dist/cjs/middleware/combine/index.js b/node_modules/hono/dist/cjs/middleware/combine/index.js deleted file mode 100644 index 2889137..0000000 --- a/node_modules/hono/dist/cjs/middleware/combine/index.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except2, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except2) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var combine_exports = {}; -__export(combine_exports, { - every: () => every, - except: () => except, - some: () => some -}); -module.exports = __toCommonJS(combine_exports); -var import_compose = require("../../compose"); -var import_router = require("../../router"); -var import_trie_router = require("../../router/trie-router"); -const some = (...middleware) => { - return async function some2(c, next) { - let isNextCalled = false; - const wrappedNext = () => { - isNextCalled = true; - return next(); - }; - let lastError; - for (const handler of middleware) { - try { - const result = await handler(c, wrappedNext); - if (result === true && !c.finalized) { - await wrappedNext(); - } else if (result === false) { - lastError = new Error("No successful middleware found"); - continue; - } - lastError = void 0; - break; - } catch (error) { - lastError = error; - if (isNextCalled) { - break; - } - } - } - if (lastError) { - throw lastError; - } - }; -}; -const every = (...middleware) => { - return async function every2(c, next) { - const currentRouteIndex = c.req.routeIndex; - await (0, import_compose.compose)( - middleware.map((m) => [ - [ - async (c2, next2) => { - c2.req.routeIndex = currentRouteIndex; - const res = await m(c2, next2); - if (res === false) { - throw new Error("Unmet condition"); - } - return res; - } - ] - ]) - )(c, next); - }; -}; -const except = (condition, ...middleware) => { - let router = void 0; - const conditions = (Array.isArray(condition) ? condition : [condition]).map((condition2) => { - if (typeof condition2 === "string") { - router ||= new import_trie_router.TrieRouter(); - router.add(import_router.METHOD_NAME_ALL, condition2, true); - } else { - return condition2; - } - }).filter(Boolean); - if (router) { - conditions.unshift((c) => !!router?.match(import_router.METHOD_NAME_ALL, c.req.path)?.[0]?.[0]?.[0]); - } - const handler = some((c) => conditions.some((cond) => cond(c)), every(...middleware)); - return async function except2(c, next) { - await handler(c, next); - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - every, - except, - some -}); diff --git a/node_modules/hono/dist/cjs/middleware/compress/index.js b/node_modules/hono/dist/cjs/middleware/compress/index.js deleted file mode 100644 index 3a29b46..0000000 --- a/node_modules/hono/dist/cjs/middleware/compress/index.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var compress_exports = {}; -__export(compress_exports, { - compress: () => compress -}); -module.exports = __toCommonJS(compress_exports); -var import_compress = require("../../utils/compress"); -const ENCODING_TYPES = ["gzip", "deflate"]; -const cacheControlNoTransformRegExp = /(?:^|,)\s*?no-transform\s*?(?:,|$)/i; -const compress = (options) => { - const threshold = options?.threshold ?? 1024; - return async function compress2(ctx, next) { - await next(); - const contentLength = ctx.res.headers.get("Content-Length"); - if (ctx.res.headers.has("Content-Encoding") || // already encoded - ctx.res.headers.has("Transfer-Encoding") || // already encoded or chunked - ctx.req.method === "HEAD" || // HEAD request - contentLength && Number(contentLength) < threshold || // content-length below threshold - !shouldCompress(ctx.res) || // not compressible type - !shouldTransform(ctx.res)) { - return; - } - const accepted = ctx.req.header("Accept-Encoding"); - const encoding = options?.encoding ?? ENCODING_TYPES.find((encoding2) => accepted?.includes(encoding2)); - if (!encoding || !ctx.res.body) { - return; - } - const stream = new CompressionStream(encoding); - ctx.res = new Response(ctx.res.body.pipeThrough(stream), ctx.res); - ctx.res.headers.delete("Content-Length"); - ctx.res.headers.set("Content-Encoding", encoding); - }; -}; -const shouldCompress = (res) => { - const type = res.headers.get("Content-Type"); - return type && import_compress.COMPRESSIBLE_CONTENT_TYPE_REGEX.test(type); -}; -const shouldTransform = (res) => { - const cacheControl = res.headers.get("Cache-Control"); - return !cacheControl || !cacheControlNoTransformRegExp.test(cacheControl); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - compress -}); diff --git a/node_modules/hono/dist/cjs/middleware/context-storage/index.js b/node_modules/hono/dist/cjs/middleware/context-storage/index.js deleted file mode 100644 index d1370ef..0000000 --- a/node_modules/hono/dist/cjs/middleware/context-storage/index.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var context_storage_exports = {}; -__export(context_storage_exports, { - contextStorage: () => contextStorage, - getContext: () => getContext, - tryGetContext: () => tryGetContext -}); -module.exports = __toCommonJS(context_storage_exports); -var import_node_async_hooks = require("node:async_hooks"); -const asyncLocalStorage = new import_node_async_hooks.AsyncLocalStorage(); -const contextStorage = () => { - return async function contextStorage2(c, next) { - await asyncLocalStorage.run(c, next); - }; -}; -const tryGetContext = () => { - return asyncLocalStorage.getStore(); -}; -const getContext = () => { - const context = tryGetContext(); - if (!context) { - throw new Error("Context is not available"); - } - return context; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - contextStorage, - getContext, - tryGetContext -}); diff --git a/node_modules/hono/dist/cjs/middleware/cors/index.js b/node_modules/hono/dist/cjs/middleware/cors/index.js deleted file mode 100644 index db07713..0000000 --- a/node_modules/hono/dist/cjs/middleware/cors/index.js +++ /dev/null @@ -1,110 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var cors_exports = {}; -__export(cors_exports, { - cors: () => cors -}); -module.exports = __toCommonJS(cors_exports); -const cors = (options) => { - const defaults = { - origin: "*", - allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH"], - allowHeaders: [], - exposeHeaders: [] - }; - const opts = { - ...defaults, - ...options - }; - const findAllowOrigin = ((optsOrigin) => { - if (typeof optsOrigin === "string") { - if (optsOrigin === "*") { - return () => optsOrigin; - } else { - return (origin) => optsOrigin === origin ? origin : null; - } - } else if (typeof optsOrigin === "function") { - return optsOrigin; - } else { - return (origin) => optsOrigin.includes(origin) ? origin : null; - } - })(opts.origin); - const findAllowMethods = ((optsAllowMethods) => { - if (typeof optsAllowMethods === "function") { - return optsAllowMethods; - } else if (Array.isArray(optsAllowMethods)) { - return () => optsAllowMethods; - } else { - return () => []; - } - })(opts.allowMethods); - return async function cors2(c, next) { - function set(key, value) { - c.res.headers.set(key, value); - } - const allowOrigin = await findAllowOrigin(c.req.header("origin") || "", c); - if (allowOrigin) { - set("Access-Control-Allow-Origin", allowOrigin); - } - if (opts.credentials) { - set("Access-Control-Allow-Credentials", "true"); - } - if (opts.exposeHeaders?.length) { - set("Access-Control-Expose-Headers", opts.exposeHeaders.join(",")); - } - if (c.req.method === "OPTIONS") { - if (opts.origin !== "*") { - set("Vary", "Origin"); - } - if (opts.maxAge != null) { - set("Access-Control-Max-Age", opts.maxAge.toString()); - } - const allowMethods = await findAllowMethods(c.req.header("origin") || "", c); - if (allowMethods.length) { - set("Access-Control-Allow-Methods", allowMethods.join(",")); - } - let headers = opts.allowHeaders; - if (!headers?.length) { - const requestHeaders = c.req.header("Access-Control-Request-Headers"); - if (requestHeaders) { - headers = requestHeaders.split(/\s*,\s*/); - } - } - if (headers?.length) { - set("Access-Control-Allow-Headers", headers.join(",")); - c.res.headers.append("Vary", "Access-Control-Request-Headers"); - } - c.res.headers.delete("Content-Length"); - c.res.headers.delete("Content-Type"); - return new Response(null, { - headers: c.res.headers, - status: 204, - statusText: "No Content" - }); - } - await next(); - if (opts.origin !== "*") { - c.header("Vary", "Origin", { append: true }); - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - cors -}); diff --git a/node_modules/hono/dist/cjs/middleware/csrf/index.js b/node_modules/hono/dist/cjs/middleware/csrf/index.js deleted file mode 100644 index 9434a5f..0000000 --- a/node_modules/hono/dist/cjs/middleware/csrf/index.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var csrf_exports = {}; -__export(csrf_exports, { - csrf: () => csrf -}); -module.exports = __toCommonJS(csrf_exports); -var import_http_exception = require("../../http-exception"); -const secFetchSiteValues = ["same-origin", "same-site", "none", "cross-site"]; -const isSecFetchSite = (value) => secFetchSiteValues.includes(value); -const isSafeMethodRe = /^(GET|HEAD)$/; -const isRequestedByFormElementRe = /^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)\b/i; -const csrf = (options) => { - const originHandler = ((optsOrigin) => { - if (!optsOrigin) { - return (origin, c) => origin === new URL(c.req.url).origin; - } else if (typeof optsOrigin === "string") { - return (origin) => origin === optsOrigin; - } else if (typeof optsOrigin === "function") { - return optsOrigin; - } else { - return (origin) => optsOrigin.includes(origin); - } - })(options?.origin); - const isAllowedOrigin = async (origin, c) => { - if (origin === void 0) { - return false; - } - return await originHandler(origin, c); - }; - const secFetchSiteHandler = ((optsSecFetchSite) => { - if (!optsSecFetchSite) { - return (secFetchSite) => secFetchSite === "same-origin"; - } else if (typeof optsSecFetchSite === "string") { - return (secFetchSite) => secFetchSite === optsSecFetchSite; - } else if (typeof optsSecFetchSite === "function") { - return optsSecFetchSite; - } else { - return (secFetchSite) => optsSecFetchSite.includes(secFetchSite); - } - })(options?.secFetchSite); - const isAllowedSecFetchSite = async (secFetchSite, c) => { - if (secFetchSite === void 0) { - return false; - } - if (!isSecFetchSite(secFetchSite)) { - return false; - } - return await secFetchSiteHandler(secFetchSite, c); - }; - return async function csrf2(c, next) { - if (!isSafeMethodRe.test(c.req.method) && isRequestedByFormElementRe.test(c.req.header("content-type") || "text/plain") && !await isAllowedSecFetchSite(c.req.header("sec-fetch-site"), c) && !await isAllowedOrigin(c.req.header("origin"), c)) { - const res = new Response("Forbidden", { status: 403 }); - throw new import_http_exception.HTTPException(403, { res }); - } - await next(); - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - csrf -}); diff --git a/node_modules/hono/dist/cjs/middleware/etag/digest.js b/node_modules/hono/dist/cjs/middleware/etag/digest.js deleted file mode 100644 index cbfde28..0000000 --- a/node_modules/hono/dist/cjs/middleware/etag/digest.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var digest_exports = {}; -__export(digest_exports, { - generateDigest: () => generateDigest -}); -module.exports = __toCommonJS(digest_exports); -const mergeBuffers = (buffer1, buffer2) => { - if (!buffer1) { - return buffer2; - } - const merged = new Uint8Array( - new ArrayBuffer(buffer1.byteLength + buffer2.byteLength) - ); - merged.set(new Uint8Array(buffer1), 0); - merged.set(buffer2, buffer1.byteLength); - return merged; -}; -const generateDigest = async (stream, generator) => { - if (!stream) { - return null; - } - let result = void 0; - const reader = stream.getReader(); - for (; ; ) { - const { value, done } = await reader.read(); - if (done) { - break; - } - result = await generator(mergeBuffers(result, value)); - } - if (!result) { - return null; - } - return Array.prototype.map.call(new Uint8Array(result), (x) => x.toString(16).padStart(2, "0")).join(""); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - generateDigest -}); diff --git a/node_modules/hono/dist/cjs/middleware/etag/index.js b/node_modules/hono/dist/cjs/middleware/etag/index.js deleted file mode 100644 index e65652b..0000000 --- a/node_modules/hono/dist/cjs/middleware/etag/index.js +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var etag_exports = {}; -__export(etag_exports, { - RETAINED_304_HEADERS: () => RETAINED_304_HEADERS, - etag: () => etag -}); -module.exports = __toCommonJS(etag_exports); -var import_digest = require("./digest"); -const RETAINED_304_HEADERS = [ - "cache-control", - "content-location", - "date", - "etag", - "expires", - "vary" -]; -const stripWeak = (tag) => tag.replace(/^W\//, ""); -function etagMatches(etag2, ifNoneMatch) { - return ifNoneMatch != null && ifNoneMatch.split(/,\s*/).some((t) => stripWeak(t) === stripWeak(etag2)); -} -function initializeGenerator(generator) { - if (!generator) { - if (crypto && crypto.subtle) { - generator = (body) => crypto.subtle.digest( - { - name: "SHA-1" - }, - body - ); - } - } - return generator; -} -const etag = (options) => { - const retainedHeaders = options?.retainedHeaders ?? RETAINED_304_HEADERS; - const weak = options?.weak ?? false; - const generator = initializeGenerator(options?.generateDigest); - return async function etag2(c, next) { - const ifNoneMatch = c.req.header("If-None-Match") ?? null; - await next(); - const res = c.res; - let etag3 = res.headers.get("ETag"); - if (!etag3) { - if (!generator) { - return; - } - const hash = await (0, import_digest.generateDigest)( - // This type casing avoids the type error for `deno publish` - res.clone().body, - generator - ); - if (hash === null) { - return; - } - etag3 = weak ? `W/"${hash}"` : `"${hash}"`; - } - if (etagMatches(etag3, ifNoneMatch)) { - c.res = new Response(null, { - status: 304, - statusText: "Not Modified", - headers: { - ETag: etag3 - } - }); - c.res.headers.forEach((_, key) => { - if (retainedHeaders.indexOf(key.toLowerCase()) === -1) { - c.res.headers.delete(key); - } - }); - } else { - c.res.headers.set("ETag", etag3); - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - RETAINED_304_HEADERS, - etag -}); diff --git a/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js b/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js deleted file mode 100644 index 29738a0..0000000 --- a/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +++ /dev/null @@ -1,125 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var ip_restriction_exports = {}; -__export(ip_restriction_exports, { - ipRestriction: () => ipRestriction -}); -module.exports = __toCommonJS(ip_restriction_exports); -var import_http_exception = require("../../http-exception"); -var import_ipaddr = require("../../utils/ipaddr"); -const IS_CIDR_NOTATION_REGEX = /\/[0-9]{0,3}$/; -const buildMatcher = (rules) => { - const functionRules = []; - const staticRules = /* @__PURE__ */ new Set(); - const cidrRules = []; - for (let rule of rules) { - if (rule === "*") { - return () => true; - } else if (typeof rule === "function") { - functionRules.push(rule); - } else { - if (IS_CIDR_NOTATION_REGEX.test(rule)) { - const separatedRule = rule.split("/"); - const addrStr = separatedRule[0]; - const type2 = (0, import_ipaddr.distinctRemoteAddr)(addrStr); - if (type2 === void 0) { - throw new TypeError(`Invalid rule: ${rule}`); - } - const isIPv4 = type2 === "IPv4"; - const prefix = parseInt(separatedRule[1]); - if (isIPv4 ? prefix === 32 : prefix === 128) { - rule = addrStr; - } else { - const addr = (isIPv4 ? import_ipaddr.convertIPv4ToBinary : import_ipaddr.convertIPv6ToBinary)(addrStr); - const mask = (1n << BigInt(prefix)) - 1n << BigInt((isIPv4 ? 32 : 128) - prefix); - cidrRules.push([isIPv4, addr & mask, mask]); - continue; - } - } - const type = (0, import_ipaddr.distinctRemoteAddr)(rule); - if (type === void 0) { - throw new TypeError(`Invalid rule: ${rule}`); - } - staticRules.add( - type === "IPv4" ? rule : (0, import_ipaddr.convertIPv6BinaryToString)((0, import_ipaddr.convertIPv6ToBinary)(rule)) - // normalize IPv6 address (e.g. 0000:0000:0000:0000:0000:0000:0000:0001 => ::1) - ); - } - } - return (remote) => { - if (staticRules.has(remote.addr)) { - return true; - } - for (const [isIPv4, addr, mask] of cidrRules) { - if (isIPv4 !== remote.isIPv4) { - continue; - } - const remoteAddr = remote.binaryAddr ||= (isIPv4 ? import_ipaddr.convertIPv4ToBinary : import_ipaddr.convertIPv6ToBinary)(remote.addr); - if ((remoteAddr & mask) === addr) { - return true; - } - } - for (const rule of functionRules) { - if (rule({ addr: remote.addr, type: remote.type })) { - return true; - } - } - return false; - }; -}; -const ipRestriction = (getIP, { denyList = [], allowList = [] }, onError) => { - const allowLength = allowList.length; - const denyMatcher = buildMatcher(denyList); - const allowMatcher = buildMatcher(allowList); - const blockError = (c) => new import_http_exception.HTTPException(403, { - res: c.text("Forbidden", { - status: 403 - }) - }); - return async function ipRestriction2(c, next) { - const connInfo = getIP(c); - const addr = typeof connInfo === "string" ? connInfo : connInfo.remote.address; - if (!addr) { - throw blockError(c); - } - const type = typeof connInfo !== "string" && connInfo.remote.addressType || (0, import_ipaddr.distinctRemoteAddr)(addr); - const remoteData = { addr, type, isIPv4: type === "IPv4" }; - if (denyMatcher(remoteData)) { - if (onError) { - return onError({ addr, type }, c); - } - throw blockError(c); - } - if (allowMatcher(remoteData)) { - return await next(); - } - if (allowLength === 0) { - return await next(); - } else { - if (onError) { - return await onError({ addr, type }, c); - } - throw blockError(c); - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - ipRestriction -}); diff --git a/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js b/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js deleted file mode 100644 index 3d7c32d..0000000 --- a/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jsx_renderer_exports = {}; -__export(jsx_renderer_exports, { - RequestContext: () => RequestContext, - jsxRenderer: () => jsxRenderer, - useRequestContext: () => useRequestContext -}); -module.exports = __toCommonJS(jsx_renderer_exports); -var import_html = require("../../helper/html"); -var import_jsx = require("../../jsx"); -var import_streaming = require("../../jsx/streaming"); -const RequestContext = (0, import_jsx.createContext)(null); -const createRenderer = (c, Layout, component, options) => (children, props) => { - const docType = typeof options?.docType === "string" ? options.docType : options?.docType === false ? "" : ""; - const currentLayout = component ? (0, import_jsx.jsx)( - (props2) => component(props2, c), - { - Layout, - ...props - }, - children - ) : children; - const body = import_html.html`${(0, import_html.raw)(docType)}${(0, import_jsx.jsx)( - RequestContext.Provider, - { value: c }, - currentLayout - )}`; - if (options?.stream) { - if (options.stream === true) { - c.header("Transfer-Encoding", "chunked"); - c.header("Content-Type", "text/html; charset=UTF-8"); - c.header("Content-Encoding", "Identity"); - } else { - for (const [key, value] of Object.entries(options.stream)) { - c.header(key, value); - } - } - return c.body((0, import_streaming.renderToReadableStream)(body)); - } else { - return c.html(body); - } -}; -const jsxRenderer = (component, options) => function jsxRenderer2(c, next) { - const Layout = c.getLayout() ?? import_jsx.Fragment; - if (component) { - c.setLayout((props) => { - return component({ ...props, Layout }, c); - }); - } - c.setRenderer(createRenderer(c, Layout, component, options)); - return next(); -}; -const useRequestContext = () => { - const c = (0, import_jsx.useContext)(RequestContext); - if (!c) { - throw new Error("RequestContext is not provided."); - } - return c; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - RequestContext, - jsxRenderer, - useRequestContext -}); diff --git a/node_modules/hono/dist/cjs/middleware/jwk/index.js b/node_modules/hono/dist/cjs/middleware/jwk/index.js deleted file mode 100644 index 1c22463..0000000 --- a/node_modules/hono/dist/cjs/middleware/jwk/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jwk_exports = {}; -__export(jwk_exports, { - jwk: () => import_jwk.jwk -}); -module.exports = __toCommonJS(jwk_exports); -var import_jwk = require("./jwk"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - jwk -}); diff --git a/node_modules/hono/dist/cjs/middleware/jwk/jwk.js b/node_modules/hono/dist/cjs/middleware/jwk/jwk.js deleted file mode 100644 index 40dd842..0000000 --- a/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +++ /dev/null @@ -1,135 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jwk_exports = {}; -__export(jwk_exports, { - jwk: () => jwk -}); -module.exports = __toCommonJS(jwk_exports); -var import_cookie = require("../../helper/cookie"); -var import_http_exception = require("../../http-exception"); -var import_jwt = require("../../utils/jwt"); -var import_context = require("../../context"); -const jwk = (options, init) => { - const verifyOpts = options.verification || {}; - if (!options || !(options.keys || options.jwks_uri)) { - throw new Error('JWK auth middleware requires options for either "keys" or "jwks_uri" or both'); - } - if (!crypto.subtle || !crypto.subtle.importKey) { - throw new Error("`crypto.subtle.importKey` is undefined. JWK auth middleware requires it."); - } - return async function jwk2(ctx, next) { - const headerName = options.headerName || "Authorization"; - const credentials = ctx.req.raw.headers.get(headerName); - let token; - if (credentials) { - const parts = credentials.split(/\s+/); - if (parts.length !== 2) { - const errDescription = "invalid credentials structure"; - throw new import_http_exception.HTTPException(401, { - message: errDescription, - res: unauthorizedResponse({ - ctx, - error: "invalid_request", - errDescription - }) - }); - } else { - token = parts[1]; - } - } else if (options.cookie) { - if (typeof options.cookie == "string") { - token = (0, import_cookie.getCookie)(ctx, options.cookie); - } else if (options.cookie.secret) { - if (options.cookie.prefixOptions) { - token = await (0, import_cookie.getSignedCookie)( - ctx, - options.cookie.secret, - options.cookie.key, - options.cookie.prefixOptions - ); - } else { - token = await (0, import_cookie.getSignedCookie)(ctx, options.cookie.secret, options.cookie.key); - } - } else { - if (options.cookie.prefixOptions) { - token = (0, import_cookie.getCookie)(ctx, options.cookie.key, options.cookie.prefixOptions); - } else { - token = (0, import_cookie.getCookie)(ctx, options.cookie.key); - } - } - } - if (!token) { - if (options.allow_anon) { - return next(); - } - const errDescription = "no authorization included in request"; - throw new import_http_exception.HTTPException(401, { - message: errDescription, - res: unauthorizedResponse({ - ctx, - error: "invalid_request", - errDescription - }) - }); - } - let payload; - let cause; - try { - const keys = typeof options.keys === "function" ? await options.keys(ctx) : options.keys; - const jwks_uri = typeof options.jwks_uri === "function" ? await options.jwks_uri(ctx) : options.jwks_uri; - payload = await import_jwt.Jwt.verifyWithJwks( - token, - { keys, jwks_uri, verification: verifyOpts, allowedAlgorithms: options.alg }, - init - ); - } catch (e) { - cause = e; - } - if (!payload) { - if (cause instanceof Error && cause.constructor === Error) { - throw cause; - } - throw new import_http_exception.HTTPException(401, { - message: "Unauthorized", - res: unauthorizedResponse({ - ctx, - error: "invalid_token", - statusText: "Unauthorized", - errDescription: "token verification failure" - }), - cause - }); - } - ctx.set("jwtPayload", payload); - await next(); - }; -}; -function unauthorizedResponse(opts) { - return new Response("Unauthorized", { - status: 401, - statusText: opts.statusText, - headers: { - "WWW-Authenticate": `Bearer realm="${opts.ctx.req.url}",error="${opts.error}",error_description="${opts.errDescription}"` - } - }); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - jwk -}); diff --git a/node_modules/hono/dist/cjs/middleware/jwt/index.js b/node_modules/hono/dist/cjs/middleware/jwt/index.js deleted file mode 100644 index db35054..0000000 --- a/node_modules/hono/dist/cjs/middleware/jwt/index.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jwt_exports = {}; -__export(jwt_exports, { - AlgorithmTypes: () => import_jwa.AlgorithmTypes, - decode: () => import_jwt.decode, - jwt: () => import_jwt.jwt, - sign: () => import_jwt.sign, - verify: () => import_jwt.verify, - verifyWithJwks: () => import_jwt.verifyWithJwks -}); -module.exports = __toCommonJS(jwt_exports); -var import_jwt = require("./jwt"); -var import_jwa = require("../../utils/jwt/jwa"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - AlgorithmTypes, - decode, - jwt, - sign, - verify, - verifyWithJwks -}); diff --git a/node_modules/hono/dist/cjs/middleware/jwt/jwt.js b/node_modules/hono/dist/cjs/middleware/jwt/jwt.js deleted file mode 100644 index 97a301f..0000000 --- a/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +++ /dev/null @@ -1,141 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jwt_exports = {}; -__export(jwt_exports, { - decode: () => decode, - jwt: () => jwt, - sign: () => sign, - verify: () => verify, - verifyWithJwks: () => verifyWithJwks -}); -module.exports = __toCommonJS(jwt_exports); -var import_cookie = require("../../helper/cookie"); -var import_http_exception = require("../../http-exception"); -var import_jwt = require("../../utils/jwt"); -var import_context = require("../../context"); -const jwt = (options) => { - const verifyOpts = options.verification || {}; - if (!options || !options.secret) { - throw new Error('JWT auth middleware requires options for "secret"'); - } - if (!options.alg) { - throw new Error('JWT auth middleware requires options for "alg"'); - } - if (!crypto.subtle || !crypto.subtle.importKey) { - throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); - } - return async function jwt2(ctx, next) { - const headerName = options.headerName || "Authorization"; - const credentials = ctx.req.raw.headers.get(headerName); - let token; - if (credentials) { - const parts = credentials.split(/\s+/); - if (parts.length !== 2) { - const errDescription = "invalid credentials structure"; - throw new import_http_exception.HTTPException(401, { - message: errDescription, - res: unauthorizedResponse({ - ctx, - error: "invalid_request", - errDescription - }) - }); - } else { - token = parts[1]; - } - } else if (options.cookie) { - if (typeof options.cookie == "string") { - token = (0, import_cookie.getCookie)(ctx, options.cookie); - } else if (options.cookie.secret) { - if (options.cookie.prefixOptions) { - token = await (0, import_cookie.getSignedCookie)( - ctx, - options.cookie.secret, - options.cookie.key, - options.cookie.prefixOptions - ); - } else { - token = await (0, import_cookie.getSignedCookie)(ctx, options.cookie.secret, options.cookie.key); - } - } else { - if (options.cookie.prefixOptions) { - token = (0, import_cookie.getCookie)(ctx, options.cookie.key, options.cookie.prefixOptions); - } else { - token = (0, import_cookie.getCookie)(ctx, options.cookie.key); - } - } - } - if (!token) { - const errDescription = "no authorization included in request"; - throw new import_http_exception.HTTPException(401, { - message: errDescription, - res: unauthorizedResponse({ - ctx, - error: "invalid_request", - errDescription - }) - }); - } - let payload; - let cause; - try { - payload = await import_jwt.Jwt.verify(token, options.secret, { - alg: options.alg, - ...verifyOpts - }); - } catch (e) { - cause = e; - } - if (!payload) { - throw new import_http_exception.HTTPException(401, { - message: "Unauthorized", - res: unauthorizedResponse({ - ctx, - error: "invalid_token", - statusText: "Unauthorized", - errDescription: "token verification failure" - }), - cause - }); - } - ctx.set("jwtPayload", payload); - await next(); - }; -}; -function unauthorizedResponse(opts) { - return new Response("Unauthorized", { - status: 401, - statusText: opts.statusText, - headers: { - "WWW-Authenticate": `Bearer realm="${opts.ctx.req.url}",error="${opts.error}",error_description="${opts.errDescription}"` - } - }); -} -const verifyWithJwks = import_jwt.Jwt.verifyWithJwks; -const verify = import_jwt.Jwt.verify; -const decode = import_jwt.Jwt.decode; -const sign = import_jwt.Jwt.sign; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - decode, - jwt, - sign, - verify, - verifyWithJwks -}); diff --git a/node_modules/hono/dist/cjs/middleware/language/index.js b/node_modules/hono/dist/cjs/middleware/language/index.js deleted file mode 100644 index 133886f..0000000 --- a/node_modules/hono/dist/cjs/middleware/language/index.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var language_exports = {}; -__export(language_exports, { - detectFromCookie: () => import_language.detectFromCookie, - detectFromHeader: () => import_language.detectFromHeader, - detectFromPath: () => import_language.detectFromPath, - detectFromQuery: () => import_language.detectFromQuery, - languageDetector: () => import_language.languageDetector -}); -module.exports = __toCommonJS(language_exports); -var import_language = require("./language"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - detectFromCookie, - detectFromHeader, - detectFromPath, - detectFromQuery, - languageDetector -}); diff --git a/node_modules/hono/dist/cjs/middleware/language/language.js b/node_modules/hono/dist/cjs/middleware/language/language.js deleted file mode 100644 index ed6433d..0000000 --- a/node_modules/hono/dist/cjs/middleware/language/language.js +++ /dev/null @@ -1,211 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var language_exports = {}; -__export(language_exports, { - DEFAULT_OPTIONS: () => DEFAULT_OPTIONS, - detectFromCookie: () => detectFromCookie, - detectFromHeader: () => detectFromHeader, - detectFromPath: () => detectFromPath, - detectFromQuery: () => detectFromQuery, - detectors: () => detectors, - languageDetector: () => languageDetector, - normalizeLanguage: () => normalizeLanguage, - parseAcceptLanguage: () => parseAcceptLanguage, - validateOptions: () => validateOptions -}); -module.exports = __toCommonJS(language_exports); -var import_cookie = require("../../helper/cookie"); -var import_accept = require("../../utils/accept"); -const DEFAULT_OPTIONS = { - order: ["querystring", "cookie", "header"], - lookupQueryString: "lang", - lookupCookie: "language", - lookupFromHeaderKey: "accept-language", - lookupFromPathIndex: 0, - caches: ["cookie"], - ignoreCase: true, - fallbackLanguage: "en", - supportedLanguages: ["en"], - cookieOptions: { - sameSite: "Strict", - secure: true, - maxAge: 365 * 24 * 60 * 60, - httpOnly: true - }, - debug: false -}; -function parseAcceptLanguage(header) { - return (0, import_accept.parseAccept)(header).map(({ type, q }) => ({ lang: type, q })); -} -const normalizeLanguage = (lang, options) => { - if (!lang) { - return void 0; - } - try { - let normalizedLang = lang.trim(); - if (options.convertDetectedLanguage) { - normalizedLang = options.convertDetectedLanguage(normalizedLang); - } - const compLang = options.ignoreCase ? normalizedLang.toLowerCase() : normalizedLang; - const compSupported = options.supportedLanguages.map( - (l) => options.ignoreCase ? l.toLowerCase() : l - ); - const matchedLang = compSupported.find((l) => l === compLang); - return matchedLang ? options.supportedLanguages[compSupported.indexOf(matchedLang)] : void 0; - } catch { - return void 0; - } -}; -const detectFromQuery = (c, options) => { - try { - const query = c.req.query(options.lookupQueryString); - return normalizeLanguage(query, options); - } catch { - return void 0; - } -}; -const detectFromCookie = (c, options) => { - try { - const cookie = (0, import_cookie.getCookie)(c, options.lookupCookie); - return normalizeLanguage(cookie, options); - } catch { - return void 0; - } -}; -function detectFromHeader(c, options) { - try { - const acceptLanguage = c.req.header(options.lookupFromHeaderKey); - if (!acceptLanguage) { - return void 0; - } - const languages = parseAcceptLanguage(acceptLanguage); - for (const { lang } of languages) { - const normalizedLang = normalizeLanguage(lang, options); - if (normalizedLang) { - return normalizedLang; - } - } - return void 0; - } catch { - return void 0; - } -} -function detectFromPath(c, options) { - try { - const url = new URL(c.req.url); - const pathSegments = url.pathname.split("/").filter(Boolean); - const langSegment = pathSegments[options.lookupFromPathIndex]; - return normalizeLanguage(langSegment, options); - } catch { - return void 0; - } -} -const detectors = { - querystring: detectFromQuery, - cookie: detectFromCookie, - header: detectFromHeader, - path: detectFromPath -}; -function validateOptions(options) { - if (!options.supportedLanguages.includes(options.fallbackLanguage)) { - throw new Error("Fallback language must be included in supported languages"); - } - if (options.lookupFromPathIndex < 0) { - throw new Error("Path index must be non-negative"); - } - if (!options.order.every((detector) => Object.keys(detectors).includes(detector))) { - throw new Error("Invalid detector type in order array"); - } -} -function cacheLanguage(c, language, options) { - if (!Array.isArray(options.caches) || !options.caches.includes("cookie")) { - return; - } - try { - (0, import_cookie.setCookie)(c, options.lookupCookie, language, options.cookieOptions); - } catch (error) { - if (options.debug) { - console.error("Failed to cache language:", error); - } - } -} -const detectLanguage = (c, options) => { - let detectedLang; - for (const detectorName of options.order) { - const detector = detectors[detectorName]; - if (!detector) { - continue; - } - try { - detectedLang = detector(c, options); - if (detectedLang) { - if (options.debug) { - console.log(`Language detected from ${detectorName}: ${detectedLang}`); - } - break; - } - } catch (error) { - if (options.debug) { - console.error(`Error in ${detectorName} detector:`, error); - } - continue; - } - } - const finalLang = detectedLang || options.fallbackLanguage; - if (detectedLang && options.caches) { - cacheLanguage(c, finalLang, options); - } - return finalLang; -}; -const languageDetector = (userOptions) => { - const options = { - ...DEFAULT_OPTIONS, - ...userOptions, - cookieOptions: { - ...DEFAULT_OPTIONS.cookieOptions, - ...userOptions.cookieOptions - } - }; - validateOptions(options); - return async function languageDetector2(ctx, next) { - try { - const lang = detectLanguage(ctx, options); - ctx.set("language", lang); - } catch (error) { - if (options.debug) { - console.error("Language detection failed:", error); - } - ctx.set("language", options.fallbackLanguage); - } - await next(); - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - DEFAULT_OPTIONS, - detectFromCookie, - detectFromHeader, - detectFromPath, - detectFromQuery, - detectors, - languageDetector, - normalizeLanguage, - parseAcceptLanguage, - validateOptions -}); diff --git a/node_modules/hono/dist/cjs/middleware/logger/index.js b/node_modules/hono/dist/cjs/middleware/logger/index.js deleted file mode 100644 index ee709cf..0000000 --- a/node_modules/hono/dist/cjs/middleware/logger/index.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var logger_exports = {}; -__export(logger_exports, { - logger: () => logger -}); -module.exports = __toCommonJS(logger_exports); -var import_color = require("../../utils/color"); -var LogPrefix = /* @__PURE__ */ ((LogPrefix2) => { - LogPrefix2["Outgoing"] = "-->"; - LogPrefix2["Incoming"] = "<--"; - LogPrefix2["Error"] = "xxx"; - return LogPrefix2; -})(LogPrefix || {}); -const humanize = (times) => { - const [delimiter, separator] = [",", "."]; - const orderTimes = times.map((v) => v.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + delimiter)); - return orderTimes.join(separator); -}; -const time = (start) => { - const delta = Date.now() - start; - return humanize([delta < 1e3 ? delta + "ms" : Math.round(delta / 1e3) + "s"]); -}; -const colorStatus = async (status) => { - const colorEnabled = await (0, import_color.getColorEnabledAsync)(); - if (colorEnabled) { - switch (status / 100 | 0) { - case 5: - return `\x1B[31m${status}\x1B[0m`; - case 4: - return `\x1B[33m${status}\x1B[0m`; - case 3: - return `\x1B[36m${status}\x1B[0m`; - case 2: - return `\x1B[32m${status}\x1B[0m`; - } - } - return `${status}`; -}; -async function log(fn, prefix, method, path, status = 0, elapsed) { - const out = prefix === "<--" /* Incoming */ ? `${prefix} ${method} ${path}` : `${prefix} ${method} ${path} ${await colorStatus(status)} ${elapsed}`; - fn(out); -} -const logger = (fn = console.log) => { - return async function logger2(c, next) { - const { method, url } = c.req; - const path = url.slice(url.indexOf("/", 8)); - await log(fn, "<--" /* Incoming */, method, path); - const start = Date.now(); - await next(); - await log(fn, "-->" /* Outgoing */, method, path, c.res.status, time(start)); - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - logger -}); diff --git a/node_modules/hono/dist/cjs/middleware/method-override/index.js b/node_modules/hono/dist/cjs/middleware/method-override/index.js deleted file mode 100644 index dfbd952..0000000 --- a/node_modules/hono/dist/cjs/middleware/method-override/index.js +++ /dev/null @@ -1,105 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var method_override_exports = {}; -__export(method_override_exports, { - methodOverride: () => methodOverride -}); -module.exports = __toCommonJS(method_override_exports); -var import_body = require("../../utils/body"); -const DEFAULT_METHOD_FORM_NAME = "_method"; -const methodOverride = (options) => async function methodOverride2(c, next) { - if (c.req.method === "GET") { - return await next(); - } - const app = options.app; - if (!(options.header || options.query)) { - const contentType = c.req.header("content-type"); - const methodFormName = options.form || DEFAULT_METHOD_FORM_NAME; - const clonedRequest = c.req.raw.clone(); - const newRequest = clonedRequest.clone(); - if (contentType?.startsWith("multipart/form-data")) { - const form = await clonedRequest.formData(); - const method = form.get(methodFormName); - if (method) { - const newForm = await newRequest.formData(); - newForm.delete(methodFormName); - const newHeaders = new Headers(clonedRequest.headers); - newHeaders.delete("content-type"); - newHeaders.delete("content-length"); - const request = new Request(c.req.url, { - body: newForm, - headers: newHeaders, - method - }); - return app.fetch(request, c.env, getExecutionCtx(c)); - } - } - if (contentType === "application/x-www-form-urlencoded") { - const params = await (0, import_body.parseBody)(clonedRequest); - const method = params[methodFormName]; - if (method) { - delete params[methodFormName]; - const newParams = new URLSearchParams(params); - const request = new Request(newRequest, { - body: newParams, - method - }); - return app.fetch(request, c.env, getExecutionCtx(c)); - } - } - } else if (options.header) { - const headerName = options.header; - const method = c.req.header(headerName); - if (method) { - const newHeaders = new Headers(c.req.raw.headers); - newHeaders.delete(headerName); - const request = new Request(c.req.raw, { - headers: newHeaders, - method - }); - return app.fetch(request, c.env, getExecutionCtx(c)); - } - } else if (options.query) { - const queryName = options.query; - const method = c.req.query(queryName); - if (method) { - const url = new URL(c.req.url); - url.searchParams.delete(queryName); - const request = new Request(url.toString(), { - body: c.req.raw.body, - headers: c.req.raw.headers, - method - }); - return app.fetch(request, c.env, getExecutionCtx(c)); - } - } - await next(); -}; -const getExecutionCtx = (c) => { - let executionCtx; - try { - executionCtx = c.executionCtx; - } catch { - } - return executionCtx; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - methodOverride -}); diff --git a/node_modules/hono/dist/cjs/middleware/powered-by/index.js b/node_modules/hono/dist/cjs/middleware/powered-by/index.js deleted file mode 100644 index 5580b93..0000000 --- a/node_modules/hono/dist/cjs/middleware/powered-by/index.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var powered_by_exports = {}; -__export(powered_by_exports, { - poweredBy: () => poweredBy -}); -module.exports = __toCommonJS(powered_by_exports); -const poweredBy = (options) => { - return async function poweredBy2(c, next) { - await next(); - c.res.headers.set("X-Powered-By", options?.serverName ?? "Hono"); - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - poweredBy -}); diff --git a/node_modules/hono/dist/cjs/middleware/pretty-json/index.js b/node_modules/hono/dist/cjs/middleware/pretty-json/index.js deleted file mode 100644 index 0ca7c39..0000000 --- a/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var pretty_json_exports = {}; -__export(pretty_json_exports, { - prettyJSON: () => prettyJSON -}); -module.exports = __toCommonJS(pretty_json_exports); -const prettyJSON = (options) => { - const targetQuery = options?.query ?? "pretty"; - return async function prettyJSON2(c, next) { - const pretty = options?.force || c.req.query(targetQuery) || c.req.query(targetQuery) === ""; - await next(); - if (pretty && c.res.headers.get("Content-Type")?.startsWith("application/json")) { - const obj = await c.res.json(); - c.res = new Response(JSON.stringify(obj, null, options?.space ?? 2), c.res); - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - prettyJSON -}); diff --git a/node_modules/hono/dist/cjs/middleware/request-id/index.js b/node_modules/hono/dist/cjs/middleware/request-id/index.js deleted file mode 100644 index ec5ac3d..0000000 --- a/node_modules/hono/dist/cjs/middleware/request-id/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var request_id_exports = {}; -__export(request_id_exports, { - requestId: () => import_request_id.requestId -}); -module.exports = __toCommonJS(request_id_exports); -var import_request_id = require("./request-id"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - requestId -}); diff --git a/node_modules/hono/dist/cjs/middleware/request-id/request-id.js b/node_modules/hono/dist/cjs/middleware/request-id/request-id.js deleted file mode 100644 index 48e7ced..0000000 --- a/node_modules/hono/dist/cjs/middleware/request-id/request-id.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var request_id_exports = {}; -__export(request_id_exports, { - requestId: () => requestId -}); -module.exports = __toCommonJS(request_id_exports); -const requestId = ({ - limitLength = 255, - headerName = "X-Request-Id", - generator = () => crypto.randomUUID() -} = {}) => { - return async function requestId2(c, next) { - let reqId = headerName ? c.req.header(headerName) : void 0; - if (!reqId || reqId.length > limitLength || /[^\w\-=]/.test(reqId)) { - reqId = generator(c); - } - c.set("requestId", reqId); - if (headerName) { - c.header(headerName, reqId); - } - await next(); - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - requestId -}); diff --git a/node_modules/hono/dist/cjs/middleware/secure-headers/index.js b/node_modules/hono/dist/cjs/middleware/secure-headers/index.js deleted file mode 100644 index de33ce9..0000000 --- a/node_modules/hono/dist/cjs/middleware/secure-headers/index.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var secure_headers_exports = {}; -__export(secure_headers_exports, { - NONCE: () => import_secure_headers.NONCE, - secureHeaders: () => import_secure_headers.secureHeaders -}); -module.exports = __toCommonJS(secure_headers_exports); -var import_secure_headers = require("./secure-headers"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - NONCE, - secureHeaders -}); diff --git a/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js b/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js deleted file mode 100644 index 468148d..0000000 --- a/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var permissions_policy_exports = {}; -module.exports = __toCommonJS(permissions_policy_exports); diff --git a/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js b/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js deleted file mode 100644 index b8c9bf4..0000000 --- a/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +++ /dev/null @@ -1,190 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var secure_headers_exports = {}; -__export(secure_headers_exports, { - NONCE: () => NONCE, - secureHeaders: () => secureHeaders -}); -module.exports = __toCommonJS(secure_headers_exports); -var import_encode = require("../../utils/encode"); -const HEADERS_MAP = { - crossOriginEmbedderPolicy: ["Cross-Origin-Embedder-Policy", "require-corp"], - crossOriginResourcePolicy: ["Cross-Origin-Resource-Policy", "same-origin"], - crossOriginOpenerPolicy: ["Cross-Origin-Opener-Policy", "same-origin"], - originAgentCluster: ["Origin-Agent-Cluster", "?1"], - referrerPolicy: ["Referrer-Policy", "no-referrer"], - strictTransportSecurity: ["Strict-Transport-Security", "max-age=15552000; includeSubDomains"], - xContentTypeOptions: ["X-Content-Type-Options", "nosniff"], - xDnsPrefetchControl: ["X-DNS-Prefetch-Control", "off"], - xDownloadOptions: ["X-Download-Options", "noopen"], - xFrameOptions: ["X-Frame-Options", "SAMEORIGIN"], - xPermittedCrossDomainPolicies: ["X-Permitted-Cross-Domain-Policies", "none"], - xXssProtection: ["X-XSS-Protection", "0"] -}; -const DEFAULT_OPTIONS = { - crossOriginEmbedderPolicy: false, - crossOriginResourcePolicy: true, - crossOriginOpenerPolicy: true, - originAgentCluster: true, - referrerPolicy: true, - strictTransportSecurity: true, - xContentTypeOptions: true, - xDnsPrefetchControl: true, - xDownloadOptions: true, - xFrameOptions: true, - xPermittedCrossDomainPolicies: true, - xXssProtection: true, - removePoweredBy: true, - permissionsPolicy: {} -}; -const generateNonce = () => { - const arrayBuffer = new Uint8Array(16); - crypto.getRandomValues(arrayBuffer); - return (0, import_encode.encodeBase64)(arrayBuffer.buffer); -}; -const NONCE = (ctx) => { - const key = "secureHeadersNonce"; - const init = ctx.get(key); - const nonce = init || generateNonce(); - if (init == null) { - ctx.set(key, nonce); - } - return `'nonce-${nonce}'`; -}; -const secureHeaders = (customOptions) => { - const options = { ...DEFAULT_OPTIONS, ...customOptions }; - const headersToSet = getFilteredHeaders(options); - const callbacks = []; - if (options.contentSecurityPolicy) { - const [callback, value] = getCSPDirectives(options.contentSecurityPolicy); - if (callback) { - callbacks.push(callback); - } - headersToSet.push(["Content-Security-Policy", value]); - } - if (options.contentSecurityPolicyReportOnly) { - const [callback, value] = getCSPDirectives(options.contentSecurityPolicyReportOnly); - if (callback) { - callbacks.push(callback); - } - headersToSet.push(["Content-Security-Policy-Report-Only", value]); - } - if (options.permissionsPolicy && Object.keys(options.permissionsPolicy).length > 0) { - headersToSet.push([ - "Permissions-Policy", - getPermissionsPolicyDirectives(options.permissionsPolicy) - ]); - } - if (options.reportingEndpoints) { - headersToSet.push(["Reporting-Endpoints", getReportingEndpoints(options.reportingEndpoints)]); - } - if (options.reportTo) { - headersToSet.push(["Report-To", getReportToOptions(options.reportTo)]); - } - return async function secureHeaders2(ctx, next) { - const headersToSetForReq = callbacks.length === 0 ? headersToSet : callbacks.reduce((acc, cb) => cb(ctx, acc), headersToSet); - await next(); - setHeaders(ctx, headersToSetForReq); - if (options?.removePoweredBy) { - ctx.res.headers.delete("X-Powered-By"); - } - }; -}; -function getFilteredHeaders(options) { - return Object.entries(HEADERS_MAP).filter(([key]) => options[key]).map(([key, defaultValue]) => { - const overrideValue = options[key]; - return typeof overrideValue === "string" ? [defaultValue[0], overrideValue] : defaultValue; - }); -} -function getCSPDirectives(contentSecurityPolicy) { - const callbacks = []; - const resultValues = []; - for (const [directive, value] of Object.entries(contentSecurityPolicy)) { - const valueArray = Array.isArray(value) ? value : [value]; - valueArray.forEach((value2, i) => { - if (typeof value2 === "function") { - const index = i * 2 + 2 + resultValues.length; - callbacks.push((ctx, values) => { - values[index] = value2(ctx, directive); - }); - } - }); - resultValues.push( - directive.replace( - /[A-Z]+(?![a-z])|[A-Z]/g, - (match, offset) => offset ? "-" + match.toLowerCase() : match.toLowerCase() - ), - ...valueArray.flatMap((value2) => [" ", value2]), - "; " - ); - } - resultValues.pop(); - return callbacks.length === 0 ? [void 0, resultValues.join("")] : [ - (ctx, headersToSet) => headersToSet.map((values) => { - if (values[0] === "Content-Security-Policy" || values[0] === "Content-Security-Policy-Report-Only") { - const clone = values[1].slice(); - callbacks.forEach((cb) => { - cb(ctx, clone); - }); - return [values[0], clone.join("")]; - } else { - return values; - } - }), - resultValues - ]; -} -function getPermissionsPolicyDirectives(policy) { - return Object.entries(policy).map(([directive, value]) => { - const kebabDirective = camelToKebab(directive); - if (typeof value === "boolean") { - return `${kebabDirective}=${value ? "*" : "none"}`; - } - if (Array.isArray(value)) { - if (value.length === 0) { - return `${kebabDirective}=()`; - } - if (value.length === 1 && (value[0] === "*" || value[0] === "none")) { - return `${kebabDirective}=${value[0]}`; - } - const allowlist = value.map((item) => ["self", "src"].includes(item) ? item : `"${item}"`); - return `${kebabDirective}=(${allowlist.join(" ")})`; - } - return ""; - }).filter(Boolean).join(", "); -} -function camelToKebab(str) { - return str.replace(/([a-z\d])([A-Z])/g, "$1-$2").toLowerCase(); -} -function getReportingEndpoints(reportingEndpoints = []) { - return reportingEndpoints.map((endpoint) => `${endpoint.name}="${endpoint.url}"`).join(", "); -} -function getReportToOptions(reportTo = []) { - return reportTo.map((option) => JSON.stringify(option)).join(", "); -} -function setHeaders(ctx, headersToSet) { - headersToSet.forEach(([header, value]) => { - ctx.res.headers.set(header, value); - }); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - NONCE, - secureHeaders -}); diff --git a/node_modules/hono/dist/cjs/middleware/serve-static/index.js b/node_modules/hono/dist/cjs/middleware/serve-static/index.js deleted file mode 100644 index ffd483d..0000000 --- a/node_modules/hono/dist/cjs/middleware/serve-static/index.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var serve_static_exports = {}; -__export(serve_static_exports, { - serveStatic: () => serveStatic -}); -module.exports = __toCommonJS(serve_static_exports); -var import_compress = require("../../utils/compress"); -var import_mime = require("../../utils/mime"); -var import_path = require("./path"); -const ENCODINGS = { - br: ".br", - zstd: ".zst", - gzip: ".gz" -}; -const ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS); -const DEFAULT_DOCUMENT = "index.html"; -const serveStatic = (options) => { - const root = options.root ?? "./"; - const optionPath = options.path; - const join = options.join ?? import_path.defaultJoin; - return async (c, next) => { - if (c.finalized) { - return next(); - } - let filename; - if (options.path) { - filename = options.path; - } else { - try { - filename = decodeURIComponent(c.req.path); - if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) { - throw new Error(); - } - } catch { - await options.onNotFound?.(c.req.path, c); - return next(); - } - } - let path = join( - root, - !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename) : filename - ); - if (options.isDir && await options.isDir(path)) { - path = join(path, DEFAULT_DOCUMENT); - } - const getContent = options.getContent; - let content = await getContent(path, c); - if (content instanceof Response) { - return c.newResponse(content.body, content); - } - if (content) { - const mimeType = options.mimes && (0, import_mime.getMimeType)(path, options.mimes) || (0, import_mime.getMimeType)(path); - c.header("Content-Type", mimeType || "application/octet-stream"); - if (options.precompressed && (!mimeType || import_compress.COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) { - const acceptEncodingSet = new Set( - c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()) - ); - for (const encoding of ENCODINGS_ORDERED_KEYS) { - if (!acceptEncodingSet.has(encoding)) { - continue; - } - const compressedContent = await getContent(path + ENCODINGS[encoding], c); - if (compressedContent) { - content = compressedContent; - c.header("Content-Encoding", encoding); - c.header("Vary", "Accept-Encoding", { append: true }); - break; - } - } - } - await options.onFound?.(path, c); - return c.body(content); - } - await options.onNotFound?.(path, c); - await next(); - return; - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - serveStatic -}); diff --git a/node_modules/hono/dist/cjs/middleware/serve-static/path.js b/node_modules/hono/dist/cjs/middleware/serve-static/path.js deleted file mode 100644 index ff620aa..0000000 --- a/node_modules/hono/dist/cjs/middleware/serve-static/path.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var path_exports = {}; -__export(path_exports, { - defaultJoin: () => defaultJoin -}); -module.exports = __toCommonJS(path_exports); -const defaultJoin = (...paths) => { - let result = paths.filter((p) => p !== "").join("/"); - result = result.replace(/(?<=\/)\/+/g, ""); - const segments = result.split("/"); - const resolved = []; - for (const segment of segments) { - if (segment === ".." && resolved.length > 0 && resolved.at(-1) !== "..") { - resolved.pop(); - } else if (segment !== ".") { - resolved.push(segment); - } - } - return resolved.join("/") || "."; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - defaultJoin -}); diff --git a/node_modules/hono/dist/cjs/middleware/timeout/index.js b/node_modules/hono/dist/cjs/middleware/timeout/index.js deleted file mode 100644 index 1df7d76..0000000 --- a/node_modules/hono/dist/cjs/middleware/timeout/index.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var timeout_exports = {}; -__export(timeout_exports, { - timeout: () => timeout -}); -module.exports = __toCommonJS(timeout_exports); -var import_http_exception = require("../../http-exception"); -const defaultTimeoutException = new import_http_exception.HTTPException(504, { - message: "Gateway Timeout" -}); -const timeout = (duration, exception = defaultTimeoutException) => { - return async function timeout2(context, next) { - let timer; - const timeoutPromise = new Promise((_, reject) => { - timer = setTimeout(() => { - reject(typeof exception === "function" ? exception(context) : exception); - }, duration); - }); - try { - await Promise.race([next(), timeoutPromise]); - } finally { - if (timer !== void 0) { - clearTimeout(timer); - } - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - timeout -}); diff --git a/node_modules/hono/dist/cjs/middleware/timing/index.js b/node_modules/hono/dist/cjs/middleware/timing/index.js deleted file mode 100644 index 2775406..0000000 --- a/node_modules/hono/dist/cjs/middleware/timing/index.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var timing_exports = {}; -__export(timing_exports, { - endTime: () => import_timing.endTime, - setMetric: () => import_timing.setMetric, - startTime: () => import_timing.startTime, - timing: () => import_timing.timing, - wrapTime: () => import_timing.wrapTime -}); -module.exports = __toCommonJS(timing_exports); -var import_timing = require("./timing"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - endTime, - setMetric, - startTime, - timing, - wrapTime -}); diff --git a/node_modules/hono/dist/cjs/middleware/timing/timing.js b/node_modules/hono/dist/cjs/middleware/timing/timing.js deleted file mode 100644 index 7c25a94..0000000 --- a/node_modules/hono/dist/cjs/middleware/timing/timing.js +++ /dev/null @@ -1,129 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var timing_exports = {}; -__export(timing_exports, { - endTime: () => endTime, - setMetric: () => setMetric, - startTime: () => startTime, - timing: () => timing, - wrapTime: () => wrapTime -}); -module.exports = __toCommonJS(timing_exports); -var import_context = require("../../context"); -const getTime = () => { - try { - return performance.now(); - } catch { - } - return Date.now(); -}; -const timing = (config) => { - const options = { - total: true, - enabled: true, - totalDescription: "Total Response Time", - autoEnd: true, - crossOrigin: false, - ...config - }; - return async function timing2(c, next) { - const headers = []; - const timers = /* @__PURE__ */ new Map(); - if (c.get("metric")) { - return await next(); - } - c.set("metric", { headers, timers }); - if (options.total) { - startTime(c, "total", options.totalDescription); - } - await next(); - if (options.total) { - endTime(c, "total"); - } - if (options.autoEnd) { - timers.forEach((_, key) => endTime(c, key)); - } - const enabled = typeof options.enabled === "function" ? options.enabled(c) : options.enabled; - if (enabled) { - c.res.headers.append("Server-Timing", headers.join(",")); - const crossOrigin = typeof options.crossOrigin === "function" ? options.crossOrigin(c) : options.crossOrigin; - if (crossOrigin) { - c.res.headers.append( - "Timing-Allow-Origin", - typeof crossOrigin === "string" ? crossOrigin : "*" - ); - } - } - }; -}; -const setMetric = (c, name, valueDescription, description, precision) => { - const metrics = c.get("metric"); - if (!metrics) { - console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); - return; - } - if (typeof valueDescription === "number") { - const dur = valueDescription.toFixed(precision || 1); - const metric = description ? `${name};dur=${dur};desc="${description}"` : `${name};dur=${dur}`; - metrics.headers.push(metric); - } else { - const metric = valueDescription ? `${name};desc="${valueDescription}"` : `${name}`; - metrics.headers.push(metric); - } -}; -const startTime = (c, name, description) => { - const metrics = c.get("metric"); - if (!metrics) { - console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); - return; - } - metrics.timers.set(name, { description, start: getTime() }); -}; -const endTime = (c, name, precision) => { - const metrics = c.get("metric"); - if (!metrics) { - console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); - return; - } - const timer = metrics.timers.get(name); - if (!timer) { - console.warn(`Timer "${name}" does not exist!`); - return; - } - const { description, start } = timer; - const duration = getTime() - start; - setMetric(c, name, duration, description, precision); - metrics.timers.delete(name); -}; -async function wrapTime(c, name, callable, description, precision) { - startTime(c, name, description); - try { - return await callable; - } finally { - endTime(c, name, precision); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - endTime, - setMetric, - startTime, - timing, - wrapTime -}); diff --git a/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js b/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js deleted file mode 100644 index 085f34c..0000000 --- a/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var trailing_slash_exports = {}; -__export(trailing_slash_exports, { - appendTrailingSlash: () => appendTrailingSlash, - trimTrailingSlash: () => trimTrailingSlash -}); -module.exports = __toCommonJS(trailing_slash_exports); -const trimTrailingSlash = () => { - return async function trimTrailingSlash2(c, next) { - await next(); - if (c.res.status === 404 && (c.req.method === "GET" || c.req.method === "HEAD") && c.req.path !== "/" && c.req.path.at(-1) === "/") { - const url = new URL(c.req.url); - url.pathname = url.pathname.substring(0, url.pathname.length - 1); - c.res = c.redirect(url.toString(), 301); - } - }; -}; -const appendTrailingSlash = () => { - return async function appendTrailingSlash2(c, next) { - await next(); - if (c.res.status === 404 && (c.req.method === "GET" || c.req.method === "HEAD") && c.req.path.at(-1) !== "/") { - const url = new URL(c.req.url); - url.pathname += "/"; - c.res = c.redirect(url.toString(), 301); - } - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - appendTrailingSlash, - trimTrailingSlash -}); diff --git a/node_modules/hono/dist/cjs/package.json b/node_modules/hono/dist/cjs/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/node_modules/hono/dist/cjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/hono/dist/cjs/preset/quick.js b/node_modules/hono/dist/cjs/preset/quick.js deleted file mode 100644 index 793f3d8..0000000 --- a/node_modules/hono/dist/cjs/preset/quick.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var quick_exports = {}; -__export(quick_exports, { - Hono: () => Hono -}); -module.exports = __toCommonJS(quick_exports); -var import_hono_base = require("../hono-base"); -var import_linear_router = require("../router/linear-router"); -var import_smart_router = require("../router/smart-router"); -var import_trie_router = require("../router/trie-router"); -class Hono extends import_hono_base.HonoBase { - constructor(options = {}) { - super(options); - this.router = new import_smart_router.SmartRouter({ - routers: [new import_linear_router.LinearRouter(), new import_trie_router.TrieRouter()] - }); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Hono -}); diff --git a/node_modules/hono/dist/cjs/preset/tiny.js b/node_modules/hono/dist/cjs/preset/tiny.js deleted file mode 100644 index 1fd5478..0000000 --- a/node_modules/hono/dist/cjs/preset/tiny.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var tiny_exports = {}; -__export(tiny_exports, { - Hono: () => Hono -}); -module.exports = __toCommonJS(tiny_exports); -var import_hono_base = require("../hono-base"); -var import_pattern_router = require("../router/pattern-router"); -class Hono extends import_hono_base.HonoBase { - constructor(options = {}) { - super(options); - this.router = new import_pattern_router.PatternRouter(); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Hono -}); diff --git a/node_modules/hono/dist/cjs/request.js b/node_modules/hono/dist/cjs/request.js deleted file mode 100644 index 51c192f..0000000 --- a/node_modules/hono/dist/cjs/request.js +++ /dev/null @@ -1,325 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var request_exports = {}; -__export(request_exports, { - HonoRequest: () => HonoRequest, - cloneRawRequest: () => cloneRawRequest -}); -module.exports = __toCommonJS(request_exports); -var import_http_exception = require("./http-exception"); -var import_constants = require("./request/constants"); -var import_body = require("./utils/body"); -var import_url = require("./utils/url"); -const tryDecodeURIComponent = (str) => (0, import_url.tryDecode)(str, import_url.decodeURIComponent_); -class HonoRequest { - /** - * `.raw` can get the raw Request object. - * - * @see {@link https://hono.dev/docs/api/request#raw} - * - * @example - * ```ts - * // For Cloudflare Workers - * app.post('/', async (c) => { - * const metadata = c.req.raw.cf?.hostMetadata? - * ... - * }) - * ``` - */ - raw; - #validatedData; - // Short name of validatedData - #matchResult; - routeIndex = 0; - /** - * `.path` can get the pathname of the request. - * - * @see {@link https://hono.dev/docs/api/request#path} - * - * @example - * ```ts - * app.get('/about/me', (c) => { - * const pathname = c.req.path // `/about/me` - * }) - * ``` - */ - path; - bodyCache = {}; - constructor(request, path = "/", matchResult = [[]]) { - this.raw = request; - this.path = path; - this.#matchResult = matchResult; - this.#validatedData = {}; - } - param(key) { - return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams(); - } - #getDecodedParam(key) { - const paramKey = this.#matchResult[0][this.routeIndex][1][key]; - const param = this.#getParamValue(paramKey); - return param && /\%/.test(param) ? tryDecodeURIComponent(param) : param; - } - #getAllDecodedParams() { - const decoded = {}; - const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]); - for (const key of keys) { - const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]); - if (value !== void 0) { - decoded[key] = /\%/.test(value) ? tryDecodeURIComponent(value) : value; - } - } - return decoded; - } - #getParamValue(paramKey) { - return this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey; - } - query(key) { - return (0, import_url.getQueryParam)(this.url, key); - } - queries(key) { - return (0, import_url.getQueryParams)(this.url, key); - } - header(name) { - if (name) { - return this.raw.headers.get(name) ?? void 0; - } - const headerData = {}; - this.raw.headers.forEach((value, key) => { - headerData[key] = value; - }); - return headerData; - } - async parseBody(options) { - return this.bodyCache.parsedBody ??= await (0, import_body.parseBody)(this, options); - } - #cachedBody = (key) => { - const { bodyCache, raw } = this; - const cachedBody = bodyCache[key]; - if (cachedBody) { - return cachedBody; - } - const anyCachedKey = Object.keys(bodyCache)[0]; - if (anyCachedKey) { - return bodyCache[anyCachedKey].then((body) => { - if (anyCachedKey === "json") { - body = JSON.stringify(body); - } - return new Response(body)[key](); - }); - } - return bodyCache[key] = raw[key](); - }; - /** - * `.json()` can parse Request body of type `application/json` - * - * @see {@link https://hono.dev/docs/api/request#json} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.json() - * }) - * ``` - */ - json() { - return this.#cachedBody("text").then((text) => JSON.parse(text)); - } - /** - * `.text()` can parse Request body of type `text/plain` - * - * @see {@link https://hono.dev/docs/api/request#text} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.text() - * }) - * ``` - */ - text() { - return this.#cachedBody("text"); - } - /** - * `.arrayBuffer()` parse Request body as an `ArrayBuffer` - * - * @see {@link https://hono.dev/docs/api/request#arraybuffer} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.arrayBuffer() - * }) - * ``` - */ - arrayBuffer() { - return this.#cachedBody("arrayBuffer"); - } - /** - * Parses the request body as a `Blob`. - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.blob(); - * }); - * ``` - * @see https://hono.dev/docs/api/request#blob - */ - blob() { - return this.#cachedBody("blob"); - } - /** - * Parses the request body as `FormData`. - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.formData(); - * }); - * ``` - * @see https://hono.dev/docs/api/request#formdata - */ - formData() { - return this.#cachedBody("formData"); - } - /** - * Adds validated data to the request. - * - * @param target - The target of the validation. - * @param data - The validated data to add. - */ - addValidatedData(target, data) { - this.#validatedData[target] = data; - } - valid(target) { - return this.#validatedData[target]; - } - /** - * `.url()` can get the request url strings. - * - * @see {@link https://hono.dev/docs/api/request#url} - * - * @example - * ```ts - * app.get('/about/me', (c) => { - * const url = c.req.url // `http://localhost:8787/about/me` - * ... - * }) - * ``` - */ - get url() { - return this.raw.url; - } - /** - * `.method()` can get the method name of the request. - * - * @see {@link https://hono.dev/docs/api/request#method} - * - * @example - * ```ts - * app.get('/about/me', (c) => { - * const method = c.req.method // `GET` - * }) - * ``` - */ - get method() { - return this.raw.method; - } - get [import_constants.GET_MATCH_RESULT]() { - return this.#matchResult; - } - /** - * `.matchedRoutes()` can return a matched route in the handler - * - * @deprecated - * - * Use matchedRoutes helper defined in "hono/route" instead. - * - * @see {@link https://hono.dev/docs/api/request#matchedroutes} - * - * @example - * ```ts - * app.use('*', async function logger(c, next) { - * await next() - * c.req.matchedRoutes.forEach(({ handler, method, path }, i) => { - * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') - * console.log( - * method, - * ' ', - * path, - * ' '.repeat(Math.max(10 - path.length, 0)), - * name, - * i === c.req.routeIndex ? '<- respond from here' : '' - * ) - * }) - * }) - * ``` - */ - get matchedRoutes() { - return this.#matchResult[0].map(([[, route]]) => route); - } - /** - * `routePath()` can retrieve the path registered within the handler - * - * @deprecated - * - * Use routePath helper defined in "hono/route" instead. - * - * @see {@link https://hono.dev/docs/api/request#routepath} - * - * @example - * ```ts - * app.get('/posts/:id', (c) => { - * return c.json({ path: c.req.routePath }) - * }) - * ``` - */ - get routePath() { - return this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path; - } -} -const cloneRawRequest = async (req) => { - if (!req.raw.bodyUsed) { - return req.raw.clone(); - } - const cacheKey = Object.keys(req.bodyCache)[0]; - if (!cacheKey) { - throw new import_http_exception.HTTPException(500, { - message: "Cannot clone request: body was already consumed and not cached. Please use HonoRequest methods (e.g., req.json(), req.text()) instead of consuming req.raw directly." - }); - } - const requestInit = { - body: await req[cacheKey](), - cache: req.raw.cache, - credentials: req.raw.credentials, - headers: req.header(), - integrity: req.raw.integrity, - keepalive: req.raw.keepalive, - method: req.method, - mode: req.raw.mode, - redirect: req.raw.redirect, - referrer: req.raw.referrer, - referrerPolicy: req.raw.referrerPolicy, - signal: req.raw.signal - }; - return new Request(req.url, requestInit); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HonoRequest, - cloneRawRequest -}); diff --git a/node_modules/hono/dist/cjs/request/constants.js b/node_modules/hono/dist/cjs/request/constants.js deleted file mode 100644 index 322f24d..0000000 --- a/node_modules/hono/dist/cjs/request/constants.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var constants_exports = {}; -__export(constants_exports, { - GET_MATCH_RESULT: () => GET_MATCH_RESULT -}); -module.exports = __toCommonJS(constants_exports); -const GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - GET_MATCH_RESULT -}); diff --git a/node_modules/hono/dist/cjs/router.js b/node_modules/hono/dist/cjs/router.js deleted file mode 100644 index b05b67f..0000000 --- a/node_modules/hono/dist/cjs/router.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var router_exports = {}; -__export(router_exports, { - MESSAGE_MATCHER_IS_ALREADY_BUILT: () => MESSAGE_MATCHER_IS_ALREADY_BUILT, - METHODS: () => METHODS, - METHOD_NAME_ALL: () => METHOD_NAME_ALL, - METHOD_NAME_ALL_LOWERCASE: () => METHOD_NAME_ALL_LOWERCASE, - UnsupportedPathError: () => UnsupportedPathError -}); -module.exports = __toCommonJS(router_exports); -const METHOD_NAME_ALL = "ALL"; -const METHOD_NAME_ALL_LOWERCASE = "all"; -const METHODS = ["get", "post", "put", "delete", "options", "patch"]; -const MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built."; -class UnsupportedPathError extends Error { -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - MESSAGE_MATCHER_IS_ALREADY_BUILT, - METHODS, - METHOD_NAME_ALL, - METHOD_NAME_ALL_LOWERCASE, - UnsupportedPathError -}); diff --git a/node_modules/hono/dist/cjs/router/linear-router/index.js b/node_modules/hono/dist/cjs/router/linear-router/index.js deleted file mode 100644 index 10ed2b2..0000000 --- a/node_modules/hono/dist/cjs/router/linear-router/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var linear_router_exports = {}; -__export(linear_router_exports, { - LinearRouter: () => import_router.LinearRouter -}); -module.exports = __toCommonJS(linear_router_exports); -var import_router = require("./router"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - LinearRouter -}); diff --git a/node_modules/hono/dist/cjs/router/linear-router/router.js b/node_modules/hono/dist/cjs/router/linear-router/router.js deleted file mode 100644 index c72e7ca..0000000 --- a/node_modules/hono/dist/cjs/router/linear-router/router.js +++ /dev/null @@ -1,141 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var router_exports = {}; -__export(router_exports, { - LinearRouter: () => LinearRouter -}); -module.exports = __toCommonJS(router_exports); -var import_router = require("../../router"); -var import_url = require("../../utils/url"); -const emptyParams = /* @__PURE__ */ Object.create(null); -const splitPathRe = /\/(:\w+(?:{(?:(?:{[\d,]+})|[^}])+})?)|\/[^\/\?]+|(\?)/g; -const splitByStarRe = /\*/; -class LinearRouter { - name = "LinearRouter"; - #routes = []; - add(method, path, handler) { - for (let i = 0, paths = (0, import_url.checkOptionalParameter)(path) || [path], len = paths.length; i < len; i++) { - this.#routes.push([method, paths[i], handler]); - } - } - match(method, path) { - const handlers = []; - ROUTES_LOOP: for (let i = 0, len = this.#routes.length; i < len; i++) { - const [routeMethod, routePath, handler] = this.#routes[i]; - if (routeMethod === method || routeMethod === import_router.METHOD_NAME_ALL) { - if (routePath === "*" || routePath === "/*") { - handlers.push([handler, emptyParams]); - continue; - } - const hasStar = routePath.indexOf("*") !== -1; - const hasLabel = routePath.indexOf(":") !== -1; - if (!hasStar && !hasLabel) { - if (routePath === path || routePath + "/" === path) { - handlers.push([handler, emptyParams]); - } - } else if (hasStar && !hasLabel) { - const endsWithStar = routePath.charCodeAt(routePath.length - 1) === 42; - const parts = (endsWithStar ? routePath.slice(0, -2) : routePath).split(splitByStarRe); - const lastIndex = parts.length - 1; - for (let j = 0, pos = 0, len2 = parts.length; j < len2; j++) { - const part = parts[j]; - const index = path.indexOf(part, pos); - if (index !== pos) { - continue ROUTES_LOOP; - } - pos += part.length; - if (j === lastIndex) { - if (!endsWithStar && pos !== path.length && !(pos === path.length - 1 && path.charCodeAt(pos) === 47)) { - continue ROUTES_LOOP; - } - } else { - const index2 = path.indexOf("/", pos); - if (index2 === -1) { - continue ROUTES_LOOP; - } - pos = index2; - } - } - handlers.push([handler, emptyParams]); - } else if (hasLabel && !hasStar) { - const params = /* @__PURE__ */ Object.create(null); - const parts = routePath.match(splitPathRe); - const lastIndex = parts.length - 1; - for (let j = 0, pos = 0, len2 = parts.length; j < len2; j++) { - if (pos === -1 || pos >= path.length) { - continue ROUTES_LOOP; - } - const part = parts[j]; - if (part.charCodeAt(1) === 58) { - if (path.charCodeAt(pos) !== 47) { - continue ROUTES_LOOP; - } - let name = part.slice(2); - let value; - if (name.charCodeAt(name.length - 1) === 125) { - const openBracePos = name.indexOf("{"); - const next = parts[j + 1]; - const lookahead = next && next[1] !== ":" && next[1] !== "*" ? `(?=${next})` : ""; - const pattern = name.slice(openBracePos + 1, -1) + lookahead; - const restPath = path.slice(pos + 1); - const match = new RegExp(pattern, "d").exec(restPath); - if (!match || match.indices[0][0] !== 0 || match.indices[0][1] === 0) { - continue ROUTES_LOOP; - } - name = name.slice(0, openBracePos); - value = restPath.slice(...match.indices[0]); - pos += match.indices[0][1] + 1; - } else { - let endValuePos = path.indexOf("/", pos + 1); - if (endValuePos === -1) { - if (pos + 1 === path.length) { - continue ROUTES_LOOP; - } - endValuePos = path.length; - } - value = path.slice(pos + 1, endValuePos); - pos = endValuePos; - } - params[name] ||= value; - } else { - const index = path.indexOf(part, pos); - if (index !== pos) { - continue ROUTES_LOOP; - } - pos += part.length; - } - if (j === lastIndex) { - if (pos !== path.length && !(pos === path.length - 1 && path.charCodeAt(pos) === 47)) { - continue ROUTES_LOOP; - } - } - } - handlers.push([handler, params]); - } else if (hasLabel && hasStar) { - throw new import_router.UnsupportedPathError(); - } - } - } - return [handlers]; - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - LinearRouter -}); diff --git a/node_modules/hono/dist/cjs/router/pattern-router/index.js b/node_modules/hono/dist/cjs/router/pattern-router/index.js deleted file mode 100644 index 54e9757..0000000 --- a/node_modules/hono/dist/cjs/router/pattern-router/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var pattern_router_exports = {}; -__export(pattern_router_exports, { - PatternRouter: () => import_router.PatternRouter -}); -module.exports = __toCommonJS(pattern_router_exports); -var import_router = require("./router"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - PatternRouter -}); diff --git a/node_modules/hono/dist/cjs/router/pattern-router/router.js b/node_modules/hono/dist/cjs/router/pattern-router/router.js deleted file mode 100644 index a9592d9..0000000 --- a/node_modules/hono/dist/cjs/router/pattern-router/router.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var router_exports = {}; -__export(router_exports, { - PatternRouter: () => PatternRouter -}); -module.exports = __toCommonJS(router_exports); -var import_router = require("../../router"); -const emptyParams = /* @__PURE__ */ Object.create(null); -class PatternRouter { - name = "PatternRouter"; - #routes = []; - add(method, path, handler) { - const endsWithWildcard = path.at(-1) === "*"; - if (endsWithWildcard) { - path = path.slice(0, -2); - } - if (path.at(-1) === "?") { - path = path.slice(0, -1); - this.add(method, path.replace(/\/[^/]+$/, ""), handler); - } - const parts = (path.match(/\/?(:\w+(?:{(?:(?:{[\d,]+})|[^}])+})?)|\/?[^\/\?]+/g) || []).map( - (part) => { - const match = part.match(/^\/:([^{]+)(?:{(.*)})?/); - return match ? `/(?<${match[1]}>${match[2] || "[^/]+"})` : part === "/*" ? "/[^/]+" : part.replace(/[.\\+*[^\]$()]/g, "\\$&"); - } - ); - try { - this.#routes.push([ - new RegExp(`^${parts.join("")}${endsWithWildcard ? "" : "/?$"}`), - method, - handler - ]); - } catch { - throw new import_router.UnsupportedPathError(); - } - } - match(method, path) { - const handlers = []; - for (let i = 0, len = this.#routes.length; i < len; i++) { - const [pattern, routeMethod, handler] = this.#routes[i]; - if (routeMethod === method || routeMethod === import_router.METHOD_NAME_ALL) { - const match = pattern.exec(path); - if (match) { - handlers.push([handler, match.groups || emptyParams]); - } - } - } - return [handlers]; - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - PatternRouter -}); diff --git a/node_modules/hono/dist/cjs/router/reg-exp-router/index.js b/node_modules/hono/dist/cjs/router/reg-exp-router/index.js deleted file mode 100644 index 46ad451..0000000 --- a/node_modules/hono/dist/cjs/router/reg-exp-router/index.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var reg_exp_router_exports = {}; -__export(reg_exp_router_exports, { - PreparedRegExpRouter: () => import_prepared_router.PreparedRegExpRouter, - RegExpRouter: () => import_router.RegExpRouter, - buildInitParams: () => import_prepared_router.buildInitParams, - serializeInitParams: () => import_prepared_router.serializeInitParams -}); -module.exports = __toCommonJS(reg_exp_router_exports); -var import_router = require("./router"); -var import_prepared_router = require("./prepared-router"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - PreparedRegExpRouter, - RegExpRouter, - buildInitParams, - serializeInitParams -}); diff --git a/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js b/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js deleted file mode 100644 index cacc336..0000000 --- a/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var matcher_exports = {}; -__export(matcher_exports, { - emptyParam: () => emptyParam, - match: () => match -}); -module.exports = __toCommonJS(matcher_exports); -var import_router = require("../../router"); -const emptyParam = []; -function match(method, path) { - const matchers = this.buildAllMatchers(); - const match2 = ((method2, path2) => { - const matcher = matchers[method2] || matchers[import_router.METHOD_NAME_ALL]; - const staticMatch = matcher[2][path2]; - if (staticMatch) { - return staticMatch; - } - const match3 = path2.match(matcher[0]); - if (!match3) { - return [[], emptyParam]; - } - const index = match3.indexOf("", 1); - return [matcher[1][index], match3]; - }); - this.match = match2; - return match2(method, path); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - emptyParam, - match -}); diff --git a/node_modules/hono/dist/cjs/router/reg-exp-router/node.js b/node_modules/hono/dist/cjs/router/reg-exp-router/node.js deleted file mode 100644 index c5486a9..0000000 --- a/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +++ /dev/null @@ -1,135 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var node_exports = {}; -__export(node_exports, { - Node: () => Node, - PATH_ERROR: () => PATH_ERROR -}); -module.exports = __toCommonJS(node_exports); -const LABEL_REG_EXP_STR = "[^/]+"; -const ONLY_WILDCARD_REG_EXP_STR = ".*"; -const TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; -const PATH_ERROR = /* @__PURE__ */ Symbol(); -const regExpMetaChars = new Set(".\\+*[^]$()"); -function compareKey(a, b) { - if (a.length === 1) { - return b.length === 1 ? a < b ? -1 : 1 : -1; - } - if (b.length === 1) { - return 1; - } - if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) { - return 1; - } else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) { - return -1; - } - if (a === LABEL_REG_EXP_STR) { - return 1; - } else if (b === LABEL_REG_EXP_STR) { - return -1; - } - return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length; -} -class Node { - #index; - #varIndex; - #children = /* @__PURE__ */ Object.create(null); - insert(tokens, index, paramMap, context, pathErrorCheckOnly) { - if (tokens.length === 0) { - if (this.#index !== void 0) { - throw PATH_ERROR; - } - if (pathErrorCheckOnly) { - return; - } - this.#index = index; - return; - } - const [token, ...restTokens] = tokens; - const pattern = token === "*" ? restTokens.length === 0 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); - let node; - if (pattern) { - const name = pattern[1]; - let regexpStr = pattern[2] || LABEL_REG_EXP_STR; - if (name && pattern[2]) { - if (regexpStr === ".*") { - throw PATH_ERROR; - } - regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:"); - if (/\((?!\?:)/.test(regexpStr)) { - throw PATH_ERROR; - } - } - node = this.#children[regexpStr]; - if (!node) { - if (Object.keys(this.#children).some( - (k) => k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR - )) { - throw PATH_ERROR; - } - if (pathErrorCheckOnly) { - return; - } - node = this.#children[regexpStr] = new Node(); - if (name !== "") { - node.#varIndex = context.varIndex++; - } - } - if (!pathErrorCheckOnly && name !== "") { - paramMap.push([name, node.#varIndex]); - } - } else { - node = this.#children[token]; - if (!node) { - if (Object.keys(this.#children).some( - (k) => k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR - )) { - throw PATH_ERROR; - } - if (pathErrorCheckOnly) { - return; - } - node = this.#children[token] = new Node(); - } - } - node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly); - } - buildRegExpStr() { - const childKeys = Object.keys(this.#children).sort(compareKey); - const strList = childKeys.map((k) => { - const c = this.#children[k]; - return (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr(); - }); - if (typeof this.#index === "number") { - strList.unshift(`#${this.#index}`); - } - if (strList.length === 0) { - return ""; - } - if (strList.length === 1) { - return strList[0]; - } - return "(?:" + strList.join("|") + ")"; - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Node, - PATH_ERROR -}); diff --git a/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js b/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js deleted file mode 100644 index 6785515..0000000 --- a/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +++ /dev/null @@ -1,167 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var prepared_router_exports = {}; -__export(prepared_router_exports, { - PreparedRegExpRouter: () => PreparedRegExpRouter, - buildInitParams: () => buildInitParams, - serializeInitParams: () => serializeInitParams -}); -module.exports = __toCommonJS(prepared_router_exports); -var import_router = require("../../router"); -var import_matcher = require("./matcher"); -var import_router2 = require("./router"); -class PreparedRegExpRouter { - name = "PreparedRegExpRouter"; - #matchers; - #relocateMap; - constructor(matchers, relocateMap) { - this.#matchers = matchers; - this.#relocateMap = relocateMap; - } - #addWildcard(method, handlerData) { - const matcher = this.#matchers[method]; - matcher[1].forEach((list) => list && list.push(handlerData)); - Object.values(matcher[2]).forEach((list) => list[0].push(handlerData)); - } - #addPath(method, path, handler, indexes, map) { - const matcher = this.#matchers[method]; - if (!map) { - matcher[2][path][0].push([handler, {}]); - } else { - indexes.forEach((index) => { - if (typeof index === "number") { - matcher[1][index].push([handler, map]); - } else { - ; - matcher[2][index || path][0].push([handler, map]); - } - }); - } - } - add(method, path, handler) { - if (!this.#matchers[method]) { - const all = this.#matchers[import_router.METHOD_NAME_ALL]; - const staticMap = {}; - for (const key in all[2]) { - staticMap[key] = [all[2][key][0].slice(), import_matcher.emptyParam]; - } - this.#matchers[method] = [ - all[0], - all[1].map((list) => Array.isArray(list) ? list.slice() : 0), - staticMap - ]; - } - if (path === "/*" || path === "*") { - const handlerData = [handler, {}]; - if (method === import_router.METHOD_NAME_ALL) { - for (const m in this.#matchers) { - this.#addWildcard(m, handlerData); - } - } else { - this.#addWildcard(method, handlerData); - } - return; - } - const data = this.#relocateMap[path]; - if (!data) { - throw new Error(`Path ${path} is not registered`); - } - for (const [indexes, map] of data) { - if (method === import_router.METHOD_NAME_ALL) { - for (const m in this.#matchers) { - this.#addPath(m, path, handler, indexes, map); - } - } else { - this.#addPath(method, path, handler, indexes, map); - } - } - } - buildAllMatchers() { - return this.#matchers; - } - match = import_matcher.match; -} -const buildInitParams = ({ paths }) => { - const RegExpRouterWithMatcherExport = class extends import_router2.RegExpRouter { - buildAndExportAllMatchers() { - return this.buildAllMatchers(); - } - }; - const router = new RegExpRouterWithMatcherExport(); - for (const path of paths) { - router.add(import_router.METHOD_NAME_ALL, path, path); - } - const matchers = router.buildAndExportAllMatchers(); - const all = matchers[import_router.METHOD_NAME_ALL]; - const relocateMap = {}; - for (const path of paths) { - if (path === "/*" || path === "*") { - continue; - } - all[1].forEach((list, i) => { - list.forEach(([p, map]) => { - if (p === path) { - if (relocateMap[path]) { - relocateMap[path][0][1] = { - ...relocateMap[path][0][1], - ...map - }; - } else { - relocateMap[path] = [[[], map]]; - } - if (relocateMap[path][0][0].findIndex((j) => j === i) === -1) { - relocateMap[path][0][0].push(i); - } - } - }); - }); - for (const path2 in all[2]) { - all[2][path2][0].forEach(([p]) => { - if (p === path) { - relocateMap[path] ||= [[[]]]; - const value = path2 === path ? "" : path2; - if (relocateMap[path][0][0].findIndex((v) => v === value) === -1) { - relocateMap[path][0][0].push(value); - } - } - }); - } - } - for (let i = 0, len = all[1].length; i < len; i++) { - all[1][i] = all[1][i] ? [] : 0; - } - for (const path in all[2]) { - all[2][path][0] = []; - } - return [matchers, relocateMap]; -}; -const serializeInitParams = ([matchers, relocateMap]) => { - const matchersStr = JSON.stringify( - matchers, - (_, value) => value instanceof RegExp ? `##${value.toString()}##` : value - ).replace(/"##(.+?)##"/g, (_, str) => str.replace(/\\\\/g, "\\")); - const relocateMapStr = JSON.stringify(relocateMap); - return `[${matchersStr},${relocateMapStr}]`; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - PreparedRegExpRouter, - buildInitParams, - serializeInitParams -}); diff --git a/node_modules/hono/dist/cjs/router/reg-exp-router/router.js b/node_modules/hono/dist/cjs/router/reg-exp-router/router.js deleted file mode 100644 index 0b66be9..0000000 --- a/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +++ /dev/null @@ -1,209 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var router_exports = {}; -__export(router_exports, { - RegExpRouter: () => RegExpRouter -}); -module.exports = __toCommonJS(router_exports); -var import_router = require("../../router"); -var import_url = require("../../utils/url"); -var import_matcher = require("./matcher"); -var import_node = require("./node"); -var import_trie = require("./trie"); -const nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)]; -let wildcardRegExpCache = /* @__PURE__ */ Object.create(null); -function buildWildcardRegExp(path) { - return wildcardRegExpCache[path] ??= new RegExp( - path === "*" ? "" : `^${path.replace( - /\/\*$|([.\\+*[^\]$()])/g, - (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)" - )}$` - ); -} -function clearWildcardRegExpCache() { - wildcardRegExpCache = /* @__PURE__ */ Object.create(null); -} -function buildMatcherFromPreprocessedRoutes(routes) { - const trie = new import_trie.Trie(); - const handlerData = []; - if (routes.length === 0) { - return nullMatcher; - } - const routesWithStaticPathFlag = routes.map( - (route) => [!/\*|\/:/.test(route[0]), ...route] - ).sort( - ([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length - ); - const staticMap = /* @__PURE__ */ Object.create(null); - for (let i = 0, j = -1, len = routesWithStaticPathFlag.length; i < len; i++) { - const [pathErrorCheckOnly, path, handlers] = routesWithStaticPathFlag[i]; - if (pathErrorCheckOnly) { - staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), import_matcher.emptyParam]; - } else { - j++; - } - let paramAssoc; - try { - paramAssoc = trie.insert(path, j, pathErrorCheckOnly); - } catch (e) { - throw e === import_node.PATH_ERROR ? new import_router.UnsupportedPathError(path) : e; - } - if (pathErrorCheckOnly) { - continue; - } - handlerData[j] = handlers.map(([h, paramCount]) => { - const paramIndexMap = /* @__PURE__ */ Object.create(null); - paramCount -= 1; - for (; paramCount >= 0; paramCount--) { - const [key, value] = paramAssoc[paramCount]; - paramIndexMap[key] = value; - } - return [h, paramIndexMap]; - }); - } - const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp(); - for (let i = 0, len = handlerData.length; i < len; i++) { - for (let j = 0, len2 = handlerData[i].length; j < len2; j++) { - const map = handlerData[i][j]?.[1]; - if (!map) { - continue; - } - const keys = Object.keys(map); - for (let k = 0, len3 = keys.length; k < len3; k++) { - map[keys[k]] = paramReplacementMap[map[keys[k]]]; - } - } - } - const handlerMap = []; - for (const i in indexReplacementMap) { - handlerMap[i] = handlerData[indexReplacementMap[i]]; - } - return [regexp, handlerMap, staticMap]; -} -function findMiddleware(middleware, path) { - if (!middleware) { - return void 0; - } - for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) { - if (buildWildcardRegExp(k).test(path)) { - return [...middleware[k]]; - } - } - return void 0; -} -class RegExpRouter { - name = "RegExpRouter"; - #middleware; - #routes; - constructor() { - this.#middleware = { [import_router.METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; - this.#routes = { [import_router.METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; - } - add(method, path, handler) { - const middleware = this.#middleware; - const routes = this.#routes; - if (!middleware || !routes) { - throw new Error(import_router.MESSAGE_MATCHER_IS_ALREADY_BUILT); - } - if (!middleware[method]) { - ; - [middleware, routes].forEach((handlerMap) => { - handlerMap[method] = /* @__PURE__ */ Object.create(null); - Object.keys(handlerMap[import_router.METHOD_NAME_ALL]).forEach((p) => { - handlerMap[method][p] = [...handlerMap[import_router.METHOD_NAME_ALL][p]]; - }); - }); - } - if (path === "/*") { - path = "*"; - } - const paramCount = (path.match(/\/:/g) || []).length; - if (/\*$/.test(path)) { - const re = buildWildcardRegExp(path); - if (method === import_router.METHOD_NAME_ALL) { - Object.keys(middleware).forEach((m) => { - middleware[m][path] ||= findMiddleware(middleware[m], path) || findMiddleware(middleware[import_router.METHOD_NAME_ALL], path) || []; - }); - } else { - middleware[method][path] ||= findMiddleware(middleware[method], path) || findMiddleware(middleware[import_router.METHOD_NAME_ALL], path) || []; - } - Object.keys(middleware).forEach((m) => { - if (method === import_router.METHOD_NAME_ALL || method === m) { - Object.keys(middleware[m]).forEach((p) => { - re.test(p) && middleware[m][p].push([handler, paramCount]); - }); - } - }); - Object.keys(routes).forEach((m) => { - if (method === import_router.METHOD_NAME_ALL || method === m) { - Object.keys(routes[m]).forEach( - (p) => re.test(p) && routes[m][p].push([handler, paramCount]) - ); - } - }); - return; - } - const paths = (0, import_url.checkOptionalParameter)(path) || [path]; - for (let i = 0, len = paths.length; i < len; i++) { - const path2 = paths[i]; - Object.keys(routes).forEach((m) => { - if (method === import_router.METHOD_NAME_ALL || method === m) { - routes[m][path2] ||= [ - ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[import_router.METHOD_NAME_ALL], path2) || [] - ]; - routes[m][path2].push([handler, paramCount - len + i + 1]); - } - }); - } - } - match = import_matcher.match; - buildAllMatchers() { - const matchers = /* @__PURE__ */ Object.create(null); - Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => { - matchers[method] ||= this.#buildMatcher(method); - }); - this.#middleware = this.#routes = void 0; - clearWildcardRegExpCache(); - return matchers; - } - #buildMatcher(method) { - const routes = []; - let hasOwnRoute = method === import_router.METHOD_NAME_ALL; - [this.#middleware, this.#routes].forEach((r) => { - const ownRoute = r[method] ? Object.keys(r[method]).map((path) => [path, r[method][path]]) : []; - if (ownRoute.length !== 0) { - hasOwnRoute ||= true; - routes.push(...ownRoute); - } else if (method !== import_router.METHOD_NAME_ALL) { - routes.push( - ...Object.keys(r[import_router.METHOD_NAME_ALL]).map((path) => [path, r[import_router.METHOD_NAME_ALL][path]]) - ); - } - }); - if (!hasOwnRoute) { - return null; - } else { - return buildMatcherFromPreprocessedRoutes(routes); - } - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - RegExpRouter -}); diff --git a/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js b/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js deleted file mode 100644 index 70754e1..0000000 --- a/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var trie_exports = {}; -__export(trie_exports, { - Trie: () => Trie -}); -module.exports = __toCommonJS(trie_exports); -var import_node = require("./node"); -class Trie { - #context = { varIndex: 0 }; - #root = new import_node.Node(); - insert(path, index, pathErrorCheckOnly) { - const paramAssoc = []; - const groups = []; - for (let i = 0; ; ) { - let replaced = false; - path = path.replace(/\{[^}]+\}/g, (m) => { - const mark = `@\\${i}`; - groups[i] = [mark, m]; - i++; - replaced = true; - return mark; - }); - if (!replaced) { - break; - } - } - const tokens = path.match(/(?::[^\/]+)|(?:\/\*$)|./g) || []; - for (let i = groups.length - 1; i >= 0; i--) { - const [mark] = groups[i]; - for (let j = tokens.length - 1; j >= 0; j--) { - if (tokens[j].indexOf(mark) !== -1) { - tokens[j] = tokens[j].replace(mark, groups[i][1]); - break; - } - } - } - this.#root.insert(tokens, index, paramAssoc, this.#context, pathErrorCheckOnly); - return paramAssoc; - } - buildRegExp() { - let regexp = this.#root.buildRegExpStr(); - if (regexp === "") { - return [/^$/, [], []]; - } - let captureIndex = 0; - const indexReplacementMap = []; - const paramReplacementMap = []; - regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => { - if (handlerIndex !== void 0) { - indexReplacementMap[++captureIndex] = Number(handlerIndex); - return "$()"; - } - if (paramIndex !== void 0) { - paramReplacementMap[Number(paramIndex)] = ++captureIndex; - return ""; - } - return ""; - }); - return [new RegExp(`^${regexp}`), indexReplacementMap, paramReplacementMap]; - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Trie -}); diff --git a/node_modules/hono/dist/cjs/router/smart-router/index.js b/node_modules/hono/dist/cjs/router/smart-router/index.js deleted file mode 100644 index 1d31883..0000000 --- a/node_modules/hono/dist/cjs/router/smart-router/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var smart_router_exports = {}; -__export(smart_router_exports, { - SmartRouter: () => import_router.SmartRouter -}); -module.exports = __toCommonJS(smart_router_exports); -var import_router = require("./router"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - SmartRouter -}); diff --git a/node_modules/hono/dist/cjs/router/smart-router/router.js b/node_modules/hono/dist/cjs/router/smart-router/router.js deleted file mode 100644 index 2e43178..0000000 --- a/node_modules/hono/dist/cjs/router/smart-router/router.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var router_exports = {}; -__export(router_exports, { - SmartRouter: () => SmartRouter -}); -module.exports = __toCommonJS(router_exports); -var import_router = require("../../router"); -class SmartRouter { - name = "SmartRouter"; - #routers = []; - #routes = []; - constructor(init) { - this.#routers = init.routers; - } - add(method, path, handler) { - if (!this.#routes) { - throw new Error(import_router.MESSAGE_MATCHER_IS_ALREADY_BUILT); - } - this.#routes.push([method, path, handler]); - } - match(method, path) { - if (!this.#routes) { - throw new Error("Fatal error"); - } - const routers = this.#routers; - const routes = this.#routes; - const len = routers.length; - let i = 0; - let res; - for (; i < len; i++) { - const router = routers[i]; - try { - for (let i2 = 0, len2 = routes.length; i2 < len2; i2++) { - router.add(...routes[i2]); - } - res = router.match(method, path); - } catch (e) { - if (e instanceof import_router.UnsupportedPathError) { - continue; - } - throw e; - } - this.match = router.match.bind(router); - this.#routers = [router]; - this.#routes = void 0; - break; - } - if (i === len) { - throw new Error("Fatal error"); - } - this.name = `SmartRouter + ${this.activeRouter.name}`; - return res; - } - get activeRouter() { - if (this.#routes || this.#routers.length !== 1) { - throw new Error("No active router has been determined yet."); - } - return this.#routers[0]; - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - SmartRouter -}); diff --git a/node_modules/hono/dist/cjs/router/trie-router/index.js b/node_modules/hono/dist/cjs/router/trie-router/index.js deleted file mode 100644 index feaeadb..0000000 --- a/node_modules/hono/dist/cjs/router/trie-router/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var trie_router_exports = {}; -__export(trie_router_exports, { - TrieRouter: () => import_router.TrieRouter -}); -module.exports = __toCommonJS(trie_router_exports); -var import_router = require("./router"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - TrieRouter -}); diff --git a/node_modules/hono/dist/cjs/router/trie-router/node.js b/node_modules/hono/dist/cjs/router/trie-router/node.js deleted file mode 100644 index e41f3d0..0000000 --- a/node_modules/hono/dist/cjs/router/trie-router/node.js +++ /dev/null @@ -1,185 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var node_exports = {}; -__export(node_exports, { - Node: () => Node -}); -module.exports = __toCommonJS(node_exports); -var import_router = require("../../router"); -var import_url = require("../../utils/url"); -const emptyParams = /* @__PURE__ */ Object.create(null); -class Node { - #methods; - #children; - #patterns; - #order = 0; - #params = emptyParams; - constructor(method, handler, children) { - this.#children = children || /* @__PURE__ */ Object.create(null); - this.#methods = []; - if (method && handler) { - const m = /* @__PURE__ */ Object.create(null); - m[method] = { handler, possibleKeys: [], score: 0 }; - this.#methods = [m]; - } - this.#patterns = []; - } - insert(method, path, handler) { - this.#order = ++this.#order; - let curNode = this; - const parts = (0, import_url.splitRoutingPath)(path); - const possibleKeys = []; - for (let i = 0, len = parts.length; i < len; i++) { - const p = parts[i]; - const nextP = parts[i + 1]; - const pattern = (0, import_url.getPattern)(p, nextP); - const key = Array.isArray(pattern) ? pattern[0] : p; - if (key in curNode.#children) { - curNode = curNode.#children[key]; - if (pattern) { - possibleKeys.push(pattern[1]); - } - continue; - } - curNode.#children[key] = new Node(); - if (pattern) { - curNode.#patterns.push(pattern); - possibleKeys.push(pattern[1]); - } - curNode = curNode.#children[key]; - } - curNode.#methods.push({ - [method]: { - handler, - possibleKeys: possibleKeys.filter((v, i, a) => a.indexOf(v) === i), - score: this.#order - } - }); - return curNode; - } - #getHandlerSets(node, method, nodeParams, params) { - const handlerSets = []; - for (let i = 0, len = node.#methods.length; i < len; i++) { - const m = node.#methods[i]; - const handlerSet = m[method] || m[import_router.METHOD_NAME_ALL]; - const processedSet = {}; - if (handlerSet !== void 0) { - handlerSet.params = /* @__PURE__ */ Object.create(null); - handlerSets.push(handlerSet); - if (nodeParams !== emptyParams || params && params !== emptyParams) { - for (let i2 = 0, len2 = handlerSet.possibleKeys.length; i2 < len2; i2++) { - const key = handlerSet.possibleKeys[i2]; - const processed = processedSet[handlerSet.score]; - handlerSet.params[key] = params?.[key] && !processed ? params[key] : nodeParams[key] ?? params?.[key]; - processedSet[handlerSet.score] = true; - } - } - } - } - return handlerSets; - } - search(method, path) { - const handlerSets = []; - this.#params = emptyParams; - const curNode = this; - let curNodes = [curNode]; - const parts = (0, import_url.splitPath)(path); - const curNodesQueue = []; - for (let i = 0, len = parts.length; i < len; i++) { - const part = parts[i]; - const isLast = i === len - 1; - const tempNodes = []; - for (let j = 0, len2 = curNodes.length; j < len2; j++) { - const node = curNodes[j]; - const nextNode = node.#children[part]; - if (nextNode) { - nextNode.#params = node.#params; - if (isLast) { - if (nextNode.#children["*"]) { - handlerSets.push( - ...this.#getHandlerSets(nextNode.#children["*"], method, node.#params) - ); - } - handlerSets.push(...this.#getHandlerSets(nextNode, method, node.#params)); - } else { - tempNodes.push(nextNode); - } - } - for (let k = 0, len3 = node.#patterns.length; k < len3; k++) { - const pattern = node.#patterns[k]; - const params = node.#params === emptyParams ? {} : { ...node.#params }; - if (pattern === "*") { - const astNode = node.#children["*"]; - if (astNode) { - handlerSets.push(...this.#getHandlerSets(astNode, method, node.#params)); - astNode.#params = params; - tempNodes.push(astNode); - } - continue; - } - const [key, name, matcher] = pattern; - if (!part && !(matcher instanceof RegExp)) { - continue; - } - const child = node.#children[key]; - const restPathString = parts.slice(i).join("/"); - if (matcher instanceof RegExp) { - const m = matcher.exec(restPathString); - if (m) { - params[name] = m[0]; - handlerSets.push(...this.#getHandlerSets(child, method, node.#params, params)); - if (Object.keys(child.#children).length) { - child.#params = params; - const componentCount = m[0].match(/\//)?.length ?? 0; - const targetCurNodes = curNodesQueue[componentCount] ||= []; - targetCurNodes.push(child); - } - continue; - } - } - if (matcher === true || matcher.test(part)) { - params[name] = part; - if (isLast) { - handlerSets.push(...this.#getHandlerSets(child, method, params, node.#params)); - if (child.#children["*"]) { - handlerSets.push( - ...this.#getHandlerSets(child.#children["*"], method, params, node.#params) - ); - } - } else { - child.#params = params; - tempNodes.push(child); - } - } - } - } - curNodes = tempNodes.concat(curNodesQueue.shift() ?? []); - } - if (handlerSets.length > 1) { - handlerSets.sort((a, b) => { - return a.score - b.score; - }); - } - return [handlerSets.map(({ handler, params }) => [handler, params])]; - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Node -}); diff --git a/node_modules/hono/dist/cjs/router/trie-router/router.js b/node_modules/hono/dist/cjs/router/trie-router/router.js deleted file mode 100644 index 9c2133f..0000000 --- a/node_modules/hono/dist/cjs/router/trie-router/router.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var router_exports = {}; -__export(router_exports, { - TrieRouter: () => TrieRouter -}); -module.exports = __toCommonJS(router_exports); -var import_url = require("../../utils/url"); -var import_node = require("./node"); -class TrieRouter { - name = "TrieRouter"; - #node; - constructor() { - this.#node = new import_node.Node(); - } - add(method, path, handler) { - const results = (0, import_url.checkOptionalParameter)(path); - if (results) { - for (let i = 0, len = results.length; i < len; i++) { - this.#node.insert(method, results[i], handler); - } - return; - } - this.#node.insert(method, path, handler); - } - match(method, path) { - return this.#node.search(method, path); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - TrieRouter -}); diff --git a/node_modules/hono/dist/cjs/types.js b/node_modules/hono/dist/cjs/types.js deleted file mode 100644 index 2daf730..0000000 --- a/node_modules/hono/dist/cjs/types.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var types_exports = {}; -__export(types_exports, { - FetchEventLike: () => FetchEventLike -}); -module.exports = __toCommonJS(types_exports); -class FetchEventLike { -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - FetchEventLike -}); diff --git a/node_modules/hono/dist/cjs/utils/accept.js b/node_modules/hono/dist/cjs/utils/accept.js deleted file mode 100644 index d717757..0000000 --- a/node_modules/hono/dist/cjs/utils/accept.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var accept_exports = {}; -__export(accept_exports, { - parseAccept: () => parseAccept -}); -module.exports = __toCommonJS(accept_exports); -const parseAccept = (acceptHeader) => { - if (!acceptHeader) { - return []; - } - const acceptValues = acceptHeader.split(",").map((value, index) => ({ value, index })); - return acceptValues.map(parseAcceptValue).filter((item) => Boolean(item)).sort(sortByQualityAndIndex).map(({ type, params, q }) => ({ type, params, q })); -}; -const parseAcceptValueRegex = /;(?=(?:(?:[^"]*"){2})*[^"]*$)/; -const parseAcceptValue = ({ value, index }) => { - const parts = value.trim().split(parseAcceptValueRegex).map((s) => s.trim()); - const type = parts[0]; - if (!type) { - return null; - } - const params = parseParams(parts.slice(1)); - const q = parseQuality(params.q); - return { type, params, q, index }; -}; -const parseParams = (paramParts) => { - return paramParts.reduce((acc, param) => { - const [key, val] = param.split("=").map((s) => s.trim()); - if (key && val) { - acc[key] = val; - } - return acc; - }, {}); -}; -const parseQuality = (qVal) => { - if (qVal === void 0) { - return 1; - } - if (qVal === "") { - return 1; - } - if (qVal === "NaN") { - return 0; - } - const num = Number(qVal); - if (num === Infinity) { - return 1; - } - if (num === -Infinity) { - return 0; - } - if (Number.isNaN(num)) { - return 1; - } - if (num < 0 || num > 1) { - return 1; - } - return num; -}; -const sortByQualityAndIndex = (a, b) => { - const qDiff = b.q - a.q; - if (qDiff !== 0) { - return qDiff; - } - return a.index - b.index; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - parseAccept -}); diff --git a/node_modules/hono/dist/cjs/utils/basic-auth.js b/node_modules/hono/dist/cjs/utils/basic-auth.js deleted file mode 100644 index a8d4719..0000000 --- a/node_modules/hono/dist/cjs/utils/basic-auth.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var basic_auth_exports = {}; -__export(basic_auth_exports, { - auth: () => auth -}); -module.exports = __toCommonJS(basic_auth_exports); -var import_encode = require("./encode"); -const CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/; -const USER_PASS_REGEXP = /^([^:]*):(.*)$/; -const utf8Decoder = new TextDecoder(); -const auth = (req) => { - const match = CREDENTIALS_REGEXP.exec(req.headers.get("Authorization") || ""); - if (!match) { - return void 0; - } - let userPass = void 0; - try { - userPass = USER_PASS_REGEXP.exec(utf8Decoder.decode((0, import_encode.decodeBase64)(match[1]))); - } catch { - } - if (!userPass) { - return void 0; - } - return { username: userPass[1], password: userPass[2] }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - auth -}); diff --git a/node_modules/hono/dist/cjs/utils/body.js b/node_modules/hono/dist/cjs/utils/body.js deleted file mode 100644 index cbcb761..0000000 --- a/node_modules/hono/dist/cjs/utils/body.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var body_exports = {}; -__export(body_exports, { - parseBody: () => parseBody -}); -module.exports = __toCommonJS(body_exports); -var import_request = require("../request"); -const parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => { - const { all = false, dot = false } = options; - const headers = request instanceof import_request.HonoRequest ? request.raw.headers : request.headers; - const contentType = headers.get("Content-Type"); - if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) { - return parseFormData(request, { all, dot }); - } - return {}; -}; -async function parseFormData(request, options) { - const formData = await request.formData(); - if (formData) { - return convertFormDataToBodyData(formData, options); - } - return {}; -} -function convertFormDataToBodyData(formData, options) { - const form = /* @__PURE__ */ Object.create(null); - formData.forEach((value, key) => { - const shouldParseAllValues = options.all || key.endsWith("[]"); - if (!shouldParseAllValues) { - form[key] = value; - } else { - handleParsingAllValues(form, key, value); - } - }); - if (options.dot) { - Object.entries(form).forEach(([key, value]) => { - const shouldParseDotValues = key.includes("."); - if (shouldParseDotValues) { - handleParsingNestedValues(form, key, value); - delete form[key]; - } - }); - } - return form; -} -const handleParsingAllValues = (form, key, value) => { - if (form[key] !== void 0) { - if (Array.isArray(form[key])) { - ; - form[key].push(value); - } else { - form[key] = [form[key], value]; - } - } else { - if (!key.endsWith("[]")) { - form[key] = value; - } else { - form[key] = [value]; - } - } -}; -const handleParsingNestedValues = (form, key, value) => { - let nestedForm = form; - const keys = key.split("."); - keys.forEach((key2, index) => { - if (index === keys.length - 1) { - nestedForm[key2] = value; - } else { - if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) { - nestedForm[key2] = /* @__PURE__ */ Object.create(null); - } - nestedForm = nestedForm[key2]; - } - }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - parseBody -}); diff --git a/node_modules/hono/dist/cjs/utils/buffer.js b/node_modules/hono/dist/cjs/utils/buffer.js deleted file mode 100644 index fbd826f..0000000 --- a/node_modules/hono/dist/cjs/utils/buffer.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var buffer_exports = {}; -__export(buffer_exports, { - bufferToFormData: () => bufferToFormData, - bufferToString: () => bufferToString, - equal: () => equal, - timingSafeEqual: () => timingSafeEqual -}); -module.exports = __toCommonJS(buffer_exports); -var import_crypto = require("./crypto"); -const equal = (a, b) => { - if (a === b) { - return true; - } - if (a.byteLength !== b.byteLength) { - return false; - } - const va = new DataView(a); - const vb = new DataView(b); - let i = va.byteLength; - while (i--) { - if (va.getUint8(i) !== vb.getUint8(i)) { - return false; - } - } - return true; -}; -const timingSafeEqual = async (a, b, hashFunction) => { - if (!hashFunction) { - hashFunction = import_crypto.sha256; - } - const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]); - if (!sa || !sb) { - return false; - } - return sa === sb && a === b; -}; -const bufferToString = (buffer) => { - if (buffer instanceof ArrayBuffer) { - const enc = new TextDecoder("utf-8"); - return enc.decode(buffer); - } - return buffer; -}; -const bufferToFormData = (arrayBuffer, contentType) => { - const response = new Response(arrayBuffer, { - headers: { - "Content-Type": contentType - } - }); - return response.formData(); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - bufferToFormData, - bufferToString, - equal, - timingSafeEqual -}); diff --git a/node_modules/hono/dist/cjs/utils/color.js b/node_modules/hono/dist/cjs/utils/color.js deleted file mode 100644 index 9383515..0000000 --- a/node_modules/hono/dist/cjs/utils/color.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var color_exports = {}; -__export(color_exports, { - getColorEnabled: () => getColorEnabled, - getColorEnabledAsync: () => getColorEnabledAsync -}); -module.exports = __toCommonJS(color_exports); -function getColorEnabled() { - const { process, Deno } = globalThis; - const isNoColor = typeof Deno?.noColor === "boolean" ? Deno.noColor : process !== void 0 ? ( - // eslint-disable-next-line no-unsafe-optional-chaining - "NO_COLOR" in process?.env - ) : false; - return !isNoColor; -} -async function getColorEnabledAsync() { - const { navigator } = globalThis; - const cfWorkers = "cloudflare:workers"; - const isNoColor = navigator !== void 0 && navigator.userAgent === "Cloudflare-Workers" ? await (async () => { - try { - return "NO_COLOR" in ((await import(cfWorkers)).env ?? {}); - } catch { - return false; - } - })() : !getColorEnabled(); - return !isNoColor; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - getColorEnabled, - getColorEnabledAsync -}); diff --git a/node_modules/hono/dist/cjs/utils/compress.js b/node_modules/hono/dist/cjs/utils/compress.js deleted file mode 100644 index a7c2098..0000000 --- a/node_modules/hono/dist/cjs/utils/compress.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var compress_exports = {}; -__export(compress_exports, { - COMPRESSIBLE_CONTENT_TYPE_REGEX: () => COMPRESSIBLE_CONTENT_TYPE_REGEX -}); -module.exports = __toCommonJS(compress_exports); -const COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/(?!event-stream(?:[;\s]|$))[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - COMPRESSIBLE_CONTENT_TYPE_REGEX -}); diff --git a/node_modules/hono/dist/cjs/utils/concurrent.js b/node_modules/hono/dist/cjs/utils/concurrent.js deleted file mode 100644 index 56fa28d..0000000 --- a/node_modules/hono/dist/cjs/utils/concurrent.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var concurrent_exports = {}; -__export(concurrent_exports, { - createPool: () => createPool -}); -module.exports = __toCommonJS(concurrent_exports); -const DEFAULT_CONCURRENCY = 1024; -const createPool = ({ - concurrency, - interval -} = {}) => { - concurrency ||= DEFAULT_CONCURRENCY; - if (concurrency === Infinity) { - return { - run: async (fn) => fn() - }; - } - const pool = /* @__PURE__ */ new Set(); - const run = async (fn, promise, resolve) => { - if (pool.size >= concurrency) { - promise ||= new Promise((r) => resolve = r); - setTimeout(() => run(fn, promise, resolve)); - return promise; - } - const marker = {}; - pool.add(marker); - const result = await fn(); - if (interval) { - setTimeout(() => pool.delete(marker), interval); - } else { - pool.delete(marker); - } - if (resolve) { - resolve(result); - return promise; - } else { - return result; - } - }; - return { run }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createPool -}); diff --git a/node_modules/hono/dist/cjs/utils/constants.js b/node_modules/hono/dist/cjs/utils/constants.js deleted file mode 100644 index 08c127f..0000000 --- a/node_modules/hono/dist/cjs/utils/constants.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var constants_exports = {}; -__export(constants_exports, { - COMPOSED_HANDLER: () => COMPOSED_HANDLER -}); -module.exports = __toCommonJS(constants_exports); -const COMPOSED_HANDLER = "__COMPOSED_HANDLER"; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - COMPOSED_HANDLER -}); diff --git a/node_modules/hono/dist/cjs/utils/cookie.js b/node_modules/hono/dist/cjs/utils/cookie.js deleted file mode 100644 index e8f1134..0000000 --- a/node_modules/hono/dist/cjs/utils/cookie.js +++ /dev/null @@ -1,173 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var cookie_exports = {}; -__export(cookie_exports, { - parse: () => parse, - parseSigned: () => parseSigned, - serialize: () => serialize, - serializeSigned: () => serializeSigned -}); -module.exports = __toCommonJS(cookie_exports); -var import_url = require("./url"); -const algorithm = { name: "HMAC", hash: "SHA-256" }; -const getCryptoKey = async (secret) => { - const secretBuf = typeof secret === "string" ? new TextEncoder().encode(secret) : secret; - return await crypto.subtle.importKey("raw", secretBuf, algorithm, false, ["sign", "verify"]); -}; -const makeSignature = async (value, secret) => { - const key = await getCryptoKey(secret); - const signature = await crypto.subtle.sign(algorithm.name, key, new TextEncoder().encode(value)); - return btoa(String.fromCharCode(...new Uint8Array(signature))); -}; -const verifySignature = async (base64Signature, value, secret) => { - try { - const signatureBinStr = atob(base64Signature); - const signature = new Uint8Array(signatureBinStr.length); - for (let i = 0, len = signatureBinStr.length; i < len; i++) { - signature[i] = signatureBinStr.charCodeAt(i); - } - return await crypto.subtle.verify(algorithm, secret, signature, new TextEncoder().encode(value)); - } catch { - return false; - } -}; -const validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/; -const validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/; -const parse = (cookie, name) => { - if (name && cookie.indexOf(name) === -1) { - return {}; - } - const pairs = cookie.trim().split(";"); - const parsedCookie = {}; - for (let pairStr of pairs) { - pairStr = pairStr.trim(); - const valueStartPos = pairStr.indexOf("="); - if (valueStartPos === -1) { - continue; - } - const cookieName = pairStr.substring(0, valueStartPos).trim(); - if (name && name !== cookieName || !validCookieNameRegEx.test(cookieName)) { - continue; - } - let cookieValue = pairStr.substring(valueStartPos + 1).trim(); - if (cookieValue.startsWith('"') && cookieValue.endsWith('"')) { - cookieValue = cookieValue.slice(1, -1); - } - if (validCookieValueRegEx.test(cookieValue)) { - parsedCookie[cookieName] = cookieValue.indexOf("%") !== -1 ? (0, import_url.tryDecode)(cookieValue, import_url.decodeURIComponent_) : cookieValue; - if (name) { - break; - } - } - } - return parsedCookie; -}; -const parseSigned = async (cookie, secret, name) => { - const parsedCookie = {}; - const secretKey = await getCryptoKey(secret); - for (const [key, value] of Object.entries(parse(cookie, name))) { - const signatureStartPos = value.lastIndexOf("."); - if (signatureStartPos < 1) { - continue; - } - const signedValue = value.substring(0, signatureStartPos); - const signature = value.substring(signatureStartPos + 1); - if (signature.length !== 44 || !signature.endsWith("=")) { - continue; - } - const isVerified = await verifySignature(signature, signedValue, secretKey); - parsedCookie[key] = isVerified ? signedValue : false; - } - return parsedCookie; -}; -const _serialize = (name, value, opt = {}) => { - let cookie = `${name}=${value}`; - if (name.startsWith("__Secure-") && !opt.secure) { - throw new Error("__Secure- Cookie must have Secure attributes"); - } - if (name.startsWith("__Host-")) { - if (!opt.secure) { - throw new Error("__Host- Cookie must have Secure attributes"); - } - if (opt.path !== "/") { - throw new Error('__Host- Cookie must have Path attributes with "/"'); - } - if (opt.domain) { - throw new Error("__Host- Cookie must not have Domain attributes"); - } - } - if (opt && typeof opt.maxAge === "number" && opt.maxAge >= 0) { - if (opt.maxAge > 3456e4) { - throw new Error( - "Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration." - ); - } - cookie += `; Max-Age=${opt.maxAge | 0}`; - } - if (opt.domain && opt.prefix !== "host") { - cookie += `; Domain=${opt.domain}`; - } - if (opt.path) { - cookie += `; Path=${opt.path}`; - } - if (opt.expires) { - if (opt.expires.getTime() - Date.now() > 3456e7) { - throw new Error( - "Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future." - ); - } - cookie += `; Expires=${opt.expires.toUTCString()}`; - } - if (opt.httpOnly) { - cookie += "; HttpOnly"; - } - if (opt.secure) { - cookie += "; Secure"; - } - if (opt.sameSite) { - cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`; - } - if (opt.priority) { - cookie += `; Priority=${opt.priority.charAt(0).toUpperCase() + opt.priority.slice(1)}`; - } - if (opt.partitioned) { - if (!opt.secure) { - throw new Error("Partitioned Cookie must have Secure attributes"); - } - cookie += "; Partitioned"; - } - return cookie; -}; -const serialize = (name, value, opt) => { - value = encodeURIComponent(value); - return _serialize(name, value, opt); -}; -const serializeSigned = async (name, value, secret, opt = {}) => { - const signature = await makeSignature(value, secret); - value = `${value}.${signature}`; - value = encodeURIComponent(value); - return _serialize(name, value, opt); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - parse, - parseSigned, - serialize, - serializeSigned -}); diff --git a/node_modules/hono/dist/cjs/utils/crypto.js b/node_modules/hono/dist/cjs/utils/crypto.js deleted file mode 100644 index 90e3757..0000000 --- a/node_modules/hono/dist/cjs/utils/crypto.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var crypto_exports = {}; -__export(crypto_exports, { - createHash: () => createHash, - md5: () => md5, - sha1: () => sha1, - sha256: () => sha256 -}); -module.exports = __toCommonJS(crypto_exports); -const sha256 = async (data) => { - const algorithm = { name: "SHA-256", alias: "sha256" }; - const hash = await createHash(data, algorithm); - return hash; -}; -const sha1 = async (data) => { - const algorithm = { name: "SHA-1", alias: "sha1" }; - const hash = await createHash(data, algorithm); - return hash; -}; -const md5 = async (data) => { - const algorithm = { name: "MD5", alias: "md5" }; - const hash = await createHash(data, algorithm); - return hash; -}; -const createHash = async (data, algorithm) => { - let sourceBuffer; - if (ArrayBuffer.isView(data) || data instanceof ArrayBuffer) { - sourceBuffer = data; - } else { - if (typeof data === "object") { - data = JSON.stringify(data); - } - sourceBuffer = new TextEncoder().encode(String(data)); - } - if (crypto && crypto.subtle) { - const buffer = await crypto.subtle.digest( - { - name: algorithm.name - }, - sourceBuffer - ); - const hash = Array.prototype.map.call(new Uint8Array(buffer), (x) => ("00" + x.toString(16)).slice(-2)).join(""); - return hash; - } - return null; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createHash, - md5, - sha1, - sha256 -}); diff --git a/node_modules/hono/dist/cjs/utils/encode.js b/node_modules/hono/dist/cjs/utils/encode.js deleted file mode 100644 index dcb6469..0000000 --- a/node_modules/hono/dist/cjs/utils/encode.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var encode_exports = {}; -__export(encode_exports, { - decodeBase64: () => decodeBase64, - decodeBase64Url: () => decodeBase64Url, - encodeBase64: () => encodeBase64, - encodeBase64Url: () => encodeBase64Url -}); -module.exports = __toCommonJS(encode_exports); -const decodeBase64Url = (str) => { - return decodeBase64(str.replace(/_|-/g, (m) => ({ _: "/", "-": "+" })[m] ?? m)); -}; -const encodeBase64Url = (buf) => encodeBase64(buf).replace(/\/|\+/g, (m) => ({ "/": "_", "+": "-" })[m] ?? m); -const 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); -}; -const 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; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - decodeBase64, - decodeBase64Url, - encodeBase64, - encodeBase64Url -}); diff --git a/node_modules/hono/dist/cjs/utils/filepath.js b/node_modules/hono/dist/cjs/utils/filepath.js deleted file mode 100644 index 59b6ff6..0000000 --- a/node_modules/hono/dist/cjs/utils/filepath.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var filepath_exports = {}; -__export(filepath_exports, { - getFilePath: () => getFilePath, - getFilePathWithoutDefaultDocument: () => getFilePathWithoutDefaultDocument -}); -module.exports = __toCommonJS(filepath_exports); -const getFilePath = (options) => { - let filename = options.filename; - const defaultDocument = options.defaultDocument || "index.html"; - if (filename.endsWith("/")) { - filename = filename.concat(defaultDocument); - } else if (!filename.match(/\.[a-zA-Z0-9_-]+$/)) { - filename = filename.concat("/" + defaultDocument); - } - const path = getFilePathWithoutDefaultDocument({ - root: options.root, - filename - }); - return path; -}; -const getFilePathWithoutDefaultDocument = (options) => { - let root = options.root || ""; - let filename = options.filename; - if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) { - return; - } - filename = filename.replace(/^\.?[\/\\]/, ""); - filename = filename.replace(/\\/, "/"); - root = root.replace(/\/$/, ""); - let path = root ? root + "/" + filename : filename; - path = path.replace(/^\.?\//, ""); - if (root[0] !== "/" && path[0] === "/") { - return; - } - return path; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - getFilePath, - getFilePathWithoutDefaultDocument -}); diff --git a/node_modules/hono/dist/cjs/utils/handler.js b/node_modules/hono/dist/cjs/utils/handler.js deleted file mode 100644 index c3d51da..0000000 --- a/node_modules/hono/dist/cjs/utils/handler.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var handler_exports = {}; -__export(handler_exports, { - findTargetHandler: () => findTargetHandler, - isMiddleware: () => isMiddleware -}); -module.exports = __toCommonJS(handler_exports); -var import_constants = require("./constants"); -const isMiddleware = (handler) => handler.length > 1; -const findTargetHandler = (handler) => { - return handler[import_constants.COMPOSED_HANDLER] ? ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - findTargetHandler(handler[import_constants.COMPOSED_HANDLER]) - ) : handler; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - findTargetHandler, - isMiddleware -}); diff --git a/node_modules/hono/dist/cjs/utils/headers.js b/node_modules/hono/dist/cjs/utils/headers.js deleted file mode 100644 index e58ee38..0000000 --- a/node_modules/hono/dist/cjs/utils/headers.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var headers_exports = {}; -module.exports = __toCommonJS(headers_exports); diff --git a/node_modules/hono/dist/cjs/utils/html.js b/node_modules/hono/dist/cjs/utils/html.js deleted file mode 100644 index 508c4be..0000000 --- a/node_modules/hono/dist/cjs/utils/html.js +++ /dev/null @@ -1,151 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var html_exports = {}; -__export(html_exports, { - HtmlEscapedCallbackPhase: () => HtmlEscapedCallbackPhase, - escapeToBuffer: () => escapeToBuffer, - raw: () => raw, - resolveCallback: () => resolveCallback, - resolveCallbackSync: () => resolveCallbackSync, - stringBufferToString: () => stringBufferToString -}); -module.exports = __toCommonJS(html_exports); -const HtmlEscapedCallbackPhase = { - Stringify: 1, - BeforeStream: 2, - Stream: 3 -}; -const raw = (value, callbacks) => { - const escapedString = new String(value); - escapedString.isEscaped = true; - escapedString.callbacks = callbacks; - return escapedString; -}; -const escapeRe = /[&<>'"]/; -const stringBufferToString = async (buffer, callbacks) => { - let str = ""; - callbacks ||= []; - const resolvedBuffer = await Promise.all(buffer); - for (let i = resolvedBuffer.length - 1; ; i--) { - str += resolvedBuffer[i]; - i--; - if (i < 0) { - break; - } - let r = resolvedBuffer[i]; - if (typeof r === "object") { - callbacks.push(...r.callbacks || []); - } - const isEscaped = r.isEscaped; - r = await (typeof r === "object" ? r.toString() : r); - if (typeof r === "object") { - callbacks.push(...r.callbacks || []); - } - if (r.isEscaped ?? isEscaped) { - str += r; - } else { - const buf = [str]; - escapeToBuffer(r, buf); - str = buf[0]; - } - } - return raw(str, callbacks); -}; -const escapeToBuffer = (str, buffer) => { - const match = str.search(escapeRe); - if (match === -1) { - buffer[0] += str; - return; - } - let escape; - let index; - let lastIndex = 0; - for (index = match; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: - escape = """; - break; - case 39: - escape = "'"; - break; - case 38: - escape = "&"; - break; - case 60: - escape = "<"; - break; - case 62: - escape = ">"; - break; - default: - continue; - } - buffer[0] += str.substring(lastIndex, index) + escape; - lastIndex = index + 1; - } - buffer[0] += str.substring(lastIndex, index); -}; -const resolveCallbackSync = (str) => { - const callbacks = str.callbacks; - if (!callbacks?.length) { - return str; - } - const buffer = [str]; - const context = {}; - callbacks.forEach((c) => c({ phase: HtmlEscapedCallbackPhase.Stringify, buffer, context })); - return buffer[0]; -}; -const resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => { - if (typeof str === "object" && !(str instanceof String)) { - if (!(str instanceof Promise)) { - str = str.toString(); - } - if (str instanceof Promise) { - str = await str; - } - } - const callbacks = str.callbacks; - if (!callbacks?.length) { - return Promise.resolve(str); - } - if (buffer) { - buffer[0] += str; - } else { - buffer = [str]; - } - const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then( - (res) => Promise.all( - res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer)) - ).then(() => buffer[0]) - ); - if (preserveCallbacks) { - return raw(await resStr, callbacks); - } else { - return resStr; - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HtmlEscapedCallbackPhase, - escapeToBuffer, - raw, - resolveCallback, - resolveCallbackSync, - stringBufferToString -}); diff --git a/node_modules/hono/dist/cjs/utils/http-status.js b/node_modules/hono/dist/cjs/utils/http-status.js deleted file mode 100644 index cbc154b..0000000 --- a/node_modules/hono/dist/cjs/utils/http-status.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var http_status_exports = {}; -module.exports = __toCommonJS(http_status_exports); diff --git a/node_modules/hono/dist/cjs/utils/ipaddr.js b/node_modules/hono/dist/cjs/utils/ipaddr.js deleted file mode 100644 index dd0544a..0000000 --- a/node_modules/hono/dist/cjs/utils/ipaddr.js +++ /dev/null @@ -1,130 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var ipaddr_exports = {}; -__export(ipaddr_exports, { - convertIPv4BinaryToString: () => convertIPv4BinaryToString, - convertIPv4ToBinary: () => convertIPv4ToBinary, - convertIPv6BinaryToString: () => convertIPv6BinaryToString, - convertIPv6ToBinary: () => convertIPv6ToBinary, - distinctRemoteAddr: () => distinctRemoteAddr, - expandIPv6: () => expandIPv6 -}); -module.exports = __toCommonJS(ipaddr_exports); -const expandIPv6 = (ipV6) => { - const sections = ipV6.split(":"); - if (IPV4_REGEX.test(sections.at(-1))) { - sections.splice( - -1, - 1, - ...convertIPv6BinaryToString(convertIPv4ToBinary(sections.at(-1))).substring(2).split(":") - // => ['7f00', '0001'] - ); - } - for (let i = 0; i < sections.length; i++) { - const node = sections[i]; - if (node !== "") { - sections[i] = node.padStart(4, "0"); - } else { - sections[i + 1] === "" && sections.splice(i + 1, 1); - sections[i] = new Array(8 - sections.length + 1).fill("0000").join(":"); - } - } - return sections.join(":"); -}; -const IPV4_OCTET_PART = "(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])"; -const IPV4_REGEX = new RegExp(`^(?:${IPV4_OCTET_PART}\\.){3}${IPV4_OCTET_PART}$`); -const distinctRemoteAddr = (remoteAddr) => { - if (IPV4_REGEX.test(remoteAddr)) { - return "IPv4"; - } - if (remoteAddr.includes(":")) { - return "IPv6"; - } -}; -const convertIPv4ToBinary = (ipv4) => { - const parts = ipv4.split("."); - let result = 0n; - for (let i = 0; i < 4; i++) { - result <<= 8n; - result += BigInt(parts[i]); - } - return result; -}; -const convertIPv6ToBinary = (ipv6) => { - const sections = expandIPv6(ipv6).split(":"); - let result = 0n; - for (let i = 0; i < 8; i++) { - result <<= 16n; - result += BigInt(parseInt(sections[i], 16)); - } - return result; -}; -const convertIPv4BinaryToString = (ipV4) => { - const sections = []; - for (let i = 0; i < 4; i++) { - sections.push(ipV4 >> BigInt(8 * (3 - i)) & 0xffn); - } - return sections.join("."); -}; -const convertIPv6BinaryToString = (ipV6) => { - if (ipV6 >> 32n === 0xffffn) { - return `::ffff:${convertIPv4BinaryToString(ipV6 & 0xffffffffn)}`; - } - const sections = []; - for (let i = 0; i < 8; i++) { - sections.push((ipV6 >> BigInt(16 * (7 - i)) & 0xffffn).toString(16)); - } - let currentZeroStart = -1; - let maxZeroStart = -1; - let maxZeroEnd = -1; - for (let i = 0; i < 8; i++) { - if (sections[i] === "0") { - if (currentZeroStart === -1) { - currentZeroStart = i; - } - } else { - if (currentZeroStart > -1) { - if (i - currentZeroStart > maxZeroEnd - maxZeroStart) { - maxZeroStart = currentZeroStart; - maxZeroEnd = i; - } - currentZeroStart = -1; - } - } - } - if (currentZeroStart > -1) { - if (8 - currentZeroStart > maxZeroEnd - maxZeroStart) { - maxZeroStart = currentZeroStart; - maxZeroEnd = 8; - } - } - if (maxZeroStart !== -1) { - sections.splice(maxZeroStart, maxZeroEnd - maxZeroStart, ":"); - } - return sections.join(":").replace(/:{2,}/g, "::"); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - convertIPv4BinaryToString, - convertIPv4ToBinary, - convertIPv6BinaryToString, - convertIPv6ToBinary, - distinctRemoteAddr, - expandIPv6 -}); diff --git a/node_modules/hono/dist/cjs/utils/jwt/index.js b/node_modules/hono/dist/cjs/utils/jwt/index.js deleted file mode 100644 index eade561..0000000 --- a/node_modules/hono/dist/cjs/utils/jwt/index.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jwt_exports = {}; -__export(jwt_exports, { - Jwt: () => Jwt -}); -module.exports = __toCommonJS(jwt_exports); -var import_jwt = require("./jwt"); -const Jwt = { sign: import_jwt.sign, verify: import_jwt.verify, decode: import_jwt.decode, verifyWithJwks: import_jwt.verifyWithJwks }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Jwt -}); diff --git a/node_modules/hono/dist/cjs/utils/jwt/jwa.js b/node_modules/hono/dist/cjs/utils/jwt/jwa.js deleted file mode 100644 index 5094b50..0000000 --- a/node_modules/hono/dist/cjs/utils/jwt/jwa.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jwa_exports = {}; -__export(jwa_exports, { - AlgorithmTypes: () => AlgorithmTypes -}); -module.exports = __toCommonJS(jwa_exports); -var AlgorithmTypes = /* @__PURE__ */ ((AlgorithmTypes2) => { - AlgorithmTypes2["HS256"] = "HS256"; - AlgorithmTypes2["HS384"] = "HS384"; - AlgorithmTypes2["HS512"] = "HS512"; - AlgorithmTypes2["RS256"] = "RS256"; - AlgorithmTypes2["RS384"] = "RS384"; - AlgorithmTypes2["RS512"] = "RS512"; - AlgorithmTypes2["PS256"] = "PS256"; - AlgorithmTypes2["PS384"] = "PS384"; - AlgorithmTypes2["PS512"] = "PS512"; - AlgorithmTypes2["ES256"] = "ES256"; - AlgorithmTypes2["ES384"] = "ES384"; - AlgorithmTypes2["ES512"] = "ES512"; - AlgorithmTypes2["EdDSA"] = "EdDSA"; - return AlgorithmTypes2; -})(AlgorithmTypes || {}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - AlgorithmTypes -}); diff --git a/node_modules/hono/dist/cjs/utils/jwt/jws.js b/node_modules/hono/dist/cjs/utils/jwt/jws.js deleted file mode 100644 index 0f0c88e..0000000 --- a/node_modules/hono/dist/cjs/utils/jwt/jws.js +++ /dev/null @@ -1,216 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jws_exports = {}; -__export(jws_exports, { - signing: () => signing, - verifying: () => verifying -}); -module.exports = __toCommonJS(jws_exports); -var import_adapter = require("../../helper/adapter"); -var import_encode = require("../encode"); -var import_types = require("./types"); -var import_utf8 = require("./utf8"); -async function signing(privateKey, alg, data) { - const algorithm = getKeyAlgorithm(alg); - const cryptoKey = await importPrivateKey(privateKey, algorithm); - return await crypto.subtle.sign(algorithm, cryptoKey, data); -} -async function verifying(publicKey, alg, signature, data) { - const algorithm = getKeyAlgorithm(alg); - const cryptoKey = await importPublicKey(publicKey, algorithm); - return await crypto.subtle.verify(algorithm, cryptoKey, signature, data); -} -function pemToBinary(pem) { - return (0, import_encode.decodeBase64)(pem.replace(/-+(BEGIN|END).*/g, "").replace(/\s/g, "")); -} -async function importPrivateKey(key, alg) { - if (!crypto.subtle || !crypto.subtle.importKey) { - throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); - } - if (isCryptoKey(key)) { - if (key.type !== "private" && key.type !== "secret") { - throw new Error( - `unexpected key type: CryptoKey.type is ${key.type}, expected private or secret` - ); - } - return key; - } - const usages = [import_types.CryptoKeyUsage.Sign]; - if (typeof key === "object") { - return await crypto.subtle.importKey("jwk", key, alg, false, usages); - } - if (key.includes("PRIVATE")) { - return await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, false, usages); - } - return await crypto.subtle.importKey("raw", import_utf8.utf8Encoder.encode(key), alg, false, usages); -} -async function importPublicKey(key, alg) { - if (!crypto.subtle || !crypto.subtle.importKey) { - throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); - } - if (isCryptoKey(key)) { - if (key.type === "public" || key.type === "secret") { - return key; - } - key = await exportPublicJwkFrom(key); - } - if (typeof key === "string" && key.includes("PRIVATE")) { - const privateKey = await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, true, [ - import_types.CryptoKeyUsage.Sign - ]); - key = await exportPublicJwkFrom(privateKey); - } - const usages = [import_types.CryptoKeyUsage.Verify]; - if (typeof key === "object") { - return await crypto.subtle.importKey("jwk", key, alg, false, usages); - } - if (key.includes("PUBLIC")) { - return await crypto.subtle.importKey("spki", pemToBinary(key), alg, false, usages); - } - return await crypto.subtle.importKey("raw", import_utf8.utf8Encoder.encode(key), alg, false, usages); -} -async function exportPublicJwkFrom(privateKey) { - if (privateKey.type !== "private") { - throw new Error(`unexpected key type: ${privateKey.type}`); - } - if (!privateKey.extractable) { - throw new Error("unexpected private key is unextractable"); - } - const jwk = await crypto.subtle.exportKey("jwk", privateKey); - const { kty } = jwk; - const { alg, e, n } = jwk; - const { crv, x, y } = jwk; - return { kty, alg, e, n, crv, x, y, key_ops: [import_types.CryptoKeyUsage.Verify] }; -} -function getKeyAlgorithm(name) { - switch (name) { - case "HS256": - return { - name: "HMAC", - hash: { - name: "SHA-256" - } - }; - case "HS384": - return { - name: "HMAC", - hash: { - name: "SHA-384" - } - }; - case "HS512": - return { - name: "HMAC", - hash: { - name: "SHA-512" - } - }; - case "RS256": - return { - name: "RSASSA-PKCS1-v1_5", - hash: { - name: "SHA-256" - } - }; - case "RS384": - return { - name: "RSASSA-PKCS1-v1_5", - hash: { - name: "SHA-384" - } - }; - case "RS512": - return { - name: "RSASSA-PKCS1-v1_5", - hash: { - name: "SHA-512" - } - }; - case "PS256": - return { - name: "RSA-PSS", - hash: { - name: "SHA-256" - }, - saltLength: 32 - // 256 >> 3 - }; - case "PS384": - return { - name: "RSA-PSS", - hash: { - name: "SHA-384" - }, - saltLength: 48 - // 384 >> 3 - }; - case "PS512": - return { - name: "RSA-PSS", - hash: { - name: "SHA-512" - }, - saltLength: 64 - // 512 >> 3, - }; - case "ES256": - return { - name: "ECDSA", - hash: { - name: "SHA-256" - }, - namedCurve: "P-256" - }; - case "ES384": - return { - name: "ECDSA", - hash: { - name: "SHA-384" - }, - namedCurve: "P-384" - }; - case "ES512": - return { - name: "ECDSA", - hash: { - name: "SHA-512" - }, - namedCurve: "P-521" - }; - case "EdDSA": - return { - name: "Ed25519", - namedCurve: "Ed25519" - }; - default: - throw new import_types.JwtAlgorithmNotImplemented(name); - } -} -function isCryptoKey(key) { - const runtime = (0, import_adapter.getRuntimeKey)(); - if (runtime === "node" && !!crypto.webcrypto) { - return key instanceof crypto.webcrypto.CryptoKey; - } - return key instanceof CryptoKey; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - signing, - verifying -}); diff --git a/node_modules/hono/dist/cjs/utils/jwt/jwt.js b/node_modules/hono/dist/cjs/utils/jwt/jwt.js deleted file mode 100644 index f4e8d2a..0000000 --- a/node_modules/hono/dist/cjs/utils/jwt/jwt.js +++ /dev/null @@ -1,210 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var jwt_exports = {}; -__export(jwt_exports, { - decode: () => decode, - decodeHeader: () => decodeHeader, - isTokenHeader: () => isTokenHeader, - sign: () => sign, - verify: () => verify, - verifyWithJwks: () => verifyWithJwks -}); -module.exports = __toCommonJS(jwt_exports); -var import_encode = require("../../utils/encode"); -var import_jwa = require("./jwa"); -var import_jws = require("./jws"); -var import_types = require("./types"); -var import_utf8 = require("./utf8"); -const encodeJwtPart = (part) => (0, import_encode.encodeBase64Url)(import_utf8.utf8Encoder.encode(JSON.stringify(part)).buffer).replace(/=/g, ""); -const encodeSignaturePart = (buf) => (0, import_encode.encodeBase64Url)(buf).replace(/=/g, ""); -const decodeJwtPart = (part) => JSON.parse(import_utf8.utf8Decoder.decode((0, import_encode.decodeBase64Url)(part))); -function isTokenHeader(obj) { - if (typeof obj === "object" && obj !== null) { - const objWithAlg = obj; - return "alg" in objWithAlg && Object.values(import_jwa.AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT"); - } - return false; -} -const sign = async (payload, privateKey, alg = "HS256") => { - const encodedPayload = encodeJwtPart(payload); - let encodedHeader; - if (typeof privateKey === "object" && "alg" in privateKey) { - alg = privateKey.alg; - encodedHeader = encodeJwtPart({ alg, typ: "JWT", kid: privateKey.kid }); - } else { - encodedHeader = encodeJwtPart({ alg, typ: "JWT" }); - } - const partialToken = `${encodedHeader}.${encodedPayload}`; - const signaturePart = await (0, import_jws.signing)(privateKey, alg, import_utf8.utf8Encoder.encode(partialToken)); - const signature = encodeSignaturePart(signaturePart); - return `${partialToken}.${signature}`; -}; -const verify = async (token, publicKey, algOrOptions) => { - if (!algOrOptions) { - throw new import_types.JwtAlgorithmRequired(); - } - const { - alg, - iss, - nbf = true, - exp = true, - iat = true, - aud - } = typeof algOrOptions === "string" ? { alg: algOrOptions } : algOrOptions; - if (!alg) { - throw new import_types.JwtAlgorithmRequired(); - } - const tokenParts = token.split("."); - if (tokenParts.length !== 3) { - throw new import_types.JwtTokenInvalid(token); - } - const { header, payload } = decode(token); - if (!isTokenHeader(header)) { - throw new import_types.JwtHeaderInvalid(header); - } - if (header.alg !== alg) { - throw new import_types.JwtAlgorithmMismatch(alg, header.alg); - } - const now = Date.now() / 1e3 | 0; - if (nbf && payload.nbf && payload.nbf > now) { - throw new import_types.JwtTokenNotBefore(token); - } - if (exp && payload.exp && payload.exp <= now) { - throw new import_types.JwtTokenExpired(token); - } - if (iat && payload.iat && now < payload.iat) { - throw new import_types.JwtTokenIssuedAt(now, payload.iat); - } - if (iss) { - if (!payload.iss) { - throw new import_types.JwtTokenIssuer(iss, null); - } - if (typeof iss === "string" && payload.iss !== iss) { - throw new import_types.JwtTokenIssuer(iss, payload.iss); - } - if (iss instanceof RegExp && !iss.test(payload.iss)) { - throw new import_types.JwtTokenIssuer(iss, payload.iss); - } - } - if (aud) { - if (!payload.aud) { - throw new import_types.JwtPayloadRequiresAud(payload); - } - const audiences = Array.isArray(payload.aud) ? payload.aud : [payload.aud]; - const matched = audiences.some( - (payloadAud) => aud instanceof RegExp ? aud.test(payloadAud) : typeof aud === "string" ? payloadAud === aud : Array.isArray(aud) && aud.includes(payloadAud) - ); - if (!matched) { - throw new import_types.JwtTokenAudience(aud, payload.aud); - } - } - const headerPayload = token.substring(0, token.lastIndexOf(".")); - const verified = await (0, import_jws.verifying)( - publicKey, - alg, - (0, import_encode.decodeBase64Url)(tokenParts[2]), - import_utf8.utf8Encoder.encode(headerPayload) - ); - if (!verified) { - throw new import_types.JwtTokenSignatureMismatched(token); - } - return payload; -}; -const symmetricAlgorithms = [ - import_jwa.AlgorithmTypes.HS256, - import_jwa.AlgorithmTypes.HS384, - import_jwa.AlgorithmTypes.HS512 -]; -const verifyWithJwks = async (token, options, init) => { - const verifyOpts = options.verification || {}; - const header = decodeHeader(token); - if (!isTokenHeader(header)) { - throw new import_types.JwtHeaderInvalid(header); - } - if (!header.kid) { - throw new import_types.JwtHeaderRequiresKid(header); - } - if (symmetricAlgorithms.includes(header.alg)) { - throw new import_types.JwtSymmetricAlgorithmNotAllowed(header.alg); - } - if (!options.allowedAlgorithms.includes(header.alg)) { - throw new import_types.JwtAlgorithmNotAllowed(header.alg, options.allowedAlgorithms); - } - if (options.jwks_uri) { - const response = await fetch(options.jwks_uri, init); - if (!response.ok) { - throw new Error(`failed to fetch JWKS from ${options.jwks_uri}`); - } - const data = await response.json(); - if (!data.keys) { - throw new Error('invalid JWKS response. "keys" field is missing'); - } - if (!Array.isArray(data.keys)) { - throw new Error('invalid JWKS response. "keys" field is not an array'); - } - if (options.keys) { - options.keys.push(...data.keys); - } else { - options.keys = data.keys; - } - } else if (!options.keys) { - throw new Error('verifyWithJwks requires options for either "keys" or "jwks_uri" or both'); - } - const matchingKey = options.keys.find((key) => key.kid === header.kid); - if (!matchingKey) { - throw new import_types.JwtTokenInvalid(token); - } - if (matchingKey.alg && matchingKey.alg !== header.alg) { - throw new import_types.JwtAlgorithmMismatch(matchingKey.alg, header.alg); - } - return await verify(token, matchingKey, { - alg: header.alg, - ...verifyOpts - }); -}; -const decode = (token) => { - try { - const [h, p] = token.split("."); - const header = decodeJwtPart(h); - const payload = decodeJwtPart(p); - return { - header, - payload - }; - } catch { - throw new import_types.JwtTokenInvalid(token); - } -}; -const decodeHeader = (token) => { - try { - const [h] = token.split("."); - return decodeJwtPart(h); - } catch { - throw new import_types.JwtTokenInvalid(token); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - decode, - decodeHeader, - isTokenHeader, - sign, - verify, - verifyWithJwks -}); diff --git a/node_modules/hono/dist/cjs/utils/jwt/types.js b/node_modules/hono/dist/cjs/utils/jwt/types.js deleted file mode 100644 index 855f793..0000000 --- a/node_modules/hono/dist/cjs/utils/jwt/types.js +++ /dev/null @@ -1,162 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var types_exports = {}; -__export(types_exports, { - CryptoKeyUsage: () => CryptoKeyUsage, - JwtAlgorithmMismatch: () => JwtAlgorithmMismatch, - JwtAlgorithmNotAllowed: () => JwtAlgorithmNotAllowed, - JwtAlgorithmNotImplemented: () => JwtAlgorithmNotImplemented, - JwtAlgorithmRequired: () => JwtAlgorithmRequired, - JwtHeaderInvalid: () => JwtHeaderInvalid, - JwtHeaderRequiresKid: () => JwtHeaderRequiresKid, - JwtPayloadRequiresAud: () => JwtPayloadRequiresAud, - JwtSymmetricAlgorithmNotAllowed: () => JwtSymmetricAlgorithmNotAllowed, - JwtTokenAudience: () => JwtTokenAudience, - JwtTokenExpired: () => JwtTokenExpired, - JwtTokenInvalid: () => JwtTokenInvalid, - JwtTokenIssuedAt: () => JwtTokenIssuedAt, - JwtTokenIssuer: () => JwtTokenIssuer, - JwtTokenNotBefore: () => JwtTokenNotBefore, - JwtTokenSignatureMismatched: () => JwtTokenSignatureMismatched -}); -module.exports = __toCommonJS(types_exports); -class JwtAlgorithmNotImplemented extends Error { - constructor(alg) { - super(`${alg} is not an implemented algorithm`); - this.name = "JwtAlgorithmNotImplemented"; - } -} -class JwtAlgorithmRequired extends Error { - constructor() { - super('JWT verification requires "alg" option to be specified'); - this.name = "JwtAlgorithmRequired"; - } -} -class JwtAlgorithmMismatch extends Error { - constructor(expected, actual) { - super(`JWT algorithm mismatch: expected "${expected}", got "${actual}"`); - this.name = "JwtAlgorithmMismatch"; - } -} -class JwtTokenInvalid extends Error { - constructor(token) { - super(`invalid JWT token: ${token}`); - this.name = "JwtTokenInvalid"; - } -} -class JwtTokenNotBefore extends Error { - constructor(token) { - super(`token (${token}) is being used before it's valid`); - this.name = "JwtTokenNotBefore"; - } -} -class JwtTokenExpired extends Error { - constructor(token) { - super(`token (${token}) expired`); - this.name = "JwtTokenExpired"; - } -} -class JwtTokenIssuedAt extends Error { - constructor(currentTimestamp, iat) { - super( - `Invalid "iat" claim, must be a valid number lower than "${currentTimestamp}" (iat: "${iat}")` - ); - this.name = "JwtTokenIssuedAt"; - } -} -class JwtTokenIssuer extends Error { - constructor(expected, iss) { - super(`expected issuer "${expected}", got ${iss ? `"${iss}"` : "none"} `); - this.name = "JwtTokenIssuer"; - } -} -class JwtHeaderInvalid extends Error { - constructor(header) { - super(`jwt header is invalid: ${JSON.stringify(header)}`); - this.name = "JwtHeaderInvalid"; - } -} -class JwtHeaderRequiresKid extends Error { - constructor(header) { - super(`required "kid" in jwt header: ${JSON.stringify(header)}`); - this.name = "JwtHeaderRequiresKid"; - } -} -class JwtSymmetricAlgorithmNotAllowed extends Error { - constructor(alg) { - super(`symmetric algorithm "${alg}" is not allowed for JWK verification`); - this.name = "JwtSymmetricAlgorithmNotAllowed"; - } -} -class JwtAlgorithmNotAllowed extends Error { - constructor(alg, allowedAlgorithms) { - super(`algorithm "${alg}" is not in the allowed list: [${allowedAlgorithms.join(", ")}]`); - this.name = "JwtAlgorithmNotAllowed"; - } -} -class JwtTokenSignatureMismatched extends Error { - constructor(token) { - super(`token(${token}) signature mismatched`); - this.name = "JwtTokenSignatureMismatched"; - } -} -class JwtPayloadRequiresAud extends Error { - constructor(payload) { - super(`required "aud" in jwt payload: ${JSON.stringify(payload)}`); - this.name = "JwtPayloadRequiresAud"; - } -} -class JwtTokenAudience extends Error { - constructor(expected, aud) { - super( - `expected audience "${Array.isArray(expected) ? expected.join(", ") : expected}", got "${aud}"` - ); - this.name = "JwtTokenAudience"; - } -} -var CryptoKeyUsage = /* @__PURE__ */ ((CryptoKeyUsage2) => { - CryptoKeyUsage2["Encrypt"] = "encrypt"; - CryptoKeyUsage2["Decrypt"] = "decrypt"; - CryptoKeyUsage2["Sign"] = "sign"; - CryptoKeyUsage2["Verify"] = "verify"; - CryptoKeyUsage2["DeriveKey"] = "deriveKey"; - CryptoKeyUsage2["DeriveBits"] = "deriveBits"; - CryptoKeyUsage2["WrapKey"] = "wrapKey"; - CryptoKeyUsage2["UnwrapKey"] = "unwrapKey"; - return CryptoKeyUsage2; -})(CryptoKeyUsage || {}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - CryptoKeyUsage, - JwtAlgorithmMismatch, - JwtAlgorithmNotAllowed, - JwtAlgorithmNotImplemented, - JwtAlgorithmRequired, - JwtHeaderInvalid, - JwtHeaderRequiresKid, - JwtPayloadRequiresAud, - JwtSymmetricAlgorithmNotAllowed, - JwtTokenAudience, - JwtTokenExpired, - JwtTokenInvalid, - JwtTokenIssuedAt, - JwtTokenIssuer, - JwtTokenNotBefore, - JwtTokenSignatureMismatched -}); diff --git a/node_modules/hono/dist/cjs/utils/jwt/utf8.js b/node_modules/hono/dist/cjs/utils/jwt/utf8.js deleted file mode 100644 index 9afa123..0000000 --- a/node_modules/hono/dist/cjs/utils/jwt/utf8.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var utf8_exports = {}; -__export(utf8_exports, { - utf8Decoder: () => utf8Decoder, - utf8Encoder: () => utf8Encoder -}); -module.exports = __toCommonJS(utf8_exports); -const utf8Encoder = new TextEncoder(); -const utf8Decoder = new TextDecoder(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - utf8Decoder, - utf8Encoder -}); diff --git a/node_modules/hono/dist/cjs/utils/mime.js b/node_modules/hono/dist/cjs/utils/mime.js deleted file mode 100644 index f3b1b82..0000000 --- a/node_modules/hono/dist/cjs/utils/mime.js +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var mime_exports = {}; -__export(mime_exports, { - getExtension: () => getExtension, - getMimeType: () => getMimeType, - mimes: () => baseMimes -}); -module.exports = __toCommonJS(mime_exports); -const getMimeType = (filename, mimes = baseMimes) => { - const regexp = /\.([a-zA-Z0-9]+?)$/; - const match = filename.match(regexp); - if (!match) { - return; - } - let mimeType = mimes[match[1]]; - if (mimeType && mimeType.startsWith("text")) { - mimeType += "; charset=utf-8"; - } - return mimeType; -}; -const getExtension = (mimeType) => { - for (const ext in baseMimes) { - if (baseMimes[ext] === mimeType) { - return ext; - } - } -}; -const _baseMimes = { - aac: "audio/aac", - avi: "video/x-msvideo", - avif: "image/avif", - av1: "video/av1", - bin: "application/octet-stream", - bmp: "image/bmp", - css: "text/css", - csv: "text/csv", - eot: "application/vnd.ms-fontobject", - epub: "application/epub+zip", - gif: "image/gif", - gz: "application/gzip", - htm: "text/html", - html: "text/html", - ico: "image/x-icon", - ics: "text/calendar", - jpeg: "image/jpeg", - jpg: "image/jpeg", - js: "text/javascript", - json: "application/json", - jsonld: "application/ld+json", - map: "application/json", - mid: "audio/x-midi", - midi: "audio/x-midi", - mjs: "text/javascript", - mp3: "audio/mpeg", - mp4: "video/mp4", - mpeg: "video/mpeg", - oga: "audio/ogg", - ogv: "video/ogg", - ogx: "application/ogg", - opus: "audio/opus", - otf: "font/otf", - pdf: "application/pdf", - png: "image/png", - rtf: "application/rtf", - svg: "image/svg+xml", - tif: "image/tiff", - tiff: "image/tiff", - ts: "video/mp2t", - ttf: "font/ttf", - txt: "text/plain", - wasm: "application/wasm", - webm: "video/webm", - weba: "audio/webm", - webmanifest: "application/manifest+json", - webp: "image/webp", - woff: "font/woff", - woff2: "font/woff2", - xhtml: "application/xhtml+xml", - xml: "application/xml", - zip: "application/zip", - "3gp": "video/3gpp", - "3g2": "video/3gpp2", - gltf: "model/gltf+json", - glb: "model/gltf-binary" -}; -const baseMimes = _baseMimes; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - getExtension, - getMimeType, - mimes -}); diff --git a/node_modules/hono/dist/cjs/utils/stream.js b/node_modules/hono/dist/cjs/utils/stream.js deleted file mode 100644 index bbcdc01..0000000 --- a/node_modules/hono/dist/cjs/utils/stream.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var stream_exports = {}; -__export(stream_exports, { - StreamingApi: () => StreamingApi -}); -module.exports = __toCommonJS(stream_exports); -class StreamingApi { - writer; - encoder; - writable; - abortSubscribers = []; - responseReadable; - /** - * Whether the stream has been aborted. - */ - aborted = false; - /** - * Whether the stream has been closed normally. - */ - closed = false; - constructor(writable, _readable) { - this.writable = writable; - this.writer = writable.getWriter(); - this.encoder = new TextEncoder(); - const reader = _readable.getReader(); - this.abortSubscribers.push(async () => { - await reader.cancel(); - }); - this.responseReadable = new ReadableStream({ - async pull(controller) { - const { done, value } = await reader.read(); - done ? controller.close() : controller.enqueue(value); - }, - cancel: () => { - this.abort(); - } - }); - } - async write(input) { - try { - if (typeof input === "string") { - input = this.encoder.encode(input); - } - await this.writer.write(input); - } catch { - } - return this; - } - async writeln(input) { - await this.write(input + "\n"); - return this; - } - sleep(ms) { - return new Promise((res) => setTimeout(res, ms)); - } - async close() { - try { - await this.writer.close(); - } catch { - } - this.closed = true; - } - async pipe(body) { - this.writer.releaseLock(); - await body.pipeTo(this.writable, { preventClose: true }); - this.writer = this.writable.getWriter(); - } - onAbort(listener) { - this.abortSubscribers.push(listener); - } - /** - * Abort the stream. - * You can call this method when stream is aborted by external event. - */ - abort() { - if (!this.aborted) { - this.aborted = true; - this.abortSubscribers.forEach((subscriber) => subscriber()); - } - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - StreamingApi -}); diff --git a/node_modules/hono/dist/cjs/utils/types.js b/node_modules/hono/dist/cjs/utils/types.js deleted file mode 100644 index 43ae536..0000000 --- a/node_modules/hono/dist/cjs/utils/types.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var types_exports = {}; -module.exports = __toCommonJS(types_exports); diff --git a/node_modules/hono/dist/cjs/utils/url.js b/node_modules/hono/dist/cjs/utils/url.js deleted file mode 100644 index 9926c55..0000000 --- a/node_modules/hono/dist/cjs/utils/url.js +++ /dev/null @@ -1,255 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var url_exports = {}; -__export(url_exports, { - checkOptionalParameter: () => checkOptionalParameter, - decodeURIComponent_: () => decodeURIComponent_, - getPath: () => getPath, - getPathNoStrict: () => getPathNoStrict, - getPattern: () => getPattern, - getQueryParam: () => getQueryParam, - getQueryParams: () => getQueryParams, - getQueryStrings: () => getQueryStrings, - mergePath: () => mergePath, - splitPath: () => splitPath, - splitRoutingPath: () => splitRoutingPath, - tryDecode: () => tryDecode -}); -module.exports = __toCommonJS(url_exports); -const splitPath = (path) => { - const paths = path.split("/"); - if (paths[0] === "") { - paths.shift(); - } - return paths; -}; -const splitRoutingPath = (routePath) => { - const { groups, path } = extractGroupsFromPath(routePath); - const paths = splitPath(path); - return replaceGroupMarks(paths, groups); -}; -const extractGroupsFromPath = (path) => { - const groups = []; - path = path.replace(/\{[^}]+\}/g, (match, index) => { - const mark = `@${index}`; - groups.push([mark, match]); - return mark; - }); - return { groups, path }; -}; -const replaceGroupMarks = (paths, groups) => { - for (let i = groups.length - 1; i >= 0; i--) { - const [mark] = groups[i]; - for (let j = paths.length - 1; j >= 0; j--) { - if (paths[j].includes(mark)) { - paths[j] = paths[j].replace(mark, groups[i][1]); - break; - } - } - } - return paths; -}; -const patternCache = {}; -const getPattern = (label, next) => { - if (label === "*") { - return "*"; - } - const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); - if (match) { - const cacheKey = `${label}#${next}`; - if (!patternCache[cacheKey]) { - if (match[2]) { - patternCache[cacheKey] = next && next[0] !== ":" && next[0] !== "*" ? [cacheKey, match[1], new RegExp(`^${match[2]}(?=/${next})`)] : [label, match[1], new RegExp(`^${match[2]}$`)]; - } else { - patternCache[cacheKey] = [label, match[1], true]; - } - } - return patternCache[cacheKey]; - } - return null; -}; -const tryDecode = (str, decoder) => { - try { - return decoder(str); - } catch { - return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => { - try { - return decoder(match); - } catch { - return match; - } - }); - } -}; -const tryDecodeURI = (str) => tryDecode(str, decodeURI); -const getPath = (request) => { - const url = request.url; - const start = url.indexOf("/", url.indexOf(":") + 4); - let i = start; - for (; i < url.length; i++) { - const charCode = url.charCodeAt(i); - if (charCode === 37) { - const queryIndex = url.indexOf("?", i); - const hashIndex = url.indexOf("#", i); - const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex); - const path = url.slice(start, end); - return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path); - } else if (charCode === 63 || charCode === 35) { - break; - } - } - return url.slice(start, i); -}; -const getQueryStrings = (url) => { - const queryIndex = url.indexOf("?", 8); - return queryIndex === -1 ? "" : "?" + url.slice(queryIndex + 1); -}; -const getPathNoStrict = (request) => { - const result = getPath(request); - return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result; -}; -const mergePath = (base, sub, ...rest) => { - if (rest.length) { - sub = mergePath(sub, ...rest); - } - return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`; -}; -const checkOptionalParameter = (path) => { - if (path.charCodeAt(path.length - 1) !== 63 || !path.includes(":")) { - return null; - } - const segments = path.split("/"); - const results = []; - let basePath = ""; - segments.forEach((segment) => { - if (segment !== "" && !/\:/.test(segment)) { - basePath += "/" + segment; - } else if (/\:/.test(segment)) { - if (/\?/.test(segment)) { - if (results.length === 0 && basePath === "") { - results.push("/"); - } else { - results.push(basePath); - } - const optionalSegment = segment.replace("?", ""); - basePath += "/" + optionalSegment; - results.push(basePath); - } else { - basePath += "/" + segment; - } - } - }); - return results.filter((v, i, a) => a.indexOf(v) === i); -}; -const _decodeURI = (value) => { - if (!/[%+]/.test(value)) { - return value; - } - if (value.indexOf("+") !== -1) { - value = value.replace(/\+/g, " "); - } - return value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value; -}; -const _getQueryParam = (url, key, multiple) => { - let encoded; - if (!multiple && key && !/[%+]/.test(key)) { - let keyIndex2 = url.indexOf("?", 8); - if (keyIndex2 === -1) { - return void 0; - } - if (!url.startsWith(key, keyIndex2 + 1)) { - keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1); - } - while (keyIndex2 !== -1) { - const trailingKeyCode = url.charCodeAt(keyIndex2 + key.length + 1); - if (trailingKeyCode === 61) { - const valueIndex = keyIndex2 + key.length + 2; - const endIndex = url.indexOf("&", valueIndex); - return _decodeURI(url.slice(valueIndex, endIndex === -1 ? void 0 : endIndex)); - } else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) { - return ""; - } - keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1); - } - encoded = /[%+]/.test(url); - if (!encoded) { - return void 0; - } - } - const results = {}; - encoded ??= /[%+]/.test(url); - let keyIndex = url.indexOf("?", 8); - while (keyIndex !== -1) { - const nextKeyIndex = url.indexOf("&", keyIndex + 1); - let valueIndex = url.indexOf("=", keyIndex); - if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) { - valueIndex = -1; - } - let name = url.slice( - keyIndex + 1, - valueIndex === -1 ? nextKeyIndex === -1 ? void 0 : nextKeyIndex : valueIndex - ); - if (encoded) { - name = _decodeURI(name); - } - keyIndex = nextKeyIndex; - if (name === "") { - continue; - } - let value; - if (valueIndex === -1) { - value = ""; - } else { - value = url.slice(valueIndex + 1, nextKeyIndex === -1 ? void 0 : nextKeyIndex); - if (encoded) { - value = _decodeURI(value); - } - } - if (multiple) { - if (!(results[name] && Array.isArray(results[name]))) { - results[name] = []; - } - ; - results[name].push(value); - } else { - results[name] ??= value; - } - } - return key ? results[key] : results; -}; -const getQueryParam = _getQueryParam; -const getQueryParams = (url, key) => { - return _getQueryParam(url, key, true); -}; -const decodeURIComponent_ = decodeURIComponent; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - checkOptionalParameter, - decodeURIComponent_, - getPath, - getPathNoStrict, - getPattern, - getQueryParam, - getQueryParams, - getQueryStrings, - mergePath, - splitPath, - splitRoutingPath, - tryDecode -}); diff --git a/node_modules/hono/dist/cjs/validator/index.js b/node_modules/hono/dist/cjs/validator/index.js deleted file mode 100644 index cbaa47f..0000000 --- a/node_modules/hono/dist/cjs/validator/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var validator_exports = {}; -__export(validator_exports, { - validator: () => import_validator.validator -}); -module.exports = __toCommonJS(validator_exports); -var import_validator = require("./validator"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - validator -}); diff --git a/node_modules/hono/dist/cjs/validator/utils.js b/node_modules/hono/dist/cjs/validator/utils.js deleted file mode 100644 index cfe4f8a..0000000 --- a/node_modules/hono/dist/cjs/validator/utils.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var utils_exports = {}; -module.exports = __toCommonJS(utils_exports); diff --git a/node_modules/hono/dist/cjs/validator/validator.js b/node_modules/hono/dist/cjs/validator/validator.js deleted file mode 100644 index 552cd60..0000000 --- a/node_modules/hono/dist/cjs/validator/validator.js +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var validator_exports = {}; -__export(validator_exports, { - validator: () => validator -}); -module.exports = __toCommonJS(validator_exports); -var import_cookie = require("../helper/cookie"); -var import_http_exception = require("../http-exception"); -var import_buffer = require("../utils/buffer"); -const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/; -const multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/; -const urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/; -const validator = (target, validationFunc) => { - return async (c, next) => { - let value = {}; - const contentType = c.req.header("Content-Type"); - switch (target) { - case "json": - if (!contentType || !jsonRegex.test(contentType)) { - break; - } - try { - value = await c.req.json(); - } catch { - const message = "Malformed JSON in request body"; - throw new import_http_exception.HTTPException(400, { message }); - } - break; - case "form": { - if (!contentType || !(multipartRegex.test(contentType) || urlencodedRegex.test(contentType))) { - break; - } - let formData; - if (c.req.bodyCache.formData) { - formData = await c.req.bodyCache.formData; - } else { - try { - const arrayBuffer = await c.req.arrayBuffer(); - formData = await (0, import_buffer.bufferToFormData)(arrayBuffer, contentType); - c.req.bodyCache.formData = formData; - } catch (e) { - let message = "Malformed FormData request."; - message += e instanceof Error ? ` ${e.message}` : ` ${String(e)}`; - throw new import_http_exception.HTTPException(400, { message }); - } - } - const form = {}; - formData.forEach((value2, key) => { - if (key.endsWith("[]")) { - ; - (form[key] ??= []).push(value2); - } else if (Array.isArray(form[key])) { - ; - form[key].push(value2); - } else if (key in form) { - form[key] = [form[key], value2]; - } else { - form[key] = value2; - } - }); - value = form; - break; - } - case "query": - value = Object.fromEntries( - Object.entries(c.req.queries()).map(([k, v]) => { - return v.length === 1 ? [k, v[0]] : [k, v]; - }) - ); - break; - case "param": - value = c.req.param(); - break; - case "header": - value = c.req.header(); - break; - case "cookie": - value = (0, import_cookie.getCookie)(c); - break; - } - const res = await validationFunc(value, c); - if (res instanceof Response) { - return res; - } - c.req.addValidatedData(target, res); - return await next(); - }; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - validator -}); diff --git a/node_modules/hono/dist/client/client.js b/node_modules/hono/dist/client/client.js deleted file mode 100644 index 6b9ef67..0000000 --- a/node_modules/hono/dist/client/client.js +++ /dev/null @@ -1,174 +0,0 @@ -// src/client/client.ts -import { serialize } from "../utils/cookie.js"; -import { - buildSearchParams, - deepMerge, - mergePath, - removeIndexString, - replaceUrlParam, - replaceUrlProtocol -} from "./utils.js"; -var createProxy = (callback, path) => { - const proxy = new Proxy(() => { - }, { - get(_obj, key) { - if (typeof key !== "string" || key === "then") { - return void 0; - } - return createProxy(callback, [...path, key]); - }, - apply(_1, _2, args) { - return callback({ - path, - args - }); - } - }); - return proxy; -}; -var ClientRequestImpl = class { - url; - method; - buildSearchParams; - queryParams = void 0; - pathParams = {}; - rBody; - cType = void 0; - constructor(url, method, options) { - this.url = url; - this.method = method; - this.buildSearchParams = options.buildSearchParams; - } - fetch = async (args, opt) => { - if (args) { - if (args.query) { - this.queryParams = this.buildSearchParams(args.query); - } - if (args.form) { - const form = new FormData(); - for (const [k, v] of Object.entries(args.form)) { - if (Array.isArray(v)) { - for (const v2 of v) { - form.append(k, v2); - } - } else { - form.append(k, v); - } - } - this.rBody = form; - } - if (args.json) { - this.rBody = JSON.stringify(args.json); - this.cType = "application/json"; - } - if (args.param) { - this.pathParams = args.param; - } - } - let methodUpperCase = this.method.toUpperCase(); - const headerValues = { - ...args?.header, - ...typeof opt?.headers === "function" ? await opt.headers() : opt?.headers - }; - if (args?.cookie) { - const cookies = []; - for (const [key, value] of Object.entries(args.cookie)) { - cookies.push(serialize(key, value, { path: "/" })); - } - headerValues["Cookie"] = cookies.join(","); - } - if (this.cType) { - headerValues["Content-Type"] = this.cType; - } - const headers = new Headers(headerValues ?? void 0); - let url = this.url; - url = removeIndexString(url); - url = replaceUrlParam(url, this.pathParams); - if (this.queryParams) { - url = url + "?" + this.queryParams.toString(); - } - methodUpperCase = this.method.toUpperCase(); - const setBody = !(methodUpperCase === "GET" || methodUpperCase === "HEAD"); - return (opt?.fetch || fetch)(url, { - body: setBody ? this.rBody : void 0, - method: methodUpperCase, - headers, - ...opt?.init - }); - }; -}; -var hc = (baseUrl, options) => createProxy(function proxyCallback(opts) { - const buildSearchParamsOption = options?.buildSearchParams ?? buildSearchParams; - const parts = [...opts.path]; - const lastParts = parts.slice(-3).reverse(); - if (lastParts[0] === "toString") { - if (lastParts[1] === "name") { - return lastParts[2] || ""; - } - return proxyCallback.toString(); - } - if (lastParts[0] === "valueOf") { - if (lastParts[1] === "name") { - return lastParts[2] || ""; - } - return proxyCallback; - } - let method = ""; - if (/^\$/.test(lastParts[0])) { - const last = parts.pop(); - if (last) { - method = last.replace(/^\$/, ""); - } - } - const path = parts.join("/"); - const url = mergePath(baseUrl, path); - if (method === "url") { - let result = url; - if (opts.args[0]) { - if (opts.args[0].param) { - result = replaceUrlParam(url, opts.args[0].param); - } - if (opts.args[0].query) { - result = result + "?" + buildSearchParamsOption(opts.args[0].query).toString(); - } - } - result = removeIndexString(result); - return new URL(result); - } - if (method === "ws") { - const webSocketUrl = replaceUrlProtocol( - opts.args[0] && opts.args[0].param ? replaceUrlParam(url, opts.args[0].param) : url, - "ws" - ); - const targetUrl = new URL(webSocketUrl); - const queryParams = opts.args[0]?.query; - if (queryParams) { - Object.entries(queryParams).forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach((item) => targetUrl.searchParams.append(key, item)); - } else { - targetUrl.searchParams.set(key, value); - } - }); - } - const establishWebSocket = (...args) => { - if (options?.webSocket !== void 0 && typeof options.webSocket === "function") { - return options.webSocket(...args); - } - return new WebSocket(...args); - }; - return establishWebSocket(targetUrl.toString()); - } - const req = new ClientRequestImpl(url, method, { - buildSearchParams: buildSearchParamsOption - }); - if (method) { - options ??= {}; - const args = deepMerge(options, { ...opts.args[1] }); - return req.fetch(opts.args[0], args); - } - return req; -}, []); -export { - hc -}; diff --git a/node_modules/hono/dist/client/fetch-result-please.js b/node_modules/hono/dist/client/fetch-result-please.js deleted file mode 100644 index 9f7a813..0000000 --- a/node_modules/hono/dist/client/fetch-result-please.js +++ /dev/null @@ -1,62 +0,0 @@ -// src/client/fetch-result-please.ts -var nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]); -async function fetchRP(fetchRes) { - const _fetchRes = await fetchRes; - const hasBody = (_fetchRes.body || _fetchRes._bodyInit) && !nullBodyResponses.has(_fetchRes.status); - if (hasBody) { - const responseType = detectResponseType(_fetchRes); - _fetchRes._data = await _fetchRes[responseType](); - } - if (!_fetchRes.ok) { - throw new DetailedError(`${_fetchRes.status} ${_fetchRes.statusText}`, { - statusCode: _fetchRes?.status, - detail: { - data: _fetchRes?._data, - statusText: _fetchRes?.statusText - } - }); - } - return _fetchRes._data; -} -var DetailedError = class extends Error { - /** - * Additional `message` that will be logged AND returned to client - */ - detail; - /** - * Additional `code` that will be logged AND returned to client - */ - code; - /** - * Additional value that will be logged AND NOT returned to client - */ - log; - /** - * Optionally set the status code to return, in a web server context - */ - statusCode; - constructor(message, options = {}) { - super(message); - this.name = "DetailedError"; - this.log = options.log; - this.detail = options.detail; - this.code = options.code; - this.statusCode = options.statusCode; - } -}; -var jsonRegex = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(?:;.+)?$/i; -function detectResponseType(response) { - const _contentType = response.headers.get("content-type"); - if (!_contentType) { - return "text"; - } - const contentType = _contentType.split(";").shift(); - if (jsonRegex.test(contentType)) { - return "json"; - } - return "text"; -} -export { - DetailedError, - fetchRP -}; diff --git a/node_modules/hono/dist/client/index.js b/node_modules/hono/dist/client/index.js deleted file mode 100644 index e133afa..0000000 --- a/node_modules/hono/dist/client/index.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/client/index.ts -import { hc } from "./client.js"; -import { parseResponse, DetailedError } from "./utils.js"; -export { - DetailedError, - hc, - parseResponse -}; diff --git a/node_modules/hono/dist/client/types.js b/node_modules/hono/dist/client/types.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/client/utils.js b/node_modules/hono/dist/client/utils.js deleted file mode 100644 index 1842ff8..0000000 --- a/node_modules/hono/dist/client/utils.js +++ /dev/null @@ -1,76 +0,0 @@ -// src/client/utils.ts -import { fetchRP, DetailedError } from "./fetch-result-please.js"; -var mergePath = (base, path) => { - base = base.replace(/\/+$/, ""); - base = base + "/"; - path = path.replace(/^\/+/, ""); - return base + path; -}; -var replaceUrlParam = (urlString, params) => { - for (const [k, v] of Object.entries(params)) { - const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??"); - urlString = urlString.replace(reg, v ? `/${v}` : ""); - } - return urlString; -}; -var buildSearchParams = (query) => { - const searchParams = new URLSearchParams(); - for (const [k, v] of Object.entries(query)) { - if (v === void 0) { - continue; - } - if (Array.isArray(v)) { - for (const v2 of v) { - searchParams.append(k, v2); - } - } else { - searchParams.set(k, v); - } - } - return searchParams; -}; -var replaceUrlProtocol = (urlString, protocol) => { - switch (protocol) { - case "ws": - return urlString.replace(/^http/, "ws"); - case "http": - return urlString.replace(/^ws/, "http"); - } -}; -var removeIndexString = (urlString) => { - if (/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(urlString)) { - return urlString.replace(/\/index(?=\?|$)/, "/"); - } - return urlString.replace(/\/index(?=\?|$)/, ""); -}; -function isObject(item) { - return typeof item === "object" && item !== null && !Array.isArray(item); -} -function deepMerge(target, source) { - if (!isObject(target) && !isObject(source)) { - return source; - } - const merged = { ...target }; - for (const key in source) { - const value = source[key]; - if (isObject(merged[key]) && isObject(value)) { - merged[key] = deepMerge(merged[key], value); - } else { - merged[key] = value; - } - } - return merged; -} -async function parseResponse(fetchRes) { - return fetchRP(fetchRes); -} -export { - DetailedError, - buildSearchParams, - deepMerge, - mergePath, - parseResponse, - removeIndexString, - replaceUrlParam, - replaceUrlProtocol -}; diff --git a/node_modules/hono/dist/compose.js b/node_modules/hono/dist/compose.js deleted file mode 100644 index 8e1326f..0000000 --- a/node_modules/hono/dist/compose.js +++ /dev/null @@ -1,46 +0,0 @@ -// src/compose.ts -var compose = (middleware, onError, onNotFound) => { - return (context, next) => { - let index = -1; - return dispatch(0); - async function dispatch(i) { - if (i <= index) { - throw new Error("next() called multiple times"); - } - index = i; - let res; - let isError = false; - let handler; - if (middleware[i]) { - handler = middleware[i][0][0]; - context.req.routeIndex = i; - } else { - handler = i === middleware.length && next || void 0; - } - if (handler) { - try { - res = await handler(context, () => dispatch(i + 1)); - } catch (err) { - if (err instanceof Error && onError) { - context.error = err; - res = await onError(err, context); - isError = true; - } else { - throw err; - } - } - } else { - if (context.finalized === false && onNotFound) { - res = await onNotFound(context); - } - } - if (res && (context.finalized === false || isError)) { - context.res = res; - } - return context; - } - }; -}; -export { - compose -}; diff --git a/node_modules/hono/dist/context.js b/node_modules/hono/dist/context.js deleted file mode 100644 index 3d8a9c6..0000000 --- a/node_modules/hono/dist/context.js +++ /dev/null @@ -1,411 +0,0 @@ -// src/context.ts -import { HonoRequest } from "./request.js"; -import { HtmlEscapedCallbackPhase, resolveCallback } from "./utils/html.js"; -var TEXT_PLAIN = "text/plain; charset=UTF-8"; -var setDefaultContentType = (contentType, headers) => { - return { - "Content-Type": contentType, - ...headers - }; -}; -var Context = class { - #rawRequest; - #req; - /** - * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers. - * - * @see {@link https://hono.dev/docs/api/context#env} - * - * @example - * ```ts - * // Environment object for Cloudflare Workers - * app.get('*', async c => { - * const counter = c.env.COUNTER - * }) - * ``` - */ - env = {}; - #var; - finalized = false; - /** - * `.error` can get the error object from the middleware if the Handler throws an error. - * - * @see {@link https://hono.dev/docs/api/context#error} - * - * @example - * ```ts - * app.use('*', async (c, next) => { - * await next() - * if (c.error) { - * // do something... - * } - * }) - * ``` - */ - error; - #status; - #executionCtx; - #res; - #layout; - #renderer; - #notFoundHandler; - #preparedHeaders; - #matchResult; - #path; - /** - * Creates an instance of the Context class. - * - * @param req - The Request object. - * @param options - Optional configuration options for the context. - */ - constructor(req, options) { - this.#rawRequest = req; - if (options) { - this.#executionCtx = options.executionCtx; - this.env = options.env; - this.#notFoundHandler = options.notFoundHandler; - this.#path = options.path; - this.#matchResult = options.matchResult; - } - } - /** - * `.req` is the instance of {@link HonoRequest}. - */ - get req() { - this.#req ??= new HonoRequest(this.#rawRequest, this.#path, this.#matchResult); - return this.#req; - } - /** - * @see {@link https://hono.dev/docs/api/context#event} - * The FetchEvent associated with the current request. - * - * @throws Will throw an error if the context does not have a FetchEvent. - */ - get event() { - if (this.#executionCtx && "respondWith" in this.#executionCtx) { - return this.#executionCtx; - } else { - throw Error("This context has no FetchEvent"); - } - } - /** - * @see {@link https://hono.dev/docs/api/context#executionctx} - * The ExecutionContext associated with the current request. - * - * @throws Will throw an error if the context does not have an ExecutionContext. - */ - get executionCtx() { - if (this.#executionCtx) { - return this.#executionCtx; - } else { - throw Error("This context has no ExecutionContext"); - } - } - /** - * @see {@link https://hono.dev/docs/api/context#res} - * The Response object for the current request. - */ - get res() { - return this.#res ||= new Response(null, { - headers: this.#preparedHeaders ??= new Headers() - }); - } - /** - * Sets the Response object for the current request. - * - * @param _res - The Response object to set. - */ - set res(_res) { - if (this.#res && _res) { - _res = new Response(_res.body, _res); - for (const [k, v] of this.#res.headers.entries()) { - if (k === "content-type") { - continue; - } - if (k === "set-cookie") { - const cookies = this.#res.headers.getSetCookie(); - _res.headers.delete("set-cookie"); - for (const cookie of cookies) { - _res.headers.append("set-cookie", cookie); - } - } else { - _res.headers.set(k, v); - } - } - } - this.#res = _res; - this.finalized = true; - } - /** - * `.render()` can create a response within a layout. - * - * @see {@link https://hono.dev/docs/api/context#render-setrenderer} - * - * @example - * ```ts - * app.get('/', (c) => { - * return c.render('Hello!') - * }) - * ``` - */ - render = (...args) => { - this.#renderer ??= (content) => this.html(content); - return this.#renderer(...args); - }; - /** - * Sets the layout for the response. - * - * @param layout - The layout to set. - * @returns The layout function. - */ - setLayout = (layout) => this.#layout = layout; - /** - * Gets the current layout for the response. - * - * @returns The current layout function. - */ - getLayout = () => this.#layout; - /** - * `.setRenderer()` can set the layout in the custom middleware. - * - * @see {@link https://hono.dev/docs/api/context#render-setrenderer} - * - * @example - * ```tsx - * app.use('*', async (c, next) => { - * c.setRenderer((content) => { - * return c.html( - * - * - *

{content}

- * - * - * ) - * }) - * await next() - * }) - * ``` - */ - setRenderer = (renderer) => { - this.#renderer = renderer; - }; - /** - * `.header()` can set headers. - * - * @see {@link https://hono.dev/docs/api/context#header} - * - * @example - * ```ts - * app.get('/welcome', (c) => { - * // Set headers - * c.header('X-Message', 'Hello!') - * c.header('Content-Type', 'text/plain') - * - * return c.body('Thank you for coming') - * }) - * ``` - */ - header = (name, value, options) => { - if (this.finalized) { - this.#res = new Response(this.#res.body, this.#res); - } - const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers(); - if (value === void 0) { - headers.delete(name); - } else if (options?.append) { - headers.append(name, value); - } else { - headers.set(name, value); - } - }; - status = (status) => { - this.#status = status; - }; - /** - * `.set()` can set the value specified by the key. - * - * @see {@link https://hono.dev/docs/api/context#set-get} - * - * @example - * ```ts - * app.use('*', async (c, next) => { - * c.set('message', 'Hono is hot!!') - * await next() - * }) - * ``` - */ - set = (key, value) => { - this.#var ??= /* @__PURE__ */ new Map(); - this.#var.set(key, value); - }; - /** - * `.get()` can use the value specified by the key. - * - * @see {@link https://hono.dev/docs/api/context#set-get} - * - * @example - * ```ts - * app.get('/', (c) => { - * const message = c.get('message') - * return c.text(`The message is "${message}"`) - * }) - * ``` - */ - get = (key) => { - return this.#var ? this.#var.get(key) : void 0; - }; - /** - * `.var` can access the value of a variable. - * - * @see {@link https://hono.dev/docs/api/context#var} - * - * @example - * ```ts - * const result = c.var.client.oneMethod() - * ``` - */ - // c.var.propName is a read-only - get var() { - if (!this.#var) { - return {}; - } - return Object.fromEntries(this.#var); - } - #newResponse(data, arg, headers) { - const responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders ?? new Headers(); - if (typeof arg === "object" && "headers" in arg) { - const argHeaders = arg.headers instanceof Headers ? arg.headers : new Headers(arg.headers); - for (const [key, value] of argHeaders) { - if (key.toLowerCase() === "set-cookie") { - responseHeaders.append(key, value); - } else { - responseHeaders.set(key, value); - } - } - } - if (headers) { - for (const [k, v] of Object.entries(headers)) { - if (typeof v === "string") { - responseHeaders.set(k, v); - } else { - responseHeaders.delete(k); - for (const v2 of v) { - responseHeaders.append(k, v2); - } - } - } - } - const status = typeof arg === "number" ? arg : arg?.status ?? this.#status; - return new Response(data, { status, headers: responseHeaders }); - } - newResponse = (...args) => this.#newResponse(...args); - /** - * `.body()` can return the HTTP response. - * You can set headers with `.header()` and set HTTP status code with `.status`. - * This can also be set in `.text()`, `.json()` and so on. - * - * @see {@link https://hono.dev/docs/api/context#body} - * - * @example - * ```ts - * app.get('/welcome', (c) => { - * // Set headers - * c.header('X-Message', 'Hello!') - * c.header('Content-Type', 'text/plain') - * // Set HTTP status code - * c.status(201) - * - * // Return the response body - * return c.body('Thank you for coming') - * }) - * ``` - */ - body = (data, arg, headers) => this.#newResponse(data, arg, headers); - /** - * `.text()` can render text as `Content-Type:text/plain`. - * - * @see {@link https://hono.dev/docs/api/context#text} - * - * @example - * ```ts - * app.get('/say', (c) => { - * return c.text('Hello!') - * }) - * ``` - */ - text = (text, arg, headers) => { - return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse( - text, - arg, - setDefaultContentType(TEXT_PLAIN, headers) - ); - }; - /** - * `.json()` can render JSON as `Content-Type:application/json`. - * - * @see {@link https://hono.dev/docs/api/context#json} - * - * @example - * ```ts - * app.get('/api', (c) => { - * return c.json({ message: 'Hello!' }) - * }) - * ``` - */ - json = (object, arg, headers) => { - return this.#newResponse( - JSON.stringify(object), - arg, - setDefaultContentType("application/json", headers) - ); - }; - html = (html, arg, headers) => { - const res = (html2) => this.#newResponse(html2, arg, setDefaultContentType("text/html; charset=UTF-8", headers)); - return typeof html === "object" ? resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html); - }; - /** - * `.redirect()` can Redirect, default status code is 302. - * - * @see {@link https://hono.dev/docs/api/context#redirect} - * - * @example - * ```ts - * app.get('/redirect', (c) => { - * return c.redirect('/') - * }) - * app.get('/redirect-permanently', (c) => { - * return c.redirect('/', 301) - * }) - * ``` - */ - redirect = (location, status) => { - const locationString = String(location); - this.header( - "Location", - // Multibyes should be encoded - // eslint-disable-next-line no-control-regex - !/[^\x00-\xFF]/.test(locationString) ? locationString : encodeURI(locationString) - ); - return this.newResponse(null, status ?? 302); - }; - /** - * `.notFound()` can return the Not Found Response. - * - * @see {@link https://hono.dev/docs/api/context#notfound} - * - * @example - * ```ts - * app.get('/notfound', (c) => { - * return c.notFound() - * }) - * ``` - */ - notFound = () => { - this.#notFoundHandler ??= () => new Response(); - return this.#notFoundHandler(this); - }; -}; -export { - Context, - TEXT_PLAIN -}; diff --git a/node_modules/hono/dist/helper/accepts/accepts.js b/node_modules/hono/dist/helper/accepts/accepts.js deleted file mode 100644 index fd87c4c..0000000 --- a/node_modules/hono/dist/helper/accepts/accepts.js +++ /dev/null @@ -1,20 +0,0 @@ -// src/helper/accepts/accepts.ts -import { parseAccept } from "../../utils/accept.js"; -var defaultMatch = (accepts2, config) => { - const { supports, default: defaultSupport } = config; - const accept = accepts2.sort((a, b) => b.q - a.q).find((accept2) => supports.includes(accept2.type)); - return accept ? accept.type : defaultSupport; -}; -var accepts = (c, options) => { - const acceptHeader = c.req.header(options.header); - if (!acceptHeader) { - return options.default; - } - const accepts2 = parseAccept(acceptHeader); - const match = options.match || defaultMatch; - return match(accepts2, options); -}; -export { - accepts, - defaultMatch -}; diff --git a/node_modules/hono/dist/helper/accepts/index.js b/node_modules/hono/dist/helper/accepts/index.js deleted file mode 100644 index f80f3c8..0000000 --- a/node_modules/hono/dist/helper/accepts/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/helper/accepts/index.ts -import { accepts } from "./accepts.js"; -export { - accepts -}; diff --git a/node_modules/hono/dist/helper/adapter/index.js b/node_modules/hono/dist/helper/adapter/index.js deleted file mode 100644 index 7eb7803..0000000 --- a/node_modules/hono/dist/helper/adapter/index.js +++ /dev/null @@ -1,56 +0,0 @@ -// src/helper/adapter/index.ts -var env = (c, runtime) => { - const global = globalThis; - const globalEnv = global?.process?.env; - runtime ??= getRuntimeKey(); - const runtimeEnvHandlers = { - bun: () => globalEnv, - node: () => globalEnv, - "edge-light": () => globalEnv, - deno: () => { - return Deno.env.toObject(); - }, - workerd: () => c.env, - // On Fastly Compute, you can use the ConfigStore to manage user-defined data. - fastly: () => ({}), - other: () => ({}) - }; - return runtimeEnvHandlers[runtime](); -}; -var knownUserAgents = { - deno: "Deno", - bun: "Bun", - workerd: "Cloudflare-Workers", - node: "Node.js" -}; -var getRuntimeKey = () => { - const global = globalThis; - const userAgentSupported = typeof navigator !== "undefined" && typeof navigator.userAgent === "string"; - if (userAgentSupported) { - for (const [runtimeKey, userAgent] of Object.entries(knownUserAgents)) { - if (checkUserAgentEquals(userAgent)) { - return runtimeKey; - } - } - } - if (typeof global?.EdgeRuntime === "string") { - return "edge-light"; - } - if (global?.fastly !== void 0) { - return "fastly"; - } - if (global?.process?.release?.name === "node") { - return "node"; - } - return "other"; -}; -var checkUserAgentEquals = (platform) => { - const userAgent = navigator.userAgent; - return userAgent.startsWith(platform); -}; -export { - checkUserAgentEquals, - env, - getRuntimeKey, - knownUserAgents -}; diff --git a/node_modules/hono/dist/helper/conninfo/index.js b/node_modules/hono/dist/helper/conninfo/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/helper/conninfo/types.js b/node_modules/hono/dist/helper/conninfo/types.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/helper/cookie/index.js b/node_modules/hono/dist/helper/cookie/index.js deleted file mode 100644 index 59f9968..0000000 --- a/node_modules/hono/dist/helper/cookie/index.js +++ /dev/null @@ -1,102 +0,0 @@ -// src/helper/cookie/index.ts -import { parse, parseSigned, serialize, serializeSigned } from "../../utils/cookie.js"; -var getCookie = (c, key, prefix) => { - const cookie = c.req.raw.headers.get("Cookie"); - if (typeof key === "string") { - if (!cookie) { - return void 0; - } - let finalKey = key; - if (prefix === "secure") { - finalKey = "__Secure-" + key; - } else if (prefix === "host") { - finalKey = "__Host-" + key; - } - const obj2 = parse(cookie, finalKey); - return obj2[finalKey]; - } - if (!cookie) { - return {}; - } - const obj = parse(cookie); - return obj; -}; -var getSignedCookie = async (c, secret, key, prefix) => { - const cookie = c.req.raw.headers.get("Cookie"); - if (typeof key === "string") { - if (!cookie) { - return void 0; - } - let finalKey = key; - if (prefix === "secure") { - finalKey = "__Secure-" + key; - } else if (prefix === "host") { - finalKey = "__Host-" + key; - } - const obj2 = await parseSigned(cookie, secret, finalKey); - return obj2[finalKey]; - } - if (!cookie) { - return {}; - } - const obj = await parseSigned(cookie, secret); - return obj; -}; -var generateCookie = (name, value, opt) => { - let cookie; - if (opt?.prefix === "secure") { - cookie = serialize("__Secure-" + name, value, { path: "/", ...opt, secure: true }); - } else if (opt?.prefix === "host") { - cookie = serialize("__Host-" + name, value, { - ...opt, - path: "/", - secure: true, - domain: void 0 - }); - } else { - cookie = serialize(name, value, { path: "/", ...opt }); - } - return cookie; -}; -var setCookie = (c, name, value, opt) => { - const cookie = generateCookie(name, value, opt); - c.header("Set-Cookie", cookie, { append: true }); -}; -var generateSignedCookie = async (name, value, secret, opt) => { - let cookie; - if (opt?.prefix === "secure") { - cookie = await serializeSigned("__Secure-" + name, value, secret, { - path: "/", - ...opt, - secure: true - }); - } else if (opt?.prefix === "host") { - cookie = await serializeSigned("__Host-" + name, value, secret, { - ...opt, - path: "/", - secure: true, - domain: void 0 - }); - } else { - cookie = await serializeSigned(name, value, secret, { path: "/", ...opt }); - } - return cookie; -}; -var setSignedCookie = async (c, name, value, secret, opt) => { - const cookie = await generateSignedCookie(name, value, secret, opt); - c.header("set-cookie", cookie, { append: true }); -}; -var deleteCookie = (c, name, opt) => { - const deletedCookie = getCookie(c, name, opt?.prefix); - setCookie(c, name, "", { ...opt, maxAge: 0 }); - return deletedCookie; -}; -export { - deleteCookie, - generateCookie, - generateSignedCookie, - getCookie, - getSignedCookie, - setCookie, - setSignedCookie -}; diff --git a/node_modules/hono/dist/helper/css/common.js b/node_modules/hono/dist/helper/css/common.js deleted file mode 100644 index a48d437..0000000 --- a/node_modules/hono/dist/helper/css/common.js +++ /dev/null @@ -1,185 +0,0 @@ -// src/helper/css/common.ts -var PSEUDO_GLOBAL_SELECTOR = ":-hono-global"; -var isPseudoGlobalSelectorRe = new RegExp(`^${PSEUDO_GLOBAL_SELECTOR}{(.*)}$`); -var DEFAULT_STYLE_ID = "hono-css"; -var SELECTOR = /* @__PURE__ */ Symbol(); -var CLASS_NAME = /* @__PURE__ */ Symbol(); -var STYLE_STRING = /* @__PURE__ */ Symbol(); -var SELECTORS = /* @__PURE__ */ Symbol(); -var EXTERNAL_CLASS_NAMES = /* @__PURE__ */ Symbol(); -var CSS_ESCAPED = /* @__PURE__ */ Symbol(); -var IS_CSS_ESCAPED = /* @__PURE__ */ Symbol(); -var rawCssString = (value) => { - return { - [CSS_ESCAPED]: value - }; -}; -var toHash = (str) => { - let i = 0, out = 11; - while (i < str.length) { - out = 101 * out + str.charCodeAt(i++) >>> 0; - } - return "css-" + out; -}; -var cssStringReStr = [ - '"(?:(?:\\\\[\\s\\S]|[^"\\\\])*)"', - // double quoted string - "'(?:(?:\\\\[\\s\\S]|[^'\\\\])*)'" - // single quoted string -].join("|"); -var minifyCssRe = new RegExp( - [ - "(" + cssStringReStr + ")", - // $1: quoted string - "(?:" + [ - "^\\s+", - // head whitespace - "\\/\\*.*?\\*\\/\\s*", - // multi-line comment - "\\/\\/.*\\n\\s*", - // single-line comment - "\\s+$" - // tail whitespace - ].join("|") + ")", - "\\s*;\\s*(}|$)\\s*", - // $2: trailing semicolon - "\\s*([{};:,])\\s*", - // $3: whitespace around { } : , ; - "(\\s)\\s+" - // $4: 2+ spaces - ].join("|"), - "g" -); -var minify = (css) => { - return css.replace(minifyCssRe, (_, $1, $2, $3, $4) => $1 || $2 || $3 || $4 || ""); -}; -var buildStyleString = (strings, values) => { - const selectors = []; - const externalClassNames = []; - const label = strings[0].match(/^\s*\/\*(.*?)\*\//)?.[1] || ""; - let styleString = ""; - for (let i = 0, len = strings.length; i < len; i++) { - styleString += strings[i]; - let vArray = values[i]; - if (typeof vArray === "boolean" || vArray === null || vArray === void 0) { - continue; - } - if (!Array.isArray(vArray)) { - vArray = [vArray]; - } - for (let j = 0, len2 = vArray.length; j < len2; j++) { - let value = vArray[j]; - if (typeof value === "boolean" || value === null || value === void 0) { - continue; - } - if (typeof value === "string") { - if (/([\\"'\/])/.test(value)) { - styleString += value.replace(/([\\"']|(?<=<)\/)/g, "\\$1"); - } else { - styleString += value; - } - } else if (typeof value === "number") { - styleString += value; - } else if (value[CSS_ESCAPED]) { - styleString += value[CSS_ESCAPED]; - } else if (value[CLASS_NAME].startsWith("@keyframes ")) { - selectors.push(value); - styleString += ` ${value[CLASS_NAME].substring(11)} `; - } else { - if (strings[i + 1]?.match(/^\s*{/)) { - selectors.push(value); - value = `.${value[CLASS_NAME]}`; - } else { - selectors.push(...value[SELECTORS]); - externalClassNames.push(...value[EXTERNAL_CLASS_NAMES]); - value = value[STYLE_STRING]; - const valueLen = value.length; - if (valueLen > 0) { - const lastChar = value[valueLen - 1]; - if (lastChar !== ";" && lastChar !== "}") { - value += ";"; - } - } - } - styleString += `${value || ""}`; - } - } - } - return [label, minify(styleString), selectors, externalClassNames]; -}; -var cssCommon = (strings, values) => { - let [label, thisStyleString, selectors, externalClassNames] = buildStyleString(strings, values); - const isPseudoGlobal = isPseudoGlobalSelectorRe.exec(thisStyleString); - if (isPseudoGlobal) { - thisStyleString = isPseudoGlobal[1]; - } - const selector = (isPseudoGlobal ? PSEUDO_GLOBAL_SELECTOR : "") + toHash(label + thisStyleString); - const className = (isPseudoGlobal ? selectors.map((s) => s[CLASS_NAME]) : [selector, ...externalClassNames]).join(" "); - return { - [SELECTOR]: selector, - [CLASS_NAME]: className, - [STYLE_STRING]: thisStyleString, - [SELECTORS]: selectors, - [EXTERNAL_CLASS_NAMES]: externalClassNames - }; -}; -var cxCommon = (args) => { - for (let i = 0, len = args.length; i < len; i++) { - const arg = args[i]; - if (typeof arg === "string") { - args[i] = { - [SELECTOR]: "", - [CLASS_NAME]: "", - [STYLE_STRING]: "", - [SELECTORS]: [], - [EXTERNAL_CLASS_NAMES]: [arg] - }; - } - } - return args; -}; -var keyframesCommon = (strings, ...values) => { - const [label, styleString] = buildStyleString(strings, values); - return { - [SELECTOR]: "", - [CLASS_NAME]: `@keyframes ${toHash(label + styleString)}`, - [STYLE_STRING]: styleString, - [SELECTORS]: [], - [EXTERNAL_CLASS_NAMES]: [] - }; -}; -var viewTransitionNameIndex = 0; -var viewTransitionCommon = ((strings, values) => { - if (!strings) { - strings = [`/* h-v-t ${viewTransitionNameIndex++} */`]; - } - const content = Array.isArray(strings) ? cssCommon(strings, values) : strings; - const transitionName = content[CLASS_NAME]; - const res = cssCommon(["view-transition-name:", ""], [transitionName]); - content[CLASS_NAME] = PSEUDO_GLOBAL_SELECTOR + content[CLASS_NAME]; - content[STYLE_STRING] = content[STYLE_STRING].replace( - /(?<=::view-transition(?:[a-z-]*)\()(?=\))/g, - transitionName - ); - res[CLASS_NAME] = res[SELECTOR] = transitionName; - res[SELECTORS] = [...content[SELECTORS], content]; - return res; -}); -export { - CLASS_NAME, - DEFAULT_STYLE_ID, - EXTERNAL_CLASS_NAMES, - IS_CSS_ESCAPED, - PSEUDO_GLOBAL_SELECTOR, - SELECTOR, - SELECTORS, - STYLE_STRING, - buildStyleString, - cssCommon, - cxCommon, - isPseudoGlobalSelectorRe, - keyframesCommon, - minify, - rawCssString, - viewTransitionCommon -}; diff --git a/node_modules/hono/dist/helper/css/index.js b/node_modules/hono/dist/helper/css/index.js deleted file mode 100644 index b60a2c7..0000000 --- a/node_modules/hono/dist/helper/css/index.js +++ /dev/null @@ -1,125 +0,0 @@ -// src/helper/css/index.ts -import { raw } from "../../helper/html/index.js"; -import { DOM_RENDERER } from "../../jsx/constants.js"; -import { createCssJsxDomObjects } from "../../jsx/dom/css.js"; -import { - CLASS_NAME, - DEFAULT_STYLE_ID, - PSEUDO_GLOBAL_SELECTOR, - SELECTOR, - SELECTORS, - STYLE_STRING, - cssCommon, - cxCommon, - keyframesCommon, - viewTransitionCommon -} from "./common.js"; -import { rawCssString } from "./common.js"; -var createCssContext = ({ id }) => { - const [cssJsxDomObject, StyleRenderToDom] = createCssJsxDomObjects({ id }); - const contextMap = /* @__PURE__ */ new WeakMap(); - const nonceMap = /* @__PURE__ */ new WeakMap(); - const replaceStyleRe = new RegExp(`()`); - const newCssClassNameObject = (cssClassName) => { - const appendStyle = ({ buffer, context }) => { - const [toAdd, added] = contextMap.get(context); - const names = Object.keys(toAdd); - if (!names.length) { - return; - } - let stylesStr = ""; - names.forEach((className2) => { - added[className2] = true; - stylesStr += className2.startsWith(PSEUDO_GLOBAL_SELECTOR) ? toAdd[className2] : `${className2[0] === "@" ? "" : "."}${className2}{${toAdd[className2]}}`; - }); - contextMap.set(context, [{}, added]); - if (buffer && replaceStyleRe.test(buffer[0])) { - buffer[0] = buffer[0].replace(replaceStyleRe, (_, pre, post) => `${pre}${stylesStr}${post}`); - return; - } - const nonce = nonceMap.get(context); - const appendStyleScript = `document.querySelector('#${id}').textContent+=${JSON.stringify(stylesStr)}`; - if (buffer) { - buffer[0] = `${appendStyleScript}${buffer[0]}`; - return; - } - return Promise.resolve(appendStyleScript); - }; - const addClassNameToContext = ({ context }) => { - if (!contextMap.has(context)) { - contextMap.set(context, [{}, {}]); - } - const [toAdd, added] = contextMap.get(context); - let allAdded = true; - if (!added[cssClassName[SELECTOR]]) { - allAdded = false; - toAdd[cssClassName[SELECTOR]] = cssClassName[STYLE_STRING]; - } - cssClassName[SELECTORS].forEach( - ({ [CLASS_NAME]: className2, [STYLE_STRING]: styleString }) => { - if (!added[className2]) { - allAdded = false; - toAdd[className2] = styleString; - } - } - ); - if (allAdded) { - return; - } - return Promise.resolve(raw("", [appendStyle])); - }; - const className = new String(cssClassName[CLASS_NAME]); - Object.assign(className, cssClassName); - className.isEscaped = true; - className.callbacks = [addClassNameToContext]; - const promise = Promise.resolve(className); - Object.assign(promise, cssClassName); - promise.toString = cssJsxDomObject.toString; - return promise; - }; - const css2 = (strings, ...values) => { - return newCssClassNameObject(cssCommon(strings, values)); - }; - const cx2 = (...args) => { - args = cxCommon(args); - return css2(Array(args.length).fill(""), ...args); - }; - const keyframes2 = keyframesCommon; - const viewTransition2 = ((strings, ...values) => { - return newCssClassNameObject(viewTransitionCommon(strings, values)); - }); - const Style2 = ({ children, nonce } = {}) => raw( - ``, - [ - ({ context }) => { - nonceMap.set(context, nonce); - return void 0; - } - ] - ); - Style2[DOM_RENDERER] = StyleRenderToDom; - return { - css: css2, - cx: cx2, - keyframes: keyframes2, - viewTransition: viewTransition2, - Style: Style2 - }; -}; -var defaultContext = createCssContext({ - id: DEFAULT_STYLE_ID -}); -var css = defaultContext.css; -var cx = defaultContext.cx; -var keyframes = defaultContext.keyframes; -var viewTransition = defaultContext.viewTransition; -var Style = defaultContext.Style; -export { - Style, - createCssContext, - css, - cx, - keyframes, - rawCssString, - viewTransition -}; diff --git a/node_modules/hono/dist/helper/dev/index.js b/node_modules/hono/dist/helper/dev/index.js deleted file mode 100644 index 98244ef..0000000 --- a/node_modules/hono/dist/helper/dev/index.js +++ /dev/null @@ -1,55 +0,0 @@ -// src/helper/dev/index.ts -import { getColorEnabled } from "../../utils/color.js"; -import { findTargetHandler, isMiddleware } from "../../utils/handler.js"; -var handlerName = (handler) => { - return handler.name || (isMiddleware(handler) ? "[middleware]" : "[handler]"); -}; -var inspectRoutes = (hono) => { - return hono.routes.map(({ path, method, handler }) => { - const targetHandler = findTargetHandler(handler); - return { - path, - method, - name: handlerName(targetHandler), - isMiddleware: isMiddleware(targetHandler) - }; - }); -}; -var showRoutes = (hono, opts) => { - const colorEnabled = opts?.colorize ?? getColorEnabled(); - const routeData = {}; - let maxMethodLength = 0; - let maxPathLength = 0; - inspectRoutes(hono).filter(({ isMiddleware: isMiddleware2 }) => opts?.verbose || !isMiddleware2).map((route) => { - const key = `${route.method}-${route.path}`; - (routeData[key] ||= []).push(route); - if (routeData[key].length > 1) { - return; - } - maxMethodLength = Math.max(maxMethodLength, route.method.length); - maxPathLength = Math.max(maxPathLength, route.path.length); - return { method: route.method, path: route.path, routes: routeData[key] }; - }).forEach((data) => { - if (!data) { - return; - } - const { method, path, routes } = data; - const methodStr = colorEnabled ? `\x1B[32m${method}\x1B[0m` : method; - console.log(`${methodStr} ${" ".repeat(maxMethodLength - method.length)} ${path}`); - if (!opts?.verbose) { - return; - } - routes.forEach(({ name }) => { - console.log(`${" ".repeat(maxMethodLength + 3)} ${name}`); - }); - }); -}; -var getRouterName = (app) => { - app.router.match("GET", "/"); - return app.router.name; -}; -export { - getRouterName, - inspectRoutes, - showRoutes -}; diff --git a/node_modules/hono/dist/helper/factory/index.js b/node_modules/hono/dist/helper/factory/index.js deleted file mode 100644 index 6b48e91..0000000 --- a/node_modules/hono/dist/helper/factory/index.js +++ /dev/null @@ -1,30 +0,0 @@ -// src/helper/factory/index.ts -import { Hono } from "../../hono.js"; -var Factory = class { - initApp; - #defaultAppOptions; - constructor(init) { - this.initApp = init?.initApp; - this.#defaultAppOptions = init?.defaultAppOptions; - } - createApp = (options) => { - const app = new Hono( - options && this.#defaultAppOptions ? { ...this.#defaultAppOptions, ...options } : options ?? this.#defaultAppOptions - ); - if (this.initApp) { - this.initApp(app); - } - return app; - }; - createMiddleware = (middleware) => middleware; - createHandlers = (...handlers) => { - return handlers.filter((handler) => handler !== void 0); - }; -}; -var createFactory = (init) => new Factory(init); -var createMiddleware = (middleware) => middleware; -export { - Factory, - createFactory, - createMiddleware -}; diff --git a/node_modules/hono/dist/helper/html/index.js b/node_modules/hono/dist/helper/html/index.js deleted file mode 100644 index d5726ca..0000000 --- a/node_modules/hono/dist/helper/html/index.js +++ /dev/null @@ -1,41 +0,0 @@ -// src/helper/html/index.ts -import { escapeToBuffer, raw, resolveCallbackSync, stringBufferToString } from "../../utils/html.js"; -var html = (strings, ...values) => { - const buffer = [""]; - for (let i = 0, len = strings.length - 1; i < len; i++) { - buffer[0] += strings[i]; - const children = Array.isArray(values[i]) ? values[i].flat(Infinity) : [values[i]]; - for (let i2 = 0, len2 = children.length; i2 < len2; i2++) { - const child = children[i2]; - if (typeof child === "string") { - escapeToBuffer(child, buffer); - } else if (typeof child === "number") { - ; - buffer[0] += child; - } else if (typeof child === "boolean" || child === null || child === void 0) { - continue; - } else if (typeof child === "object" && child.isEscaped) { - if (child.callbacks) { - buffer.unshift("", child); - } else { - const tmp = child.toString(); - if (tmp instanceof Promise) { - buffer.unshift("", tmp); - } else { - buffer[0] += tmp; - } - } - } else if (child instanceof Promise) { - buffer.unshift("", child); - } else { - escapeToBuffer(child.toString(), buffer); - } - } - } - buffer[0] += strings.at(-1); - return buffer.length === 1 ? "callbacks" in buffer ? raw(resolveCallbackSync(raw(buffer[0], buffer.callbacks))) : raw(buffer[0]) : stringBufferToString(buffer, buffer.callbacks); -}; -export { - html, - raw -}; diff --git a/node_modules/hono/dist/helper/proxy/index.js b/node_modules/hono/dist/helper/proxy/index.js deleted file mode 100644 index e666f7a..0000000 --- a/node_modules/hono/dist/helper/proxy/index.js +++ /dev/null @@ -1,89 +0,0 @@ -// src/helper/proxy/index.ts -import { HTTPException } from "../../http-exception.js"; -var hopByHopHeaders = [ - "connection", - "keep-alive", - "proxy-authenticate", - "proxy-authorization", - "te", - "trailer", - "transfer-encoding", - "upgrade" -]; -var ALLOWED_TOKEN_PATTERN = /^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/; -var buildRequestInitFromRequest = (request, strictConnectionProcessing) => { - if (!request) { - return {}; - } - const headers = new Headers(request.headers); - if (strictConnectionProcessing) { - const connectionValue = headers.get("connection"); - if (connectionValue) { - const headerNames = connectionValue.split(",").map((h) => h.trim()); - const invalidHeaders = headerNames.filter((h) => !ALLOWED_TOKEN_PATTERN.test(h)); - if (invalidHeaders.length > 0) { - throw new HTTPException(400, { - message: `Invalid Connection header value: ${invalidHeaders.join(", ")}` - }); - } - headerNames.forEach((headerName) => { - headers.delete(headerName); - }); - } - } - hopByHopHeaders.forEach((header) => { - headers.delete(header); - }); - return { - method: request.method, - body: request.body, - duplex: request.body ? "half" : void 0, - headers, - signal: request.signal - }; -}; -var preprocessRequestInit = (requestInit) => { - if (!requestInit.headers || Array.isArray(requestInit.headers) || requestInit.headers instanceof Headers) { - return requestInit; - } - const headers = new Headers(); - for (const [key, value] of Object.entries(requestInit.headers)) { - if (value == null) { - headers.delete(key); - } else { - headers.set(key, value); - } - } - requestInit.headers = headers; - return requestInit; -}; -var proxy = async (input, proxyInit) => { - const { - raw, - customFetch, - strictConnectionProcessing = false, - ...requestInit - } = proxyInit instanceof Request ? { raw: proxyInit } : proxyInit ?? {}; - const req = new Request(input, { - ...buildRequestInitFromRequest(raw, strictConnectionProcessing), - ...preprocessRequestInit(requestInit) - }); - req.headers.delete("accept-encoding"); - const res = await (customFetch || fetch)(req); - const resHeaders = new Headers(res.headers); - hopByHopHeaders.forEach((header) => { - resHeaders.delete(header); - }); - if (resHeaders.has("content-encoding")) { - resHeaders.delete("content-encoding"); - resHeaders.delete("content-length"); - } - return new Response(res.body, { - status: res.status, - statusText: res.statusText, - headers: resHeaders - }); -}; -export { - proxy -}; diff --git a/node_modules/hono/dist/helper/route/index.js b/node_modules/hono/dist/helper/route/index.js deleted file mode 100644 index 457d362..0000000 --- a/node_modules/hono/dist/helper/route/index.js +++ /dev/null @@ -1,46 +0,0 @@ -// src/helper/route/index.ts -import { GET_MATCH_RESULT } from "../../request/constants.js"; -import { getPattern, splitRoutingPath } from "../../utils/url.js"; -var matchedRoutes = (c) => ( - // @ts-expect-error c.req[GET_MATCH_RESULT] is not typed - c.req[GET_MATCH_RESULT][0].map(([[, route]]) => route) -); -var routePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.path ?? ""; -var baseRoutePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.basePath ?? ""; -var basePathCacheMap = /* @__PURE__ */ new WeakMap(); -var basePath = (c, index) => { - index ??= c.req.routeIndex; - const cache = basePathCacheMap.get(c) || []; - if (typeof cache[index] === "string") { - return cache[index]; - } - let result; - const rp = baseRoutePath(c, index); - if (!/[:*]/.test(rp)) { - result = rp; - } else { - const paths = splitRoutingPath(rp); - const reqPath = c.req.path; - let basePathLength = 0; - for (let i = 0, len = paths.length; i < len; i++) { - const pattern = getPattern(paths[i], paths[i + 1]); - if (pattern) { - const re = pattern[2] === true || pattern === "*" ? /[^\/]+/ : pattern[2]; - basePathLength += reqPath.substring(basePathLength + 1).match(re)?.[0].length || 0; - } else { - basePathLength += paths[i].length; - } - basePathLength += 1; - } - result = reqPath.substring(0, basePathLength); - } - cache[index] = result; - basePathCacheMap.set(c, cache); - return result; -}; -export { - basePath, - baseRoutePath, - matchedRoutes, - routePath -}; diff --git a/node_modules/hono/dist/helper/ssg/index.js b/node_modules/hono/dist/helper/ssg/index.js deleted file mode 100644 index 68bcb8e..0000000 --- a/node_modules/hono/dist/helper/ssg/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// src/helper/ssg/index.ts -export * from "./ssg.js"; -import { - X_HONO_DISABLE_SSG_HEADER_KEY, - ssgParams, - isSSGContext, - disableSSG, - onlySSG -} from "./middleware.js"; -export { - X_HONO_DISABLE_SSG_HEADER_KEY, - disableSSG, - isSSGContext, - onlySSG, - ssgParams -}; diff --git a/node_modules/hono/dist/helper/ssg/middleware.js b/node_modules/hono/dist/helper/ssg/middleware.js deleted file mode 100644 index ddb59bd..0000000 --- a/node_modules/hono/dist/helper/ssg/middleware.js +++ /dev/null @@ -1,45 +0,0 @@ -// src/helper/ssg/middleware.ts -import { isDynamicRoute } from "./utils.js"; -var SSG_CONTEXT = "HONO_SSG_CONTEXT"; -var X_HONO_DISABLE_SSG_HEADER_KEY = "x-hono-disable-ssg"; -var SSG_DISABLED_RESPONSE = (() => { - try { - return new Response("SSG is disabled", { - status: 404, - headers: { [X_HONO_DISABLE_SSG_HEADER_KEY]: "true" } - }); - } catch { - return null; - } -})(); -var ssgParams = (params) => async (c, next) => { - if (isDynamicRoute(c.req.path)) { - ; - c.req.raw.ssgParams = Array.isArray(params) ? params : await params(c); - return c.notFound(); - } - await next(); -}; -var isSSGContext = (c) => !!c.env?.[SSG_CONTEXT]; -var disableSSG = () => async function disableSSG2(c, next) { - if (isSSGContext(c)) { - c.header(X_HONO_DISABLE_SSG_HEADER_KEY, "true"); - return c.notFound(); - } - await next(); -}; -var onlySSG = () => async function onlySSG2(c, next) { - if (!isSSGContext(c)) { - return c.notFound(); - } - await next(); -}; -export { - SSG_CONTEXT, - SSG_DISABLED_RESPONSE, - X_HONO_DISABLE_SSG_HEADER_KEY, - disableSSG, - isSSGContext, - onlySSG, - ssgParams -}; diff --git a/node_modules/hono/dist/helper/ssg/ssg.js b/node_modules/hono/dist/helper/ssg/ssg.js deleted file mode 100644 index d51f07d..0000000 --- a/node_modules/hono/dist/helper/ssg/ssg.js +++ /dev/null @@ -1,295 +0,0 @@ -// src/helper/ssg/ssg.ts -import { replaceUrlParam } from "../../client/utils.js"; -import { createPool } from "../../utils/concurrent.js"; -import { getExtension } from "../../utils/mime.js"; -import { SSG_CONTEXT, X_HONO_DISABLE_SSG_HEADER_KEY } from "./middleware.js"; -import { dirname, filterStaticGenerateRoutes, isDynamicRoute, joinPaths } from "./utils.js"; -var DEFAULT_CONCURRENCY = 2; -var DEFAULT_CONTENT_TYPE = "text/plain"; -var DEFAULT_OUTPUT_DIR = "./static"; -var generateFilePath = (routePath, outDir, mimeType, extensionMap) => { - const extension = determineExtension(mimeType, extensionMap); - if (routePath.endsWith(`.${extension}`)) { - return joinPaths(outDir, routePath); - } - if (routePath === "/") { - return joinPaths(outDir, `index.${extension}`); - } - if (routePath.endsWith("/")) { - return joinPaths(outDir, routePath, `index.${extension}`); - } - return joinPaths(outDir, `${routePath}.${extension}`); -}; -var parseResponseContent = async (response) => { - const contentType = response.headers.get("Content-Type"); - try { - if (contentType?.includes("text") || contentType?.includes("json")) { - return await response.text(); - } else { - return await response.arrayBuffer(); - } - } catch (error) { - throw new Error( - `Error processing response: ${error instanceof Error ? error.message : "Unknown error"}` - ); - } -}; -var defaultExtensionMap = { - "text/html": "html", - "text/xml": "xml", - "application/xml": "xml", - "application/yaml": "yaml" -}; -var determineExtension = (mimeType, userExtensionMap) => { - const extensionMap = userExtensionMap || defaultExtensionMap; - if (mimeType in extensionMap) { - return extensionMap[mimeType]; - } - return getExtension(mimeType) || "html"; -}; -var combineBeforeRequestHooks = (hooks) => { - if (!Array.isArray(hooks)) { - return hooks; - } - return async (req) => { - let currentReq = req; - for (const hook of hooks) { - const result = await hook(currentReq); - if (result === false) { - return false; - } - if (result instanceof Request) { - currentReq = result; - } - } - return currentReq; - }; -}; -var combineAfterResponseHooks = (hooks) => { - if (!Array.isArray(hooks)) { - return hooks; - } - return async (res) => { - let currentRes = res; - for (const hook of hooks) { - const result = await hook(currentRes); - if (result === false) { - return false; - } - if (result instanceof Response) { - currentRes = result; - } - } - return currentRes; - }; -}; -var combineAfterGenerateHooks = (hooks, fsModule, options) => { - if (!Array.isArray(hooks)) { - return hooks; - } - return async (result) => { - for (const hook of hooks) { - await hook(result, fsModule, options); - } - }; -}; -var fetchRoutesContent = function* (app, beforeRequestHook, afterResponseHook, concurrency) { - const baseURL = "http://localhost"; - const pool = createPool({ concurrency }); - for (const route of filterStaticGenerateRoutes(app)) { - const thisRouteBaseURL = new URL(route.path, baseURL).toString(); - let forGetInfoURLRequest = new Request(thisRouteBaseURL); - yield new Promise(async (resolveGetInfo, rejectGetInfo) => { - try { - if (beforeRequestHook) { - const maybeRequest = await beforeRequestHook(forGetInfoURLRequest); - if (!maybeRequest) { - resolveGetInfo(void 0); - return; - } - forGetInfoURLRequest = maybeRequest; - } - await pool.run(() => app.fetch(forGetInfoURLRequest)); - if (!forGetInfoURLRequest.ssgParams) { - if (isDynamicRoute(route.path)) { - resolveGetInfo(void 0); - return; - } - forGetInfoURLRequest.ssgParams = [{}]; - } - const requestInit = { - method: forGetInfoURLRequest.method, - headers: forGetInfoURLRequest.headers - }; - resolveGetInfo( - (function* () { - for (const param of forGetInfoURLRequest.ssgParams) { - yield new Promise(async (resolveReq, rejectReq) => { - try { - const replacedUrlParam = replaceUrlParam(route.path, param); - let response = await pool.run( - () => app.request(replacedUrlParam, requestInit, { - [SSG_CONTEXT]: true - }) - ); - if (response.headers.get(X_HONO_DISABLE_SSG_HEADER_KEY)) { - resolveReq(void 0); - return; - } - if (afterResponseHook) { - const maybeResponse = await afterResponseHook(response); - if (!maybeResponse) { - resolveReq(void 0); - return; - } - response = maybeResponse; - } - const mimeType = response.headers.get("Content-Type")?.split(";")[0] || DEFAULT_CONTENT_TYPE; - const content = await parseResponseContent(response); - resolveReq({ - routePath: replacedUrlParam, - mimeType, - content - }); - } catch (error) { - rejectReq(error); - } - }); - } - })() - ); - } catch (error) { - rejectGetInfo(error); - } - }); - } -}; -var createdDirs = /* @__PURE__ */ new Set(); -var saveContentToFile = async (data, fsModule, outDir, extensionMap) => { - const awaitedData = await data; - if (!awaitedData) { - return; - } - const { routePath, content, mimeType } = awaitedData; - const filePath = generateFilePath(routePath, outDir, mimeType, extensionMap); - const dirPath = dirname(filePath); - if (!createdDirs.has(dirPath)) { - await fsModule.mkdir(dirPath, { recursive: true }); - createdDirs.add(dirPath); - } - if (typeof content === "string") { - await fsModule.writeFile(filePath, content); - } else if (content instanceof ArrayBuffer) { - await fsModule.writeFile(filePath, new Uint8Array(content)); - } - return filePath; -}; -var defaultPlugin = { - afterResponseHook: (res) => { - if (res.status !== 200) { - return false; - } - return res; - } -}; -var toSSG = async (app, fs, options) => { - let result; - const getInfoPromises = []; - const savePromises = []; - const plugins = options?.plugins || [defaultPlugin]; - const beforeRequestHooks = []; - const afterResponseHooks = []; - const afterGenerateHooks = []; - if (options?.beforeRequestHook) { - beforeRequestHooks.push( - ...Array.isArray(options.beforeRequestHook) ? options.beforeRequestHook : [options.beforeRequestHook] - ); - } - if (options?.afterResponseHook) { - afterResponseHooks.push( - ...Array.isArray(options.afterResponseHook) ? options.afterResponseHook : [options.afterResponseHook] - ); - } - if (options?.afterGenerateHook) { - afterGenerateHooks.push( - ...Array.isArray(options.afterGenerateHook) ? options.afterGenerateHook : [options.afterGenerateHook] - ); - } - for (const plugin of plugins) { - if (plugin.beforeRequestHook) { - beforeRequestHooks.push( - ...Array.isArray(plugin.beforeRequestHook) ? plugin.beforeRequestHook : [plugin.beforeRequestHook] - ); - } - if (plugin.afterResponseHook) { - afterResponseHooks.push( - ...Array.isArray(plugin.afterResponseHook) ? plugin.afterResponseHook : [plugin.afterResponseHook] - ); - } - if (plugin.afterGenerateHook) { - afterGenerateHooks.push( - ...Array.isArray(plugin.afterGenerateHook) ? plugin.afterGenerateHook : [plugin.afterGenerateHook] - ); - } - } - try { - const outputDir = options?.dir ?? DEFAULT_OUTPUT_DIR; - const concurrency = options?.concurrency ?? DEFAULT_CONCURRENCY; - const combinedBeforeRequestHook = combineBeforeRequestHooks( - beforeRequestHooks.length > 0 ? beforeRequestHooks : [(req) => req] - ); - const combinedAfterResponseHook = combineAfterResponseHooks( - afterResponseHooks.length > 0 ? afterResponseHooks : [(req) => req] - ); - const getInfoGen = fetchRoutesContent( - app, - combinedBeforeRequestHook, - combinedAfterResponseHook, - concurrency - ); - for (const getInfo of getInfoGen) { - getInfoPromises.push( - getInfo.then((getContentGen) => { - if (!getContentGen) { - return; - } - for (const content of getContentGen) { - savePromises.push( - saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e) - ); - } - }) - ); - } - await Promise.all(getInfoPromises); - const files = []; - for (const savePromise of savePromises) { - const fileOrError = await savePromise; - if (typeof fileOrError === "string") { - files.push(fileOrError); - } else if (fileOrError) { - throw fileOrError; - } - } - result = { success: true, files }; - } catch (error) { - const errorObj = error instanceof Error ? error : new Error(String(error)); - result = { success: false, files: [], error: errorObj }; - } - if (afterGenerateHooks.length > 0) { - const combinedAfterGenerateHooks = combineAfterGenerateHooks(afterGenerateHooks, fs, options); - await combinedAfterGenerateHooks(result, fs, options); - } - return result; -}; -export { - DEFAULT_OUTPUT_DIR, - combineAfterGenerateHooks, - combineAfterResponseHooks, - combineBeforeRequestHooks, - defaultExtensionMap, - defaultPlugin, - fetchRoutesContent, - saveContentToFile, - toSSG -}; diff --git a/node_modules/hono/dist/helper/ssg/utils.js b/node_modules/hono/dist/helper/ssg/utils.js deleted file mode 100644 index 793b5dc..0000000 --- a/node_modules/hono/dist/helper/ssg/utils.js +++ /dev/null @@ -1,59 +0,0 @@ -// src/helper/ssg/utils.ts -import { METHOD_NAME_ALL } from "../../router.js"; -import { findTargetHandler, isMiddleware } from "../../utils/handler.js"; -var dirname = (path) => { - const separatedPath = path.split(/[\/\\]/); - return separatedPath.slice(0, -1).join("/"); -}; -var normalizePath = (path) => { - return path.replace(/(\\)/g, "/").replace(/\/$/g, ""); -}; -var handleParent = (resultPaths, beforeParentFlag) => { - if (resultPaths.length === 0 || beforeParentFlag) { - resultPaths.push(".."); - } else { - resultPaths.pop(); - } -}; -var handleNonDot = (path, resultPaths) => { - path = path.replace(/^\.(?!.)/, ""); - if (path !== "") { - resultPaths.push(path); - } -}; -var handleSegments = (paths, resultPaths) => { - let beforeParentFlag = false; - for (const path of paths) { - if (path === "..") { - handleParent(resultPaths, beforeParentFlag); - beforeParentFlag = true; - } else { - handleNonDot(path, resultPaths); - beforeParentFlag = false; - } - } -}; -var joinPaths = (...paths) => { - paths = paths.map(normalizePath); - const resultPaths = []; - handleSegments(paths.join("/").split("/"), resultPaths); - return (paths[0][0] === "/" ? "/" : "") + resultPaths.join("/"); -}; -var filterStaticGenerateRoutes = (hono) => { - return hono.routes.reduce((acc, { method, handler, path }) => { - const targetHandler = findTargetHandler(handler); - if (["GET", METHOD_NAME_ALL].includes(method) && !isMiddleware(targetHandler)) { - acc.push({ path }); - } - return acc; - }, []); -}; -var isDynamicRoute = (path) => { - return path.split("/").some((segment) => segment.startsWith(":") || segment.includes("*")); -}; -export { - dirname, - filterStaticGenerateRoutes, - isDynamicRoute, - joinPaths -}; diff --git a/node_modules/hono/dist/helper/streaming/index.js b/node_modules/hono/dist/helper/streaming/index.js deleted file mode 100644 index c59a2d0..0000000 --- a/node_modules/hono/dist/helper/streaming/index.js +++ /dev/null @@ -1,10 +0,0 @@ -// src/helper/streaming/index.ts -import { stream } from "./stream.js"; -import { streamSSE, SSEStreamingApi } from "./sse.js"; -import { streamText } from "./text.js"; -export { - SSEStreamingApi, - stream, - streamSSE, - streamText -}; diff --git a/node_modules/hono/dist/helper/streaming/sse.js b/node_modules/hono/dist/helper/streaming/sse.js deleted file mode 100644 index d9e8c72..0000000 --- a/node_modules/hono/dist/helper/streaming/sse.js +++ /dev/null @@ -1,62 +0,0 @@ -// src/helper/streaming/sse.ts -import { HtmlEscapedCallbackPhase, resolveCallback } from "../../utils/html.js"; -import { StreamingApi } from "../../utils/stream.js"; -import { isOldBunVersion } from "./utils.js"; -var SSEStreamingApi = class extends StreamingApi { - constructor(writable, readable) { - super(writable, readable); - } - async writeSSE(message) { - const data = await resolveCallback(message.data, HtmlEscapedCallbackPhase.Stringify, false, {}); - const dataLines = data.split(/\r\n|\r|\n/).map((line) => { - return `data: ${line}`; - }).join("\n"); - const sseData = [ - message.event && `event: ${message.event}`, - dataLines, - message.id && `id: ${message.id}`, - message.retry && `retry: ${message.retry}` - ].filter(Boolean).join("\n") + "\n\n"; - await this.write(sseData); - } -}; -var run = async (stream, cb, onError) => { - try { - await cb(stream); - } catch (e) { - if (e instanceof Error && onError) { - await onError(e, stream); - await stream.writeSSE({ - event: "error", - data: e.message - }); - } else { - console.error(e); - } - } finally { - stream.close(); - } -}; -var contextStash = /* @__PURE__ */ new WeakMap(); -var streamSSE = (c, cb, onError) => { - const { readable, writable } = new TransformStream(); - const stream = new SSEStreamingApi(writable, readable); - if (isOldBunVersion()) { - c.req.raw.signal.addEventListener("abort", () => { - if (!stream.closed) { - stream.abort(); - } - }); - } - contextStash.set(stream.responseReadable, c); - c.header("Transfer-Encoding", "chunked"); - c.header("Content-Type", "text/event-stream"); - c.header("Cache-Control", "no-cache"); - c.header("Connection", "keep-alive"); - run(stream, cb, onError); - return c.newResponse(stream.responseReadable); -}; -export { - SSEStreamingApi, - streamSSE -}; diff --git a/node_modules/hono/dist/helper/streaming/stream.js b/node_modules/hono/dist/helper/streaming/stream.js deleted file mode 100644 index 8a3feb4..0000000 --- a/node_modules/hono/dist/helper/streaming/stream.js +++ /dev/null @@ -1,34 +0,0 @@ -// src/helper/streaming/stream.ts -import { StreamingApi } from "../../utils/stream.js"; -import { isOldBunVersion } from "./utils.js"; -var contextStash = /* @__PURE__ */ new WeakMap(); -var stream = (c, cb, onError) => { - const { readable, writable } = new TransformStream(); - const stream2 = new StreamingApi(writable, readable); - if (isOldBunVersion()) { - c.req.raw.signal.addEventListener("abort", () => { - if (!stream2.closed) { - stream2.abort(); - } - }); - } - contextStash.set(stream2.responseReadable, c); - (async () => { - try { - await cb(stream2); - } catch (e) { - if (e === void 0) { - } else if (e instanceof Error && onError) { - await onError(e, stream2); - } else { - console.error(e); - } - } finally { - stream2.close(); - } - })(); - return c.newResponse(stream2.responseReadable); -}; -export { - stream -}; diff --git a/node_modules/hono/dist/helper/streaming/text.js b/node_modules/hono/dist/helper/streaming/text.js deleted file mode 100644 index 9e93cab..0000000 --- a/node_modules/hono/dist/helper/streaming/text.js +++ /dev/null @@ -1,12 +0,0 @@ -// src/helper/streaming/text.ts -import { TEXT_PLAIN } from "../../context.js"; -import { stream } from "./index.js"; -var streamText = (c, cb, onError) => { - c.header("Content-Type", TEXT_PLAIN); - c.header("X-Content-Type-Options", "nosniff"); - c.header("Transfer-Encoding", "chunked"); - return stream(c, cb, onError); -}; -export { - streamText -}; diff --git a/node_modules/hono/dist/helper/streaming/utils.js b/node_modules/hono/dist/helper/streaming/utils.js deleted file mode 100644 index 671f441..0000000 --- a/node_modules/hono/dist/helper/streaming/utils.js +++ /dev/null @@ -1,13 +0,0 @@ -// src/helper/streaming/utils.ts -var isOldBunVersion = () => { - const version = typeof Bun !== "undefined" ? Bun.version : void 0; - if (version === void 0) { - return false; - } - const result = version.startsWith("1.1") || version.startsWith("1.0") || version.startsWith("0."); - isOldBunVersion = () => result; - return result; -}; -export { - isOldBunVersion -}; diff --git a/node_modules/hono/dist/helper/testing/index.js b/node_modules/hono/dist/helper/testing/index.js deleted file mode 100644 index 7ba1034..0000000 --- a/node_modules/hono/dist/helper/testing/index.js +++ /dev/null @@ -1,11 +0,0 @@ -// src/helper/testing/index.ts -import { hc } from "../../client/index.js"; -var testClient = (app, Env, executionCtx, options) => { - const customFetch = (input, init) => { - return app.request(input, init, Env, executionCtx); - }; - return hc("http://localhost", { ...options, fetch: customFetch }); -}; -export { - testClient -}; diff --git a/node_modules/hono/dist/helper/websocket/index.js b/node_modules/hono/dist/helper/websocket/index.js deleted file mode 100644 index 1225415..0000000 --- a/node_modules/hono/dist/helper/websocket/index.js +++ /dev/null @@ -1,57 +0,0 @@ -// src/helper/websocket/index.ts -var WSContext = class { - #init; - constructor(init) { - this.#init = init; - this.raw = init.raw; - this.url = init.url ? new URL(init.url) : null; - this.protocol = init.protocol ?? null; - } - send(source, options) { - this.#init.send(source, options ?? {}); - } - raw; - binaryType = "arraybuffer"; - get readyState() { - return this.#init.readyState; - } - url; - protocol; - close(code, reason) { - this.#init.close(code, reason); - } -}; -var createWSMessageEvent = (source) => { - return new MessageEvent("message", { - data: source - }); -}; -var defineWebSocketHelper = (handler) => { - return ((...args) => { - if (typeof args[0] === "function") { - const [createEvents, options] = args; - return async function upgradeWebSocket(c, next) { - const events = await createEvents(c); - const result = await handler(c, events, options); - if (result) { - return result; - } - await next(); - }; - } else { - const [c, events, options] = args; - return (async () => { - const upgraded = await handler(c, events, options); - if (!upgraded) { - throw new Error("Failed to upgrade WebSocket"); - } - return upgraded; - })(); - } - }); -}; -export { - WSContext, - createWSMessageEvent, - defineWebSocketHelper -}; diff --git a/node_modules/hono/dist/hono-base.js b/node_modules/hono/dist/hono-base.js deleted file mode 100644 index 61003a8..0000000 --- a/node_modules/hono/dist/hono-base.js +++ /dev/null @@ -1,378 +0,0 @@ -// src/hono-base.ts -import { compose } from "./compose.js"; -import { Context } from "./context.js"; -import { METHODS, METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE } from "./router.js"; -import { COMPOSED_HANDLER } from "./utils/constants.js"; -import { getPath, getPathNoStrict, mergePath } from "./utils/url.js"; -var notFoundHandler = (c) => { - return c.text("404 Not Found", 404); -}; -var errorHandler = (err, c) => { - if ("getResponse" in err) { - const res = err.getResponse(); - return c.newResponse(res.body, res); - } - console.error(err); - return c.text("Internal Server Error", 500); -}; -var Hono = class _Hono { - get; - post; - put; - delete; - options; - patch; - all; - on; - use; - /* - This class is like an abstract class and does not have a router. - To use it, inherit the class and implement router in the constructor. - */ - router; - getPath; - // Cannot use `#` because it requires visibility at JavaScript runtime. - _basePath = "/"; - #path = "/"; - routes = []; - constructor(options = {}) { - const allMethods = [...METHODS, METHOD_NAME_ALL_LOWERCASE]; - allMethods.forEach((method) => { - this[method] = (args1, ...args) => { - if (typeof args1 === "string") { - this.#path = args1; - } else { - this.#addRoute(method, this.#path, args1); - } - args.forEach((handler) => { - this.#addRoute(method, this.#path, handler); - }); - return this; - }; - }); - this.on = (method, path, ...handlers) => { - for (const p of [path].flat()) { - this.#path = p; - for (const m of [method].flat()) { - handlers.map((handler) => { - this.#addRoute(m.toUpperCase(), this.#path, handler); - }); - } - } - return this; - }; - this.use = (arg1, ...handlers) => { - if (typeof arg1 === "string") { - this.#path = arg1; - } else { - this.#path = "*"; - handlers.unshift(arg1); - } - handlers.forEach((handler) => { - this.#addRoute(METHOD_NAME_ALL, this.#path, handler); - }); - return this; - }; - const { strict, ...optionsWithoutStrict } = options; - Object.assign(this, optionsWithoutStrict); - this.getPath = strict ?? true ? options.getPath ?? getPath : getPathNoStrict; - } - #clone() { - const clone = new _Hono({ - router: this.router, - getPath: this.getPath - }); - clone.errorHandler = this.errorHandler; - clone.#notFoundHandler = this.#notFoundHandler; - clone.routes = this.routes; - return clone; - } - #notFoundHandler = notFoundHandler; - // Cannot use `#` because it requires visibility at JavaScript runtime. - errorHandler = errorHandler; - /** - * `.route()` allows grouping other Hono instance in routes. - * - * @see {@link https://hono.dev/docs/api/routing#grouping} - * - * @param {string} path - base Path - * @param {Hono} app - other Hono instance - * @returns {Hono} routed Hono instance - * - * @example - * ```ts - * const app = new Hono() - * const app2 = new Hono() - * - * app2.get("/user", (c) => c.text("user")) - * app.route("/api", app2) // GET /api/user - * ``` - */ - route(path, app) { - const subApp = this.basePath(path); - app.routes.map((r) => { - let handler; - if (app.errorHandler === errorHandler) { - handler = r.handler; - } else { - handler = async (c, next) => (await compose([], app.errorHandler)(c, () => r.handler(c, next))).res; - handler[COMPOSED_HANDLER] = r.handler; - } - subApp.#addRoute(r.method, r.path, handler); - }); - return this; - } - /** - * `.basePath()` allows base paths to be specified. - * - * @see {@link https://hono.dev/docs/api/routing#base-path} - * - * @param {string} path - base Path - * @returns {Hono} changed Hono instance - * - * @example - * ```ts - * const api = new Hono().basePath('/api') - * ``` - */ - basePath(path) { - const subApp = this.#clone(); - subApp._basePath = mergePath(this._basePath, path); - return subApp; - } - /** - * `.onError()` handles an error and returns a customized Response. - * - * @see {@link https://hono.dev/docs/api/hono#error-handling} - * - * @param {ErrorHandler} handler - request Handler for error - * @returns {Hono} changed Hono instance - * - * @example - * ```ts - * app.onError((err, c) => { - * console.error(`${err}`) - * return c.text('Custom Error Message', 500) - * }) - * ``` - */ - onError = (handler) => { - this.errorHandler = handler; - return this; - }; - /** - * `.notFound()` allows you to customize a Not Found Response. - * - * @see {@link https://hono.dev/docs/api/hono#not-found} - * - * @param {NotFoundHandler} handler - request handler for not-found - * @returns {Hono} changed Hono instance - * - * @example - * ```ts - * app.notFound((c) => { - * return c.text('Custom 404 Message', 404) - * }) - * ``` - */ - notFound = (handler) => { - this.#notFoundHandler = handler; - return this; - }; - /** - * `.mount()` allows you to mount applications built with other frameworks into your Hono application. - * - * @see {@link https://hono.dev/docs/api/hono#mount} - * - * @param {string} path - base Path - * @param {Function} applicationHandler - other Request Handler - * @param {MountOptions} [options] - options of `.mount()` - * @returns {Hono} mounted Hono instance - * - * @example - * ```ts - * import { Router as IttyRouter } from 'itty-router' - * import { Hono } from 'hono' - * // Create itty-router application - * const ittyRouter = IttyRouter() - * // GET /itty-router/hello - * ittyRouter.get('/hello', () => new Response('Hello from itty-router')) - * - * const app = new Hono() - * app.mount('/itty-router', ittyRouter.handle) - * ``` - * - * @example - * ```ts - * const app = new Hono() - * // Send the request to another application without modification. - * app.mount('/app', anotherApp, { - * replaceRequest: (req) => req, - * }) - * ``` - */ - mount(path, applicationHandler, options) { - let replaceRequest; - let optionHandler; - if (options) { - if (typeof options === "function") { - optionHandler = options; - } else { - optionHandler = options.optionHandler; - if (options.replaceRequest === false) { - replaceRequest = (request) => request; - } else { - replaceRequest = options.replaceRequest; - } - } - } - const getOptions = optionHandler ? (c) => { - const options2 = optionHandler(c); - return Array.isArray(options2) ? options2 : [options2]; - } : (c) => { - let executionContext = void 0; - try { - executionContext = c.executionCtx; - } catch { - } - return [c.env, executionContext]; - }; - replaceRequest ||= (() => { - const mergedPath = mergePath(this._basePath, path); - const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length; - return (request) => { - const url = new URL(request.url); - url.pathname = url.pathname.slice(pathPrefixLength) || "/"; - return new Request(url, request); - }; - })(); - const handler = async (c, next) => { - const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c)); - if (res) { - return res; - } - await next(); - }; - this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler); - return this; - } - #addRoute(method, path, handler) { - method = method.toUpperCase(); - path = mergePath(this._basePath, path); - const r = { basePath: this._basePath, path, method, handler }; - this.router.add(method, path, [handler, r]); - this.routes.push(r); - } - #handleError(err, c) { - if (err instanceof Error) { - return this.errorHandler(err, c); - } - throw err; - } - #dispatch(request, executionCtx, env, method) { - if (method === "HEAD") { - return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))(); - } - const path = this.getPath(request, { env }); - const matchResult = this.router.match(method, path); - const c = new Context(request, { - path, - matchResult, - env, - executionCtx, - notFoundHandler: this.#notFoundHandler - }); - if (matchResult[0].length === 1) { - let res; - try { - res = matchResult[0][0][0][0](c, async () => { - c.res = await this.#notFoundHandler(c); - }); - } catch (err) { - return this.#handleError(err, c); - } - return res instanceof Promise ? res.then( - (resolved) => resolved || (c.finalized ? c.res : this.#notFoundHandler(c)) - ).catch((err) => this.#handleError(err, c)) : res ?? this.#notFoundHandler(c); - } - const composed = compose(matchResult[0], this.errorHandler, this.#notFoundHandler); - return (async () => { - try { - const context = await composed(c); - if (!context.finalized) { - throw new Error( - "Context is not finalized. Did you forget to return a Response object or `await next()`?" - ); - } - return context.res; - } catch (err) { - return this.#handleError(err, c); - } - })(); - } - /** - * `.fetch()` will be entry point of your app. - * - * @see {@link https://hono.dev/docs/api/hono#fetch} - * - * @param {Request} request - request Object of request - * @param {Env} Env - env Object - * @param {ExecutionContext} - context of execution - * @returns {Response | Promise} response of request - * - */ - fetch = (request, ...rest) => { - return this.#dispatch(request, rest[1], rest[0], request.method); - }; - /** - * `.request()` is a useful method for testing. - * You can pass a URL or pathname to send a GET request. - * app will return a Response object. - * ```ts - * test('GET /hello is ok', async () => { - * const res = await app.request('/hello') - * expect(res.status).toBe(200) - * }) - * ``` - * @see https://hono.dev/docs/api/hono#request - */ - request = (input, requestInit, Env, executionCtx) => { - if (input instanceof Request) { - return this.fetch(requestInit ? new Request(input, requestInit) : input, Env, executionCtx); - } - input = input.toString(); - return this.fetch( - new Request( - /^https?:\/\//.test(input) ? input : `http://localhost${mergePath("/", input)}`, - requestInit - ), - Env, - executionCtx - ); - }; - /** - * `.fire()` automatically adds a global fetch event listener. - * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers. - * @deprecated - * Use `fire` from `hono/service-worker` instead. - * ```ts - * import { Hono } from 'hono' - * import { fire } from 'hono/service-worker' - * - * const app = new Hono() - * // ... - * fire(app) - * ``` - * @see https://hono.dev/docs/api/hono#fire - * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API - * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ - */ - fire = () => { - addEventListener("fetch", (event) => { - event.respondWith(this.#dispatch(event.request, event, void 0, event.request.method)); - }); - }; -}; -export { - Hono as HonoBase -}; diff --git a/node_modules/hono/dist/hono.js b/node_modules/hono/dist/hono.js deleted file mode 100644 index ff63386..0000000 --- a/node_modules/hono/dist/hono.js +++ /dev/null @@ -1,21 +0,0 @@ -// src/hono.ts -import { HonoBase } from "./hono-base.js"; -import { RegExpRouter } from "./router/reg-exp-router/index.js"; -import { SmartRouter } from "./router/smart-router/index.js"; -import { TrieRouter } from "./router/trie-router/index.js"; -var Hono = class extends HonoBase { - /** - * Creates an instance of the Hono class. - * - * @param options - Optional configuration options for the Hono instance. - */ - constructor(options = {}) { - super(options); - this.router = options.router ?? new SmartRouter({ - routers: [new RegExpRouter(), new TrieRouter()] - }); - } -}; -export { - Hono -}; diff --git a/node_modules/hono/dist/http-exception.js b/node_modules/hono/dist/http-exception.js deleted file mode 100644 index 070a51f..0000000 --- a/node_modules/hono/dist/http-exception.js +++ /dev/null @@ -1,35 +0,0 @@ -// src/http-exception.ts -var HTTPException = class extends Error { - res; - status; - /** - * Creates an instance of `HTTPException`. - * @param status - HTTP status code for the exception. Defaults to 500. - * @param options - Additional options for the exception. - */ - constructor(status = 500, options) { - super(options?.message, { cause: options?.cause }); - this.res = options?.res; - this.status = status; - } - /** - * Returns the response object associated with the exception. - * If a response object is not provided, a new response is created with the error message and status code. - * @returns The response object. - */ - getResponse() { - if (this.res) { - const newResponse = new Response(this.res.body, { - status: this.status, - headers: this.res.headers - }); - return newResponse; - } - return new Response(this.message, { - status: this.status - }); - } -}; -export { - HTTPException -}; diff --git a/node_modules/hono/dist/index.js b/node_modules/hono/dist/index.js deleted file mode 100644 index 7f45bb9..0000000 --- a/node_modules/hono/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/index.ts -import { Hono } from "./hono.js"; -export { - Hono -}; diff --git a/node_modules/hono/dist/jsx/base.js b/node_modules/hono/dist/jsx/base.js deleted file mode 100644 index 105e25c..0000000 --- a/node_modules/hono/dist/jsx/base.js +++ /dev/null @@ -1,331 +0,0 @@ -// src/jsx/base.ts -import { raw } from "../helper/html/index.js"; -import { escapeToBuffer, resolveCallbackSync, stringBufferToString } from "../utils/html.js"; -import { DOM_RENDERER, DOM_MEMO } from "./constants.js"; -import { createContext, globalContexts, useContext } from "./context.js"; -import { domRenderers } from "./intrinsic-element/common.js"; -import * as intrinsicElementTags from "./intrinsic-element/components.js"; -import { normalizeIntrinsicElementKey, styleObjectForEach } from "./utils.js"; -var nameSpaceContext = void 0; -var getNameSpaceContext = () => nameSpaceContext; -var toSVGAttributeName = (key) => /[A-Z]/.test(key) && // Presentation attributes are findable in style object. "clip-path", "font-size", "stroke-width", etc. -// Or other un-deprecated kebab-case attributes. "overline-position", "paint-order", "strikethrough-position", etc. -key.match( - /^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/ -) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key; -var emptyTags = [ - "area", - "base", - "br", - "col", - "embed", - "hr", - "img", - "input", - "keygen", - "link", - "meta", - "param", - "source", - "track", - "wbr" -]; -var booleanAttributes = [ - "allowfullscreen", - "async", - "autofocus", - "autoplay", - "checked", - "controls", - "default", - "defer", - "disabled", - "download", - "formnovalidate", - "hidden", - "inert", - "ismap", - "itemscope", - "loop", - "multiple", - "muted", - "nomodule", - "novalidate", - "open", - "playsinline", - "readonly", - "required", - "reversed", - "selected" -]; -var childrenToStringToBuffer = (children, buffer) => { - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if (typeof child === "string") { - escapeToBuffer(child, buffer); - } else if (typeof child === "boolean" || child === null || child === void 0) { - continue; - } else if (child instanceof JSXNode) { - child.toStringToBuffer(buffer); - } else if (typeof child === "number" || child.isEscaped) { - ; - buffer[0] += child; - } else if (child instanceof Promise) { - buffer.unshift("", child); - } else { - childrenToStringToBuffer(child, buffer); - } - } -}; -var JSXNode = class { - tag; - props; - key; - children; - isEscaped = true; - localContexts; - constructor(tag, props, children) { - this.tag = tag; - this.props = props; - this.children = children; - } - get type() { - return this.tag; - } - // Added for compatibility with libraries that rely on React's internal structure - // eslint-disable-next-line @typescript-eslint/no-explicit-any - get ref() { - return this.props.ref || null; - } - toString() { - const buffer = [""]; - this.localContexts?.forEach(([context, value]) => { - context.values.push(value); - }); - try { - this.toStringToBuffer(buffer); - } finally { - this.localContexts?.forEach(([context]) => { - context.values.pop(); - }); - } - return buffer.length === 1 ? "callbacks" in buffer ? resolveCallbackSync(raw(buffer[0], buffer.callbacks)).toString() : buffer[0] : stringBufferToString(buffer, buffer.callbacks); - } - toStringToBuffer(buffer) { - const tag = this.tag; - const props = this.props; - let { children } = this; - buffer[0] += `<${tag}`; - const normalizeKey = nameSpaceContext && useContext(nameSpaceContext) === "svg" ? (key) => toSVGAttributeName(normalizeIntrinsicElementKey(key)) : (key) => normalizeIntrinsicElementKey(key); - for (let [key, v] of Object.entries(props)) { - key = normalizeKey(key); - if (key === "children") { - } else if (key === "style" && typeof v === "object") { - let styleStr = ""; - styleObjectForEach(v, (property, value) => { - if (value != null) { - styleStr += `${styleStr ? ";" : ""}${property}:${value}`; - } - }); - buffer[0] += ' style="'; - escapeToBuffer(styleStr, buffer); - buffer[0] += '"'; - } else if (typeof v === "string") { - buffer[0] += ` ${key}="`; - escapeToBuffer(v, buffer); - buffer[0] += '"'; - } else if (v === null || v === void 0) { - } else if (typeof v === "number" || v.isEscaped) { - buffer[0] += ` ${key}="${v}"`; - } else if (typeof v === "boolean" && booleanAttributes.includes(key)) { - if (v) { - buffer[0] += ` ${key}=""`; - } - } else if (key === "dangerouslySetInnerHTML") { - if (children.length > 0) { - throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."); - } - children = [raw(v.__html)]; - } else if (v instanceof Promise) { - buffer[0] += ` ${key}="`; - buffer.unshift('"', v); - } else if (typeof v === "function") { - if (!key.startsWith("on") && key !== "ref") { - throw new Error(`Invalid prop '${key}' of type 'function' supplied to '${tag}'.`); - } - } else { - buffer[0] += ` ${key}="`; - escapeToBuffer(v.toString(), buffer); - buffer[0] += '"'; - } - } - if (emptyTags.includes(tag) && children.length === 0) { - buffer[0] += "/>"; - return; - } - buffer[0] += ">"; - childrenToStringToBuffer(children, buffer); - buffer[0] += ``; - } -}; -var JSXFunctionNode = class extends JSXNode { - toStringToBuffer(buffer) { - const { children } = this; - const props = { ...this.props }; - if (children.length) { - props.children = children.length === 1 ? children[0] : children; - } - const res = this.tag.call(null, props); - if (typeof res === "boolean" || res == null) { - return; - } else if (res instanceof Promise) { - if (globalContexts.length === 0) { - buffer.unshift("", res); - } else { - const currentContexts = globalContexts.map((c) => [c, c.values.at(-1)]); - buffer.unshift( - "", - res.then((childRes) => { - if (childRes instanceof JSXNode) { - childRes.localContexts = currentContexts; - } - return childRes; - }) - ); - } - } else if (res instanceof JSXNode) { - res.toStringToBuffer(buffer); - } else if (typeof res === "number" || res.isEscaped) { - buffer[0] += res; - if (res.callbacks) { - buffer.callbacks ||= []; - buffer.callbacks.push(...res.callbacks); - } - } else { - escapeToBuffer(res, buffer); - } - } -}; -var JSXFragmentNode = class extends JSXNode { - toStringToBuffer(buffer) { - childrenToStringToBuffer(this.children, buffer); - } -}; -var jsx = (tag, props, ...children) => { - props ??= {}; - if (children.length) { - props.children = children.length === 1 ? children[0] : children; - } - const key = props.key; - delete props["key"]; - const node = jsxFn(tag, props, children); - node.key = key; - return node; -}; -var initDomRenderer = false; -var jsxFn = (tag, props, children) => { - if (!initDomRenderer) { - for (const k in domRenderers) { - ; - intrinsicElementTags[k][DOM_RENDERER] = domRenderers[k]; - } - initDomRenderer = true; - } - if (typeof tag === "function") { - return new JSXFunctionNode(tag, props, children); - } else if (intrinsicElementTags[tag]) { - return new JSXFunctionNode( - intrinsicElementTags[tag], - props, - children - ); - } else if (tag === "svg" || tag === "head") { - nameSpaceContext ||= createContext(""); - return new JSXNode(tag, props, [ - new JSXFunctionNode( - nameSpaceContext, - { - value: tag - }, - children - ) - ]); - } else { - return new JSXNode(tag, props, children); - } -}; -var shallowEqual = (a, b) => { - if (a === b) { - return true; - } - const aKeys = Object.keys(a).sort(); - const bKeys = Object.keys(b).sort(); - if (aKeys.length !== bKeys.length) { - return false; - } - for (let i = 0, len = aKeys.length; i < len; i++) { - if (aKeys[i] === "children" && bKeys[i] === "children" && !a.children?.length && !b.children?.length) { - continue; - } else if (a[aKeys[i]] !== b[aKeys[i]]) { - return false; - } - } - return true; -}; -var memo = (component, propsAreEqual = shallowEqual) => { - let computed = null; - let prevProps = void 0; - const wrapper = ((props) => { - if (prevProps && !propsAreEqual(prevProps, props)) { - computed = null; - } - prevProps = props; - return computed ||= component(props); - }); - wrapper[DOM_MEMO] = propsAreEqual; - wrapper[DOM_RENDERER] = component; - return wrapper; -}; -var Fragment = ({ - children -}) => { - return new JSXFragmentNode( - "", - { - children - }, - Array.isArray(children) ? children : children ? [children] : [] - ); -}; -var isValidElement = (element) => { - return !!(element && typeof element === "object" && "tag" in element && "props" in element); -}; -var cloneElement = (element, props, ...children) => { - let childrenToClone; - if (children.length > 0) { - childrenToClone = children; - } else { - const c = element.props.children; - childrenToClone = Array.isArray(c) ? c : [c]; - } - return jsx( - element.tag, - { ...element.props, ...props }, - ...childrenToClone - ); -}; -var reactAPICompatVersion = "19.0.0-hono-jsx"; -export { - Fragment, - JSXFragmentNode, - JSXNode, - booleanAttributes, - cloneElement, - getNameSpaceContext, - isValidElement, - jsx, - jsxFn, - memo, - reactAPICompatVersion, - shallowEqual -}; diff --git a/node_modules/hono/dist/jsx/children.js b/node_modules/hono/dist/jsx/children.js deleted file mode 100644 index 12ad951..0000000 --- a/node_modules/hono/dist/jsx/children.js +++ /dev/null @@ -1,21 +0,0 @@ -// src/jsx/children.ts -var toArray = (children) => Array.isArray(children) ? children : [children]; -var Children = { - map: (children, fn) => toArray(children).map(fn), - forEach: (children, fn) => { - toArray(children).forEach(fn); - }, - count: (children) => toArray(children).length, - only: (_children) => { - const children = toArray(_children); - if (children.length !== 1) { - throw new Error("Children.only() expects only one child"); - } - return children[0]; - }, - toArray -}; -export { - Children, - toArray -}; diff --git a/node_modules/hono/dist/jsx/components.js b/node_modules/hono/dist/jsx/components.js deleted file mode 100644 index 011c11c..0000000 --- a/node_modules/hono/dist/jsx/components.js +++ /dev/null @@ -1,178 +0,0 @@ -// src/jsx/components.ts -import { raw } from "../helper/html/index.js"; -import { HtmlEscapedCallbackPhase, resolveCallback } from "../utils/html.js"; -import { jsx, Fragment } from "./base.js"; -import { DOM_RENDERER } from "./constants.js"; -import { useContext } from "./context.js"; -import { ErrorBoundary as ErrorBoundaryDomRenderer } from "./dom/components.js"; -import { StreamingContext } from "./streaming.js"; -var errorBoundaryCounter = 0; -var childrenToString = async (children) => { - try { - return children.flat().map((c) => c == null || typeof c === "boolean" ? "" : c.toString()); - } catch (e) { - if (e instanceof Promise) { - await e; - return childrenToString(children); - } else { - throw e; - } - } -}; -var resolveChildEarly = (c) => { - if (c == null || typeof c === "boolean") { - return ""; - } else if (typeof c === "string") { - return c; - } else { - const str = c.toString(); - if (!(str instanceof Promise)) { - return raw(str); - } else { - return str; - } - } -}; -var ErrorBoundary = async ({ children, fallback, fallbackRender, onError }) => { - if (!children) { - return raw(""); - } - if (!Array.isArray(children)) { - children = [children]; - } - const nonce = useContext(StreamingContext)?.scriptNonce; - let fallbackStr; - const resolveFallbackStr = async () => { - const awaitedFallback = await fallback; - if (typeof awaitedFallback === "string") { - fallbackStr = awaitedFallback; - } else { - fallbackStr = await awaitedFallback?.toString(); - if (typeof fallbackStr === "string") { - fallbackStr = raw(fallbackStr); - } - } - }; - const fallbackRes = (error) => { - onError?.(error); - return fallbackStr || fallbackRender && jsx(Fragment, {}, fallbackRender(error)) || ""; - }; - let resArray = []; - try { - resArray = children.map(resolveChildEarly); - } catch (e) { - await resolveFallbackStr(); - if (e instanceof Promise) { - resArray = [ - e.then(() => childrenToString(children)).catch((e2) => fallbackRes(e2)) - ]; - } else { - resArray = [fallbackRes(e)]; - } - } - if (resArray.some((res) => res instanceof Promise)) { - await resolveFallbackStr(); - const index = errorBoundaryCounter++; - const replaceRe = RegExp(`(.*?)(.*?)()`); - const caught = false; - const catchCallback = async ({ error: error2, buffer }) => { - if (caught) { - return ""; - } - const fallbackResString = await Fragment({ - children: fallbackRes(error2) - }).toString(); - if (buffer) { - buffer[0] = buffer[0].replace(replaceRe, fallbackResString); - } - return buffer ? "" : ``; - }; - let error; - const promiseAll = Promise.all(resArray).catch((e) => error = e); - return raw(``, [ - ({ phase, buffer, context }) => { - if (phase === HtmlEscapedCallbackPhase.BeforeStream) { - return; - } - return promiseAll.then(async (htmlArray) => { - if (error) { - throw error; - } - htmlArray = htmlArray.flat(); - const content = htmlArray.join(""); - let html = buffer ? "" : ` -((d,c) => { -c=d.currentScript.previousSibling -d=d.getElementById('E:${index}') -if(!d)return -d.parentElement.insertBefore(c.content,d.nextSibling) -})(document) -`; - if (htmlArray.every((html2) => !html2.callbacks?.length)) { - if (buffer) { - buffer[0] = buffer[0].replace(replaceRe, content); - } - return html; - } - if (buffer) { - buffer[0] = buffer[0].replace( - replaceRe, - (_all, pre, _, post) => `${pre}${content}${post}` - ); - } - const callbacks = htmlArray.map((html2) => html2.callbacks || []).flat(); - if (phase === HtmlEscapedCallbackPhase.Stream) { - html = await resolveCallback( - html, - HtmlEscapedCallbackPhase.BeforeStream, - true, - context - ); - } - let resolvedCount = 0; - const promises = callbacks.map( - (c) => (...args) => c(...args)?.then((content2) => { - resolvedCount++; - if (buffer) { - if (resolvedCount === callbacks.length) { - buffer[0] = buffer[0].replace(replaceRe, (_all, _pre, content3) => content3); - } - buffer[0] += content2; - return raw("", content2.callbacks); - } - return raw( - content2 + (resolvedCount !== callbacks.length ? "" : ``), - content2.callbacks - ); - }).catch((error2) => catchCallback({ error: error2, buffer })) - ); - return raw(html, promises); - }).catch((error2) => catchCallback({ error: error2, buffer })); - } - ]); - } else { - return Fragment({ children: resArray }); - } -}; -ErrorBoundary[DOM_RENDERER] = ErrorBoundaryDomRenderer; -export { - ErrorBoundary, - childrenToString -}; diff --git a/node_modules/hono/dist/jsx/constants.js b/node_modules/hono/dist/jsx/constants.js deleted file mode 100644 index 872b4bb..0000000 --- a/node_modules/hono/dist/jsx/constants.js +++ /dev/null @@ -1,15 +0,0 @@ -// src/jsx/constants.ts -var DOM_RENDERER = /* @__PURE__ */ Symbol("RENDERER"); -var DOM_ERROR_HANDLER = /* @__PURE__ */ Symbol("ERROR_HANDLER"); -var DOM_STASH = /* @__PURE__ */ Symbol("STASH"); -var DOM_INTERNAL_TAG = /* @__PURE__ */ Symbol("INTERNAL"); -var DOM_MEMO = /* @__PURE__ */ Symbol("MEMO"); -var PERMALINK = /* @__PURE__ */ Symbol("PERMALINK"); -export { - DOM_ERROR_HANDLER, - DOM_INTERNAL_TAG, - DOM_MEMO, - DOM_RENDERER, - DOM_STASH, - PERMALINK -}; diff --git a/node_modules/hono/dist/jsx/context.js b/node_modules/hono/dist/jsx/context.js deleted file mode 100644 index c79308f..0000000 --- a/node_modules/hono/dist/jsx/context.js +++ /dev/null @@ -1,38 +0,0 @@ -// src/jsx/context.ts -import { raw } from "../helper/html/index.js"; -import { JSXFragmentNode } from "./base.js"; -import { DOM_RENDERER } from "./constants.js"; -import { createContextProviderFunction } from "./dom/context.js"; -var globalContexts = []; -var createContext = (defaultValue) => { - const values = [defaultValue]; - const context = ((props) => { - values.push(props.value); - let string; - try { - string = props.children ? (Array.isArray(props.children) ? new JSXFragmentNode("", {}, props.children) : props.children).toString() : ""; - } catch (e) { - values.pop(); - throw e; - } - if (string instanceof Promise) { - return string.finally(() => values.pop()).then((resString) => raw(resString, resString.callbacks)); - } else { - values.pop(); - return raw(string); - } - }); - context.values = values; - context.Provider = context; - context[DOM_RENDERER] = createContextProviderFunction(values); - globalContexts.push(context); - return context; -}; -var useContext = (context) => { - return context.values.at(-1); -}; -export { - createContext, - globalContexts, - useContext -}; diff --git a/node_modules/hono/dist/jsx/dom/client.js b/node_modules/hono/dist/jsx/dom/client.js deleted file mode 100644 index 4338249..0000000 --- a/node_modules/hono/dist/jsx/dom/client.js +++ /dev/null @@ -1,53 +0,0 @@ -// src/jsx/dom/client.ts -import { useState } from "../hooks/index.js"; -import { buildNode, renderNode } from "./render.js"; -var createRoot = (element, options = {}) => { - let setJsxNode = ( - // unmounted - void 0 - ); - if (Object.keys(options).length > 0) { - console.warn("createRoot options are not supported yet"); - } - return { - render(jsxNode) { - if (setJsxNode === null) { - throw new Error("Cannot update an unmounted root"); - } - if (setJsxNode) { - setJsxNode(jsxNode); - } else { - renderNode( - buildNode({ - tag: () => { - const [_jsxNode, _setJsxNode] = useState(jsxNode); - setJsxNode = _setJsxNode; - return _jsxNode; - }, - props: {} - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }), - element - ); - } - }, - unmount() { - setJsxNode?.(null); - setJsxNode = null; - } - }; -}; -var hydrateRoot = (element, reactNode, options = {}) => { - const root = createRoot(element, options); - root.render(reactNode); - return root; -}; -var client_default = { - createRoot, - hydrateRoot -}; -export { - createRoot, - client_default as default, - hydrateRoot -}; diff --git a/node_modules/hono/dist/jsx/dom/components.js b/node_modules/hono/dist/jsx/dom/components.js deleted file mode 100644 index ad120be..0000000 --- a/node_modules/hono/dist/jsx/dom/components.js +++ /dev/null @@ -1,32 +0,0 @@ -// src/jsx/dom/components.ts -import { DOM_ERROR_HANDLER } from "../constants.js"; -import { Fragment } from "./jsx-runtime.js"; -var ErrorBoundary = (({ children, fallback, fallbackRender, onError }) => { - const res = Fragment({ children }); - res[DOM_ERROR_HANDLER] = (err) => { - if (err instanceof Promise) { - throw err; - } - onError?.(err); - return fallbackRender?.(err) || fallback; - }; - return res; -}); -var Suspense = (({ - children, - fallback -}) => { - const res = Fragment({ children }); - res[DOM_ERROR_HANDLER] = (err, retry) => { - if (!(err instanceof Promise)) { - throw err; - } - err.finally(retry); - return fallback; - }; - return res; -}); -export { - ErrorBoundary, - Suspense -}; diff --git a/node_modules/hono/dist/jsx/dom/context.js b/node_modules/hono/dist/jsx/dom/context.js deleted file mode 100644 index 5bc71a7..0000000 --- a/node_modules/hono/dist/jsx/dom/context.js +++ /dev/null @@ -1,48 +0,0 @@ -// src/jsx/dom/context.ts -import { DOM_ERROR_HANDLER } from "../constants.js"; -import { globalContexts } from "../context.js"; -import { setInternalTagFlag } from "./utils.js"; -var createContextProviderFunction = (values) => ({ value, children }) => { - if (!children) { - return void 0; - } - const props = { - children: [ - { - tag: setInternalTagFlag(() => { - values.push(value); - }), - props: {} - } - ] - }; - if (Array.isArray(children)) { - props.children.push(...children.flat()); - } else { - props.children.push(children); - } - props.children.push({ - tag: setInternalTagFlag(() => { - values.pop(); - }), - props: {} - }); - const res = { tag: "", props, type: "" }; - res[DOM_ERROR_HANDLER] = (err) => { - values.pop(); - throw err; - }; - return res; -}; -var createContext = (defaultValue) => { - const values = [defaultValue]; - const context = createContextProviderFunction(values); - context.values = values; - context.Provider = context; - globalContexts.push(context); - return context; -}; -export { - createContext, - createContextProviderFunction -}; diff --git a/node_modules/hono/dist/jsx/dom/css.js b/node_modules/hono/dist/jsx/dom/css.js deleted file mode 100644 index f5bc6de..0000000 --- a/node_modules/hono/dist/jsx/dom/css.js +++ /dev/null @@ -1,143 +0,0 @@ -// src/jsx/dom/css.ts -import { - CLASS_NAME, - DEFAULT_STYLE_ID, - PSEUDO_GLOBAL_SELECTOR, - SELECTOR, - SELECTORS, - STYLE_STRING, - cssCommon, - cxCommon, - keyframesCommon, - viewTransitionCommon -} from "../../helper/css/common.js"; -import { rawCssString } from "../../helper/css/common.js"; -var splitRule = (rule) => { - const result = []; - let startPos = 0; - let depth = 0; - for (let i = 0, len = rule.length; i < len; i++) { - const char = rule[i]; - if (char === "'" || char === '"') { - const quote = char; - i++; - for (; i < len; i++) { - if (rule[i] === "\\") { - i++; - continue; - } - if (rule[i] === quote) { - break; - } - } - continue; - } - if (char === "{") { - depth++; - continue; - } - if (char === "}") { - depth--; - if (depth === 0) { - result.push(rule.slice(startPos, i + 1)); - startPos = i + 1; - } - continue; - } - } - return result; -}; -var createCssJsxDomObjects = ({ id }) => { - let styleSheet = void 0; - const findStyleSheet = () => { - if (!styleSheet) { - styleSheet = document.querySelector(`style#${id}`)?.sheet; - if (styleSheet) { - ; - styleSheet.addedStyles = /* @__PURE__ */ new Set(); - } - } - return styleSheet ? [styleSheet, styleSheet.addedStyles] : []; - }; - const insertRule = (className, styleString) => { - const [sheet, addedStyles] = findStyleSheet(); - if (!sheet || !addedStyles) { - Promise.resolve().then(() => { - if (!findStyleSheet()[0]) { - throw new Error("style sheet not found"); - } - insertRule(className, styleString); - }); - return; - } - if (!addedStyles.has(className)) { - addedStyles.add(className); - (className.startsWith(PSEUDO_GLOBAL_SELECTOR) ? splitRule(styleString) : [`${className[0] === "@" ? "" : "."}${className}{${styleString}}`]).forEach((rule) => { - sheet.insertRule(rule, sheet.cssRules.length); - }); - } - }; - const cssObject = { - toString() { - const selector = this[SELECTOR]; - insertRule(selector, this[STYLE_STRING]); - this[SELECTORS].forEach(({ [CLASS_NAME]: className, [STYLE_STRING]: styleString }) => { - insertRule(className, styleString); - }); - return this[CLASS_NAME]; - } - }; - const Style2 = ({ children, nonce }) => ({ - tag: "style", - props: { - id, - nonce, - children: children && (Array.isArray(children) ? children : [children]).map( - (c) => c[STYLE_STRING] - ) - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }); - return [cssObject, Style2]; -}; -var createCssContext = ({ id }) => { - const [cssObject, Style2] = createCssJsxDomObjects({ id }); - const newCssClassNameObject = (cssClassName) => { - cssClassName.toString = cssObject.toString; - return cssClassName; - }; - const css2 = (strings, ...values) => { - return newCssClassNameObject(cssCommon(strings, values)); - }; - const cx2 = (...args) => { - args = cxCommon(args); - return css2(Array(args.length).fill(""), ...args); - }; - const keyframes2 = keyframesCommon; - const viewTransition2 = ((strings, ...values) => { - return newCssClassNameObject(viewTransitionCommon(strings, values)); - }); - return { - css: css2, - cx: cx2, - keyframes: keyframes2, - viewTransition: viewTransition2, - Style: Style2 - }; -}; -var defaultContext = createCssContext({ id: DEFAULT_STYLE_ID }); -var css = defaultContext.css; -var cx = defaultContext.cx; -var keyframes = defaultContext.keyframes; -var viewTransition = defaultContext.viewTransition; -var Style = defaultContext.Style; -export { - Style, - createCssContext, - createCssJsxDomObjects, - css, - cx, - keyframes, - rawCssString, - viewTransition -}; diff --git a/node_modules/hono/dist/jsx/dom/hooks/index.js b/node_modules/hono/dist/jsx/dom/hooks/index.js deleted file mode 100644 index 5eed982..0000000 --- a/node_modules/hono/dist/jsx/dom/hooks/index.js +++ /dev/null @@ -1,48 +0,0 @@ -// src/jsx/dom/hooks/index.ts -import { PERMALINK } from "../../constants.js"; -import { useContext } from "../../context.js"; -import { useCallback, useState } from "../../hooks/index.js"; -import { createContext } from "../context.js"; -var FormContext = createContext({ - pending: false, - data: null, - method: null, - action: null -}); -var actions = /* @__PURE__ */ new Set(); -var registerAction = (action) => { - actions.add(action); - action.finally(() => actions.delete(action)); -}; -var useFormStatus = () => { - return useContext(FormContext); -}; -var useOptimistic = (state, updateState) => { - const [optimisticState, setOptimisticState] = useState(state); - if (actions.size > 0) { - Promise.all(actions).finally(() => { - setOptimisticState(state); - }); - } else { - setOptimisticState(state); - } - const cb = useCallback((newData) => { - setOptimisticState((currentState) => updateState(currentState, newData)); - }, []); - return [optimisticState, cb]; -}; -var useActionState = (fn, initialState, permalink) => { - const [state, setState] = useState(initialState); - const actionState = async (data) => { - setState(await fn(state, data)); - }; - actionState[PERMALINK] = permalink; - return [state, actionState]; -}; -export { - FormContext, - registerAction, - useActionState, - useFormStatus, - useOptimistic -}; diff --git a/node_modules/hono/dist/jsx/dom/index.js b/node_modules/hono/dist/jsx/dom/index.js deleted file mode 100644 index 4e5fbd3..0000000 --- a/node_modules/hono/dist/jsx/dom/index.js +++ /dev/null @@ -1,142 +0,0 @@ -// src/jsx/dom/index.ts -import { isValidElement, reactAPICompatVersion, shallowEqual } from "../base.js"; -import { Children } from "../children.js"; -import { DOM_MEMO } from "../constants.js"; -import { useContext } from "../context.js"; -import { - createRef, - forwardRef, - startTransition, - startViewTransition, - use, - useCallback, - useDebugValue, - useDeferredValue, - useEffect, - useId, - useImperativeHandle, - useInsertionEffect, - useLayoutEffect, - useMemo, - useReducer, - useRef, - useState, - useSyncExternalStore, - useTransition, - useViewTransition -} from "../hooks/index.js"; -import { ErrorBoundary, Suspense } from "./components.js"; -import { createContext } from "./context.js"; -import { useActionState, useFormStatus, useOptimistic } from "./hooks/index.js"; -import { Fragment, jsx } from "./jsx-runtime.js"; -import { createPortal, flushSync } from "./render.js"; -import { render } from "./render.js"; -var createElement = (tag, props, ...children) => { - const jsxProps = props ? { ...props } : {}; - if (children.length) { - jsxProps.children = children.length === 1 ? children[0] : children; - } - let key = void 0; - if ("key" in jsxProps) { - key = jsxProps.key; - delete jsxProps.key; - } - return jsx(tag, jsxProps, key); -}; -var cloneElement = (element, props, ...children) => { - return jsx( - element.tag, - { - ...element.props, - ...props, - children: children.length ? children : element.props.children - }, - element.key - ); -}; -var memo = (component, propsAreEqual = shallowEqual) => { - const wrapper = ((props) => component(props)); - wrapper[DOM_MEMO] = propsAreEqual; - return wrapper; -}; -var dom_default = { - version: reactAPICompatVersion, - useState, - useEffect, - useRef, - useCallback, - use, - startTransition, - useTransition, - useDeferredValue, - startViewTransition, - useViewTransition, - useMemo, - useLayoutEffect, - useInsertionEffect, - useReducer, - useId, - useDebugValue, - createRef, - forwardRef, - useImperativeHandle, - useSyncExternalStore, - useFormStatus, - useActionState, - useOptimistic, - Suspense, - ErrorBoundary, - createContext, - useContext, - memo, - isValidElement, - createElement, - cloneElement, - Children, - Fragment, - StrictMode: Fragment, - flushSync, - createPortal -}; -export { - Children, - ErrorBoundary, - Fragment, - Fragment as StrictMode, - Suspense, - cloneElement, - createContext, - createElement, - createPortal, - createRef, - dom_default as default, - flushSync, - forwardRef, - isValidElement, - createElement as jsx, - memo, - render, - startTransition, - startViewTransition, - use, - useActionState, - useCallback, - useContext, - useDebugValue, - useDeferredValue, - useEffect, - useFormStatus, - useId, - useImperativeHandle, - useInsertionEffect, - useLayoutEffect, - useMemo, - useOptimistic, - useReducer, - useRef, - useState, - useSyncExternalStore, - useTransition, - useViewTransition, - reactAPICompatVersion as version -}; diff --git a/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js b/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js deleted file mode 100644 index 995b789..0000000 --- a/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js +++ /dev/null @@ -1,337 +0,0 @@ -// src/jsx/dom/intrinsic-element/components.ts -import { useContext } from "../../context.js"; -import { use, useCallback, useMemo, useState } from "../../hooks/index.js"; -import { dataPrecedenceAttr, deDupeKeyMap, domRenderers } from "../../intrinsic-element/common.js"; -import { FormContext, registerAction } from "../hooks/index.js"; -import { createPortal, getNameSpaceContext } from "../render.js"; -var clearCache = () => { - blockingPromiseMap = /* @__PURE__ */ Object.create(null); - createdElements = /* @__PURE__ */ Object.create(null); -}; -var composeRef = (ref, cb) => { - return useMemo( - () => (e) => { - let refCleanup; - if (ref) { - if (typeof ref === "function") { - refCleanup = ref(e) || (() => { - ref(null); - }); - } else if (ref && "current" in ref) { - ref.current = e; - refCleanup = () => { - ref.current = null; - }; - } - } - const cbCleanup = cb(e); - return () => { - cbCleanup?.(); - refCleanup?.(); - }; - }, - [ref] - ); -}; -var blockingPromiseMap = /* @__PURE__ */ Object.create(null); -var createdElements = /* @__PURE__ */ Object.create(null); -var documentMetadataTag = (tag, props, preserveNodeType, supportSort, supportBlocking) => { - if (props?.itemProp) { - return { - tag, - props, - type: tag, - ref: props.ref - }; - } - const head = document.head; - let { onLoad, onError, precedence, blocking, ...restProps } = props; - let element = null; - let created = false; - const deDupeKeys = deDupeKeyMap[tag]; - let existingElements = void 0; - if (deDupeKeys.length > 0) { - const tags = head.querySelectorAll(tag); - LOOP: for (const e of tags) { - for (const key of deDupeKeyMap[tag]) { - if (e.getAttribute(key) === props[key]) { - element = e; - break LOOP; - } - } - } - if (!element) { - const cacheKey = deDupeKeys.reduce( - (acc, key) => props[key] === void 0 ? acc : `${acc}-${key}-${props[key]}`, - tag - ); - created = !createdElements[cacheKey]; - element = createdElements[cacheKey] ||= (() => { - const e = document.createElement(tag); - for (const key of deDupeKeys) { - if (props[key] !== void 0) { - e.setAttribute(key, props[key]); - } - if (props.rel) { - e.setAttribute("rel", props.rel); - } - } - return e; - })(); - } - } else { - existingElements = head.querySelectorAll(tag); - } - precedence = supportSort ? precedence ?? "" : void 0; - if (supportSort) { - restProps[dataPrecedenceAttr] = precedence; - } - const insert = useCallback( - (e) => { - if (deDupeKeys.length > 0) { - let found = false; - for (const existingElement of head.querySelectorAll(tag)) { - if (found && existingElement.getAttribute(dataPrecedenceAttr) !== precedence) { - head.insertBefore(e, existingElement); - return; - } - if (existingElement.getAttribute(dataPrecedenceAttr) === precedence) { - found = true; - } - } - head.appendChild(e); - } else if (existingElements) { - let found = false; - for (const existingElement of existingElements) { - if (existingElement === e) { - found = true; - break; - } - } - if (!found) { - head.insertBefore( - e, - head.contains(existingElements[0]) ? existingElements[0] : head.querySelector(tag) - ); - } - existingElements = void 0; - } - }, - [precedence] - ); - const ref = composeRef(props.ref, (e) => { - const key = deDupeKeys[0]; - if (preserveNodeType === 2) { - e.innerHTML = ""; - } - if (created || existingElements) { - insert(e); - } - if (!onError && !onLoad) { - return; - } - let promise = blockingPromiseMap[e.getAttribute(key)] ||= new Promise( - (resolve, reject) => { - e.addEventListener("load", resolve); - e.addEventListener("error", reject); - } - ); - if (onLoad) { - promise = promise.then(onLoad); - } - if (onError) { - promise = promise.catch(onError); - } - promise.catch(() => { - }); - }); - if (supportBlocking && blocking === "render") { - const key = deDupeKeyMap[tag][0]; - if (props[key]) { - const value = props[key]; - const promise = blockingPromiseMap[value] ||= new Promise((resolve, reject) => { - insert(element); - element.addEventListener("load", resolve); - element.addEventListener("error", reject); - }); - use(promise); - } - } - const jsxNode = { - tag, - type: tag, - props: { - ...restProps, - ref - }, - ref - }; - jsxNode.p = preserveNodeType; - if (element) { - jsxNode.e = element; - } - return createPortal( - jsxNode, - head - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ); -}; -var title = (props) => { - const nameSpaceContext = getNameSpaceContext(); - const ns = nameSpaceContext && useContext(nameSpaceContext); - if (ns?.endsWith("svg")) { - return { - tag: "title", - props, - type: "title", - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ref: props.ref - }; - } - return documentMetadataTag("title", props, void 0, false, false); -}; -var script = (props) => { - if (!props || ["src", "async"].some((k) => !props[k])) { - return { - tag: "script", - props, - type: "script", - ref: props.ref - }; - } - return documentMetadataTag("script", props, 1, false, true); -}; -var style = (props) => { - if (!props || !["href", "precedence"].every((k) => k in props)) { - return { - tag: "style", - props, - type: "style", - ref: props.ref - }; - } - props["data-href"] = props.href; - delete props.href; - return documentMetadataTag("style", props, 2, true, true); -}; -var link = (props) => { - if (!props || ["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) { - return { - tag: "link", - props, - type: "link", - ref: props.ref - }; - } - return documentMetadataTag("link", props, 1, "precedence" in props, true); -}; -var meta = (props) => { - return documentMetadataTag("meta", props, void 0, false, false); -}; -var customEventFormAction = /* @__PURE__ */ Symbol(); -var form = (props) => { - const { action, ...restProps } = props; - if (typeof action !== "function") { - ; - restProps.action = action; - } - const [state, setState] = useState([null, false]); - const onSubmit = useCallback( - async (ev) => { - const currentAction = ev.isTrusted ? action : ev.detail[customEventFormAction]; - if (typeof currentAction !== "function") { - return; - } - ev.preventDefault(); - const formData = new FormData(ev.target); - setState([formData, true]); - const actionRes = currentAction(formData); - if (actionRes instanceof Promise) { - registerAction(actionRes); - await actionRes; - } - setState([null, true]); - }, - [] - ); - const ref = composeRef(props.ref, (el) => { - el.addEventListener("submit", onSubmit); - return () => { - el.removeEventListener("submit", onSubmit); - }; - }); - const [data, isDirty] = state; - state[1] = false; - return { - tag: FormContext, - props: { - value: { - pending: data !== null, - data, - method: data ? "post" : null, - action: data ? action : null - }, - children: { - tag: "form", - props: { - ...restProps, - ref - }, - type: "form", - ref - } - }, - f: isDirty - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }; -}; -var formActionableElement = (tag, { - formAction, - ...props -}) => { - if (typeof formAction === "function") { - const onClick = useCallback((ev) => { - ev.preventDefault(); - ev.currentTarget.form.dispatchEvent( - new CustomEvent("submit", { detail: { [customEventFormAction]: formAction } }) - ); - }, []); - props.ref = composeRef(props.ref, (el) => { - el.addEventListener("click", onClick); - return () => { - el.removeEventListener("click", onClick); - }; - }); - } - return { - tag, - props, - type: tag, - ref: props.ref - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }; -}; -var input = (props) => formActionableElement("input", props); -var button = (props) => formActionableElement("button", props); -Object.assign(domRenderers, { - title, - script, - style, - link, - meta, - form, - input, - button -}); -export { - button, - clearCache, - composeRef, - form, - input, - link, - meta, - script, - style, - title -}; diff --git a/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js b/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js deleted file mode 100644 index 688a642..0000000 --- a/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js +++ /dev/null @@ -1,19 +0,0 @@ -// src/jsx/dom/jsx-dev-runtime.ts -import * as intrinsicElementTags from "./intrinsic-element/components.js"; -var jsxDEV = (tag, props, key) => { - if (typeof tag === "string" && intrinsicElementTags[tag]) { - tag = intrinsicElementTags[tag]; - } - return { - tag, - type: tag, - props, - key, - ref: props.ref - }; -}; -var Fragment = (props) => jsxDEV("", props, void 0); -export { - Fragment, - jsxDEV -}; diff --git a/node_modules/hono/dist/jsx/dom/jsx-runtime.js b/node_modules/hono/dist/jsx/dom/jsx-runtime.js deleted file mode 100644 index 925d6df..0000000 --- a/node_modules/hono/dist/jsx/dom/jsx-runtime.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/jsx/dom/jsx-runtime.ts -import { jsxDEV, Fragment } from "./jsx-dev-runtime.js"; -import { jsxDEV as jsxDEV2 } from "./jsx-dev-runtime.js"; -export { - Fragment, - jsxDEV as jsx, - jsxDEV2 as jsxs -}; diff --git a/node_modules/hono/dist/jsx/dom/render.js b/node_modules/hono/dist/jsx/dom/render.js deleted file mode 100644 index 6cc4912..0000000 --- a/node_modules/hono/dist/jsx/dom/render.js +++ /dev/null @@ -1,593 +0,0 @@ -// src/jsx/dom/render.ts -import { toArray } from "../children.js"; -import { - DOM_ERROR_HANDLER, - DOM_INTERNAL_TAG, - DOM_MEMO, - DOM_RENDERER, - DOM_STASH -} from "../constants.js"; -import { globalContexts as globalJSXContexts, useContext } from "../context.js"; -import { STASH_EFFECT } from "../hooks/index.js"; -import { normalizeIntrinsicElementKey, styleObjectForEach } from "../utils.js"; -import { createContext } from "./context.js"; -var HONO_PORTAL_ELEMENT = "_hp"; -var eventAliasMap = { - Change: "Input", - DoubleClick: "DblClick" -}; -var nameSpaceMap = { - svg: "2000/svg", - math: "1998/Math/MathML" -}; -var buildDataStack = []; -var refCleanupMap = /* @__PURE__ */ new WeakMap(); -var nameSpaceContext = void 0; -var getNameSpaceContext = () => nameSpaceContext; -var isNodeString = (node) => "t" in node; -var eventCache = { - // pre-define events that are used very frequently - onClick: ["click", false] -}; -var getEventSpec = (key) => { - if (!key.startsWith("on")) { - return void 0; - } - if (eventCache[key]) { - return eventCache[key]; - } - const match = key.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/); - if (match) { - const [, eventName, capture] = match; - return eventCache[key] = [(eventAliasMap[eventName] || eventName).toLowerCase(), !!capture]; - } - return void 0; -}; -var toAttributeName = (element, key) => nameSpaceContext && element instanceof SVGElement && /[A-Z]/.test(key) && (key in element.style || // Presentation attributes are findable in style object. "clip-path", "font-size", "stroke-width", etc. -key.match(/^(?:o|pai|str|u|ve)/)) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key; -var applyProps = (container, attributes, oldAttributes) => { - attributes ||= {}; - for (let key in attributes) { - const value = attributes[key]; - if (key !== "children" && (!oldAttributes || oldAttributes[key] !== value)) { - key = normalizeIntrinsicElementKey(key); - const eventSpec = getEventSpec(key); - if (eventSpec) { - if (oldAttributes?.[key] !== value) { - if (oldAttributes) { - container.removeEventListener(eventSpec[0], oldAttributes[key], eventSpec[1]); - } - if (value != null) { - if (typeof value !== "function") { - throw new Error(`Event handler for "${key}" is not a function`); - } - container.addEventListener(eventSpec[0], value, eventSpec[1]); - } - } - } else if (key === "dangerouslySetInnerHTML" && value) { - container.innerHTML = value.__html; - } else if (key === "ref") { - let cleanup; - if (typeof value === "function") { - cleanup = value(container) || (() => value(null)); - } else if (value && "current" in value) { - value.current = container; - cleanup = () => value.current = null; - } - refCleanupMap.set(container, cleanup); - } else if (key === "style") { - const style = container.style; - if (typeof value === "string") { - style.cssText = value; - } else { - style.cssText = ""; - if (value != null) { - styleObjectForEach(value, style.setProperty.bind(style)); - } - } - } else { - if (key === "value") { - const nodeName = container.nodeName; - if (nodeName === "INPUT" || nodeName === "TEXTAREA" || nodeName === "SELECT") { - ; - container.value = value === null || value === void 0 || value === false ? null : value; - if (nodeName === "TEXTAREA") { - container.textContent = value; - continue; - } else if (nodeName === "SELECT") { - if (container.selectedIndex === -1) { - ; - container.selectedIndex = 0; - } - continue; - } - } - } else if (key === "checked" && container.nodeName === "INPUT" || key === "selected" && container.nodeName === "OPTION") { - ; - container[key] = value; - } - const k = toAttributeName(container, key); - if (value === null || value === void 0 || value === false) { - container.removeAttribute(k); - } else if (value === true) { - container.setAttribute(k, ""); - } else if (typeof value === "string" || typeof value === "number") { - container.setAttribute(k, value); - } else { - container.setAttribute(k, value.toString()); - } - } - } - } - if (oldAttributes) { - for (let key in oldAttributes) { - const value = oldAttributes[key]; - if (key !== "children" && !(key in attributes)) { - key = normalizeIntrinsicElementKey(key); - const eventSpec = getEventSpec(key); - if (eventSpec) { - container.removeEventListener(eventSpec[0], value, eventSpec[1]); - } else if (key === "ref") { - refCleanupMap.get(container)?.(); - } else { - container.removeAttribute(toAttributeName(container, key)); - } - } - } - } -}; -var invokeTag = (context, node) => { - node[DOM_STASH][0] = 0; - buildDataStack.push([context, node]); - const func = node.tag[DOM_RENDERER] || node.tag; - const props = func.defaultProps ? { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ...func.defaultProps, - ...node.props - } : node.props; - try { - return [func.call(null, props)]; - } finally { - buildDataStack.pop(); - } -}; -var getNextChildren = (node, container, nextChildren, childrenToRemove, callbacks) => { - if (node.vR?.length) { - childrenToRemove.push(...node.vR); - delete node.vR; - } - if (typeof node.tag === "function") { - node[DOM_STASH][1][STASH_EFFECT]?.forEach((data) => callbacks.push(data)); - } - node.vC.forEach((child) => { - if (isNodeString(child)) { - nextChildren.push(child); - } else { - if (typeof child.tag === "function" || child.tag === "") { - child.c = container; - const currentNextChildrenIndex = nextChildren.length; - getNextChildren(child, container, nextChildren, childrenToRemove, callbacks); - if (child.s) { - for (let i = currentNextChildrenIndex; i < nextChildren.length; i++) { - nextChildren[i].s = true; - } - child.s = false; - } - } else { - nextChildren.push(child); - if (child.vR?.length) { - childrenToRemove.push(...child.vR); - delete child.vR; - } - } - } - }); -}; -var findInsertBefore = (node) => { - while (node && (node.tag === HONO_PORTAL_ELEMENT || !node.e)) { - node = node.tag === HONO_PORTAL_ELEMENT || !node.vC?.[0] ? node.nN : node.vC[0]; - } - return node?.e; -}; -var removeNode = (node) => { - if (!isNodeString(node)) { - node[DOM_STASH]?.[1][STASH_EFFECT]?.forEach((data) => data[2]?.()); - refCleanupMap.get(node.e)?.(); - if (node.p === 2) { - node.vC?.forEach((n) => n.p = 2); - } - node.vC?.forEach(removeNode); - } - if (!node.p) { - node.e?.remove(); - delete node.e; - } - if (typeof node.tag === "function") { - updateMap.delete(node); - fallbackUpdateFnArrayMap.delete(node); - delete node[DOM_STASH][3]; - node.a = true; - } -}; -var apply = (node, container, isNew) => { - node.c = container; - applyNodeObject(node, container, isNew); -}; -var findChildNodeIndex = (childNodes, child) => { - if (!child) { - return; - } - for (let i = 0, len = childNodes.length; i < len; i++) { - if (childNodes[i] === child) { - return i; - } - } - return; -}; -var cancelBuild = /* @__PURE__ */ Symbol(); -var applyNodeObject = (node, container, isNew) => { - const next = []; - const remove = []; - const callbacks = []; - getNextChildren(node, container, next, remove, callbacks); - remove.forEach(removeNode); - const childNodes = isNew ? void 0 : container.childNodes; - let offset; - let insertBeforeNode = null; - if (isNew) { - offset = -1; - } else if (!childNodes.length) { - offset = 0; - } else { - const offsetByNextNode = findChildNodeIndex(childNodes, findInsertBefore(node.nN)); - if (offsetByNextNode !== void 0) { - insertBeforeNode = childNodes[offsetByNextNode]; - offset = offsetByNextNode; - } else { - offset = findChildNodeIndex(childNodes, next.find((n) => n.tag !== HONO_PORTAL_ELEMENT && n.e)?.e) ?? -1; - } - if (offset === -1) { - isNew = true; - } - } - for (let i = 0, len = next.length; i < len; i++, offset++) { - const child = next[i]; - let el; - if (child.s && child.e) { - el = child.e; - child.s = false; - } else { - const isNewLocal = isNew || !child.e; - if (isNodeString(child)) { - if (child.e && child.d) { - child.e.textContent = child.t; - } - child.d = false; - el = child.e ||= document.createTextNode(child.t); - } else { - el = child.e ||= child.n ? document.createElementNS(child.n, child.tag) : document.createElement(child.tag); - applyProps(el, child.props, child.pP); - applyNodeObject(child, el, isNewLocal); - } - } - if (child.tag === HONO_PORTAL_ELEMENT) { - offset--; - } else if (isNew) { - if (!el.parentNode) { - container.appendChild(el); - } - } else if (childNodes[offset] !== el && childNodes[offset - 1] !== el) { - if (childNodes[offset + 1] === el) { - container.appendChild(childNodes[offset]); - } else { - container.insertBefore(el, insertBeforeNode || childNodes[offset] || null); - } - } - } - if (node.pP) { - node.pP = void 0; - } - if (callbacks.length) { - const useLayoutEffectCbs = []; - const useEffectCbs = []; - callbacks.forEach(([, useLayoutEffectCb, , useEffectCb, useInsertionEffectCb]) => { - if (useLayoutEffectCb) { - useLayoutEffectCbs.push(useLayoutEffectCb); - } - if (useEffectCb) { - useEffectCbs.push(useEffectCb); - } - useInsertionEffectCb?.(); - }); - useLayoutEffectCbs.forEach((cb) => cb()); - if (useEffectCbs.length) { - requestAnimationFrame(() => { - useEffectCbs.forEach((cb) => cb()); - }); - } - } -}; -var isSameContext = (oldContexts, newContexts) => !!(oldContexts && oldContexts.length === newContexts.length && oldContexts.every((ctx, i) => ctx[1] === newContexts[i][1])); -var fallbackUpdateFnArrayMap = /* @__PURE__ */ new WeakMap(); -var build = (context, node, children) => { - const buildWithPreviousChildren = !children && node.pC; - if (children) { - node.pC ||= node.vC; - } - let foundErrorHandler; - try { - children ||= typeof node.tag == "function" ? invokeTag(context, node) : toArray(node.props.children); - if (children[0]?.tag === "" && children[0][DOM_ERROR_HANDLER]) { - foundErrorHandler = children[0][DOM_ERROR_HANDLER]; - context[5].push([context, foundErrorHandler, node]); - } - const oldVChildren = buildWithPreviousChildren ? [...node.pC] : node.vC ? [...node.vC] : void 0; - const vChildren = []; - let prevNode; - for (let i = 0; i < children.length; i++) { - if (Array.isArray(children[i])) { - children.splice(i, 1, ...children[i].flat()); - } - let child = buildNode(children[i]); - if (child) { - if (typeof child.tag === "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any - !child.tag[DOM_INTERNAL_TAG]) { - if (globalJSXContexts.length > 0) { - child[DOM_STASH][2] = globalJSXContexts.map((c) => [c, c.values.at(-1)]); - } - if (context[5]?.length) { - child[DOM_STASH][3] = context[5].at(-1); - } - } - let oldChild; - if (oldVChildren && oldVChildren.length) { - const i2 = oldVChildren.findIndex( - isNodeString(child) ? (c) => isNodeString(c) : child.key !== void 0 ? (c) => c.key === child.key && c.tag === child.tag : (c) => c.tag === child.tag - ); - if (i2 !== -1) { - oldChild = oldVChildren[i2]; - oldVChildren.splice(i2, 1); - } - } - if (oldChild) { - if (isNodeString(child)) { - if (oldChild.t !== child.t) { - ; - oldChild.t = child.t; - oldChild.d = true; - } - child = oldChild; - } else { - const pP = oldChild.pP = oldChild.props; - oldChild.props = child.props; - oldChild.f ||= child.f || node.f; - if (typeof child.tag === "function") { - const oldContexts = oldChild[DOM_STASH][2]; - oldChild[DOM_STASH][2] = child[DOM_STASH][2] || []; - oldChild[DOM_STASH][3] = child[DOM_STASH][3]; - if (!oldChild.f && ((oldChild.o || oldChild) === child.o || // The code generated by the react compiler is memoized under this condition. - oldChild.tag[DOM_MEMO]?.(pP, oldChild.props)) && // The `memo` function is memoized under this condition. - isSameContext(oldContexts, oldChild[DOM_STASH][2])) { - oldChild.s = true; - } - } - child = oldChild; - } - } else if (!isNodeString(child) && nameSpaceContext) { - const ns = useContext(nameSpaceContext); - if (ns) { - child.n = ns; - } - } - if (!isNodeString(child) && !child.s) { - build(context, child); - delete child.f; - } - vChildren.push(child); - if (prevNode && !prevNode.s && !child.s) { - for (let p = prevNode; p && !isNodeString(p); p = p.vC?.at(-1)) { - p.nN = child; - } - } - prevNode = child; - } - } - node.vR = buildWithPreviousChildren ? [...node.vC, ...oldVChildren || []] : oldVChildren || []; - node.vC = vChildren; - if (buildWithPreviousChildren) { - delete node.pC; - } - } catch (e) { - node.f = true; - if (e === cancelBuild) { - if (foundErrorHandler) { - return; - } else { - throw e; - } - } - const [errorHandlerContext, errorHandler, errorHandlerNode] = node[DOM_STASH]?.[3] || []; - if (errorHandler) { - const fallbackUpdateFn = () => update([0, false, context[2]], errorHandlerNode); - const fallbackUpdateFnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode) || []; - fallbackUpdateFnArray.push(fallbackUpdateFn); - fallbackUpdateFnArrayMap.set(errorHandlerNode, fallbackUpdateFnArray); - const fallback = errorHandler(e, () => { - const fnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode); - if (fnArray) { - const i = fnArray.indexOf(fallbackUpdateFn); - if (i !== -1) { - fnArray.splice(i, 1); - return fallbackUpdateFn(); - } - } - }); - if (fallback) { - if (context[0] === 1) { - context[1] = true; - } else { - build(context, errorHandlerNode, [fallback]); - if ((errorHandler.length === 1 || context !== errorHandlerContext) && errorHandlerNode.c) { - apply(errorHandlerNode, errorHandlerNode.c, false); - return; - } - } - throw cancelBuild; - } - } - throw e; - } finally { - if (foundErrorHandler) { - context[5].pop(); - } - } -}; -var buildNode = (node) => { - if (node === void 0 || node === null || typeof node === "boolean") { - return void 0; - } else if (typeof node === "string" || typeof node === "number") { - return { t: node.toString(), d: true }; - } else { - if ("vR" in node) { - node = { - tag: node.tag, - props: node.props, - key: node.key, - f: node.f, - type: node.tag, - ref: node.props.ref, - o: node.o || node - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }; - } - if (typeof node.tag === "function") { - ; - node[DOM_STASH] = [0, []]; - } else { - const ns = nameSpaceMap[node.tag]; - if (ns) { - nameSpaceContext ||= createContext(""); - node.props.children = [ - { - tag: nameSpaceContext, - props: { - value: node.n = `http://www.w3.org/${ns}`, - children: node.props.children - } - } - ]; - } - } - return node; - } -}; -var replaceContainer = (node, from, to) => { - if (node.c === from) { - node.c = to; - node.vC.forEach((child) => replaceContainer(child, from, to)); - } -}; -var updateSync = (context, node) => { - node[DOM_STASH][2]?.forEach(([c, v]) => { - c.values.push(v); - }); - try { - build(context, node, void 0); - } catch { - return; - } - if (node.a) { - delete node.a; - return; - } - node[DOM_STASH][2]?.forEach(([c]) => { - c.values.pop(); - }); - if (context[0] !== 1 || !context[1]) { - apply(node, node.c, false); - } -}; -var updateMap = /* @__PURE__ */ new WeakMap(); -var currentUpdateSets = []; -var update = async (context, node) => { - context[5] ||= []; - const existing = updateMap.get(node); - if (existing) { - existing[0](void 0); - } - let resolve; - const promise = new Promise((r) => resolve = r); - updateMap.set(node, [ - resolve, - () => { - if (context[2]) { - context[2](context, node, (context2) => { - updateSync(context2, node); - }).then(() => resolve(node)); - } else { - updateSync(context, node); - resolve(node); - } - } - ]); - if (currentUpdateSets.length) { - ; - currentUpdateSets.at(-1).add(node); - } else { - await Promise.resolve(); - const latest = updateMap.get(node); - if (latest) { - updateMap.delete(node); - latest[1](); - } - } - return promise; -}; -var renderNode = (node, container) => { - const context = []; - context[5] = []; - context[4] = true; - build(context, node, void 0); - context[4] = false; - const fragment = document.createDocumentFragment(); - apply(node, fragment, true); - replaceContainer(node, fragment, container); - container.replaceChildren(fragment); -}; -var render = (jsxNode, container) => { - renderNode(buildNode({ tag: "", props: { children: jsxNode } }), container); -}; -var flushSync = (callback) => { - const set = /* @__PURE__ */ new Set(); - currentUpdateSets.push(set); - callback(); - set.forEach((node) => { - const latest = updateMap.get(node); - if (latest) { - updateMap.delete(node); - latest[1](); - } - }); - currentUpdateSets.pop(); -}; -var createPortal = (children, container, key) => ({ - tag: HONO_PORTAL_ELEMENT, - props: { - children - }, - key, - e: container, - p: 1 - // eslint-disable-next-line @typescript-eslint/no-explicit-any -}); -export { - build, - buildDataStack, - buildNode, - createPortal, - flushSync, - getNameSpaceContext, - render, - renderNode, - update -}; diff --git a/node_modules/hono/dist/jsx/dom/server.js b/node_modules/hono/dist/jsx/dom/server.js deleted file mode 100644 index a1110dd..0000000 --- a/node_modules/hono/dist/jsx/dom/server.js +++ /dev/null @@ -1,33 +0,0 @@ -// src/jsx/dom/server.ts -import { renderToReadableStream as renderToReadableStreamHono } from "../streaming.js"; -import version from "./index.js"; -var renderToString = (element, options = {}) => { - if (Object.keys(options).length > 0) { - console.warn("options are not supported yet"); - } - const res = element?.toString() ?? ""; - if (typeof res !== "string") { - throw new Error("Async component is not supported in renderToString"); - } - return res; -}; -var renderToReadableStream = async (element, options = {}) => { - if (Object.keys(options).some((key) => key !== "onError")) { - console.warn("options are not supported yet, except onError"); - } - if (!element || typeof element !== "object") { - element = element?.toString() ?? ""; - } - return renderToReadableStreamHono(element, options.onError); -}; -var server_default = { - renderToString, - renderToReadableStream, - version -}; -export { - server_default as default, - renderToReadableStream, - renderToString, - version -}; diff --git a/node_modules/hono/dist/jsx/dom/utils.js b/node_modules/hono/dist/jsx/dom/utils.js deleted file mode 100644 index b8efa98..0000000 --- a/node_modules/hono/dist/jsx/dom/utils.js +++ /dev/null @@ -1,10 +0,0 @@ -// src/jsx/dom/utils.ts -import { DOM_INTERNAL_TAG } from "../constants.js"; -var setInternalTagFlag = (fn) => { - ; - fn[DOM_INTERNAL_TAG] = true; - return fn; -}; -export { - setInternalTagFlag -}; diff --git a/node_modules/hono/dist/jsx/hooks/index.js b/node_modules/hono/dist/jsx/hooks/index.js deleted file mode 100644 index ec842c7..0000000 --- a/node_modules/hono/dist/jsx/hooks/index.js +++ /dev/null @@ -1,328 +0,0 @@ -// src/jsx/hooks/index.ts -import { DOM_STASH } from "../constants.js"; -import { buildDataStack, update } from "../dom/render.js"; -var STASH_SATE = 0; -var STASH_EFFECT = 1; -var STASH_CALLBACK = 2; -var STASH_MEMO = 3; -var STASH_REF = 4; -var resolvedPromiseValueMap = /* @__PURE__ */ new WeakMap(); -var isDepsChanged = (prevDeps, deps) => !prevDeps || !deps || prevDeps.length !== deps.length || deps.some((dep, i) => dep !== prevDeps[i]); -var viewTransitionState = void 0; -var documentStartViewTransition = (cb) => { - if (document?.startViewTransition) { - return document.startViewTransition(cb); - } else { - cb(); - return { finished: Promise.resolve() }; - } -}; -var updateHook = void 0; -var viewTransitionHook = (context, node, cb) => { - const state = [true, false]; - let lastVC = node.vC; - return documentStartViewTransition(() => { - if (lastVC === node.vC) { - viewTransitionState = state; - cb(context); - viewTransitionState = void 0; - lastVC = node.vC; - } - }).finished.then(() => { - if (state[1] && lastVC === node.vC) { - state[0] = false; - viewTransitionState = state; - cb(context); - viewTransitionState = void 0; - } - }); -}; -var startViewTransition = (callback) => { - updateHook = viewTransitionHook; - try { - callback(); - } finally { - updateHook = void 0; - } -}; -var useViewTransition = () => { - const buildData = buildDataStack.at(-1); - if (!buildData) { - return [false, () => { - }]; - } - if (viewTransitionState) { - viewTransitionState[1] = true; - } - return [!!viewTransitionState?.[0], startViewTransition]; -}; -var pendingStack = []; -var runCallback = (type, callback) => { - let resolve; - const promise = new Promise((r) => resolve = r); - pendingStack.push([type, promise]); - try { - const res = callback(); - if (res instanceof Promise) { - res.then(resolve, resolve); - } else { - resolve(); - } - } finally { - pendingStack.pop(); - } -}; -var startTransition = (callback) => { - runCallback(1, callback); -}; -var startTransitionHook = (callback) => { - runCallback(2, callback); -}; -var useTransition = () => { - const buildData = buildDataStack.at(-1); - if (!buildData) { - return [false, () => { - }]; - } - const [error, setError] = useState(); - const [state, updateState] = useState(); - if (error) { - throw error[0]; - } - const startTransitionLocalHook = useCallback( - (callback) => { - startTransitionHook(() => { - updateState((state2) => !state2); - let res = callback(); - if (res instanceof Promise) { - res = res.catch((e) => { - setError([e]); - }); - } - return res; - }); - }, - [state] - ); - const [context] = buildData; - return [context[0] === 2, startTransitionLocalHook]; -}; -var useDeferredValue = (value, ...rest) => { - const [values, setValues] = useState( - rest.length ? [rest[0], rest[0]] : [value, value] - ); - if (Object.is(values[1], value)) { - return values[1]; - } - pendingStack.push([3, Promise.resolve()]); - updateHook = async (context, _, cb) => { - cb(context); - values[0] = value; - }; - setValues([values[0], value]); - updateHook = void 0; - pendingStack.pop(); - return values[0]; -}; -var useState = (initialState) => { - const resolveInitialState = () => typeof initialState === "function" ? initialState() : initialState; - const buildData = buildDataStack.at(-1); - if (!buildData) { - return [resolveInitialState(), () => { - }]; - } - const [, node] = buildData; - const stateArray = node[DOM_STASH][1][STASH_SATE] ||= []; - const hookIndex = node[DOM_STASH][0]++; - return stateArray[hookIndex] ||= [ - resolveInitialState(), - (newState) => { - const localUpdateHook = updateHook; - const stateData = stateArray[hookIndex]; - if (typeof newState === "function") { - newState = newState(stateData[0]); - } - if (!Object.is(newState, stateData[0])) { - stateData[0] = newState; - if (pendingStack.length) { - const [pendingType, pendingPromise] = pendingStack.at(-1); - Promise.all([ - pendingType === 3 ? node : update([pendingType, false, localUpdateHook], node), - pendingPromise - ]).then(([node2]) => { - if (!node2 || !(pendingType === 2 || pendingType === 3)) { - return; - } - const lastVC = node2.vC; - const addUpdateTask = () => { - setTimeout(() => { - if (lastVC !== node2.vC) { - return; - } - update([pendingType === 3 ? 1 : 0, false, localUpdateHook], node2); - }); - }; - requestAnimationFrame(addUpdateTask); - }); - } else { - update([0, false, localUpdateHook], node); - } - } - } - ]; -}; -var useReducer = (reducer, initialArg, init) => { - const handler = useCallback( - (action) => { - setState((state2) => reducer(state2, action)); - }, - [reducer] - ); - const [state, setState] = useState(() => init ? init(initialArg) : initialArg); - return [state, handler]; -}; -var useEffectCommon = (index, effect, deps) => { - const buildData = buildDataStack.at(-1); - if (!buildData) { - return; - } - const [, node] = buildData; - const effectDepsArray = node[DOM_STASH][1][STASH_EFFECT] ||= []; - const hookIndex = node[DOM_STASH][0]++; - const [prevDeps, , prevCleanup] = effectDepsArray[hookIndex] ||= []; - if (isDepsChanged(prevDeps, deps)) { - if (prevCleanup) { - prevCleanup(); - } - const runner = () => { - data[index] = void 0; - data[2] = effect(); - }; - const data = [deps, void 0, void 0, void 0, void 0]; - data[index] = runner; - effectDepsArray[hookIndex] = data; - } -}; -var useEffect = (effect, deps) => useEffectCommon(3, effect, deps); -var useLayoutEffect = (effect, deps) => useEffectCommon(1, effect, deps); -var useInsertionEffect = (effect, deps) => useEffectCommon(4, effect, deps); -var useCallback = (callback, deps) => { - const buildData = buildDataStack.at(-1); - if (!buildData) { - return callback; - } - const [, node] = buildData; - const callbackArray = node[DOM_STASH][1][STASH_CALLBACK] ||= []; - const hookIndex = node[DOM_STASH][0]++; - const prevDeps = callbackArray[hookIndex]; - if (isDepsChanged(prevDeps?.[1], deps)) { - callbackArray[hookIndex] = [callback, deps]; - } else { - callback = callbackArray[hookIndex][0]; - } - return callback; -}; -var useRef = (initialValue) => { - const buildData = buildDataStack.at(-1); - if (!buildData) { - return { current: initialValue }; - } - const [, node] = buildData; - const refArray = node[DOM_STASH][1][STASH_REF] ||= []; - const hookIndex = node[DOM_STASH][0]++; - return refArray[hookIndex] ||= { current: initialValue }; -}; -var use = (promise) => { - const cachedRes = resolvedPromiseValueMap.get(promise); - if (cachedRes) { - if (cachedRes.length === 2) { - throw cachedRes[1]; - } - return cachedRes[0]; - } - promise.then( - (res) => resolvedPromiseValueMap.set(promise, [res]), - (e) => resolvedPromiseValueMap.set(promise, [void 0, e]) - ); - throw promise; -}; -var useMemo = (factory, deps) => { - const buildData = buildDataStack.at(-1); - if (!buildData) { - return factory(); - } - const [, node] = buildData; - const memoArray = node[DOM_STASH][1][STASH_MEMO] ||= []; - const hookIndex = node[DOM_STASH][0]++; - const prevDeps = memoArray[hookIndex]; - if (isDepsChanged(prevDeps?.[1], deps)) { - memoArray[hookIndex] = [factory(), deps]; - } - return memoArray[hookIndex][0]; -}; -var idCounter = 0; -var useId = () => useMemo(() => `:r${(idCounter++).toString(32)}:`, []); -var useDebugValue = (_value, _formatter) => { -}; -var createRef = () => { - return { current: null }; -}; -var forwardRef = (Component) => { - return (props) => { - const { ref, ...rest } = props; - return Component(rest, ref); - }; -}; -var useImperativeHandle = (ref, createHandle, deps) => { - useEffect(() => { - ref.current = createHandle(); - return () => { - ref.current = null; - }; - }, deps); -}; -var useSyncExternalStore = (subscribe, getSnapshot, getServerSnapshot) => { - const buildData = buildDataStack.at(-1); - if (!buildData) { - if (!getServerSnapshot) { - throw new Error("getServerSnapshot is required for server side rendering"); - } - return getServerSnapshot(); - } - const [serverSnapshotIsUsed] = useState(!!(buildData[0][4] && getServerSnapshot)); - const [state, setState] = useState( - () => serverSnapshotIsUsed ? getServerSnapshot() : getSnapshot() - ); - useEffect(() => { - if (serverSnapshotIsUsed) { - setState(getSnapshot()); - } - return subscribe(() => { - setState(getSnapshot()); - }); - }, []); - return state; -}; -export { - STASH_EFFECT, - createRef, - forwardRef, - startTransition, - startViewTransition, - use, - useCallback, - useDebugValue, - useDeferredValue, - useEffect, - useId, - useImperativeHandle, - useInsertionEffect, - useLayoutEffect, - useMemo, - useReducer, - useRef, - useState, - useSyncExternalStore, - useTransition, - useViewTransition -}; diff --git a/node_modules/hono/dist/jsx/index.js b/node_modules/hono/dist/jsx/index.js deleted file mode 100644 index 49b2df9..0000000 --- a/node_modules/hono/dist/jsx/index.js +++ /dev/null @@ -1,103 +0,0 @@ -// src/jsx/index.ts -import { Fragment, cloneElement, isValidElement, jsx, memo, reactAPICompatVersion } from "./base.js"; -import { Children } from "./children.js"; -import { ErrorBoundary } from "./components.js"; -import { createContext, useContext } from "./context.js"; -import { useActionState, useOptimistic } from "./dom/hooks/index.js"; -import { - createRef, - forwardRef, - startTransition, - startViewTransition, - use, - useCallback, - useDebugValue, - useDeferredValue, - useEffect, - useId, - useImperativeHandle, - useInsertionEffect, - useLayoutEffect, - useMemo, - useReducer, - useRef, - useState, - useSyncExternalStore, - useTransition, - useViewTransition -} from "./hooks/index.js"; -import { Suspense } from "./streaming.js"; -var jsx_default = { - version: reactAPICompatVersion, - memo, - Fragment, - StrictMode: Fragment, - isValidElement, - createElement: jsx, - cloneElement, - ErrorBoundary, - createContext, - useContext, - useState, - useEffect, - useRef, - useCallback, - useReducer, - useId, - useDebugValue, - use, - startTransition, - useTransition, - useDeferredValue, - startViewTransition, - useViewTransition, - useMemo, - useLayoutEffect, - useInsertionEffect, - createRef, - forwardRef, - useImperativeHandle, - useSyncExternalStore, - useActionState, - useOptimistic, - Suspense, - Children -}; -export { - Children, - ErrorBoundary, - Fragment, - Fragment as StrictMode, - Suspense, - cloneElement, - createContext, - jsx as createElement, - createRef, - jsx_default as default, - forwardRef, - isValidElement, - jsx, - memo, - startTransition, - startViewTransition, - use, - useActionState, - useCallback, - useContext, - useDebugValue, - useDeferredValue, - useEffect, - useId, - useImperativeHandle, - useInsertionEffect, - useLayoutEffect, - useMemo, - useOptimistic, - useReducer, - useRef, - useState, - useSyncExternalStore, - useTransition, - useViewTransition, - reactAPICompatVersion as version -}; diff --git a/node_modules/hono/dist/jsx/intrinsic-element/common.js b/node_modules/hono/dist/jsx/intrinsic-element/common.js deleted file mode 100644 index b287db7..0000000 --- a/node_modules/hono/dist/jsx/intrinsic-element/common.js +++ /dev/null @@ -1,15 +0,0 @@ -// src/jsx/intrinsic-element/common.ts -var deDupeKeyMap = { - title: [], - script: ["src"], - style: ["data-href"], - link: ["href"], - meta: ["name", "httpEquiv", "charset", "itemProp"] -}; -var domRenderers = {}; -var dataPrecedenceAttr = "data-precedence"; -export { - dataPrecedenceAttr, - deDupeKeyMap, - domRenderers -}; diff --git a/node_modules/hono/dist/jsx/intrinsic-element/components.js b/node_modules/hono/dist/jsx/intrinsic-element/components.js deleted file mode 100644 index 116565f..0000000 --- a/node_modules/hono/dist/jsx/intrinsic-element/components.js +++ /dev/null @@ -1,153 +0,0 @@ -// src/jsx/intrinsic-element/components.ts -import { raw } from "../../helper/html/index.js"; -import { JSXNode, getNameSpaceContext } from "../base.js"; -import { toArray } from "../children.js"; -import { PERMALINK } from "../constants.js"; -import { useContext } from "../context.js"; -import { dataPrecedenceAttr, deDupeKeyMap } from "./common.js"; -var metaTagMap = /* @__PURE__ */ new WeakMap(); -var insertIntoHead = (tagName, tag, props, precedence) => ({ buffer, context }) => { - if (!buffer) { - return; - } - const map = metaTagMap.get(context) || {}; - metaTagMap.set(context, map); - const tags = map[tagName] ||= []; - let duped = false; - const deDupeKeys = deDupeKeyMap[tagName]; - if (deDupeKeys.length > 0) { - LOOP: for (const [, tagProps] of tags) { - for (const key of deDupeKeys) { - if ((tagProps?.[key] ?? null) === props?.[key]) { - duped = true; - break LOOP; - } - } - } - } - if (duped) { - buffer[0] = buffer[0].replaceAll(tag, ""); - } else if (deDupeKeys.length > 0) { - tags.push([tag, props, precedence]); - } else { - tags.unshift([tag, props, precedence]); - } - if (buffer[0].indexOf("") !== -1) { - let insertTags; - if (precedence === void 0) { - insertTags = tags.map(([tag2]) => tag2); - } else { - const precedences = []; - insertTags = tags.map(([tag2, , precedence2]) => { - let order = precedences.indexOf(precedence2); - if (order === -1) { - precedences.push(precedence2); - order = precedences.length - 1; - } - return [tag2, order]; - }).sort((a, b) => a[1] - b[1]).map(([tag2]) => tag2); - } - insertTags.forEach((tag2) => { - buffer[0] = buffer[0].replaceAll(tag2, ""); - }); - buffer[0] = buffer[0].replace(/(?=<\/head>)/, insertTags.join("")); - } -}; -var returnWithoutSpecialBehavior = (tag, children, props) => raw(new JSXNode(tag, props, toArray(children ?? [])).toString()); -var documentMetadataTag = (tag, children, props, sort) => { - if ("itemProp" in props) { - return returnWithoutSpecialBehavior(tag, children, props); - } - let { precedence, blocking, ...restProps } = props; - precedence = sort ? precedence ?? "" : void 0; - if (sort) { - restProps[dataPrecedenceAttr] = precedence; - } - const string = new JSXNode(tag, restProps, toArray(children || [])).toString(); - if (string instanceof Promise) { - return string.then( - (resString) => raw(string, [ - ...resString.callbacks || [], - insertIntoHead(tag, resString, restProps, precedence) - ]) - ); - } else { - return raw(string, [insertIntoHead(tag, string, restProps, precedence)]); - } -}; -var title = ({ children, ...props }) => { - const nameSpaceContext = getNameSpaceContext(); - if (nameSpaceContext) { - const context = useContext(nameSpaceContext); - if (context === "svg" || context === "head") { - return new JSXNode( - "title", - props, - toArray(children ?? []) - ); - } - } - return documentMetadataTag("title", children, props, false); -}; -var script = ({ - children, - ...props -}) => { - const nameSpaceContext = getNameSpaceContext(); - if (["src", "async"].some((k) => !props[k]) || nameSpaceContext && useContext(nameSpaceContext) === "head") { - return returnWithoutSpecialBehavior("script", children, props); - } - return documentMetadataTag("script", children, props, false); -}; -var style = ({ - children, - ...props -}) => { - if (!["href", "precedence"].every((k) => k in props)) { - return returnWithoutSpecialBehavior("style", children, props); - } - props["data-href"] = props.href; - delete props.href; - return documentMetadataTag("style", children, props, true); -}; -var link = ({ children, ...props }) => { - if (["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) { - return returnWithoutSpecialBehavior("link", children, props); - } - return documentMetadataTag("link", children, props, "precedence" in props); -}; -var meta = ({ children, ...props }) => { - const nameSpaceContext = getNameSpaceContext(); - if (nameSpaceContext && useContext(nameSpaceContext) === "head") { - return returnWithoutSpecialBehavior("meta", children, props); - } - return documentMetadataTag("meta", children, props, false); -}; -var newJSXNode = (tag, { children, ...props }) => ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - new JSXNode(tag, props, toArray(children ?? [])) -); -var form = (props) => { - if (typeof props.action === "function") { - props.action = PERMALINK in props.action ? props.action[PERMALINK] : void 0; - } - return newJSXNode("form", props); -}; -var formActionableElement = (tag, props) => { - if (typeof props.formAction === "function") { - props.formAction = PERMALINK in props.formAction ? props.formAction[PERMALINK] : void 0; - } - return newJSXNode(tag, props); -}; -var input = (props) => formActionableElement("input", props); -var button = (props) => formActionableElement("button", props); -export { - button, - form, - input, - link, - meta, - script, - style, - title -}; diff --git a/node_modules/hono/dist/jsx/intrinsic-elements.js b/node_modules/hono/dist/jsx/intrinsic-elements.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/jsx/jsx-dev-runtime.js b/node_modules/hono/dist/jsx/jsx-dev-runtime.js deleted file mode 100644 index 2a68920..0000000 --- a/node_modules/hono/dist/jsx/jsx-dev-runtime.js +++ /dev/null @@ -1,18 +0,0 @@ -// src/jsx/jsx-dev-runtime.ts -import { jsxFn } from "./base.js"; -import { Fragment } from "./base.js"; -function jsxDEV(tag, props, key) { - let node; - if (!props || !("children" in props)) { - node = jsxFn(tag, props, []); - } else { - const children = props.children; - node = Array.isArray(children) ? jsxFn(tag, props, children) : jsxFn(tag, props, [children]); - } - node.key = key; - return node; -} -export { - Fragment, - jsxDEV -}; diff --git a/node_modules/hono/dist/jsx/jsx-runtime.js b/node_modules/hono/dist/jsx/jsx-runtime.js deleted file mode 100644 index 7ad5df3..0000000 --- a/node_modules/hono/dist/jsx/jsx-runtime.js +++ /dev/null @@ -1,41 +0,0 @@ -// src/jsx/jsx-runtime.ts -import { jsxDEV, Fragment } from "./jsx-dev-runtime.js"; -import { jsxDEV as jsxDEV2 } from "./jsx-dev-runtime.js"; -import { html, raw } from "../helper/html/index.js"; -import { escapeToBuffer, stringBufferToString } from "../utils/html.js"; -import { styleObjectForEach } from "./utils.js"; -var jsxAttr = (key, v) => { - const buffer = [`${key}="`]; - if (key === "style" && typeof v === "object") { - let styleStr = ""; - styleObjectForEach(v, (property, value) => { - if (value != null) { - styleStr += `${styleStr ? ";" : ""}${property}:${value}`; - } - }); - escapeToBuffer(styleStr, buffer); - buffer[0] += '"'; - } else if (typeof v === "string") { - escapeToBuffer(v, buffer); - buffer[0] += '"'; - } else if (v === null || v === void 0) { - return raw(""); - } else if (typeof v === "number" || v.isEscaped) { - buffer[0] += `${v}"`; - } else if (v instanceof Promise) { - buffer.unshift('"', v); - } else { - escapeToBuffer(v.toString(), buffer); - buffer[0] += '"'; - } - return buffer.length === 1 ? raw(buffer[0]) : stringBufferToString(buffer, void 0); -}; -var jsxEscape = (value) => value; -export { - Fragment, - jsxDEV as jsx, - jsxAttr, - jsxEscape, - html as jsxTemplate, - jsxDEV2 as jsxs -}; diff --git a/node_modules/hono/dist/jsx/streaming.js b/node_modules/hono/dist/jsx/streaming.js deleted file mode 100644 index ea64dc0..0000000 --- a/node_modules/hono/dist/jsx/streaming.js +++ /dev/null @@ -1,143 +0,0 @@ -// src/jsx/streaming.ts -import { raw } from "../helper/html/index.js"; -import { HtmlEscapedCallbackPhase, resolveCallback } from "../utils/html.js"; -import { JSXNode } from "./base.js"; -import { childrenToString } from "./components.js"; -import { DOM_RENDERER, DOM_STASH } from "./constants.js"; -import { createContext, useContext } from "./context.js"; -import { Suspense as SuspenseDomRenderer } from "./dom/components.js"; -import { buildDataStack } from "./dom/render.js"; -var StreamingContext = createContext(null); -var suspenseCounter = 0; -var Suspense = async ({ - children, - fallback -}) => { - if (!Array.isArray(children)) { - children = [children]; - } - const nonce = useContext(StreamingContext)?.scriptNonce; - let resArray = []; - const stackNode = { [DOM_STASH]: [0, []] }; - const popNodeStack = (value) => { - buildDataStack.pop(); - return value; - }; - try { - stackNode[DOM_STASH][0] = 0; - buildDataStack.push([[], stackNode]); - resArray = children.map( - (c) => c == null || typeof c === "boolean" ? "" : c.toString() - ); - } catch (e) { - if (e instanceof Promise) { - resArray = [ - e.then(() => { - stackNode[DOM_STASH][0] = 0; - buildDataStack.push([[], stackNode]); - return childrenToString(children).then(popNodeStack); - }) - ]; - } else { - throw e; - } - } finally { - popNodeStack(); - } - if (resArray.some((res) => res instanceof Promise)) { - const index = suspenseCounter++; - const fallbackStr = await fallback.toString(); - return raw(`${fallbackStr}`, [ - ...fallbackStr.callbacks || [], - ({ phase, buffer, context }) => { - if (phase === HtmlEscapedCallbackPhase.BeforeStream) { - return; - } - return Promise.all(resArray).then(async (htmlArray) => { - htmlArray = htmlArray.flat(); - const content = htmlArray.join(""); - if (buffer) { - buffer[0] = buffer[0].replace( - new RegExp(`.*?`), - content - ); - } - let html = buffer ? "" : ` -((d,c,n) => { -c=d.currentScript.previousSibling -d=d.getElementById('H:${index}') -if(!d)return -do{n=d.nextSibling;n.remove()}while(n.nodeType!=8||n.nodeValue!='/$') -d.replaceWith(c.content) -})(document) -`; - const callbacks = htmlArray.map((html2) => html2.callbacks || []).flat(); - if (!callbacks.length) { - return html; - } - if (phase === HtmlEscapedCallbackPhase.Stream) { - html = await resolveCallback(html, HtmlEscapedCallbackPhase.BeforeStream, true, context); - } - return raw(html, callbacks); - }); - } - ]); - } else { - return raw(resArray.join("")); - } -}; -Suspense[DOM_RENDERER] = SuspenseDomRenderer; -var textEncoder = new TextEncoder(); -var renderToReadableStream = (content, onError = console.trace) => { - const reader = new ReadableStream({ - async start(controller) { - try { - if (content instanceof JSXNode) { - content = content.toString(); - } - const context = typeof content === "object" ? content : {}; - const resolved = await resolveCallback( - content, - HtmlEscapedCallbackPhase.BeforeStream, - true, - context - ); - controller.enqueue(textEncoder.encode(resolved)); - let resolvedCount = 0; - const callbacks = []; - const then = (promise) => { - callbacks.push( - promise.catch((err) => { - console.log(err); - onError(err); - return ""; - }).then(async (res) => { - res = await resolveCallback( - res, - HtmlEscapedCallbackPhase.BeforeStream, - true, - context - ); - res.callbacks?.map((c) => c({ phase: HtmlEscapedCallbackPhase.Stream, context })).filter(Boolean).forEach(then); - resolvedCount++; - controller.enqueue(textEncoder.encode(res)); - }) - ); - }; - resolved.callbacks?.map((c) => c({ phase: HtmlEscapedCallbackPhase.Stream, context })).filter(Boolean).forEach(then); - while (resolvedCount !== callbacks.length) { - await Promise.all(callbacks); - } - } catch (e) { - onError(e); - } - controller.close(); - } - }); - return reader; -}; -export { - StreamingContext, - Suspense, - renderToReadableStream -}; diff --git a/node_modules/hono/dist/jsx/types.js b/node_modules/hono/dist/jsx/types.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/jsx/utils.js b/node_modules/hono/dist/jsx/utils.js deleted file mode 100644 index 7f3a219..0000000 --- a/node_modules/hono/dist/jsx/utils.js +++ /dev/null @@ -1,27 +0,0 @@ -// src/jsx/utils.ts -var normalizeElementKeyMap = /* @__PURE__ */ new Map([ - ["className", "class"], - ["htmlFor", "for"], - ["crossOrigin", "crossorigin"], - ["httpEquiv", "http-equiv"], - ["itemProp", "itemprop"], - ["fetchPriority", "fetchpriority"], - ["noModule", "nomodule"], - ["formAction", "formaction"] -]); -var normalizeIntrinsicElementKey = (key) => normalizeElementKeyMap.get(key) || key; -var styleObjectForEach = (style, fn) => { - for (const [k, v] of Object.entries(style)) { - const key = k[0] === "-" || !/[A-Z]/.test(k) ? k : k.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`); - fn( - key, - v == null ? null : typeof v === "number" ? !key.match( - /^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/ - ) ? `${v}px` : `${v}` : v - ); - } -}; -export { - normalizeIntrinsicElementKey, - styleObjectForEach -}; diff --git a/node_modules/hono/dist/middleware/basic-auth/index.js b/node_modules/hono/dist/middleware/basic-auth/index.js deleted file mode 100644 index fc54a53..0000000 --- a/node_modules/hono/dist/middleware/basic-auth/index.js +++ /dev/null @@ -1,60 +0,0 @@ -// src/middleware/basic-auth/index.ts -import { HTTPException } from "../../http-exception.js"; -import { auth } from "../../utils/basic-auth.js"; -import { timingSafeEqual } from "../../utils/buffer.js"; -var basicAuth = (options, ...users) => { - const usernamePasswordInOptions = "username" in options && "password" in options; - const verifyUserInOptions = "verifyUser" in options; - if (!(usernamePasswordInOptions || verifyUserInOptions)) { - throw new Error( - 'basic auth middleware requires options for "username and password" or "verifyUser"' - ); - } - if (!options.realm) { - options.realm = "Secure Area"; - } - if (!options.invalidUserMessage) { - options.invalidUserMessage = "Unauthorized"; - } - if (usernamePasswordInOptions) { - users.unshift({ username: options.username, password: options.password }); - } - return async function basicAuth2(ctx, next) { - const requestUser = auth(ctx.req.raw); - if (requestUser) { - if (verifyUserInOptions) { - if (await options.verifyUser(requestUser.username, requestUser.password, ctx)) { - await next(); - return; - } - } else { - for (const user of users) { - const [usernameEqual, passwordEqual] = await Promise.all([ - timingSafeEqual(user.username, requestUser.username, options.hashFunction), - timingSafeEqual(user.password, requestUser.password, options.hashFunction) - ]); - if (usernameEqual && passwordEqual) { - await next(); - return; - } - } - } - } - const status = 401; - const headers = { - "WWW-Authenticate": 'Basic realm="' + options.realm?.replace(/"/g, '\\"') + '"' - }; - const responseMessage = typeof options.invalidUserMessage === "function" ? await options.invalidUserMessage(ctx) : options.invalidUserMessage; - const res = typeof responseMessage === "string" ? new Response(responseMessage, { status, headers }) : new Response(JSON.stringify(responseMessage), { - status, - headers: { - ...headers, - "content-type": "application/json" - } - }); - throw new HTTPException(status, { res }); - }; -}; -export { - basicAuth -}; diff --git a/node_modules/hono/dist/middleware/bearer-auth/index.js b/node_modules/hono/dist/middleware/bearer-auth/index.js deleted file mode 100644 index f70af0f..0000000 --- a/node_modules/hono/dist/middleware/bearer-auth/index.js +++ /dev/null @@ -1,83 +0,0 @@ -// src/middleware/bearer-auth/index.ts -import { HTTPException } from "../../http-exception.js"; -import { timingSafeEqual } from "../../utils/buffer.js"; -var TOKEN_STRINGS = "[A-Za-z0-9._~+/-]+=*"; -var PREFIX = "Bearer"; -var HEADER = "Authorization"; -var bearerAuth = (options) => { - if (!("token" in options || "verifyToken" in options)) { - throw new Error('bearer auth middleware requires options for "token"'); - } - if (!options.realm) { - options.realm = ""; - } - if (options.prefix === void 0) { - options.prefix = PREFIX; - } - const realm = options.realm?.replace(/"/g, '\\"'); - const prefixRegexStr = options.prefix === "" ? "" : `${options.prefix} +`; - const regexp = new RegExp(`^${prefixRegexStr}(${TOKEN_STRINGS}) *$`, "i"); - const wwwAuthenticatePrefix = options.prefix === "" ? "" : `${options.prefix} `; - const throwHTTPException = async (c, status, wwwAuthenticateHeader, messageOption) => { - const wwwAuthenticateHeaderValue = typeof wwwAuthenticateHeader === "function" ? await wwwAuthenticateHeader(c) : wwwAuthenticateHeader; - const headers = { - "WWW-Authenticate": typeof wwwAuthenticateHeaderValue === "string" ? wwwAuthenticateHeaderValue : `${wwwAuthenticatePrefix}${Object.entries(wwwAuthenticateHeaderValue).map(([key, value]) => `${key}="${value}"`).join(",")}` - }; - const responseMessage = typeof messageOption === "function" ? await messageOption(c) : messageOption; - const res = typeof responseMessage === "string" ? new Response(responseMessage, { status, headers }) : new Response(JSON.stringify(responseMessage), { - status, - headers: { - ...headers, - "content-type": "application/json" - } - }); - throw new HTTPException(status, { res }); - }; - return async function bearerAuth2(c, next) { - const headerToken = c.req.header(options.headerName || HEADER); - if (!headerToken) { - await throwHTTPException( - c, - 401, - options.noAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}realm="${realm}"`, - options.noAuthenticationHeader?.message || options.noAuthenticationHeaderMessage || "Unauthorized" - ); - } else { - const match = regexp.exec(headerToken); - if (!match) { - await throwHTTPException( - c, - 400, - options.invalidAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_request"`, - options.invalidAuthenticationHeader?.message || options.invalidAuthenticationHeaderMessage || "Bad Request" - ); - } else { - let equal = false; - if ("verifyToken" in options) { - equal = await options.verifyToken(match[1], c); - } else if (typeof options.token === "string") { - equal = await timingSafeEqual(options.token, match[1], options.hashFunction); - } else if (Array.isArray(options.token) && options.token.length > 0) { - for (const token of options.token) { - if (await timingSafeEqual(token, match[1], options.hashFunction)) { - equal = true; - break; - } - } - } - if (!equal) { - await throwHTTPException( - c, - 401, - options.invalidToken?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_token"`, - options.invalidToken?.message || options.invalidTokenMessage || "Unauthorized" - ); - } - } - } - await next(); - }; -}; -export { - bearerAuth -}; diff --git a/node_modules/hono/dist/middleware/body-limit/index.js b/node_modules/hono/dist/middleware/body-limit/index.js deleted file mode 100644 index 01de755..0000000 --- a/node_modules/hono/dist/middleware/body-limit/index.js +++ /dev/null @@ -1,62 +0,0 @@ -// src/middleware/body-limit/index.ts -import { HTTPException } from "../../http-exception.js"; -var ERROR_MESSAGE = "Payload Too Large"; -var BodyLimitError = class extends Error { - constructor(message) { - super(message); - this.name = "BodyLimitError"; - } -}; -var bodyLimit = (options) => { - const onError = options.onError || (() => { - const res = new Response(ERROR_MESSAGE, { - status: 413 - }); - throw new HTTPException(413, { res }); - }); - const maxSize = options.maxSize; - return async function bodyLimit2(c, next) { - if (!c.req.raw.body) { - return next(); - } - const hasTransferEncoding = c.req.raw.headers.has("transfer-encoding"); - const hasContentLength = c.req.raw.headers.has("content-length"); - if (hasTransferEncoding && hasContentLength) { - } - if (hasContentLength && !hasTransferEncoding) { - const contentLength = parseInt(c.req.raw.headers.get("content-length") || "0", 10); - return contentLength > maxSize ? onError(c) : next(); - } - let size = 0; - const rawReader = c.req.raw.body.getReader(); - const reader = new ReadableStream({ - async start(controller) { - try { - for (; ; ) { - const { done, value } = await rawReader.read(); - if (done) { - break; - } - size += value.length; - if (size > maxSize) { - controller.error(new BodyLimitError(ERROR_MESSAGE)); - break; - } - controller.enqueue(value); - } - } finally { - controller.close(); - } - } - }); - const requestInit = { body: reader, duplex: "half" }; - c.req.raw = new Request(c.req.raw, requestInit); - await next(); - if (c.error instanceof BodyLimitError) { - c.res = await onError(c); - } - }; -}; -export { - bodyLimit -}; diff --git a/node_modules/hono/dist/middleware/cache/index.js b/node_modules/hono/dist/middleware/cache/index.js deleted file mode 100644 index 0d7bb52..0000000 --- a/node_modules/hono/dist/middleware/cache/index.js +++ /dev/null @@ -1,89 +0,0 @@ -// src/middleware/cache/index.ts -var defaultCacheableStatusCodes = [200]; -var shouldSkipCache = (res) => { - const vary = res.headers.get("Vary"); - if (vary && vary.includes("*")) { - return true; - } - const cacheControl = res.headers.get("Cache-Control"); - if (cacheControl && /(?:^|,\s*)(?:private|no-(?:store|cache))(?:\s*(?:=|,|$))/i.test(cacheControl)) { - return true; - } - if (res.headers.has("Set-Cookie")) { - return true; - } - return false; -}; -var cache = (options) => { - if (!globalThis.caches) { - console.log("Cache Middleware is not enabled because caches is not defined."); - return async (_c, next) => await next(); - } - if (options.wait === void 0) { - options.wait = false; - } - const cacheControlDirectives = options.cacheControl?.split(",").map((directive) => directive.toLowerCase()); - const varyDirectives = Array.isArray(options.vary) ? options.vary : options.vary?.split(",").map((directive) => directive.trim()); - if (options.vary?.includes("*")) { - throw new Error( - 'Middleware vary configuration cannot include "*", as it disallows effective caching.' - ); - } - const cacheableStatusCodes = new Set( - options.cacheableStatusCodes ?? defaultCacheableStatusCodes - ); - const addHeader = (c) => { - if (cacheControlDirectives) { - const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0]) ?? []; - for (const directive of cacheControlDirectives) { - let [name, value] = directive.trim().split("=", 2); - name = name.toLowerCase(); - if (!existingDirectives.includes(name)) { - c.header("Cache-Control", `${name}${value ? `=${value}` : ""}`, { append: true }); - } - } - } - if (varyDirectives) { - const existingDirectives = c.res.headers.get("Vary")?.split(",").map((d) => d.trim()) ?? []; - const vary = Array.from( - new Set( - [...existingDirectives, ...varyDirectives].map((directive) => directive.toLowerCase()) - ) - ).sort(); - if (vary.includes("*")) { - c.header("Vary", "*"); - } else { - c.header("Vary", vary.join(", ")); - } - } - }; - return async function cache2(c, next) { - let key = c.req.url; - if (options.keyGenerator) { - key = await options.keyGenerator(c); - } - const cacheName = typeof options.cacheName === "function" ? await options.cacheName(c) : options.cacheName; - const cache3 = await caches.open(cacheName); - const response = await cache3.match(key); - if (response) { - return new Response(response.body, response); - } - await next(); - if (!cacheableStatusCodes.has(c.res.status)) { - return; - } - addHeader(c); - if (shouldSkipCache(c.res)) { - return; - } - const res = c.res.clone(); - if (options.wait) { - await cache3.put(key, res); - } else { - c.executionCtx.waitUntil(cache3.put(key, res)); - } - }; -}; -export { - cache -}; diff --git a/node_modules/hono/dist/middleware/combine/index.js b/node_modules/hono/dist/middleware/combine/index.js deleted file mode 100644 index c16d91f..0000000 --- a/node_modules/hono/dist/middleware/combine/index.js +++ /dev/null @@ -1,77 +0,0 @@ -// src/middleware/combine/index.ts -import { compose } from "../../compose.js"; -import { METHOD_NAME_ALL } from "../../router.js"; -import { TrieRouter } from "../../router/trie-router/index.js"; -var some = (...middleware) => { - return async function some2(c, next) { - let isNextCalled = false; - const wrappedNext = () => { - isNextCalled = true; - return next(); - }; - let lastError; - for (const handler of middleware) { - try { - const result = await handler(c, wrappedNext); - if (result === true && !c.finalized) { - await wrappedNext(); - } else if (result === false) { - lastError = new Error("No successful middleware found"); - continue; - } - lastError = void 0; - break; - } catch (error) { - lastError = error; - if (isNextCalled) { - break; - } - } - } - if (lastError) { - throw lastError; - } - }; -}; -var every = (...middleware) => { - return async function every2(c, next) { - const currentRouteIndex = c.req.routeIndex; - await compose( - middleware.map((m) => [ - [ - async (c2, next2) => { - c2.req.routeIndex = currentRouteIndex; - const res = await m(c2, next2); - if (res === false) { - throw new Error("Unmet condition"); - } - return res; - } - ] - ]) - )(c, next); - }; -}; -var except = (condition, ...middleware) => { - let router = void 0; - const conditions = (Array.isArray(condition) ? condition : [condition]).map((condition2) => { - if (typeof condition2 === "string") { - router ||= new TrieRouter(); - router.add(METHOD_NAME_ALL, condition2, true); - } else { - return condition2; - } - }).filter(Boolean); - if (router) { - conditions.unshift((c) => !!router?.match(METHOD_NAME_ALL, c.req.path)?.[0]?.[0]?.[0]); - } - const handler = some((c) => conditions.some((cond) => cond(c)), every(...middleware)); - return async function except2(c, next) { - await handler(c, next); - }; -}; -export { - every, - except, - some -}; diff --git a/node_modules/hono/dist/middleware/compress/index.js b/node_modules/hono/dist/middleware/compress/index.js deleted file mode 100644 index fcc3ae6..0000000 --- a/node_modules/hono/dist/middleware/compress/index.js +++ /dev/null @@ -1,39 +0,0 @@ -// src/middleware/compress/index.ts -import { COMPRESSIBLE_CONTENT_TYPE_REGEX } from "../../utils/compress.js"; -var ENCODING_TYPES = ["gzip", "deflate"]; -var cacheControlNoTransformRegExp = /(?:^|,)\s*?no-transform\s*?(?:,|$)/i; -var compress = (options) => { - const threshold = options?.threshold ?? 1024; - return async function compress2(ctx, next) { - await next(); - const contentLength = ctx.res.headers.get("Content-Length"); - if (ctx.res.headers.has("Content-Encoding") || // already encoded - ctx.res.headers.has("Transfer-Encoding") || // already encoded or chunked - ctx.req.method === "HEAD" || // HEAD request - contentLength && Number(contentLength) < threshold || // content-length below threshold - !shouldCompress(ctx.res) || // not compressible type - !shouldTransform(ctx.res)) { - return; - } - const accepted = ctx.req.header("Accept-Encoding"); - const encoding = options?.encoding ?? ENCODING_TYPES.find((encoding2) => accepted?.includes(encoding2)); - if (!encoding || !ctx.res.body) { - return; - } - const stream = new CompressionStream(encoding); - ctx.res = new Response(ctx.res.body.pipeThrough(stream), ctx.res); - ctx.res.headers.delete("Content-Length"); - ctx.res.headers.set("Content-Encoding", encoding); - }; -}; -var shouldCompress = (res) => { - const type = res.headers.get("Content-Type"); - return type && COMPRESSIBLE_CONTENT_TYPE_REGEX.test(type); -}; -var shouldTransform = (res) => { - const cacheControl = res.headers.get("Cache-Control"); - return !cacheControl || !cacheControlNoTransformRegExp.test(cacheControl); -}; -export { - compress -}; diff --git a/node_modules/hono/dist/middleware/context-storage/index.js b/node_modules/hono/dist/middleware/context-storage/index.js deleted file mode 100644 index a1bd4c6..0000000 --- a/node_modules/hono/dist/middleware/context-storage/index.js +++ /dev/null @@ -1,23 +0,0 @@ -// src/middleware/context-storage/index.ts -import { AsyncLocalStorage } from "node:async_hooks"; -var asyncLocalStorage = new AsyncLocalStorage(); -var contextStorage = () => { - return async function contextStorage2(c, next) { - await asyncLocalStorage.run(c, next); - }; -}; -var tryGetContext = () => { - return asyncLocalStorage.getStore(); -}; -var getContext = () => { - const context = tryGetContext(); - if (!context) { - throw new Error("Context is not available"); - } - return context; -}; -export { - contextStorage, - getContext, - tryGetContext -}; diff --git a/node_modules/hono/dist/middleware/cors/index.js b/node_modules/hono/dist/middleware/cors/index.js deleted file mode 100644 index 9169e5a..0000000 --- a/node_modules/hono/dist/middleware/cors/index.js +++ /dev/null @@ -1,87 +0,0 @@ -// src/middleware/cors/index.ts -var cors = (options) => { - const defaults = { - origin: "*", - allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH"], - allowHeaders: [], - exposeHeaders: [] - }; - const opts = { - ...defaults, - ...options - }; - const findAllowOrigin = ((optsOrigin) => { - if (typeof optsOrigin === "string") { - if (optsOrigin === "*") { - return () => optsOrigin; - } else { - return (origin) => optsOrigin === origin ? origin : null; - } - } else if (typeof optsOrigin === "function") { - return optsOrigin; - } else { - return (origin) => optsOrigin.includes(origin) ? origin : null; - } - })(opts.origin); - const findAllowMethods = ((optsAllowMethods) => { - if (typeof optsAllowMethods === "function") { - return optsAllowMethods; - } else if (Array.isArray(optsAllowMethods)) { - return () => optsAllowMethods; - } else { - return () => []; - } - })(opts.allowMethods); - return async function cors2(c, next) { - function set(key, value) { - c.res.headers.set(key, value); - } - const allowOrigin = await findAllowOrigin(c.req.header("origin") || "", c); - if (allowOrigin) { - set("Access-Control-Allow-Origin", allowOrigin); - } - if (opts.credentials) { - set("Access-Control-Allow-Credentials", "true"); - } - if (opts.exposeHeaders?.length) { - set("Access-Control-Expose-Headers", opts.exposeHeaders.join(",")); - } - if (c.req.method === "OPTIONS") { - if (opts.origin !== "*") { - set("Vary", "Origin"); - } - if (opts.maxAge != null) { - set("Access-Control-Max-Age", opts.maxAge.toString()); - } - const allowMethods = await findAllowMethods(c.req.header("origin") || "", c); - if (allowMethods.length) { - set("Access-Control-Allow-Methods", allowMethods.join(",")); - } - let headers = opts.allowHeaders; - if (!headers?.length) { - const requestHeaders = c.req.header("Access-Control-Request-Headers"); - if (requestHeaders) { - headers = requestHeaders.split(/\s*,\s*/); - } - } - if (headers?.length) { - set("Access-Control-Allow-Headers", headers.join(",")); - c.res.headers.append("Vary", "Access-Control-Request-Headers"); - } - c.res.headers.delete("Content-Length"); - c.res.headers.delete("Content-Type"); - return new Response(null, { - headers: c.res.headers, - status: 204, - statusText: "No Content" - }); - } - await next(); - if (opts.origin !== "*") { - c.header("Vary", "Origin", { append: true }); - } - }; -}; -export { - cors -}; diff --git a/node_modules/hono/dist/middleware/csrf/index.js b/node_modules/hono/dist/middleware/csrf/index.js deleted file mode 100644 index 3df5b4e..0000000 --- a/node_modules/hono/dist/middleware/csrf/index.js +++ /dev/null @@ -1,55 +0,0 @@ -// src/middleware/csrf/index.ts -import { HTTPException } from "../../http-exception.js"; -var secFetchSiteValues = ["same-origin", "same-site", "none", "cross-site"]; -var isSecFetchSite = (value) => secFetchSiteValues.includes(value); -var isSafeMethodRe = /^(GET|HEAD)$/; -var isRequestedByFormElementRe = /^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)\b/i; -var csrf = (options) => { - const originHandler = ((optsOrigin) => { - if (!optsOrigin) { - return (origin, c) => origin === new URL(c.req.url).origin; - } else if (typeof optsOrigin === "string") { - return (origin) => origin === optsOrigin; - } else if (typeof optsOrigin === "function") { - return optsOrigin; - } else { - return (origin) => optsOrigin.includes(origin); - } - })(options?.origin); - const isAllowedOrigin = async (origin, c) => { - if (origin === void 0) { - return false; - } - return await originHandler(origin, c); - }; - const secFetchSiteHandler = ((optsSecFetchSite) => { - if (!optsSecFetchSite) { - return (secFetchSite) => secFetchSite === "same-origin"; - } else if (typeof optsSecFetchSite === "string") { - return (secFetchSite) => secFetchSite === optsSecFetchSite; - } else if (typeof optsSecFetchSite === "function") { - return optsSecFetchSite; - } else { - return (secFetchSite) => optsSecFetchSite.includes(secFetchSite); - } - })(options?.secFetchSite); - const isAllowedSecFetchSite = async (secFetchSite, c) => { - if (secFetchSite === void 0) { - return false; - } - if (!isSecFetchSite(secFetchSite)) { - return false; - } - return await secFetchSiteHandler(secFetchSite, c); - }; - return async function csrf2(c, next) { - if (!isSafeMethodRe.test(c.req.method) && isRequestedByFormElementRe.test(c.req.header("content-type") || "text/plain") && !await isAllowedSecFetchSite(c.req.header("sec-fetch-site"), c) && !await isAllowedOrigin(c.req.header("origin"), c)) { - const res = new Response("Forbidden", { status: 403 }); - throw new HTTPException(403, { res }); - } - await next(); - }; -}; -export { - csrf -}; diff --git a/node_modules/hono/dist/middleware/etag/digest.js b/node_modules/hono/dist/middleware/etag/digest.js deleted file mode 100644 index 31f78bf..0000000 --- a/node_modules/hono/dist/middleware/etag/digest.js +++ /dev/null @@ -1,33 +0,0 @@ -// src/middleware/etag/digest.ts -var mergeBuffers = (buffer1, buffer2) => { - if (!buffer1) { - return buffer2; - } - const merged = new Uint8Array( - new ArrayBuffer(buffer1.byteLength + buffer2.byteLength) - ); - merged.set(new Uint8Array(buffer1), 0); - merged.set(buffer2, buffer1.byteLength); - return merged; -}; -var generateDigest = async (stream, generator) => { - if (!stream) { - return null; - } - let result = void 0; - const reader = stream.getReader(); - for (; ; ) { - const { value, done } = await reader.read(); - if (done) { - break; - } - result = await generator(mergeBuffers(result, value)); - } - if (!result) { - return null; - } - return Array.prototype.map.call(new Uint8Array(result), (x) => x.toString(16).padStart(2, "0")).join(""); -}; -export { - generateDigest -}; diff --git a/node_modules/hono/dist/middleware/etag/index.js b/node_modules/hono/dist/middleware/etag/index.js deleted file mode 100644 index 2ad0110..0000000 --- a/node_modules/hono/dist/middleware/etag/index.js +++ /dev/null @@ -1,72 +0,0 @@ -// src/middleware/etag/index.ts -import { generateDigest } from "./digest.js"; -var RETAINED_304_HEADERS = [ - "cache-control", - "content-location", - "date", - "etag", - "expires", - "vary" -]; -var stripWeak = (tag) => tag.replace(/^W\//, ""); -function etagMatches(etag2, ifNoneMatch) { - return ifNoneMatch != null && ifNoneMatch.split(/,\s*/).some((t) => stripWeak(t) === stripWeak(etag2)); -} -function initializeGenerator(generator) { - if (!generator) { - if (crypto && crypto.subtle) { - generator = (body) => crypto.subtle.digest( - { - name: "SHA-1" - }, - body - ); - } - } - return generator; -} -var etag = (options) => { - const retainedHeaders = options?.retainedHeaders ?? RETAINED_304_HEADERS; - const weak = options?.weak ?? false; - const generator = initializeGenerator(options?.generateDigest); - return async function etag2(c, next) { - const ifNoneMatch = c.req.header("If-None-Match") ?? null; - await next(); - const res = c.res; - let etag3 = res.headers.get("ETag"); - if (!etag3) { - if (!generator) { - return; - } - const hash = await generateDigest( - // This type casing avoids the type error for `deno publish` - res.clone().body, - generator - ); - if (hash === null) { - return; - } - etag3 = weak ? `W/"${hash}"` : `"${hash}"`; - } - if (etagMatches(etag3, ifNoneMatch)) { - c.res = new Response(null, { - status: 304, - statusText: "Not Modified", - headers: { - ETag: etag3 - } - }); - c.res.headers.forEach((_, key) => { - if (retainedHeaders.indexOf(key.toLowerCase()) === -1) { - c.res.headers.delete(key); - } - }); - } else { - c.res.headers.set("ETag", etag3); - } - }; -}; -export { - RETAINED_304_HEADERS, - etag -}; diff --git a/node_modules/hono/dist/middleware/ip-restriction/index.js b/node_modules/hono/dist/middleware/ip-restriction/index.js deleted file mode 100644 index b4b390e..0000000 --- a/node_modules/hono/dist/middleware/ip-restriction/index.js +++ /dev/null @@ -1,107 +0,0 @@ -// src/middleware/ip-restriction/index.ts -import { HTTPException } from "../../http-exception.js"; -import { - convertIPv4ToBinary, - convertIPv6BinaryToString, - convertIPv6ToBinary, - distinctRemoteAddr -} from "../../utils/ipaddr.js"; -var IS_CIDR_NOTATION_REGEX = /\/[0-9]{0,3}$/; -var buildMatcher = (rules) => { - const functionRules = []; - const staticRules = /* @__PURE__ */ new Set(); - const cidrRules = []; - for (let rule of rules) { - if (rule === "*") { - return () => true; - } else if (typeof rule === "function") { - functionRules.push(rule); - } else { - if (IS_CIDR_NOTATION_REGEX.test(rule)) { - const separatedRule = rule.split("/"); - const addrStr = separatedRule[0]; - const type2 = distinctRemoteAddr(addrStr); - if (type2 === void 0) { - throw new TypeError(`Invalid rule: ${rule}`); - } - const isIPv4 = type2 === "IPv4"; - const prefix = parseInt(separatedRule[1]); - if (isIPv4 ? prefix === 32 : prefix === 128) { - rule = addrStr; - } else { - const addr = (isIPv4 ? convertIPv4ToBinary : convertIPv6ToBinary)(addrStr); - const mask = (1n << BigInt(prefix)) - 1n << BigInt((isIPv4 ? 32 : 128) - prefix); - cidrRules.push([isIPv4, addr & mask, mask]); - continue; - } - } - const type = distinctRemoteAddr(rule); - if (type === void 0) { - throw new TypeError(`Invalid rule: ${rule}`); - } - staticRules.add( - type === "IPv4" ? rule : convertIPv6BinaryToString(convertIPv6ToBinary(rule)) - // normalize IPv6 address (e.g. 0000:0000:0000:0000:0000:0000:0000:0001 => ::1) - ); - } - } - return (remote) => { - if (staticRules.has(remote.addr)) { - return true; - } - for (const [isIPv4, addr, mask] of cidrRules) { - if (isIPv4 !== remote.isIPv4) { - continue; - } - const remoteAddr = remote.binaryAddr ||= (isIPv4 ? convertIPv4ToBinary : convertIPv6ToBinary)(remote.addr); - if ((remoteAddr & mask) === addr) { - return true; - } - } - for (const rule of functionRules) { - if (rule({ addr: remote.addr, type: remote.type })) { - return true; - } - } - return false; - }; -}; -var ipRestriction = (getIP, { denyList = [], allowList = [] }, onError) => { - const allowLength = allowList.length; - const denyMatcher = buildMatcher(denyList); - const allowMatcher = buildMatcher(allowList); - const blockError = (c) => new HTTPException(403, { - res: c.text("Forbidden", { - status: 403 - }) - }); - return async function ipRestriction2(c, next) { - const connInfo = getIP(c); - const addr = typeof connInfo === "string" ? connInfo : connInfo.remote.address; - if (!addr) { - throw blockError(c); - } - const type = typeof connInfo !== "string" && connInfo.remote.addressType || distinctRemoteAddr(addr); - const remoteData = { addr, type, isIPv4: type === "IPv4" }; - if (denyMatcher(remoteData)) { - if (onError) { - return onError({ addr, type }, c); - } - throw blockError(c); - } - if (allowMatcher(remoteData)) { - return await next(); - } - if (allowLength === 0) { - return await next(); - } else { - if (onError) { - return await onError({ addr, type }, c); - } - throw blockError(c); - } - }; -}; -export { - ipRestriction -}; diff --git a/node_modules/hono/dist/middleware/jsx-renderer/index.js b/node_modules/hono/dist/middleware/jsx-renderer/index.js deleted file mode 100644 index d43b2a7..0000000 --- a/node_modules/hono/dist/middleware/jsx-renderer/index.js +++ /dev/null @@ -1,57 +0,0 @@ -// src/middleware/jsx-renderer/index.ts -import { html, raw } from "../../helper/html/index.js"; -import { Fragment, createContext, jsx, useContext } from "../../jsx/index.js"; -import { renderToReadableStream } from "../../jsx/streaming.js"; -var RequestContext = createContext(null); -var createRenderer = (c, Layout, component, options) => (children, props) => { - const docType = typeof options?.docType === "string" ? options.docType : options?.docType === false ? "" : ""; - const currentLayout = component ? jsx( - (props2) => component(props2, c), - { - Layout, - ...props - }, - children - ) : children; - const body = html`${raw(docType)}${jsx( - RequestContext.Provider, - { value: c }, - currentLayout - )}`; - if (options?.stream) { - if (options.stream === true) { - c.header("Transfer-Encoding", "chunked"); - c.header("Content-Type", "text/html; charset=UTF-8"); - c.header("Content-Encoding", "Identity"); - } else { - for (const [key, value] of Object.entries(options.stream)) { - c.header(key, value); - } - } - return c.body(renderToReadableStream(body)); - } else { - return c.html(body); - } -}; -var jsxRenderer = (component, options) => function jsxRenderer2(c, next) { - const Layout = c.getLayout() ?? Fragment; - if (component) { - c.setLayout((props) => { - return component({ ...props, Layout }, c); - }); - } - c.setRenderer(createRenderer(c, Layout, component, options)); - return next(); -}; -var useRequestContext = () => { - const c = useContext(RequestContext); - if (!c) { - throw new Error("RequestContext is not provided."); - } - return c; -}; -export { - RequestContext, - jsxRenderer, - useRequestContext -}; diff --git a/node_modules/hono/dist/middleware/jwk/index.js b/node_modules/hono/dist/middleware/jwk/index.js deleted file mode 100644 index 310baa6..0000000 --- a/node_modules/hono/dist/middleware/jwk/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/middleware/jwk/index.ts -import { jwk } from "./jwk.js"; -export { - jwk -}; diff --git a/node_modules/hono/dist/middleware/jwk/jwk.js b/node_modules/hono/dist/middleware/jwk/jwk.js deleted file mode 100644 index 2721f42..0000000 --- a/node_modules/hono/dist/middleware/jwk/jwk.js +++ /dev/null @@ -1,112 +0,0 @@ -// src/middleware/jwk/jwk.ts -import { getCookie, getSignedCookie } from "../../helper/cookie/index.js"; -import { HTTPException } from "../../http-exception.js"; -import { Jwt } from "../../utils/jwt/index.js"; -import "../../context.js"; -var jwk = (options, init) => { - const verifyOpts = options.verification || {}; - if (!options || !(options.keys || options.jwks_uri)) { - throw new Error('JWK auth middleware requires options for either "keys" or "jwks_uri" or both'); - } - if (!crypto.subtle || !crypto.subtle.importKey) { - throw new Error("`crypto.subtle.importKey` is undefined. JWK auth middleware requires it."); - } - return async function jwk2(ctx, next) { - const headerName = options.headerName || "Authorization"; - const credentials = ctx.req.raw.headers.get(headerName); - let token; - if (credentials) { - const parts = credentials.split(/\s+/); - if (parts.length !== 2) { - const errDescription = "invalid credentials structure"; - throw new HTTPException(401, { - message: errDescription, - res: unauthorizedResponse({ - ctx, - error: "invalid_request", - errDescription - }) - }); - } else { - token = parts[1]; - } - } else if (options.cookie) { - if (typeof options.cookie == "string") { - token = getCookie(ctx, options.cookie); - } else if (options.cookie.secret) { - if (options.cookie.prefixOptions) { - token = await getSignedCookie( - ctx, - options.cookie.secret, - options.cookie.key, - options.cookie.prefixOptions - ); - } else { - token = await getSignedCookie(ctx, options.cookie.secret, options.cookie.key); - } - } else { - if (options.cookie.prefixOptions) { - token = getCookie(ctx, options.cookie.key, options.cookie.prefixOptions); - } else { - token = getCookie(ctx, options.cookie.key); - } - } - } - if (!token) { - if (options.allow_anon) { - return next(); - } - const errDescription = "no authorization included in request"; - throw new HTTPException(401, { - message: errDescription, - res: unauthorizedResponse({ - ctx, - error: "invalid_request", - errDescription - }) - }); - } - let payload; - let cause; - try { - const keys = typeof options.keys === "function" ? await options.keys(ctx) : options.keys; - const jwks_uri = typeof options.jwks_uri === "function" ? await options.jwks_uri(ctx) : options.jwks_uri; - payload = await Jwt.verifyWithJwks( - token, - { keys, jwks_uri, verification: verifyOpts, allowedAlgorithms: options.alg }, - init - ); - } catch (e) { - cause = e; - } - if (!payload) { - if (cause instanceof Error && cause.constructor === Error) { - throw cause; - } - throw new HTTPException(401, { - message: "Unauthorized", - res: unauthorizedResponse({ - ctx, - error: "invalid_token", - statusText: "Unauthorized", - errDescription: "token verification failure" - }), - cause - }); - } - ctx.set("jwtPayload", payload); - await next(); - }; -}; -function unauthorizedResponse(opts) { - return new Response("Unauthorized", { - status: 401, - statusText: opts.statusText, - headers: { - "WWW-Authenticate": `Bearer realm="${opts.ctx.req.url}",error="${opts.error}",error_description="${opts.errDescription}"` - } - }); -} -export { - jwk -}; diff --git a/node_modules/hono/dist/middleware/jwt/index.js b/node_modules/hono/dist/middleware/jwt/index.js deleted file mode 100644 index 86bd76e..0000000 --- a/node_modules/hono/dist/middleware/jwt/index.js +++ /dev/null @@ -1,11 +0,0 @@ -// src/middleware/jwt/index.ts -import { jwt, verifyWithJwks, verify, decode, sign } from "./jwt.js"; -import { AlgorithmTypes } from "../../utils/jwt/jwa.js"; -export { - AlgorithmTypes, - decode, - jwt, - sign, - verify, - verifyWithJwks -}; diff --git a/node_modules/hono/dist/middleware/jwt/jwt.js b/node_modules/hono/dist/middleware/jwt/jwt.js deleted file mode 100644 index eb1ac18..0000000 --- a/node_modules/hono/dist/middleware/jwt/jwt.js +++ /dev/null @@ -1,114 +0,0 @@ -// src/middleware/jwt/jwt.ts -import { getCookie, getSignedCookie } from "../../helper/cookie/index.js"; -import { HTTPException } from "../../http-exception.js"; -import { Jwt } from "../../utils/jwt/index.js"; -import "../../context.js"; -var jwt = (options) => { - const verifyOpts = options.verification || {}; - if (!options || !options.secret) { - throw new Error('JWT auth middleware requires options for "secret"'); - } - if (!options.alg) { - throw new Error('JWT auth middleware requires options for "alg"'); - } - if (!crypto.subtle || !crypto.subtle.importKey) { - throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); - } - return async function jwt2(ctx, next) { - const headerName = options.headerName || "Authorization"; - const credentials = ctx.req.raw.headers.get(headerName); - let token; - if (credentials) { - const parts = credentials.split(/\s+/); - if (parts.length !== 2) { - const errDescription = "invalid credentials structure"; - throw new HTTPException(401, { - message: errDescription, - res: unauthorizedResponse({ - ctx, - error: "invalid_request", - errDescription - }) - }); - } else { - token = parts[1]; - } - } else if (options.cookie) { - if (typeof options.cookie == "string") { - token = getCookie(ctx, options.cookie); - } else if (options.cookie.secret) { - if (options.cookie.prefixOptions) { - token = await getSignedCookie( - ctx, - options.cookie.secret, - options.cookie.key, - options.cookie.prefixOptions - ); - } else { - token = await getSignedCookie(ctx, options.cookie.secret, options.cookie.key); - } - } else { - if (options.cookie.prefixOptions) { - token = getCookie(ctx, options.cookie.key, options.cookie.prefixOptions); - } else { - token = getCookie(ctx, options.cookie.key); - } - } - } - if (!token) { - const errDescription = "no authorization included in request"; - throw new HTTPException(401, { - message: errDescription, - res: unauthorizedResponse({ - ctx, - error: "invalid_request", - errDescription - }) - }); - } - let payload; - let cause; - try { - payload = await Jwt.verify(token, options.secret, { - alg: options.alg, - ...verifyOpts - }); - } catch (e) { - cause = e; - } - if (!payload) { - throw new HTTPException(401, { - message: "Unauthorized", - res: unauthorizedResponse({ - ctx, - error: "invalid_token", - statusText: "Unauthorized", - errDescription: "token verification failure" - }), - cause - }); - } - ctx.set("jwtPayload", payload); - await next(); - }; -}; -function unauthorizedResponse(opts) { - return new Response("Unauthorized", { - status: 401, - statusText: opts.statusText, - headers: { - "WWW-Authenticate": `Bearer realm="${opts.ctx.req.url}",error="${opts.error}",error_description="${opts.errDescription}"` - } - }); -} -var verifyWithJwks = Jwt.verifyWithJwks; -var verify = Jwt.verify; -var decode = Jwt.decode; -var sign = Jwt.sign; -export { - decode, - jwt, - sign, - verify, - verifyWithJwks -}; diff --git a/node_modules/hono/dist/middleware/language/index.js b/node_modules/hono/dist/middleware/language/index.js deleted file mode 100644 index 9455c61..0000000 --- a/node_modules/hono/dist/middleware/language/index.js +++ /dev/null @@ -1,15 +0,0 @@ -// src/middleware/language/index.ts -import { - languageDetector, - detectFromCookie, - detectFromHeader, - detectFromPath, - detectFromQuery -} from "./language.js"; -export { - detectFromCookie, - detectFromHeader, - detectFromPath, - detectFromQuery, - languageDetector -}; diff --git a/node_modules/hono/dist/middleware/language/language.js b/node_modules/hono/dist/middleware/language/language.js deleted file mode 100644 index fe4316e..0000000 --- a/node_modules/hono/dist/middleware/language/language.js +++ /dev/null @@ -1,179 +0,0 @@ -// src/middleware/language/language.ts -import { setCookie, getCookie } from "../../helper/cookie/index.js"; -import { parseAccept } from "../../utils/accept.js"; -var DEFAULT_OPTIONS = { - order: ["querystring", "cookie", "header"], - lookupQueryString: "lang", - lookupCookie: "language", - lookupFromHeaderKey: "accept-language", - lookupFromPathIndex: 0, - caches: ["cookie"], - ignoreCase: true, - fallbackLanguage: "en", - supportedLanguages: ["en"], - cookieOptions: { - sameSite: "Strict", - secure: true, - maxAge: 365 * 24 * 60 * 60, - httpOnly: true - }, - debug: false -}; -function parseAcceptLanguage(header) { - return parseAccept(header).map(({ type, q }) => ({ lang: type, q })); -} -var normalizeLanguage = (lang, options) => { - if (!lang) { - return void 0; - } - try { - let normalizedLang = lang.trim(); - if (options.convertDetectedLanguage) { - normalizedLang = options.convertDetectedLanguage(normalizedLang); - } - const compLang = options.ignoreCase ? normalizedLang.toLowerCase() : normalizedLang; - const compSupported = options.supportedLanguages.map( - (l) => options.ignoreCase ? l.toLowerCase() : l - ); - const matchedLang = compSupported.find((l) => l === compLang); - return matchedLang ? options.supportedLanguages[compSupported.indexOf(matchedLang)] : void 0; - } catch { - return void 0; - } -}; -var detectFromQuery = (c, options) => { - try { - const query = c.req.query(options.lookupQueryString); - return normalizeLanguage(query, options); - } catch { - return void 0; - } -}; -var detectFromCookie = (c, options) => { - try { - const cookie = getCookie(c, options.lookupCookie); - return normalizeLanguage(cookie, options); - } catch { - return void 0; - } -}; -function detectFromHeader(c, options) { - try { - const acceptLanguage = c.req.header(options.lookupFromHeaderKey); - if (!acceptLanguage) { - return void 0; - } - const languages = parseAcceptLanguage(acceptLanguage); - for (const { lang } of languages) { - const normalizedLang = normalizeLanguage(lang, options); - if (normalizedLang) { - return normalizedLang; - } - } - return void 0; - } catch { - return void 0; - } -} -function detectFromPath(c, options) { - try { - const url = new URL(c.req.url); - const pathSegments = url.pathname.split("/").filter(Boolean); - const langSegment = pathSegments[options.lookupFromPathIndex]; - return normalizeLanguage(langSegment, options); - } catch { - return void 0; - } -} -var detectors = { - querystring: detectFromQuery, - cookie: detectFromCookie, - header: detectFromHeader, - path: detectFromPath -}; -function validateOptions(options) { - if (!options.supportedLanguages.includes(options.fallbackLanguage)) { - throw new Error("Fallback language must be included in supported languages"); - } - if (options.lookupFromPathIndex < 0) { - throw new Error("Path index must be non-negative"); - } - if (!options.order.every((detector) => Object.keys(detectors).includes(detector))) { - throw new Error("Invalid detector type in order array"); - } -} -function cacheLanguage(c, language, options) { - if (!Array.isArray(options.caches) || !options.caches.includes("cookie")) { - return; - } - try { - setCookie(c, options.lookupCookie, language, options.cookieOptions); - } catch (error) { - if (options.debug) { - console.error("Failed to cache language:", error); - } - } -} -var detectLanguage = (c, options) => { - let detectedLang; - for (const detectorName of options.order) { - const detector = detectors[detectorName]; - if (!detector) { - continue; - } - try { - detectedLang = detector(c, options); - if (detectedLang) { - if (options.debug) { - console.log(`Language detected from ${detectorName}: ${detectedLang}`); - } - break; - } - } catch (error) { - if (options.debug) { - console.error(`Error in ${detectorName} detector:`, error); - } - continue; - } - } - const finalLang = detectedLang || options.fallbackLanguage; - if (detectedLang && options.caches) { - cacheLanguage(c, finalLang, options); - } - return finalLang; -}; -var languageDetector = (userOptions) => { - const options = { - ...DEFAULT_OPTIONS, - ...userOptions, - cookieOptions: { - ...DEFAULT_OPTIONS.cookieOptions, - ...userOptions.cookieOptions - } - }; - validateOptions(options); - return async function languageDetector2(ctx, next) { - try { - const lang = detectLanguage(ctx, options); - ctx.set("language", lang); - } catch (error) { - if (options.debug) { - console.error("Language detection failed:", error); - } - ctx.set("language", options.fallbackLanguage); - } - await next(); - }; -}; -export { - DEFAULT_OPTIONS, - detectFromCookie, - detectFromHeader, - detectFromPath, - detectFromQuery, - detectors, - languageDetector, - normalizeLanguage, - parseAcceptLanguage, - validateOptions -}; diff --git a/node_modules/hono/dist/middleware/logger/index.js b/node_modules/hono/dist/middleware/logger/index.js deleted file mode 100644 index 2a727b6..0000000 --- a/node_modules/hono/dist/middleware/logger/index.js +++ /dev/null @@ -1,44 +0,0 @@ -// src/middleware/logger/index.ts -import { getColorEnabledAsync } from "../../utils/color.js"; -var humanize = (times) => { - const [delimiter, separator] = [",", "."]; - const orderTimes = times.map((v) => v.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + delimiter)); - return orderTimes.join(separator); -}; -var time = (start) => { - const delta = Date.now() - start; - return humanize([delta < 1e3 ? delta + "ms" : Math.round(delta / 1e3) + "s"]); -}; -var colorStatus = async (status) => { - const colorEnabled = await getColorEnabledAsync(); - if (colorEnabled) { - switch (status / 100 | 0) { - case 5: - return `\x1B[31m${status}\x1B[0m`; - case 4: - return `\x1B[33m${status}\x1B[0m`; - case 3: - return `\x1B[36m${status}\x1B[0m`; - case 2: - return `\x1B[32m${status}\x1B[0m`; - } - } - return `${status}`; -}; -async function log(fn, prefix, method, path, status = 0, elapsed) { - const out = prefix === "<--" /* Incoming */ ? `${prefix} ${method} ${path}` : `${prefix} ${method} ${path} ${await colorStatus(status)} ${elapsed}`; - fn(out); -} -var logger = (fn = console.log) => { - return async function logger2(c, next) { - const { method, url } = c.req; - const path = url.slice(url.indexOf("/", 8)); - await log(fn, "<--" /* Incoming */, method, path); - const start = Date.now(); - await next(); - await log(fn, "-->" /* Outgoing */, method, path, c.res.status, time(start)); - }; -}; -export { - logger -}; diff --git a/node_modules/hono/dist/middleware/method-override/index.js b/node_modules/hono/dist/middleware/method-override/index.js deleted file mode 100644 index e7daefe..0000000 --- a/node_modules/hono/dist/middleware/method-override/index.js +++ /dev/null @@ -1,82 +0,0 @@ -// src/middleware/method-override/index.ts -import { parseBody } from "../../utils/body.js"; -var DEFAULT_METHOD_FORM_NAME = "_method"; -var methodOverride = (options) => async function methodOverride2(c, next) { - if (c.req.method === "GET") { - return await next(); - } - const app = options.app; - if (!(options.header || options.query)) { - const contentType = c.req.header("content-type"); - const methodFormName = options.form || DEFAULT_METHOD_FORM_NAME; - const clonedRequest = c.req.raw.clone(); - const newRequest = clonedRequest.clone(); - if (contentType?.startsWith("multipart/form-data")) { - const form = await clonedRequest.formData(); - const method = form.get(methodFormName); - if (method) { - const newForm = await newRequest.formData(); - newForm.delete(methodFormName); - const newHeaders = new Headers(clonedRequest.headers); - newHeaders.delete("content-type"); - newHeaders.delete("content-length"); - const request = new Request(c.req.url, { - body: newForm, - headers: newHeaders, - method - }); - return app.fetch(request, c.env, getExecutionCtx(c)); - } - } - if (contentType === "application/x-www-form-urlencoded") { - const params = await parseBody(clonedRequest); - const method = params[methodFormName]; - if (method) { - delete params[methodFormName]; - const newParams = new URLSearchParams(params); - const request = new Request(newRequest, { - body: newParams, - method - }); - return app.fetch(request, c.env, getExecutionCtx(c)); - } - } - } else if (options.header) { - const headerName = options.header; - const method = c.req.header(headerName); - if (method) { - const newHeaders = new Headers(c.req.raw.headers); - newHeaders.delete(headerName); - const request = new Request(c.req.raw, { - headers: newHeaders, - method - }); - return app.fetch(request, c.env, getExecutionCtx(c)); - } - } else if (options.query) { - const queryName = options.query; - const method = c.req.query(queryName); - if (method) { - const url = new URL(c.req.url); - url.searchParams.delete(queryName); - const request = new Request(url.toString(), { - body: c.req.raw.body, - headers: c.req.raw.headers, - method - }); - return app.fetch(request, c.env, getExecutionCtx(c)); - } - } - await next(); -}; -var getExecutionCtx = (c) => { - let executionCtx; - try { - executionCtx = c.executionCtx; - } catch { - } - return executionCtx; -}; -export { - methodOverride -}; diff --git a/node_modules/hono/dist/middleware/powered-by/index.js b/node_modules/hono/dist/middleware/powered-by/index.js deleted file mode 100644 index 827f65f..0000000 --- a/node_modules/hono/dist/middleware/powered-by/index.js +++ /dev/null @@ -1,10 +0,0 @@ -// src/middleware/powered-by/index.ts -var poweredBy = (options) => { - return async function poweredBy2(c, next) { - await next(); - c.res.headers.set("X-Powered-By", options?.serverName ?? "Hono"); - }; -}; -export { - poweredBy -}; diff --git a/node_modules/hono/dist/middleware/pretty-json/index.js b/node_modules/hono/dist/middleware/pretty-json/index.js deleted file mode 100644 index 5bb7163..0000000 --- a/node_modules/hono/dist/middleware/pretty-json/index.js +++ /dev/null @@ -1,15 +0,0 @@ -// src/middleware/pretty-json/index.ts -var prettyJSON = (options) => { - const targetQuery = options?.query ?? "pretty"; - return async function prettyJSON2(c, next) { - const pretty = options?.force || c.req.query(targetQuery) || c.req.query(targetQuery) === ""; - await next(); - if (pretty && c.res.headers.get("Content-Type")?.startsWith("application/json")) { - const obj = await c.res.json(); - c.res = new Response(JSON.stringify(obj, null, options?.space ?? 2), c.res); - } - }; -}; -export { - prettyJSON -}; diff --git a/node_modules/hono/dist/middleware/request-id/index.js b/node_modules/hono/dist/middleware/request-id/index.js deleted file mode 100644 index 3f6a077..0000000 --- a/node_modules/hono/dist/middleware/request-id/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/middleware/request-id/index.ts -import { requestId } from "./request-id.js"; -export { - requestId -}; diff --git a/node_modules/hono/dist/middleware/request-id/request-id.js b/node_modules/hono/dist/middleware/request-id/request-id.js deleted file mode 100644 index 0c22de6..0000000 --- a/node_modules/hono/dist/middleware/request-id/request-id.js +++ /dev/null @@ -1,21 +0,0 @@ -// src/middleware/request-id/request-id.ts -var requestId = ({ - limitLength = 255, - headerName = "X-Request-Id", - generator = () => crypto.randomUUID() -} = {}) => { - return async function requestId2(c, next) { - let reqId = headerName ? c.req.header(headerName) : void 0; - if (!reqId || reqId.length > limitLength || /[^\w\-=]/.test(reqId)) { - reqId = generator(c); - } - c.set("requestId", reqId); - if (headerName) { - c.header(headerName, reqId); - } - await next(); - }; -}; -export { - requestId -}; diff --git a/node_modules/hono/dist/middleware/secure-headers/index.js b/node_modules/hono/dist/middleware/secure-headers/index.js deleted file mode 100644 index 7983a6f..0000000 --- a/node_modules/hono/dist/middleware/secure-headers/index.js +++ /dev/null @@ -1,6 +0,0 @@ -// src/middleware/secure-headers/index.ts -import { NONCE, secureHeaders } from "./secure-headers.js"; -export { - NONCE, - secureHeaders -}; diff --git a/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js b/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/middleware/secure-headers/secure-headers.js b/node_modules/hono/dist/middleware/secure-headers/secure-headers.js deleted file mode 100644 index 7124599..0000000 --- a/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +++ /dev/null @@ -1,166 +0,0 @@ -// src/middleware/secure-headers/secure-headers.ts -import { encodeBase64 } from "../../utils/encode.js"; -var HEADERS_MAP = { - crossOriginEmbedderPolicy: ["Cross-Origin-Embedder-Policy", "require-corp"], - crossOriginResourcePolicy: ["Cross-Origin-Resource-Policy", "same-origin"], - crossOriginOpenerPolicy: ["Cross-Origin-Opener-Policy", "same-origin"], - originAgentCluster: ["Origin-Agent-Cluster", "?1"], - referrerPolicy: ["Referrer-Policy", "no-referrer"], - strictTransportSecurity: ["Strict-Transport-Security", "max-age=15552000; includeSubDomains"], - xContentTypeOptions: ["X-Content-Type-Options", "nosniff"], - xDnsPrefetchControl: ["X-DNS-Prefetch-Control", "off"], - xDownloadOptions: ["X-Download-Options", "noopen"], - xFrameOptions: ["X-Frame-Options", "SAMEORIGIN"], - xPermittedCrossDomainPolicies: ["X-Permitted-Cross-Domain-Policies", "none"], - xXssProtection: ["X-XSS-Protection", "0"] -}; -var DEFAULT_OPTIONS = { - crossOriginEmbedderPolicy: false, - crossOriginResourcePolicy: true, - crossOriginOpenerPolicy: true, - originAgentCluster: true, - referrerPolicy: true, - strictTransportSecurity: true, - xContentTypeOptions: true, - xDnsPrefetchControl: true, - xDownloadOptions: true, - xFrameOptions: true, - xPermittedCrossDomainPolicies: true, - xXssProtection: true, - removePoweredBy: true, - permissionsPolicy: {} -}; -var generateNonce = () => { - const arrayBuffer = new Uint8Array(16); - crypto.getRandomValues(arrayBuffer); - return encodeBase64(arrayBuffer.buffer); -}; -var NONCE = (ctx) => { - const key = "secureHeadersNonce"; - const init = ctx.get(key); - const nonce = init || generateNonce(); - if (init == null) { - ctx.set(key, nonce); - } - return `'nonce-${nonce}'`; -}; -var secureHeaders = (customOptions) => { - const options = { ...DEFAULT_OPTIONS, ...customOptions }; - const headersToSet = getFilteredHeaders(options); - const callbacks = []; - if (options.contentSecurityPolicy) { - const [callback, value] = getCSPDirectives(options.contentSecurityPolicy); - if (callback) { - callbacks.push(callback); - } - headersToSet.push(["Content-Security-Policy", value]); - } - if (options.contentSecurityPolicyReportOnly) { - const [callback, value] = getCSPDirectives(options.contentSecurityPolicyReportOnly); - if (callback) { - callbacks.push(callback); - } - headersToSet.push(["Content-Security-Policy-Report-Only", value]); - } - if (options.permissionsPolicy && Object.keys(options.permissionsPolicy).length > 0) { - headersToSet.push([ - "Permissions-Policy", - getPermissionsPolicyDirectives(options.permissionsPolicy) - ]); - } - if (options.reportingEndpoints) { - headersToSet.push(["Reporting-Endpoints", getReportingEndpoints(options.reportingEndpoints)]); - } - if (options.reportTo) { - headersToSet.push(["Report-To", getReportToOptions(options.reportTo)]); - } - return async function secureHeaders2(ctx, next) { - const headersToSetForReq = callbacks.length === 0 ? headersToSet : callbacks.reduce((acc, cb) => cb(ctx, acc), headersToSet); - await next(); - setHeaders(ctx, headersToSetForReq); - if (options?.removePoweredBy) { - ctx.res.headers.delete("X-Powered-By"); - } - }; -}; -function getFilteredHeaders(options) { - return Object.entries(HEADERS_MAP).filter(([key]) => options[key]).map(([key, defaultValue]) => { - const overrideValue = options[key]; - return typeof overrideValue === "string" ? [defaultValue[0], overrideValue] : defaultValue; - }); -} -function getCSPDirectives(contentSecurityPolicy) { - const callbacks = []; - const resultValues = []; - for (const [directive, value] of Object.entries(contentSecurityPolicy)) { - const valueArray = Array.isArray(value) ? value : [value]; - valueArray.forEach((value2, i) => { - if (typeof value2 === "function") { - const index = i * 2 + 2 + resultValues.length; - callbacks.push((ctx, values) => { - values[index] = value2(ctx, directive); - }); - } - }); - resultValues.push( - directive.replace( - /[A-Z]+(?![a-z])|[A-Z]/g, - (match, offset) => offset ? "-" + match.toLowerCase() : match.toLowerCase() - ), - ...valueArray.flatMap((value2) => [" ", value2]), - "; " - ); - } - resultValues.pop(); - return callbacks.length === 0 ? [void 0, resultValues.join("")] : [ - (ctx, headersToSet) => headersToSet.map((values) => { - if (values[0] === "Content-Security-Policy" || values[0] === "Content-Security-Policy-Report-Only") { - const clone = values[1].slice(); - callbacks.forEach((cb) => { - cb(ctx, clone); - }); - return [values[0], clone.join("")]; - } else { - return values; - } - }), - resultValues - ]; -} -function getPermissionsPolicyDirectives(policy) { - return Object.entries(policy).map(([directive, value]) => { - const kebabDirective = camelToKebab(directive); - if (typeof value === "boolean") { - return `${kebabDirective}=${value ? "*" : "none"}`; - } - if (Array.isArray(value)) { - if (value.length === 0) { - return `${kebabDirective}=()`; - } - if (value.length === 1 && (value[0] === "*" || value[0] === "none")) { - return `${kebabDirective}=${value[0]}`; - } - const allowlist = value.map((item) => ["self", "src"].includes(item) ? item : `"${item}"`); - return `${kebabDirective}=(${allowlist.join(" ")})`; - } - return ""; - }).filter(Boolean).join(", "); -} -function camelToKebab(str) { - return str.replace(/([a-z\d])([A-Z])/g, "$1-$2").toLowerCase(); -} -function getReportingEndpoints(reportingEndpoints = []) { - return reportingEndpoints.map((endpoint) => `${endpoint.name}="${endpoint.url}"`).join(", "); -} -function getReportToOptions(reportTo = []) { - return reportTo.map((option) => JSON.stringify(option)).join(", "); -} -function setHeaders(ctx, headersToSet) { - headersToSet.forEach(([header, value]) => { - ctx.res.headers.set(header, value); - }); -} -export { - NONCE, - secureHeaders -}; diff --git a/node_modules/hono/dist/middleware/serve-static/index.js b/node_modules/hono/dist/middleware/serve-static/index.js deleted file mode 100644 index 7ed3d9a..0000000 --- a/node_modules/hono/dist/middleware/serve-static/index.js +++ /dev/null @@ -1,76 +0,0 @@ -// src/middleware/serve-static/index.ts -import { COMPRESSIBLE_CONTENT_TYPE_REGEX } from "../../utils/compress.js"; -import { getMimeType } from "../../utils/mime.js"; -import { defaultJoin } from "./path.js"; -var ENCODINGS = { - br: ".br", - zstd: ".zst", - gzip: ".gz" -}; -var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS); -var DEFAULT_DOCUMENT = "index.html"; -var serveStatic = (options) => { - const root = options.root ?? "./"; - const optionPath = options.path; - const join = options.join ?? defaultJoin; - return async (c, next) => { - if (c.finalized) { - return next(); - } - let filename; - if (options.path) { - filename = options.path; - } else { - try { - filename = decodeURIComponent(c.req.path); - if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) { - throw new Error(); - } - } catch { - await options.onNotFound?.(c.req.path, c); - return next(); - } - } - let path = join( - root, - !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename) : filename - ); - if (options.isDir && await options.isDir(path)) { - path = join(path, DEFAULT_DOCUMENT); - } - const getContent = options.getContent; - let content = await getContent(path, c); - if (content instanceof Response) { - return c.newResponse(content.body, content); - } - if (content) { - const mimeType = options.mimes && getMimeType(path, options.mimes) || getMimeType(path); - c.header("Content-Type", mimeType || "application/octet-stream"); - if (options.precompressed && (!mimeType || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) { - const acceptEncodingSet = new Set( - c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()) - ); - for (const encoding of ENCODINGS_ORDERED_KEYS) { - if (!acceptEncodingSet.has(encoding)) { - continue; - } - const compressedContent = await getContent(path + ENCODINGS[encoding], c); - if (compressedContent) { - content = compressedContent; - c.header("Content-Encoding", encoding); - c.header("Vary", "Accept-Encoding", { append: true }); - break; - } - } - } - await options.onFound?.(path, c); - return c.body(content); - } - await options.onNotFound?.(path, c); - await next(); - return; - }; -}; -export { - serveStatic -}; diff --git a/node_modules/hono/dist/middleware/serve-static/path.js b/node_modules/hono/dist/middleware/serve-static/path.js deleted file mode 100644 index ab7f823..0000000 --- a/node_modules/hono/dist/middleware/serve-static/path.js +++ /dev/null @@ -1,18 +0,0 @@ -// src/middleware/serve-static/path.ts -var defaultJoin = (...paths) => { - let result = paths.filter((p) => p !== "").join("/"); - result = result.replace(/(?<=\/)\/+/g, ""); - const segments = result.split("/"); - const resolved = []; - for (const segment of segments) { - if (segment === ".." && resolved.length > 0 && resolved.at(-1) !== "..") { - resolved.pop(); - } else if (segment !== ".") { - resolved.push(segment); - } - } - return resolved.join("/") || "."; -}; -export { - defaultJoin -}; diff --git a/node_modules/hono/dist/middleware/timeout/index.js b/node_modules/hono/dist/middleware/timeout/index.js deleted file mode 100644 index 9fac713..0000000 --- a/node_modules/hono/dist/middleware/timeout/index.js +++ /dev/null @@ -1,25 +0,0 @@ -// src/middleware/timeout/index.ts -import { HTTPException } from "../../http-exception.js"; -var defaultTimeoutException = new HTTPException(504, { - message: "Gateway Timeout" -}); -var timeout = (duration, exception = defaultTimeoutException) => { - return async function timeout2(context, next) { - let timer; - const timeoutPromise = new Promise((_, reject) => { - timer = setTimeout(() => { - reject(typeof exception === "function" ? exception(context) : exception); - }, duration); - }); - try { - await Promise.race([next(), timeoutPromise]); - } finally { - if (timer !== void 0) { - clearTimeout(timer); - } - } - }; -}; -export { - timeout -}; diff --git a/node_modules/hono/dist/middleware/timing/index.js b/node_modules/hono/dist/middleware/timing/index.js deleted file mode 100644 index 4c0836b..0000000 --- a/node_modules/hono/dist/middleware/timing/index.js +++ /dev/null @@ -1,9 +0,0 @@ -// src/middleware/timing/index.ts -import { timing, setMetric, startTime, endTime, wrapTime } from "./timing.js"; -export { - endTime, - setMetric, - startTime, - timing, - wrapTime -}; diff --git a/node_modules/hono/dist/middleware/timing/timing.js b/node_modules/hono/dist/middleware/timing/timing.js deleted file mode 100644 index df3014c..0000000 --- a/node_modules/hono/dist/middleware/timing/timing.js +++ /dev/null @@ -1,102 +0,0 @@ -// src/middleware/timing/timing.ts -import "../../context.js"; -var getTime = () => { - try { - return performance.now(); - } catch { - } - return Date.now(); -}; -var timing = (config) => { - const options = { - total: true, - enabled: true, - totalDescription: "Total Response Time", - autoEnd: true, - crossOrigin: false, - ...config - }; - return async function timing2(c, next) { - const headers = []; - const timers = /* @__PURE__ */ new Map(); - if (c.get("metric")) { - return await next(); - } - c.set("metric", { headers, timers }); - if (options.total) { - startTime(c, "total", options.totalDescription); - } - await next(); - if (options.total) { - endTime(c, "total"); - } - if (options.autoEnd) { - timers.forEach((_, key) => endTime(c, key)); - } - const enabled = typeof options.enabled === "function" ? options.enabled(c) : options.enabled; - if (enabled) { - c.res.headers.append("Server-Timing", headers.join(",")); - const crossOrigin = typeof options.crossOrigin === "function" ? options.crossOrigin(c) : options.crossOrigin; - if (crossOrigin) { - c.res.headers.append( - "Timing-Allow-Origin", - typeof crossOrigin === "string" ? crossOrigin : "*" - ); - } - } - }; -}; -var setMetric = (c, name, valueDescription, description, precision) => { - const metrics = c.get("metric"); - if (!metrics) { - console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); - return; - } - if (typeof valueDescription === "number") { - const dur = valueDescription.toFixed(precision || 1); - const metric = description ? `${name};dur=${dur};desc="${description}"` : `${name};dur=${dur}`; - metrics.headers.push(metric); - } else { - const metric = valueDescription ? `${name};desc="${valueDescription}"` : `${name}`; - metrics.headers.push(metric); - } -}; -var startTime = (c, name, description) => { - const metrics = c.get("metric"); - if (!metrics) { - console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); - return; - } - metrics.timers.set(name, { description, start: getTime() }); -}; -var endTime = (c, name, precision) => { - const metrics = c.get("metric"); - if (!metrics) { - console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); - return; - } - const timer = metrics.timers.get(name); - if (!timer) { - console.warn(`Timer "${name}" does not exist!`); - return; - } - const { description, start } = timer; - const duration = getTime() - start; - setMetric(c, name, duration, description, precision); - metrics.timers.delete(name); -}; -async function wrapTime(c, name, callable, description, precision) { - startTime(c, name, description); - try { - return await callable; - } finally { - endTime(c, name, precision); - } -} -export { - endTime, - setMetric, - startTime, - timing, - wrapTime -}; diff --git a/node_modules/hono/dist/middleware/trailing-slash/index.js b/node_modules/hono/dist/middleware/trailing-slash/index.js deleted file mode 100644 index c769749..0000000 --- a/node_modules/hono/dist/middleware/trailing-slash/index.js +++ /dev/null @@ -1,25 +0,0 @@ -// src/middleware/trailing-slash/index.ts -var trimTrailingSlash = () => { - return async function trimTrailingSlash2(c, next) { - await next(); - if (c.res.status === 404 && (c.req.method === "GET" || c.req.method === "HEAD") && c.req.path !== "/" && c.req.path.at(-1) === "/") { - const url = new URL(c.req.url); - url.pathname = url.pathname.substring(0, url.pathname.length - 1); - c.res = c.redirect(url.toString(), 301); - } - }; -}; -var appendTrailingSlash = () => { - return async function appendTrailingSlash2(c, next) { - await next(); - if (c.res.status === 404 && (c.req.method === "GET" || c.req.method === "HEAD") && c.req.path.at(-1) !== "/") { - const url = new URL(c.req.url); - url.pathname += "/"; - c.res = c.redirect(url.toString(), 301); - } - }; -}; -export { - appendTrailingSlash, - trimTrailingSlash -}; diff --git a/node_modules/hono/dist/preset/quick.js b/node_modules/hono/dist/preset/quick.js deleted file mode 100644 index b8eca97..0000000 --- a/node_modules/hono/dist/preset/quick.js +++ /dev/null @@ -1,16 +0,0 @@ -// src/preset/quick.ts -import { HonoBase } from "../hono-base.js"; -import { LinearRouter } from "../router/linear-router/index.js"; -import { SmartRouter } from "../router/smart-router/index.js"; -import { TrieRouter } from "../router/trie-router/index.js"; -var Hono = class extends HonoBase { - constructor(options = {}) { - super(options); - this.router = new SmartRouter({ - routers: [new LinearRouter(), new TrieRouter()] - }); - } -}; -export { - Hono -}; diff --git a/node_modules/hono/dist/preset/tiny.js b/node_modules/hono/dist/preset/tiny.js deleted file mode 100644 index 377e3b0..0000000 --- a/node_modules/hono/dist/preset/tiny.js +++ /dev/null @@ -1,12 +0,0 @@ -// src/preset/tiny.ts -import { HonoBase } from "../hono-base.js"; -import { PatternRouter } from "../router/pattern-router/index.js"; -var Hono = class extends HonoBase { - constructor(options = {}) { - super(options); - this.router = new PatternRouter(); - } -}; -export { - Hono -}; diff --git a/node_modules/hono/dist/request.js b/node_modules/hono/dist/request.js deleted file mode 100644 index 06a2bf9..0000000 --- a/node_modules/hono/dist/request.js +++ /dev/null @@ -1,301 +0,0 @@ -// src/request.ts -import { HTTPException } from "./http-exception.js"; -import { GET_MATCH_RESULT } from "./request/constants.js"; -import { parseBody } from "./utils/body.js"; -import { decodeURIComponent_, getQueryParam, getQueryParams, tryDecode } from "./utils/url.js"; -var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_); -var HonoRequest = class { - /** - * `.raw` can get the raw Request object. - * - * @see {@link https://hono.dev/docs/api/request#raw} - * - * @example - * ```ts - * // For Cloudflare Workers - * app.post('/', async (c) => { - * const metadata = c.req.raw.cf?.hostMetadata? - * ... - * }) - * ``` - */ - raw; - #validatedData; - // Short name of validatedData - #matchResult; - routeIndex = 0; - /** - * `.path` can get the pathname of the request. - * - * @see {@link https://hono.dev/docs/api/request#path} - * - * @example - * ```ts - * app.get('/about/me', (c) => { - * const pathname = c.req.path // `/about/me` - * }) - * ``` - */ - path; - bodyCache = {}; - constructor(request, path = "/", matchResult = [[]]) { - this.raw = request; - this.path = path; - this.#matchResult = matchResult; - this.#validatedData = {}; - } - param(key) { - return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams(); - } - #getDecodedParam(key) { - const paramKey = this.#matchResult[0][this.routeIndex][1][key]; - const param = this.#getParamValue(paramKey); - return param && /\%/.test(param) ? tryDecodeURIComponent(param) : param; - } - #getAllDecodedParams() { - const decoded = {}; - const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]); - for (const key of keys) { - const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]); - if (value !== void 0) { - decoded[key] = /\%/.test(value) ? tryDecodeURIComponent(value) : value; - } - } - return decoded; - } - #getParamValue(paramKey) { - return this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey; - } - query(key) { - return getQueryParam(this.url, key); - } - queries(key) { - return getQueryParams(this.url, key); - } - header(name) { - if (name) { - return this.raw.headers.get(name) ?? void 0; - } - const headerData = {}; - this.raw.headers.forEach((value, key) => { - headerData[key] = value; - }); - return headerData; - } - async parseBody(options) { - return this.bodyCache.parsedBody ??= await parseBody(this, options); - } - #cachedBody = (key) => { - const { bodyCache, raw } = this; - const cachedBody = bodyCache[key]; - if (cachedBody) { - return cachedBody; - } - const anyCachedKey = Object.keys(bodyCache)[0]; - if (anyCachedKey) { - return bodyCache[anyCachedKey].then((body) => { - if (anyCachedKey === "json") { - body = JSON.stringify(body); - } - return new Response(body)[key](); - }); - } - return bodyCache[key] = raw[key](); - }; - /** - * `.json()` can parse Request body of type `application/json` - * - * @see {@link https://hono.dev/docs/api/request#json} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.json() - * }) - * ``` - */ - json() { - return this.#cachedBody("text").then((text) => JSON.parse(text)); - } - /** - * `.text()` can parse Request body of type `text/plain` - * - * @see {@link https://hono.dev/docs/api/request#text} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.text() - * }) - * ``` - */ - text() { - return this.#cachedBody("text"); - } - /** - * `.arrayBuffer()` parse Request body as an `ArrayBuffer` - * - * @see {@link https://hono.dev/docs/api/request#arraybuffer} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.arrayBuffer() - * }) - * ``` - */ - arrayBuffer() { - return this.#cachedBody("arrayBuffer"); - } - /** - * Parses the request body as a `Blob`. - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.blob(); - * }); - * ``` - * @see https://hono.dev/docs/api/request#blob - */ - blob() { - return this.#cachedBody("blob"); - } - /** - * Parses the request body as `FormData`. - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.formData(); - * }); - * ``` - * @see https://hono.dev/docs/api/request#formdata - */ - formData() { - return this.#cachedBody("formData"); - } - /** - * Adds validated data to the request. - * - * @param target - The target of the validation. - * @param data - The validated data to add. - */ - addValidatedData(target, data) { - this.#validatedData[target] = data; - } - valid(target) { - return this.#validatedData[target]; - } - /** - * `.url()` can get the request url strings. - * - * @see {@link https://hono.dev/docs/api/request#url} - * - * @example - * ```ts - * app.get('/about/me', (c) => { - * const url = c.req.url // `http://localhost:8787/about/me` - * ... - * }) - * ``` - */ - get url() { - return this.raw.url; - } - /** - * `.method()` can get the method name of the request. - * - * @see {@link https://hono.dev/docs/api/request#method} - * - * @example - * ```ts - * app.get('/about/me', (c) => { - * const method = c.req.method // `GET` - * }) - * ``` - */ - get method() { - return this.raw.method; - } - get [GET_MATCH_RESULT]() { - return this.#matchResult; - } - /** - * `.matchedRoutes()` can return a matched route in the handler - * - * @deprecated - * - * Use matchedRoutes helper defined in "hono/route" instead. - * - * @see {@link https://hono.dev/docs/api/request#matchedroutes} - * - * @example - * ```ts - * app.use('*', async function logger(c, next) { - * await next() - * c.req.matchedRoutes.forEach(({ handler, method, path }, i) => { - * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') - * console.log( - * method, - * ' ', - * path, - * ' '.repeat(Math.max(10 - path.length, 0)), - * name, - * i === c.req.routeIndex ? '<- respond from here' : '' - * ) - * }) - * }) - * ``` - */ - get matchedRoutes() { - return this.#matchResult[0].map(([[, route]]) => route); - } - /** - * `routePath()` can retrieve the path registered within the handler - * - * @deprecated - * - * Use routePath helper defined in "hono/route" instead. - * - * @see {@link https://hono.dev/docs/api/request#routepath} - * - * @example - * ```ts - * app.get('/posts/:id', (c) => { - * return c.json({ path: c.req.routePath }) - * }) - * ``` - */ - get routePath() { - return this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path; - } -}; -var cloneRawRequest = async (req) => { - if (!req.raw.bodyUsed) { - return req.raw.clone(); - } - const cacheKey = Object.keys(req.bodyCache)[0]; - if (!cacheKey) { - throw new HTTPException(500, { - message: "Cannot clone request: body was already consumed and not cached. Please use HonoRequest methods (e.g., req.json(), req.text()) instead of consuming req.raw directly." - }); - } - const requestInit = { - body: await req[cacheKey](), - cache: req.raw.cache, - credentials: req.raw.credentials, - headers: req.header(), - integrity: req.raw.integrity, - keepalive: req.raw.keepalive, - method: req.method, - mode: req.raw.mode, - redirect: req.raw.redirect, - referrer: req.raw.referrer, - referrerPolicy: req.raw.referrerPolicy, - signal: req.raw.signal - }; - return new Request(req.url, requestInit); -}; -export { - HonoRequest, - cloneRawRequest -}; diff --git a/node_modules/hono/dist/request/constants.js b/node_modules/hono/dist/request/constants.js deleted file mode 100644 index 0dd1f54..0000000 --- a/node_modules/hono/dist/request/constants.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/request/constants.ts -var GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); -export { - GET_MATCH_RESULT -}; diff --git a/node_modules/hono/dist/router.js b/node_modules/hono/dist/router.js deleted file mode 100644 index 7e3111e..0000000 --- a/node_modules/hono/dist/router.js +++ /dev/null @@ -1,14 +0,0 @@ -// src/router.ts -var METHOD_NAME_ALL = "ALL"; -var METHOD_NAME_ALL_LOWERCASE = "all"; -var METHODS = ["get", "post", "put", "delete", "options", "patch"]; -var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built."; -var UnsupportedPathError = class extends Error { -}; -export { - MESSAGE_MATCHER_IS_ALREADY_BUILT, - METHODS, - METHOD_NAME_ALL, - METHOD_NAME_ALL_LOWERCASE, - UnsupportedPathError -}; diff --git a/node_modules/hono/dist/router/linear-router/index.js b/node_modules/hono/dist/router/linear-router/index.js deleted file mode 100644 index ed50711..0000000 --- a/node_modules/hono/dist/router/linear-router/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/router/linear-router/index.ts -import { LinearRouter } from "./router.js"; -export { - LinearRouter -}; diff --git a/node_modules/hono/dist/router/linear-router/router.js b/node_modules/hono/dist/router/linear-router/router.js deleted file mode 100644 index ca0a0c1..0000000 --- a/node_modules/hono/dist/router/linear-router/router.js +++ /dev/null @@ -1,118 +0,0 @@ -// src/router/linear-router/router.ts -import { METHOD_NAME_ALL, UnsupportedPathError } from "../../router.js"; -import { checkOptionalParameter } from "../../utils/url.js"; -var emptyParams = /* @__PURE__ */ Object.create(null); -var splitPathRe = /\/(:\w+(?:{(?:(?:{[\d,]+})|[^}])+})?)|\/[^\/\?]+|(\?)/g; -var splitByStarRe = /\*/; -var LinearRouter = class { - name = "LinearRouter"; - #routes = []; - add(method, path, handler) { - for (let i = 0, paths = checkOptionalParameter(path) || [path], len = paths.length; i < len; i++) { - this.#routes.push([method, paths[i], handler]); - } - } - match(method, path) { - const handlers = []; - ROUTES_LOOP: for (let i = 0, len = this.#routes.length; i < len; i++) { - const [routeMethod, routePath, handler] = this.#routes[i]; - if (routeMethod === method || routeMethod === METHOD_NAME_ALL) { - if (routePath === "*" || routePath === "/*") { - handlers.push([handler, emptyParams]); - continue; - } - const hasStar = routePath.indexOf("*") !== -1; - const hasLabel = routePath.indexOf(":") !== -1; - if (!hasStar && !hasLabel) { - if (routePath === path || routePath + "/" === path) { - handlers.push([handler, emptyParams]); - } - } else if (hasStar && !hasLabel) { - const endsWithStar = routePath.charCodeAt(routePath.length - 1) === 42; - const parts = (endsWithStar ? routePath.slice(0, -2) : routePath).split(splitByStarRe); - const lastIndex = parts.length - 1; - for (let j = 0, pos = 0, len2 = parts.length; j < len2; j++) { - const part = parts[j]; - const index = path.indexOf(part, pos); - if (index !== pos) { - continue ROUTES_LOOP; - } - pos += part.length; - if (j === lastIndex) { - if (!endsWithStar && pos !== path.length && !(pos === path.length - 1 && path.charCodeAt(pos) === 47)) { - continue ROUTES_LOOP; - } - } else { - const index2 = path.indexOf("/", pos); - if (index2 === -1) { - continue ROUTES_LOOP; - } - pos = index2; - } - } - handlers.push([handler, emptyParams]); - } else if (hasLabel && !hasStar) { - const params = /* @__PURE__ */ Object.create(null); - const parts = routePath.match(splitPathRe); - const lastIndex = parts.length - 1; - for (let j = 0, pos = 0, len2 = parts.length; j < len2; j++) { - if (pos === -1 || pos >= path.length) { - continue ROUTES_LOOP; - } - const part = parts[j]; - if (part.charCodeAt(1) === 58) { - if (path.charCodeAt(pos) !== 47) { - continue ROUTES_LOOP; - } - let name = part.slice(2); - let value; - if (name.charCodeAt(name.length - 1) === 125) { - const openBracePos = name.indexOf("{"); - const next = parts[j + 1]; - const lookahead = next && next[1] !== ":" && next[1] !== "*" ? `(?=${next})` : ""; - const pattern = name.slice(openBracePos + 1, -1) + lookahead; - const restPath = path.slice(pos + 1); - const match = new RegExp(pattern, "d").exec(restPath); - if (!match || match.indices[0][0] !== 0 || match.indices[0][1] === 0) { - continue ROUTES_LOOP; - } - name = name.slice(0, openBracePos); - value = restPath.slice(...match.indices[0]); - pos += match.indices[0][1] + 1; - } else { - let endValuePos = path.indexOf("/", pos + 1); - if (endValuePos === -1) { - if (pos + 1 === path.length) { - continue ROUTES_LOOP; - } - endValuePos = path.length; - } - value = path.slice(pos + 1, endValuePos); - pos = endValuePos; - } - params[name] ||= value; - } else { - const index = path.indexOf(part, pos); - if (index !== pos) { - continue ROUTES_LOOP; - } - pos += part.length; - } - if (j === lastIndex) { - if (pos !== path.length && !(pos === path.length - 1 && path.charCodeAt(pos) === 47)) { - continue ROUTES_LOOP; - } - } - } - handlers.push([handler, params]); - } else if (hasLabel && hasStar) { - throw new UnsupportedPathError(); - } - } - } - return [handlers]; - } -}; -export { - LinearRouter -}; diff --git a/node_modules/hono/dist/router/pattern-router/index.js b/node_modules/hono/dist/router/pattern-router/index.js deleted file mode 100644 index b4e9ab4..0000000 --- a/node_modules/hono/dist/router/pattern-router/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/router/pattern-router/index.ts -import { PatternRouter } from "./router.js"; -export { - PatternRouter -}; diff --git a/node_modules/hono/dist/router/pattern-router/router.js b/node_modules/hono/dist/router/pattern-router/router.js deleted file mode 100644 index 96eb0b8..0000000 --- a/node_modules/hono/dist/router/pattern-router/router.js +++ /dev/null @@ -1,48 +0,0 @@ -// src/router/pattern-router/router.ts -import { METHOD_NAME_ALL, UnsupportedPathError } from "../../router.js"; -var emptyParams = /* @__PURE__ */ Object.create(null); -var PatternRouter = class { - name = "PatternRouter"; - #routes = []; - add(method, path, handler) { - const endsWithWildcard = path.at(-1) === "*"; - if (endsWithWildcard) { - path = path.slice(0, -2); - } - if (path.at(-1) === "?") { - path = path.slice(0, -1); - this.add(method, path.replace(/\/[^/]+$/, ""), handler); - } - const parts = (path.match(/\/?(:\w+(?:{(?:(?:{[\d,]+})|[^}])+})?)|\/?[^\/\?]+/g) || []).map( - (part) => { - const match = part.match(/^\/:([^{]+)(?:{(.*)})?/); - return match ? `/(?<${match[1]}>${match[2] || "[^/]+"})` : part === "/*" ? "/[^/]+" : part.replace(/[.\\+*[^\]$()]/g, "\\$&"); - } - ); - try { - this.#routes.push([ - new RegExp(`^${parts.join("")}${endsWithWildcard ? "" : "/?$"}`), - method, - handler - ]); - } catch { - throw new UnsupportedPathError(); - } - } - match(method, path) { - const handlers = []; - for (let i = 0, len = this.#routes.length; i < len; i++) { - const [pattern, routeMethod, handler] = this.#routes[i]; - if (routeMethod === method || routeMethod === METHOD_NAME_ALL) { - const match = pattern.exec(path); - if (match) { - handlers.push([handler, match.groups || emptyParams]); - } - } - } - return [handlers]; - } -}; -export { - PatternRouter -}; diff --git a/node_modules/hono/dist/router/reg-exp-router/index.js b/node_modules/hono/dist/router/reg-exp-router/index.js deleted file mode 100644 index dc94aeb..0000000 --- a/node_modules/hono/dist/router/reg-exp-router/index.js +++ /dev/null @@ -1,9 +0,0 @@ -// src/router/reg-exp-router/index.ts -import { RegExpRouter } from "./router.js"; -import { PreparedRegExpRouter, buildInitParams, serializeInitParams } from "./prepared-router.js"; -export { - PreparedRegExpRouter, - RegExpRouter, - buildInitParams, - serializeInitParams -}; diff --git a/node_modules/hono/dist/router/reg-exp-router/matcher.js b/node_modules/hono/dist/router/reg-exp-router/matcher.js deleted file mode 100644 index 3691559..0000000 --- a/node_modules/hono/dist/router/reg-exp-router/matcher.js +++ /dev/null @@ -1,25 +0,0 @@ -// src/router/reg-exp-router/matcher.ts -import { METHOD_NAME_ALL } from "../../router.js"; -var emptyParam = []; -function match(method, path) { - const matchers = this.buildAllMatchers(); - const match2 = ((method2, path2) => { - const matcher = matchers[method2] || matchers[METHOD_NAME_ALL]; - const staticMatch = matcher[2][path2]; - if (staticMatch) { - return staticMatch; - } - const match3 = path2.match(matcher[0]); - if (!match3) { - return [[], emptyParam]; - } - const index = match3.indexOf("", 1); - return [matcher[1][index], match3]; - }); - this.match = match2; - return match2(method, path); -} -export { - emptyParam, - match -}; diff --git a/node_modules/hono/dist/router/reg-exp-router/node.js b/node_modules/hono/dist/router/reg-exp-router/node.js deleted file mode 100644 index fc4b292..0000000 --- a/node_modules/hono/dist/router/reg-exp-router/node.js +++ /dev/null @@ -1,111 +0,0 @@ -// src/router/reg-exp-router/node.ts -var LABEL_REG_EXP_STR = "[^/]+"; -var ONLY_WILDCARD_REG_EXP_STR = ".*"; -var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; -var PATH_ERROR = /* @__PURE__ */ Symbol(); -var regExpMetaChars = new Set(".\\+*[^]$()"); -function compareKey(a, b) { - if (a.length === 1) { - return b.length === 1 ? a < b ? -1 : 1 : -1; - } - if (b.length === 1) { - return 1; - } - if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) { - return 1; - } else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) { - return -1; - } - if (a === LABEL_REG_EXP_STR) { - return 1; - } else if (b === LABEL_REG_EXP_STR) { - return -1; - } - return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length; -} -var Node = class _Node { - #index; - #varIndex; - #children = /* @__PURE__ */ Object.create(null); - insert(tokens, index, paramMap, context, pathErrorCheckOnly) { - if (tokens.length === 0) { - if (this.#index !== void 0) { - throw PATH_ERROR; - } - if (pathErrorCheckOnly) { - return; - } - this.#index = index; - return; - } - const [token, ...restTokens] = tokens; - const pattern = token === "*" ? restTokens.length === 0 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); - let node; - if (pattern) { - const name = pattern[1]; - let regexpStr = pattern[2] || LABEL_REG_EXP_STR; - if (name && pattern[2]) { - if (regexpStr === ".*") { - throw PATH_ERROR; - } - regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:"); - if (/\((?!\?:)/.test(regexpStr)) { - throw PATH_ERROR; - } - } - node = this.#children[regexpStr]; - if (!node) { - if (Object.keys(this.#children).some( - (k) => k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR - )) { - throw PATH_ERROR; - } - if (pathErrorCheckOnly) { - return; - } - node = this.#children[regexpStr] = new _Node(); - if (name !== "") { - node.#varIndex = context.varIndex++; - } - } - if (!pathErrorCheckOnly && name !== "") { - paramMap.push([name, node.#varIndex]); - } - } else { - node = this.#children[token]; - if (!node) { - if (Object.keys(this.#children).some( - (k) => k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR - )) { - throw PATH_ERROR; - } - if (pathErrorCheckOnly) { - return; - } - node = this.#children[token] = new _Node(); - } - } - node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly); - } - buildRegExpStr() { - const childKeys = Object.keys(this.#children).sort(compareKey); - const strList = childKeys.map((k) => { - const c = this.#children[k]; - return (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr(); - }); - if (typeof this.#index === "number") { - strList.unshift(`#${this.#index}`); - } - if (strList.length === 0) { - return ""; - } - if (strList.length === 1) { - return strList[0]; - } - return "(?:" + strList.join("|") + ")"; - } -}; -export { - Node, - PATH_ERROR -}; diff --git a/node_modules/hono/dist/router/reg-exp-router/prepared-router.js b/node_modules/hono/dist/router/reg-exp-router/prepared-router.js deleted file mode 100644 index d329d76..0000000 --- a/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +++ /dev/null @@ -1,142 +0,0 @@ -// src/router/reg-exp-router/prepared-router.ts -import { METHOD_NAME_ALL } from "../../router.js"; -import { match, emptyParam } from "./matcher.js"; -import { RegExpRouter } from "./router.js"; -var PreparedRegExpRouter = class { - name = "PreparedRegExpRouter"; - #matchers; - #relocateMap; - constructor(matchers, relocateMap) { - this.#matchers = matchers; - this.#relocateMap = relocateMap; - } - #addWildcard(method, handlerData) { - const matcher = this.#matchers[method]; - matcher[1].forEach((list) => list && list.push(handlerData)); - Object.values(matcher[2]).forEach((list) => list[0].push(handlerData)); - } - #addPath(method, path, handler, indexes, map) { - const matcher = this.#matchers[method]; - if (!map) { - matcher[2][path][0].push([handler, {}]); - } else { - indexes.forEach((index) => { - if (typeof index === "number") { - matcher[1][index].push([handler, map]); - } else { - ; - matcher[2][index || path][0].push([handler, map]); - } - }); - } - } - add(method, path, handler) { - if (!this.#matchers[method]) { - const all = this.#matchers[METHOD_NAME_ALL]; - const staticMap = {}; - for (const key in all[2]) { - staticMap[key] = [all[2][key][0].slice(), emptyParam]; - } - this.#matchers[method] = [ - all[0], - all[1].map((list) => Array.isArray(list) ? list.slice() : 0), - staticMap - ]; - } - if (path === "/*" || path === "*") { - const handlerData = [handler, {}]; - if (method === METHOD_NAME_ALL) { - for (const m in this.#matchers) { - this.#addWildcard(m, handlerData); - } - } else { - this.#addWildcard(method, handlerData); - } - return; - } - const data = this.#relocateMap[path]; - if (!data) { - throw new Error(`Path ${path} is not registered`); - } - for (const [indexes, map] of data) { - if (method === METHOD_NAME_ALL) { - for (const m in this.#matchers) { - this.#addPath(m, path, handler, indexes, map); - } - } else { - this.#addPath(method, path, handler, indexes, map); - } - } - } - buildAllMatchers() { - return this.#matchers; - } - match = match; -}; -var buildInitParams = ({ paths }) => { - const RegExpRouterWithMatcherExport = class extends RegExpRouter { - buildAndExportAllMatchers() { - return this.buildAllMatchers(); - } - }; - const router = new RegExpRouterWithMatcherExport(); - for (const path of paths) { - router.add(METHOD_NAME_ALL, path, path); - } - const matchers = router.buildAndExportAllMatchers(); - const all = matchers[METHOD_NAME_ALL]; - const relocateMap = {}; - for (const path of paths) { - if (path === "/*" || path === "*") { - continue; - } - all[1].forEach((list, i) => { - list.forEach(([p, map]) => { - if (p === path) { - if (relocateMap[path]) { - relocateMap[path][0][1] = { - ...relocateMap[path][0][1], - ...map - }; - } else { - relocateMap[path] = [[[], map]]; - } - if (relocateMap[path][0][0].findIndex((j) => j === i) === -1) { - relocateMap[path][0][0].push(i); - } - } - }); - }); - for (const path2 in all[2]) { - all[2][path2][0].forEach(([p]) => { - if (p === path) { - relocateMap[path] ||= [[[]]]; - const value = path2 === path ? "" : path2; - if (relocateMap[path][0][0].findIndex((v) => v === value) === -1) { - relocateMap[path][0][0].push(value); - } - } - }); - } - } - for (let i = 0, len = all[1].length; i < len; i++) { - all[1][i] = all[1][i] ? [] : 0; - } - for (const path in all[2]) { - all[2][path][0] = []; - } - return [matchers, relocateMap]; -}; -var serializeInitParams = ([matchers, relocateMap]) => { - const matchersStr = JSON.stringify( - matchers, - (_, value) => value instanceof RegExp ? `##${value.toString()}##` : value - ).replace(/"##(.+?)##"/g, (_, str) => str.replace(/\\\\/g, "\\")); - const relocateMapStr = JSON.stringify(relocateMap); - return `[${matchersStr},${relocateMapStr}]`; -}; -export { - PreparedRegExpRouter, - buildInitParams, - serializeInitParams -}; diff --git a/node_modules/hono/dist/router/reg-exp-router/router.js b/node_modules/hono/dist/router/reg-exp-router/router.js deleted file mode 100644 index c8abb70..0000000 --- a/node_modules/hono/dist/router/reg-exp-router/router.js +++ /dev/null @@ -1,190 +0,0 @@ -// src/router/reg-exp-router/router.ts -import { - MESSAGE_MATCHER_IS_ALREADY_BUILT, - METHOD_NAME_ALL, - UnsupportedPathError -} from "../../router.js"; -import { checkOptionalParameter } from "../../utils/url.js"; -import { match, emptyParam } from "./matcher.js"; -import { PATH_ERROR } from "./node.js"; -import { Trie } from "./trie.js"; -var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)]; -var wildcardRegExpCache = /* @__PURE__ */ Object.create(null); -function buildWildcardRegExp(path) { - return wildcardRegExpCache[path] ??= new RegExp( - path === "*" ? "" : `^${path.replace( - /\/\*$|([.\\+*[^\]$()])/g, - (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)" - )}$` - ); -} -function clearWildcardRegExpCache() { - wildcardRegExpCache = /* @__PURE__ */ Object.create(null); -} -function buildMatcherFromPreprocessedRoutes(routes) { - const trie = new Trie(); - const handlerData = []; - if (routes.length === 0) { - return nullMatcher; - } - const routesWithStaticPathFlag = routes.map( - (route) => [!/\*|\/:/.test(route[0]), ...route] - ).sort( - ([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length - ); - const staticMap = /* @__PURE__ */ Object.create(null); - for (let i = 0, j = -1, len = routesWithStaticPathFlag.length; i < len; i++) { - const [pathErrorCheckOnly, path, handlers] = routesWithStaticPathFlag[i]; - if (pathErrorCheckOnly) { - staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam]; - } else { - j++; - } - let paramAssoc; - try { - paramAssoc = trie.insert(path, j, pathErrorCheckOnly); - } catch (e) { - throw e === PATH_ERROR ? new UnsupportedPathError(path) : e; - } - if (pathErrorCheckOnly) { - continue; - } - handlerData[j] = handlers.map(([h, paramCount]) => { - const paramIndexMap = /* @__PURE__ */ Object.create(null); - paramCount -= 1; - for (; paramCount >= 0; paramCount--) { - const [key, value] = paramAssoc[paramCount]; - paramIndexMap[key] = value; - } - return [h, paramIndexMap]; - }); - } - const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp(); - for (let i = 0, len = handlerData.length; i < len; i++) { - for (let j = 0, len2 = handlerData[i].length; j < len2; j++) { - const map = handlerData[i][j]?.[1]; - if (!map) { - continue; - } - const keys = Object.keys(map); - for (let k = 0, len3 = keys.length; k < len3; k++) { - map[keys[k]] = paramReplacementMap[map[keys[k]]]; - } - } - } - const handlerMap = []; - for (const i in indexReplacementMap) { - handlerMap[i] = handlerData[indexReplacementMap[i]]; - } - return [regexp, handlerMap, staticMap]; -} -function findMiddleware(middleware, path) { - if (!middleware) { - return void 0; - } - for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) { - if (buildWildcardRegExp(k).test(path)) { - return [...middleware[k]]; - } - } - return void 0; -} -var RegExpRouter = class { - name = "RegExpRouter"; - #middleware; - #routes; - constructor() { - this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; - this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; - } - add(method, path, handler) { - const middleware = this.#middleware; - const routes = this.#routes; - if (!middleware || !routes) { - throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT); - } - if (!middleware[method]) { - ; - [middleware, routes].forEach((handlerMap) => { - handlerMap[method] = /* @__PURE__ */ Object.create(null); - Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => { - handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]]; - }); - }); - } - if (path === "/*") { - path = "*"; - } - const paramCount = (path.match(/\/:/g) || []).length; - if (/\*$/.test(path)) { - const re = buildWildcardRegExp(path); - if (method === METHOD_NAME_ALL) { - Object.keys(middleware).forEach((m) => { - middleware[m][path] ||= findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || []; - }); - } else { - middleware[method][path] ||= findMiddleware(middleware[method], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || []; - } - Object.keys(middleware).forEach((m) => { - if (method === METHOD_NAME_ALL || method === m) { - Object.keys(middleware[m]).forEach((p) => { - re.test(p) && middleware[m][p].push([handler, paramCount]); - }); - } - }); - Object.keys(routes).forEach((m) => { - if (method === METHOD_NAME_ALL || method === m) { - Object.keys(routes[m]).forEach( - (p) => re.test(p) && routes[m][p].push([handler, paramCount]) - ); - } - }); - return; - } - const paths = checkOptionalParameter(path) || [path]; - for (let i = 0, len = paths.length; i < len; i++) { - const path2 = paths[i]; - Object.keys(routes).forEach((m) => { - if (method === METHOD_NAME_ALL || method === m) { - routes[m][path2] ||= [ - ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || [] - ]; - routes[m][path2].push([handler, paramCount - len + i + 1]); - } - }); - } - } - match = match; - buildAllMatchers() { - const matchers = /* @__PURE__ */ Object.create(null); - Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => { - matchers[method] ||= this.#buildMatcher(method); - }); - this.#middleware = this.#routes = void 0; - clearWildcardRegExpCache(); - return matchers; - } - #buildMatcher(method) { - const routes = []; - let hasOwnRoute = method === METHOD_NAME_ALL; - [this.#middleware, this.#routes].forEach((r) => { - const ownRoute = r[method] ? Object.keys(r[method]).map((path) => [path, r[method][path]]) : []; - if (ownRoute.length !== 0) { - hasOwnRoute ||= true; - routes.push(...ownRoute); - } else if (method !== METHOD_NAME_ALL) { - routes.push( - ...Object.keys(r[METHOD_NAME_ALL]).map((path) => [path, r[METHOD_NAME_ALL][path]]) - ); - } - }); - if (!hasOwnRoute) { - return null; - } else { - return buildMatcherFromPreprocessedRoutes(routes); - } - } -}; -export { - RegExpRouter -}; diff --git a/node_modules/hono/dist/router/reg-exp-router/trie.js b/node_modules/hono/dist/router/reg-exp-router/trie.js deleted file mode 100644 index 7de861e..0000000 --- a/node_modules/hono/dist/router/reg-exp-router/trie.js +++ /dev/null @@ -1,59 +0,0 @@ -// src/router/reg-exp-router/trie.ts -import { Node } from "./node.js"; -var Trie = class { - #context = { varIndex: 0 }; - #root = new Node(); - insert(path, index, pathErrorCheckOnly) { - const paramAssoc = []; - const groups = []; - for (let i = 0; ; ) { - let replaced = false; - path = path.replace(/\{[^}]+\}/g, (m) => { - const mark = `@\\${i}`; - groups[i] = [mark, m]; - i++; - replaced = true; - return mark; - }); - if (!replaced) { - break; - } - } - const tokens = path.match(/(?::[^\/]+)|(?:\/\*$)|./g) || []; - for (let i = groups.length - 1; i >= 0; i--) { - const [mark] = groups[i]; - for (let j = tokens.length - 1; j >= 0; j--) { - if (tokens[j].indexOf(mark) !== -1) { - tokens[j] = tokens[j].replace(mark, groups[i][1]); - break; - } - } - } - this.#root.insert(tokens, index, paramAssoc, this.#context, pathErrorCheckOnly); - return paramAssoc; - } - buildRegExp() { - let regexp = this.#root.buildRegExpStr(); - if (regexp === "") { - return [/^$/, [], []]; - } - let captureIndex = 0; - const indexReplacementMap = []; - const paramReplacementMap = []; - regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => { - if (handlerIndex !== void 0) { - indexReplacementMap[++captureIndex] = Number(handlerIndex); - return "$()"; - } - if (paramIndex !== void 0) { - paramReplacementMap[Number(paramIndex)] = ++captureIndex; - return ""; - } - return ""; - }); - return [new RegExp(`^${regexp}`), indexReplacementMap, paramReplacementMap]; - } -}; -export { - Trie -}; diff --git a/node_modules/hono/dist/router/smart-router/index.js b/node_modules/hono/dist/router/smart-router/index.js deleted file mode 100644 index 2e68377..0000000 --- a/node_modules/hono/dist/router/smart-router/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/router/smart-router/index.ts -import { SmartRouter } from "./router.js"; -export { - SmartRouter -}; diff --git a/node_modules/hono/dist/router/smart-router/router.js b/node_modules/hono/dist/router/smart-router/router.js deleted file mode 100644 index 1b19adb..0000000 --- a/node_modules/hono/dist/router/smart-router/router.js +++ /dev/null @@ -1,58 +0,0 @@ -// src/router/smart-router/router.ts -import { MESSAGE_MATCHER_IS_ALREADY_BUILT, UnsupportedPathError } from "../../router.js"; -var SmartRouter = class { - name = "SmartRouter"; - #routers = []; - #routes = []; - constructor(init) { - this.#routers = init.routers; - } - add(method, path, handler) { - if (!this.#routes) { - throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT); - } - this.#routes.push([method, path, handler]); - } - match(method, path) { - if (!this.#routes) { - throw new Error("Fatal error"); - } - const routers = this.#routers; - const routes = this.#routes; - const len = routers.length; - let i = 0; - let res; - for (; i < len; i++) { - const router = routers[i]; - try { - for (let i2 = 0, len2 = routes.length; i2 < len2; i2++) { - router.add(...routes[i2]); - } - res = router.match(method, path); - } catch (e) { - if (e instanceof UnsupportedPathError) { - continue; - } - throw e; - } - this.match = router.match.bind(router); - this.#routers = [router]; - this.#routes = void 0; - break; - } - if (i === len) { - throw new Error("Fatal error"); - } - this.name = `SmartRouter + ${this.activeRouter.name}`; - return res; - } - get activeRouter() { - if (this.#routes || this.#routers.length !== 1) { - throw new Error("No active router has been determined yet."); - } - return this.#routers[0]; - } -}; -export { - SmartRouter -}; diff --git a/node_modules/hono/dist/router/trie-router/index.js b/node_modules/hono/dist/router/trie-router/index.js deleted file mode 100644 index c680d10..0000000 --- a/node_modules/hono/dist/router/trie-router/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/router/trie-router/index.ts -import { TrieRouter } from "./router.js"; -export { - TrieRouter -}; diff --git a/node_modules/hono/dist/router/trie-router/node.js b/node_modules/hono/dist/router/trie-router/node.js deleted file mode 100644 index a34c96d..0000000 --- a/node_modules/hono/dist/router/trie-router/node.js +++ /dev/null @@ -1,162 +0,0 @@ -// src/router/trie-router/node.ts -import { METHOD_NAME_ALL } from "../../router.js"; -import { getPattern, splitPath, splitRoutingPath } from "../../utils/url.js"; -var emptyParams = /* @__PURE__ */ Object.create(null); -var Node = class _Node { - #methods; - #children; - #patterns; - #order = 0; - #params = emptyParams; - constructor(method, handler, children) { - this.#children = children || /* @__PURE__ */ Object.create(null); - this.#methods = []; - if (method && handler) { - const m = /* @__PURE__ */ Object.create(null); - m[method] = { handler, possibleKeys: [], score: 0 }; - this.#methods = [m]; - } - this.#patterns = []; - } - insert(method, path, handler) { - this.#order = ++this.#order; - let curNode = this; - const parts = splitRoutingPath(path); - const possibleKeys = []; - for (let i = 0, len = parts.length; i < len; i++) { - const p = parts[i]; - const nextP = parts[i + 1]; - const pattern = getPattern(p, nextP); - const key = Array.isArray(pattern) ? pattern[0] : p; - if (key in curNode.#children) { - curNode = curNode.#children[key]; - if (pattern) { - possibleKeys.push(pattern[1]); - } - continue; - } - curNode.#children[key] = new _Node(); - if (pattern) { - curNode.#patterns.push(pattern); - possibleKeys.push(pattern[1]); - } - curNode = curNode.#children[key]; - } - curNode.#methods.push({ - [method]: { - handler, - possibleKeys: possibleKeys.filter((v, i, a) => a.indexOf(v) === i), - score: this.#order - } - }); - return curNode; - } - #getHandlerSets(node, method, nodeParams, params) { - const handlerSets = []; - for (let i = 0, len = node.#methods.length; i < len; i++) { - const m = node.#methods[i]; - const handlerSet = m[method] || m[METHOD_NAME_ALL]; - const processedSet = {}; - if (handlerSet !== void 0) { - handlerSet.params = /* @__PURE__ */ Object.create(null); - handlerSets.push(handlerSet); - if (nodeParams !== emptyParams || params && params !== emptyParams) { - for (let i2 = 0, len2 = handlerSet.possibleKeys.length; i2 < len2; i2++) { - const key = handlerSet.possibleKeys[i2]; - const processed = processedSet[handlerSet.score]; - handlerSet.params[key] = params?.[key] && !processed ? params[key] : nodeParams[key] ?? params?.[key]; - processedSet[handlerSet.score] = true; - } - } - } - } - return handlerSets; - } - search(method, path) { - const handlerSets = []; - this.#params = emptyParams; - const curNode = this; - let curNodes = [curNode]; - const parts = splitPath(path); - const curNodesQueue = []; - for (let i = 0, len = parts.length; i < len; i++) { - const part = parts[i]; - const isLast = i === len - 1; - const tempNodes = []; - for (let j = 0, len2 = curNodes.length; j < len2; j++) { - const node = curNodes[j]; - const nextNode = node.#children[part]; - if (nextNode) { - nextNode.#params = node.#params; - if (isLast) { - if (nextNode.#children["*"]) { - handlerSets.push( - ...this.#getHandlerSets(nextNode.#children["*"], method, node.#params) - ); - } - handlerSets.push(...this.#getHandlerSets(nextNode, method, node.#params)); - } else { - tempNodes.push(nextNode); - } - } - for (let k = 0, len3 = node.#patterns.length; k < len3; k++) { - const pattern = node.#patterns[k]; - const params = node.#params === emptyParams ? {} : { ...node.#params }; - if (pattern === "*") { - const astNode = node.#children["*"]; - if (astNode) { - handlerSets.push(...this.#getHandlerSets(astNode, method, node.#params)); - astNode.#params = params; - tempNodes.push(astNode); - } - continue; - } - const [key, name, matcher] = pattern; - if (!part && !(matcher instanceof RegExp)) { - continue; - } - const child = node.#children[key]; - const restPathString = parts.slice(i).join("/"); - if (matcher instanceof RegExp) { - const m = matcher.exec(restPathString); - if (m) { - params[name] = m[0]; - handlerSets.push(...this.#getHandlerSets(child, method, node.#params, params)); - if (Object.keys(child.#children).length) { - child.#params = params; - const componentCount = m[0].match(/\//)?.length ?? 0; - const targetCurNodes = curNodesQueue[componentCount] ||= []; - targetCurNodes.push(child); - } - continue; - } - } - if (matcher === true || matcher.test(part)) { - params[name] = part; - if (isLast) { - handlerSets.push(...this.#getHandlerSets(child, method, params, node.#params)); - if (child.#children["*"]) { - handlerSets.push( - ...this.#getHandlerSets(child.#children["*"], method, params, node.#params) - ); - } - } else { - child.#params = params; - tempNodes.push(child); - } - } - } - } - curNodes = tempNodes.concat(curNodesQueue.shift() ?? []); - } - if (handlerSets.length > 1) { - handlerSets.sort((a, b) => { - return a.score - b.score; - }); - } - return [handlerSets.map(({ handler, params }) => [handler, params])]; - } -}; -export { - Node -}; diff --git a/node_modules/hono/dist/router/trie-router/router.js b/node_modules/hono/dist/router/trie-router/router.js deleted file mode 100644 index 40fd29d..0000000 --- a/node_modules/hono/dist/router/trie-router/router.js +++ /dev/null @@ -1,26 +0,0 @@ -// src/router/trie-router/router.ts -import { checkOptionalParameter } from "../../utils/url.js"; -import { Node } from "./node.js"; -var TrieRouter = class { - name = "TrieRouter"; - #node; - constructor() { - this.#node = new Node(); - } - add(method, path, handler) { - const results = checkOptionalParameter(path); - if (results) { - for (let i = 0, len = results.length; i < len; i++) { - this.#node.insert(method, results[i], handler); - } - return; - } - this.#node.insert(method, path, handler); - } - match(method, path) { - return this.#node.search(method, path); - } -}; -export { - TrieRouter -}; diff --git a/node_modules/hono/dist/types.js b/node_modules/hono/dist/types.js deleted file mode 100644 index 863d104..0000000 --- a/node_modules/hono/dist/types.js +++ /dev/null @@ -1,6 +0,0 @@ -// src/types.ts -var FetchEventLike = class { -}; -export { - FetchEventLike -}; diff --git a/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts b/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts deleted file mode 100644 index 2adfa9b..0000000 --- a/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -import type { Hono } from '../../hono'; -import type { Env, Schema } from '../../types'; -import type { ALBRequestContext, ApiGatewayRequestContext, ApiGatewayRequestContextV2, Handler, LambdaContext, LatticeRequestContextV2 } from './types'; -export type LambdaEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2 | ALBProxyEvent | LatticeProxyEventV2; -export interface LatticeProxyEventV2 { - version: string; - path: string; - method: string; - headers: Record; - queryStringParameters: Record; - body: string | null; - isBase64Encoded: boolean; - requestContext: LatticeRequestContextV2; -} -export interface APIGatewayProxyEventV2 { - version: string; - routeKey: string; - headers: Record; - multiValueHeaders?: undefined; - cookies?: string[]; - rawPath: string; - rawQueryString: string; - body: string | null; - isBase64Encoded: boolean; - requestContext: ApiGatewayRequestContextV2; - queryStringParameters?: { - [name: string]: string | undefined; - }; - pathParameters?: { - [name: string]: string | undefined; - }; - stageVariables?: { - [name: string]: string | undefined; - }; -} -export interface APIGatewayProxyEvent { - version: string; - httpMethod: string; - headers: Record; - multiValueHeaders?: { - [headerKey: string]: string[]; - }; - path: string; - body: string | null; - isBase64Encoded: boolean; - queryStringParameters?: Record; - requestContext: ApiGatewayRequestContext; - resource: string; - multiValueQueryStringParameters?: { - [parameterKey: string]: string[]; - }; - pathParameters?: Record; - stageVariables?: Record; -} -export interface ALBProxyEvent { - httpMethod: string; - headers?: Record; - multiValueHeaders?: Record; - path: string; - body: string | null; - isBase64Encoded: boolean; - queryStringParameters?: Record; - multiValueQueryStringParameters?: { - [parameterKey: string]: string[]; - }; - requestContext: ALBRequestContext; -} -type WithHeaders = { - headers: Record; - multiValueHeaders?: undefined; -}; -type WithMultiValueHeaders = { - headers?: undefined; - multiValueHeaders: Record; -}; -export type APIGatewayProxyResult = { - statusCode: number; - statusDescription?: string; - body: string; - cookies?: string[]; - isBase64Encoded: boolean; -} & (WithHeaders | WithMultiValueHeaders); -export declare const streamHandle: (app: Hono) => Handler; -type HandleOptions = { - isContentTypeBinary: ((contentType: string) => boolean) | undefined; -}; -/** - * Converts a Hono application to an AWS Lambda handler. - * - * Accepts events from API Gateway (v1 and v2), Application Load Balancer (ALB), - * and Lambda Function URLs. - * - * @param app - The Hono application instance - * @param options - Optional configuration - * @param options.isContentTypeBinary - A function to determine if the content type is binary. - * If not provided, the default function will be used. - * @returns Lambda handler function - * - * @example - * ```js - * import { Hono } from 'hono' - * import { handle } from 'hono/aws-lambda' - * - * const app = new Hono() - * - * app.get('/', (c) => c.text('Hello from Lambda')) - * app.get('/json', (c) => c.json({ message: 'Hello JSON' })) - * - * export const handler = handle(app) - * ``` - * - * @example - * ```js - * // With custom binary content type detection - * import { handle, defaultIsContentTypeBinary } from 'hono/aws-lambda' - * export const handler = handle(app, { - * isContentTypeBinary: (contentType) => { - * if (defaultIsContentTypeBinary(contentType)) { - * // default logic same as prior to v4.8.4 - * return true - * } - * return contentType.startsWith('image/') || contentType === 'application/pdf' - * } - * }) - * ``` - */ -export declare const handle: (app: Hono, { isContentTypeBinary }?: HandleOptions) => ((event: L, lambdaContext?: LambdaContext) => Promise; -} ? WithMultiValueHeaders : WithHeaders)>); -export declare abstract class EventProcessor { - protected abstract getPath(event: E): string; - protected abstract getMethod(event: E): string; - protected abstract getQueryString(event: E): string; - protected abstract getHeaders(event: E): Headers; - protected abstract getCookies(event: E, headers: Headers): void; - protected abstract setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; - protected getHeaderValue(headers: E['headers'], key: string): string | undefined; - protected getDomainName(event: E): string | undefined; - createRequest(event: E): Request; - createResult(event: E, res: Response, options: Pick): Promise; - setCookies(event: E, res: Response, result: APIGatewayProxyResult): void; -} -export declare class EventV2Processor extends EventProcessor { - protected getPath(event: APIGatewayProxyEventV2): string; - protected getMethod(event: APIGatewayProxyEventV2): string; - protected getQueryString(event: APIGatewayProxyEventV2): string; - protected getCookies(event: APIGatewayProxyEventV2, headers: Headers): void; - protected setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; - protected getHeaders(event: APIGatewayProxyEventV2): Headers; -} -export declare class EventV1Processor extends EventProcessor { - protected getPath(event: APIGatewayProxyEvent): string; - protected getMethod(event: APIGatewayProxyEvent): string; - protected getQueryString(event: APIGatewayProxyEvent): string; - protected getCookies(event: APIGatewayProxyEvent, headers: Headers): void; - protected getHeaders(event: APIGatewayProxyEvent): Headers; - protected setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; -} -export declare class ALBProcessor extends EventProcessor { - protected getHeaders(event: ALBProxyEvent): Headers; - protected getPath(event: ALBProxyEvent): string; - protected getMethod(event: ALBProxyEvent): string; - protected getQueryString(event: ALBProxyEvent): string; - protected getCookies(event: ALBProxyEvent, headers: Headers): void; - protected setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; -} -export declare class LatticeV2Processor extends EventProcessor { - protected getPath(event: LatticeProxyEventV2): string; - protected getMethod(event: LatticeProxyEventV2): string; - protected getQueryString(): string; - protected getHeaders(event: LatticeProxyEventV2): Headers; - protected getCookies(): void; - protected setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; -} -export declare const getProcessor: (event: LambdaEvent) => EventProcessor; -/** - * Check if the given content type is binary. - * This is a default function and may be overwritten by the user via `isContentTypeBinary` option in handler(). - * @param contentType The content type to check. - * @returns True if the content type is binary, false otherwise. - */ -export declare const defaultIsContentTypeBinary: (contentType: string) => boolean; -export declare const isContentEncodingBinary: (contentEncoding: string | null) => boolean; -export {}; diff --git a/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts b/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts deleted file mode 100644 index 5a43c2c..0000000 --- a/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @module - * AWS Lambda Adapter for Hono. - */ -export { handle, streamHandle, defaultIsContentTypeBinary } from './handler'; -export type { APIGatewayProxyResult, LambdaEvent } from './handler'; -export type { ApiGatewayRequestContext, ApiGatewayRequestContextV2, ALBRequestContext, LambdaContext, } from './types'; diff --git a/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts b/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts deleted file mode 100644 index 22bb1c1..0000000 --- a/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -export interface CognitoIdentity { - cognitoIdentityId: string; - cognitoIdentityPoolId: string; -} -export interface ClientContext { - client: ClientContextClient; - Custom?: any; - env: ClientContextEnv; -} -export interface ClientContextClient { - installationId: string; - appTitle: string; - appVersionName: string; - appVersionCode: string; - appPackageName: string; -} -export interface ClientContextEnv { - platformVersion: string; - platform: string; - make: string; - model: string; - locale: string; -} -/** - * {@link Handler} context parameter. - * See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html AWS documentation}. - */ -export interface LambdaContext { - callbackWaitsForEmptyEventLoop: boolean; - functionName: string; - functionVersion: string; - invokedFunctionArn: string; - memoryLimitInMB: string; - awsRequestId: string; - logGroupName: string; - logStreamName: string; - identity?: CognitoIdentity | undefined; - clientContext?: ClientContext | undefined; - getRemainingTimeInMillis(): number; -} -type Callback = (error?: Error | string | null, result?: TResult) => void; -export type Handler = (event: TEvent, context: LambdaContext, callback: Callback) => void | Promise; -interface ClientCert { - clientCertPem: string; - subjectDN: string; - issuerDN: string; - serialNumber: string; - validity: { - notBefore: string; - notAfter: string; - }; -} -interface Identity { - accessKey?: string; - accountId?: string; - caller?: string; - cognitoAuthenticationProvider?: string; - cognitoAuthenticationType?: string; - cognitoIdentityId?: string; - cognitoIdentityPoolId?: string; - principalOrgId?: string; - sourceIp: string; - user?: string; - userAgent: string; - userArn?: string; - clientCert?: ClientCert; -} -export interface ApiGatewayRequestContext { - accountId: string; - apiId: string; - authorizer: { - claims?: unknown; - scopes?: unknown; - }; - domainName: string; - domainPrefix: string; - extendedRequestId: string; - httpMethod: string; - identity: Identity; - path: string; - protocol: string; - requestId: string; - requestTime: string; - requestTimeEpoch: number; - resourceId?: string; - resourcePath: string; - stage: string; -} -interface Authorizer { - iam?: { - accessKey: string; - accountId: string; - callerId: string; - cognitoIdentity: null; - principalOrgId: null; - userArn: string; - userId: string; - }; -} -export interface ApiGatewayRequestContextV2 { - accountId: string; - apiId: string; - authentication: null; - authorizer: Authorizer; - domainName: string; - domainPrefix: string; - http: { - method: string; - path: string; - protocol: string; - sourceIp: string; - userAgent: string; - }; - requestId: string; - routeKey: string; - stage: string; - time: string; - timeEpoch: number; -} -export interface ALBRequestContext { - elb: { - targetGroupArn: string; - }; -} -export interface LatticeRequestContextV2 { - serviceNetworkArn: string; - serviceArn: string; - targetGroupArn: string; - region: string; - timeEpoch: string; - identity: { - sourceVpcArn?: string; - type?: string; - principal?: string; - principalOrgID?: string; - sessionName?: string; - x509IssuerOu?: string; - x509SanDns?: string; - x509SanNameCn?: string; - x509SanUri?: string; - x509SubjectCn?: string; - }; -} -export {}; diff --git a/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts b/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts deleted file mode 100644 index 1a7cf11..0000000 --- a/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { GetConnInfo } from '../../helper/conninfo'; -/** - * Get ConnInfo with Bun - * @param c Context - * @returns ConnInfo - */ -export declare const getConnInfo: GetConnInfo; diff --git a/node_modules/hono/dist/types/adapter/bun/index.d.ts b/node_modules/hono/dist/types/adapter/bun/index.d.ts deleted file mode 100644 index 2b4f5d4..0000000 --- a/node_modules/hono/dist/types/adapter/bun/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @module - * Bun Adapter for Hono. - */ -export { serveStatic } from './serve-static'; -export { bunFileSystemModule, toSSG } from './ssg'; -export { createBunWebSocket, upgradeWebSocket, websocket } from './websocket'; -export type { BunWebSocketData, BunWebSocketHandler } from './websocket'; -export { getConnInfo } from './conninfo'; -export { getBunServer } from './server'; diff --git a/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts b/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts deleted file mode 100644 index e79742d..0000000 --- a/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ServeStaticOptions } from '../../middleware/serve-static'; -import type { Env, MiddlewareHandler } from '../../types'; -export declare const serveStatic: (options: ServeStaticOptions) => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/adapter/bun/server.d.ts b/node_modules/hono/dist/types/adapter/bun/server.d.ts deleted file mode 100644 index 1baeac8..0000000 --- a/node_modules/hono/dist/types/adapter/bun/server.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Getting Bun Server Object for Bun adapters - * @module - */ -import type { Context } from '../../context'; -/** - * Get Bun Server Object from Context - * @template T - The type of Bun Server - * @param c Context - * @returns Bun Server - */ -export declare const getBunServer: (c: Context) => T | undefined; diff --git a/node_modules/hono/dist/types/adapter/bun/ssg.d.ts b/node_modules/hono/dist/types/adapter/bun/ssg.d.ts deleted file mode 100644 index 8db4e65..0000000 --- a/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { FileSystemModule, ToSSGAdaptorInterface } from '../../helper/ssg'; -/** - * @experimental - * `bunFileSystemModule` is an experimental feature. - * The API might be changed. - */ -export declare const bunFileSystemModule: FileSystemModule; -/** - * @experimental - * `toSSG` is an experimental feature. - * The API might be changed. - */ -export declare const toSSG: ToSSGAdaptorInterface; diff --git a/node_modules/hono/dist/types/adapter/bun/websocket.d.ts b/node_modules/hono/dist/types/adapter/bun/websocket.d.ts deleted file mode 100644 index 9c6e2fb..0000000 --- a/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { UpgradeWebSocket, WSEvents } from '../../helper/websocket'; -import { WSContext } from '../../helper/websocket'; -/** - * @internal - */ -export interface BunServerWebSocket { - send(data: string | ArrayBuffer | Uint8Array, compress?: boolean): void; - close(code?: number, reason?: string): void; - data: T; - readyState: 0 | 1 | 2 | 3; -} -export interface BunWebSocketHandler { - open(ws: BunServerWebSocket): void; - close(ws: BunServerWebSocket, code?: number, reason?: string): void; - message(ws: BunServerWebSocket, message: string | { - buffer: ArrayBufferLike; - }): void; -} -interface CreateWebSocket { - upgradeWebSocket: UpgradeWebSocket; - websocket: BunWebSocketHandler; -} -export interface BunWebSocketData { - events: WSEvents; - url: URL; - protocol: string; -} -/** - * @internal - */ -export declare const createWSContext: (ws: BunServerWebSocket) => WSContext; -export declare const upgradeWebSocket: UpgradeWebSocket; -export declare const websocket: BunWebSocketHandler; -/** - * @deprecated Import `upgradeWebSocket` and `websocket` directly from `hono/bun` instead. - * @returns A function to create a Bun WebSocket handler. - */ -export declare const createBunWebSocket: () => CreateWebSocket; -export {}; diff --git a/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts b/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts deleted file mode 100644 index c78b00e..0000000 --- a/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Hono } from '../../hono'; -import type { BlankSchema, Env, Input, MiddlewareHandler, Schema } from '../../types'; -type Params

= Record; -export type EventContext> = { - request: Request; - functionPath: string; - waitUntil: (promise: Promise) => void; - passThroughOnException: () => void; - props: any; - next: (input?: Request | string, init?: RequestInit) => Promise; - env: Env & { - ASSETS: { - fetch: typeof fetch; - }; - }; - params: Params

; - data: Data; -}; -declare type PagesFunction = Record> = (context: EventContext) => Response | Promise; -export declare const handle: (app: Hono) => PagesFunction; -export declare function handleMiddleware(middleware: MiddlewareHandler): PagesFunction; -/** - * - * @description `serveStatic()` is for advanced mode: - * https://developers.cloudflare.com/pages/platform/functions/advanced-mode/#set-up-a-function - * - */ -export declare const serveStatic: () => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts b/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts deleted file mode 100644 index 4a7ff17..0000000 --- a/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @module - * Cloudflare Pages Adapter for Hono. - */ -export { handle, handleMiddleware, serveStatic } from './handler'; -export type { EventContext } from './handler'; diff --git a/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts b/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts deleted file mode 100644 index da71f88..0000000 --- a/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { GetConnInfo } from '../../helper/conninfo'; -export declare const getConnInfo: GetConnInfo; diff --git a/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts b/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts deleted file mode 100644 index c2ca01b..0000000 --- a/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @module - * Cloudflare Workers Adapter for Hono. - */ -export { serveStatic } from './serve-static-module'; -export { upgradeWebSocket } from './websocket'; -export { getConnInfo } from './conninfo'; diff --git a/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts b/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts deleted file mode 100644 index 59fbd2a..0000000 --- a/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Env, MiddlewareHandler } from '../../types'; -import type { ServeStaticOptions } from './serve-static'; -declare const module: (options: Omit, "namespace">) => MiddlewareHandler; -export { module as serveStatic }; diff --git a/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts b/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts deleted file mode 100644 index a8d166d..0000000 --- a/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ServeStaticOptions as BaseServeStaticOptions } from '../../middleware/serve-static'; -import type { Env, MiddlewareHandler } from '../../types'; -export type ServeStaticOptions = BaseServeStaticOptions & { - namespace?: unknown; - manifest: object | string; -}; -/** - * @deprecated - * `serveStatic` in the Cloudflare Workers adapter is deprecated. - * You can serve static files directly using Cloudflare Static Assets. - * @see https://developers.cloudflare.com/workers/static-assets/ - * Cloudflare Static Assets is currently in open beta. If this doesn't work for you, - * please consider using Cloudflare Pages. You can start to create the Cloudflare Pages - * application with the `npm create hono@latest` command. - */ -export declare const serveStatic: (options: ServeStaticOptions) => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts b/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts deleted file mode 100644 index d406c18..0000000 --- a/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type KVAssetOptions = { - manifest?: object | string; - namespace?: unknown; -}; -export declare const getContentFromKVAsset: (path: string, options?: KVAssetOptions) => Promise; diff --git a/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts b/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts deleted file mode 100644 index be35674..0000000 --- a/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { UpgradeWebSocket, WSEvents } from '../../helper/websocket'; -export declare const upgradeWebSocket: UpgradeWebSocket, 'onOpen'>>; diff --git a/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts b/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts deleted file mode 100644 index d274def..0000000 --- a/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { GetConnInfo } from '../../helper/conninfo'; -/** - * Get conninfo with Deno - * @param c Context - * @returns ConnInfo - */ -export declare const getConnInfo: GetConnInfo; diff --git a/node_modules/hono/dist/types/adapter/deno/index.d.ts b/node_modules/hono/dist/types/adapter/deno/index.d.ts deleted file mode 100644 index d360f6d..0000000 --- a/node_modules/hono/dist/types/adapter/deno/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module - * Deno Adapter for Hono. - */ -export { serveStatic } from './serve-static'; -export { toSSG, denoFileSystemModule } from './ssg'; -export { upgradeWebSocket } from './websocket'; -export { getConnInfo } from './conninfo'; diff --git a/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts b/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts deleted file mode 100644 index e79742d..0000000 --- a/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ServeStaticOptions } from '../../middleware/serve-static'; -import type { Env, MiddlewareHandler } from '../../types'; -export declare const serveStatic: (options: ServeStaticOptions) => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/adapter/deno/ssg.d.ts b/node_modules/hono/dist/types/adapter/deno/ssg.d.ts deleted file mode 100644 index 293e1f9..0000000 --- a/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { FileSystemModule, ToSSGAdaptorInterface } from '../../helper/ssg/index'; -/** - * @experimental - * `denoFileSystemModule` is an experimental feature. - * The API might be changed. - */ -export declare const denoFileSystemModule: FileSystemModule; -/** - * @experimental - * `toSSG` is an experimental feature. - * The API might be changed. - */ -export declare const toSSG: ToSSGAdaptorInterface; diff --git a/node_modules/hono/dist/types/adapter/deno/websocket.d.ts b/node_modules/hono/dist/types/adapter/deno/websocket.d.ts deleted file mode 100644 index f391ccb..0000000 --- a/node_modules/hono/dist/types/adapter/deno/websocket.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { UpgradeWebSocket } from '../../helper/websocket'; -export declare const upgradeWebSocket: UpgradeWebSocket; diff --git a/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts b/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts deleted file mode 100644 index da71f88..0000000 --- a/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { GetConnInfo } from '../../helper/conninfo'; -export declare const getConnInfo: GetConnInfo; diff --git a/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts b/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts deleted file mode 100644 index 67800f8..0000000 --- a/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -import type { Hono } from '../../hono'; -interface CloudFrontHeader { - key: string; - value: string; -} -interface CloudFrontHeaders { - [name: string]: CloudFrontHeader[]; -} -interface CloudFrontCustomOrigin { - customHeaders: CloudFrontHeaders; - domainName: string; - keepaliveTimeout: number; - path: string; - port: number; - protocol: string; - readTimeout: number; - sslProtocols: string[]; -} -interface CloudFrontS3Origin { - authMethod: 'origin-access-identity' | 'none'; - customHeaders: CloudFrontHeaders; - domainName: string; - path: string; - region: string; -} -type CloudFrontOrigin = { - s3: CloudFrontS3Origin; - custom?: never; -} | { - custom: CloudFrontCustomOrigin; - s3?: never; -}; -export interface CloudFrontRequest { - clientIp: string; - headers: CloudFrontHeaders; - method: string; - querystring: string; - uri: string; - body?: { - inputTruncated: boolean; - action: string; - encoding: string; - data: string; - }; - origin?: CloudFrontOrigin; -} -export interface CloudFrontResponse { - headers: CloudFrontHeaders; - status: string; - statusDescription?: string; -} -export interface CloudFrontConfig { - distributionDomainName: string; - distributionId: string; - eventType: string; - requestId: string; -} -interface CloudFrontEvent { - cf: { - config: CloudFrontConfig; - request: CloudFrontRequest; - response?: CloudFrontResponse; - }; -} -export interface CloudFrontEdgeEvent { - Records: CloudFrontEvent[]; -} -type CloudFrontContext = {}; -export interface Callback { - (err: Error | null, result?: CloudFrontRequest | CloudFrontResult): void; -} -interface CloudFrontResult { - status: string; - statusDescription?: string; - headers?: { - [header: string]: { - key: string; - value: string; - }[]; - }; - body?: string; - bodyEncoding?: 'text' | 'base64'; -} -export declare const handle: (app: Hono) => ((event: CloudFrontEdgeEvent, context?: CloudFrontContext, callback?: Callback) => Promise); -export declare const createBody: (method: string, requestBody: CloudFrontRequest["body"]) => string | Uint8Array | undefined; -export declare const isContentTypeBinary: (contentType: string) => boolean; -export {}; diff --git a/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts b/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts deleted file mode 100644 index 8889c41..0000000 --- a/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @module - * Lambda@Edge Adapter for Hono. - */ -export { handle } from './handler'; -export { getConnInfo } from './conninfo'; -export type { Callback, CloudFrontConfig, CloudFrontRequest, CloudFrontResponse, CloudFrontEdgeEvent, } from './handler'; diff --git a/node_modules/hono/dist/types/adapter/netlify/handler.d.ts b/node_modules/hono/dist/types/adapter/netlify/handler.d.ts deleted file mode 100644 index 6f49216..0000000 --- a/node_modules/hono/dist/types/adapter/netlify/handler.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Hono } from '../../hono'; -export declare const handle: (app: Hono) => ((req: Request, context: any) => Response | Promise); diff --git a/node_modules/hono/dist/types/adapter/netlify/index.d.ts b/node_modules/hono/dist/types/adapter/netlify/index.d.ts deleted file mode 100644 index cd2b35c..0000000 --- a/node_modules/hono/dist/types/adapter/netlify/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @module - * Netlify Adapter for Hono. - */ -export * from './mod'; diff --git a/node_modules/hono/dist/types/adapter/netlify/mod.d.ts b/node_modules/hono/dist/types/adapter/netlify/mod.d.ts deleted file mode 100644 index a7583a3..0000000 --- a/node_modules/hono/dist/types/adapter/netlify/mod.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { handle } from './handler'; diff --git a/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts b/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts deleted file mode 100644 index b2c1c4f..0000000 --- a/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Handler for Service Worker - * @module - */ -import type { Hono } from '../../hono'; -import type { Env, Schema } from '../../types'; -import type { FetchEvent } from './types'; -type Handler = (evt: FetchEvent) => void; -export type HandleOptions = { - fetch?: typeof fetch; -}; -/** - * Adapter for Service Worker - */ -export declare const handle: (app: Hono, opts?: HandleOptions) => Handler; -export {}; diff --git a/node_modules/hono/dist/types/adapter/service-worker/index.d.ts b/node_modules/hono/dist/types/adapter/service-worker/index.d.ts deleted file mode 100644 index a89b3c7..0000000 --- a/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Service Worker Adapter for Hono. - * @module - */ -import type { Hono } from '../../hono'; -import type { Env, Schema } from '../../types'; -import { handle } from './handler'; -import type { HandleOptions } from './handler'; -/** - * Registers a Hono app to handle fetch events in a service worker. - * This sets up `addEventListener('fetch', handle(app, options))` for the provided app. - * - * @param app - The Hono application instance - * @param options - Options for handling requests (fetch defaults to undefined) - * @example - * ```ts - * import { Hono } from 'hono' - * import { fire } from 'hono/service-worker' - * - * const app = new Hono() - * - * app.get('/', (c) => c.text('Hi')) - * - * fire(app) - * ``` - */ -declare const fire: (app: Hono, options?: HandleOptions) => void; -export { handle, fire }; diff --git a/node_modules/hono/dist/types/adapter/service-worker/types.d.ts b/node_modules/hono/dist/types/adapter/service-worker/types.d.ts deleted file mode 100644 index 66298f4..0000000 --- a/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -interface ExtendableEvent extends Event { - waitUntil(f: Promise): void; -} -export interface FetchEvent extends ExtendableEvent { - readonly clientId: string; - readonly handled: Promise; - readonly preloadResponse: Promise; - readonly request: Request; - readonly resultingClientId: string; - respondWith(r: Response | PromiseLike): void; -} -export {}; diff --git a/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts b/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts deleted file mode 100644 index da71f88..0000000 --- a/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { GetConnInfo } from '../../helper/conninfo'; -export declare const getConnInfo: GetConnInfo; diff --git a/node_modules/hono/dist/types/adapter/vercel/handler.d.ts b/node_modules/hono/dist/types/adapter/vercel/handler.d.ts deleted file mode 100644 index 73bb38d..0000000 --- a/node_modules/hono/dist/types/adapter/vercel/handler.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Hono } from '../../hono'; -export declare const handle: (app: Hono) => (req: Request) => Response | Promise; diff --git a/node_modules/hono/dist/types/adapter/vercel/index.d.ts b/node_modules/hono/dist/types/adapter/vercel/index.d.ts deleted file mode 100644 index 8645b76..0000000 --- a/node_modules/hono/dist/types/adapter/vercel/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @module - * Vercel Adapter for Hono. - */ -export { handle } from './handler'; -export { getConnInfo } from './conninfo'; diff --git a/node_modules/hono/dist/types/client/client.d.ts b/node_modules/hono/dist/types/client/client.d.ts deleted file mode 100644 index 9a161b6..0000000 --- a/node_modules/hono/dist/types/client/client.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Hono } from '../hono'; -import type { UnionToIntersection } from '../utils/types'; -import type { Client, ClientRequestOptions } from './types'; -export declare const hc: , Prefix extends string = string>(baseUrl: Prefix, options?: ClientRequestOptions) => UnionToIntersection>; diff --git a/node_modules/hono/dist/types/client/fetch-result-please.d.ts b/node_modules/hono/dist/types/client/fetch-result-please.d.ts deleted file mode 100644 index f9558e0..0000000 --- a/node_modules/hono/dist/types/client/fetch-result-please.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @description This file is a modified version of `fetch-result-please` (`ofetch`), minimalized and adapted to Hono's custom needs. - * - * @link https://www.npmjs.com/package/fetch-result-please - */ -/** - * Smartly parses and return the consumable result from a fetch `Response`. - * - * Throwing a structured error if the response is not `ok`. ({@link DetailedError}) - */ -export declare function fetchRP(fetchRes: Response | Promise): Promise; -export declare class DetailedError extends Error { - /** - * Additional `message` that will be logged AND returned to client - */ - detail?: any; - /** - * Additional `code` that will be logged AND returned to client - */ - code?: any; - /** - * Additional value that will be logged AND NOT returned to client - */ - log?: any; - /** - * Optionally set the status code to return, in a web server context - */ - statusCode?: any; - constructor(message: string, options?: { - detail?: any; - code?: any; - statusCode?: number; - log?: any; - }); -} diff --git a/node_modules/hono/dist/types/client/index.d.ts b/node_modules/hono/dist/types/client/index.d.ts deleted file mode 100644 index 7530b6c..0000000 --- a/node_modules/hono/dist/types/client/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @module - * The HTTP Client for Hono. - */ -export { hc } from './client'; -export { parseResponse, DetailedError } from './utils'; -export type { InferResponseType, InferRequestType, Fetch, ClientRequestOptions, ClientRequest, ClientResponse, } from './types'; diff --git a/node_modules/hono/dist/types/client/types.d.ts b/node_modules/hono/dist/types/client/types.d.ts deleted file mode 100644 index 7b31394..0000000 --- a/node_modules/hono/dist/types/client/types.d.ts +++ /dev/null @@ -1,168 +0,0 @@ -import type { Hono } from '../hono'; -import type { HonoBase } from '../hono-base'; -import type { METHODS, METHOD_NAME_ALL_LOWERCASE } from '../router'; -import type { Endpoint, ResponseFormat, Schema } from '../types'; -import type { StatusCode, SuccessStatusCode } from '../utils/http-status'; -import type { HasRequiredKeys } from '../utils/types'; -/** - * Type representing the '$all' method name - */ -type MethodNameAll = `$${typeof METHOD_NAME_ALL_LOWERCASE}`; -/** - * Type representing all standard HTTP methods prefixed with '$' - * e.g., '$get' | '$post' | '$put' | '$delete' | '$options' | '$patch' - */ -type StandardMethods = `$${(typeof METHODS)[number]}`; -/** - * Expands '$all' into all standard HTTP methods. - * If the schema contains '$all', it creates a type where all standard HTTP methods - * point to the same endpoint definition as '$all', while removing '$all' itself. - */ -type ExpandAllMethod = MethodNameAll extends keyof S ? { - [M in StandardMethods]: S[MethodNameAll]; -} & Omit : S; -type HonoRequest = (typeof Hono.prototype)['request']; -export type BuildSearchParamsFn = (query: Record) => URLSearchParams; -export type ClientRequestOptions = { - fetch?: typeof fetch | HonoRequest; - webSocket?: (...args: ConstructorParameters) => WebSocket; - /** - * Standard `RequestInit`, caution that this take highest priority - * and could be used to overwrite things that Hono sets for you, like `body | method | headers`. - * - * If you want to add some headers, use in `headers` instead of `init` - */ - init?: RequestInit; - /** - * Custom function to serialize query parameters into URLSearchParams. - * By default, arrays are serialized as multiple parameters with the same key (e.g., `key=a&key=b`). - * You can provide a custom function to change this behavior, for example to use bracket notation (e.g., `key[]=a&key[]=b`). - * - * @example - * ```ts - * const client = hc('http://localhost', { - * buildSearchParams: (query) => { - * return new URLSearchParams(qs.stringify(query)) - * } - * }) - * ``` - */ - buildSearchParams?: BuildSearchParamsFn; -} & (keyof T extends never ? { - headers?: Record | (() => Record | Promise>); -} : { - headers: T | (() => T | Promise); -}); -export type ClientRequest = { - [M in keyof ExpandAllMethod]: ExpandAllMethod[M] extends Endpoint & { - input: infer R; - } ? R extends object ? HasRequiredKeys extends true ? (args: R, options?: ClientRequestOptions) => Promise[M]>> : (args?: R, options?: ClientRequestOptions) => Promise[M]>> : never : never; -} & { - $url: (arg?: Arg) => HonoURL; -} & (S['$get'] extends { - outputFormat: 'ws'; -} ? S['$get'] extends { - input: infer I; -} ? { - $ws: (args?: I) => WebSocket; -} : {} : {}); -type ClientResponseOfEndpoint = T extends { - output: infer O; - outputFormat: infer F; - status: infer S; -} ? ClientResponse : never; -export interface ClientResponse extends globalThis.Response { - readonly body: ReadableStream | null; - readonly bodyUsed: boolean; - ok: U extends SuccessStatusCode ? true : U extends Exclude ? false : boolean; - status: U; - statusText: string; - headers: Headers; - url: string; - redirect(url: string, status: number): Response; - clone(): Response; - json(): F extends 'text' ? Promise : F extends 'json' ? Promise : Promise; - text(): F extends 'text' ? (T extends string ? Promise : Promise) : Promise; - blob(): Promise; - formData(): Promise; - arrayBuffer(): Promise; -} -type BuildSearch = Arg extends { - [K in Key]: infer Query; -} ? IsEmptyObject extends true ? '' : `?${string}` : ''; -type BuildPathname

= Arg extends { - param: infer Param; -} ? `${ApplyParam, Param>}` : `/${TrimStartSlash

}`; -type BuildTypedURL = TypedURL<`${Protocol}:`, Host, Port, BuildPathname, BuildSearch>; -type HonoURL = IsLiteral extends true ? TrimEndSlash extends `${infer Protocol}://${infer Rest}` ? Rest extends `${infer Hostname}/${infer P}` ? ParseHostName extends [infer Host extends string, infer Port extends string] ? BuildTypedURL : never : ParseHostName extends [infer Host extends string, infer Port extends string] ? BuildTypedURL : never : URL : URL; -type ParseHostName = T extends `${infer Host}:${infer Port}` ? [Host, Port] : [T, '']; -type TrimStartSlash = T extends `/${infer R}` ? TrimStartSlash : T; -type TrimEndSlash = T extends `${infer R}/` ? TrimEndSlash : T; -type IsLiteral = [T] extends [never] ? false : string extends T ? false : true; -type ApplyParam = Path extends `${infer Head}/${infer Rest}` ? Head extends `:${infer Param}` ? P extends Record ? IsLiteral extends true ? ApplyParam : ApplyParam : ApplyParam : ApplyParam : Path extends `:${infer Param}` ? P extends Record ? IsLiteral extends true ? `${Result}/${Value & string}` : `${Result}/${Path}` : `${Result}/${Path}` : `${Result}/${Path}`; -type IsEmptyObject = keyof T extends never ? true : false; -export interface TypedURL extends URL { - protocol: Protocol; - hostname: Hostname; - port: Port; - host: Port extends '' ? Hostname : `${Hostname}:${Port}`; - origin: `${Protocol}//${Hostname}${Port extends '' ? '' : `:${Port}`}`; - pathname: Pathname; - search: Search; - href: `${Protocol}//${Hostname}${Port extends '' ? '' : `:${Port}`}${Pathname}${Search}`; -} -export interface Response extends ClientResponse { -} -export type Fetch = (args?: InferRequestType, opt?: ClientRequestOptions) => Promise>>; -type InferEndpointType = T extends (args: infer R, options: any | undefined) => Promise ? U extends ClientResponse ? { - input: NonNullable; - output: O; - outputFormat: F; - status: S; -} extends Endpoint ? { - input: NonNullable; - output: O; - outputFormat: F; - status: S; -} : never : never : never; -export type InferResponseType = InferResponseTypeFromEndpoint, U>; -type InferResponseTypeFromEndpoint = T extends { - output: infer O; - status: infer S; -} ? S extends U ? O : never : never; -export type InferRequestType = T extends (args: infer R, options: any | undefined) => Promise> ? NonNullable : never; -export type InferRequestOptionsType = T extends (args: any, options: infer R) => Promise> ? NonNullable : never; -/** - * Filter a ClientResponse type so it only includes responses of specific status codes. - */ -export type FilterClientResponseByStatusCode, U extends number = StatusCode> = T extends ClientResponse ? RC extends U ? ClientResponse : never : never; -type PathToChain = Path extends `/${infer P}` ? PathToChain : Path extends `${infer P}/${infer R}` ? { - [K in P]: PathToChain; -} : { - [K in Path extends '' ? 'index' : Path]: ClientRequest ? E[Original] : never>; -}; -export type Client = T extends HonoBase ? S extends Record ? K extends string ? PathToChain : never : never : never; -export type Callback = (opts: CallbackOptions) => unknown; -interface CallbackOptions { - path: string[]; - args: any[]; -} -export type ObjectType = { - [key: string]: T; -}; -export {}; diff --git a/node_modules/hono/dist/types/client/utils.d.ts b/node_modules/hono/dist/types/client/utils.d.ts deleted file mode 100644 index 496020b..0000000 --- a/node_modules/hono/dist/types/client/utils.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { ClientErrorStatusCode, ContentfulStatusCode, ServerErrorStatusCode } from '../utils/http-status'; -import { DetailedError } from './fetch-result-please'; -import type { ClientResponse, FilterClientResponseByStatusCode } from './types'; -export { DetailedError }; -export declare const mergePath: (base: string, path: string) => string; -export declare const replaceUrlParam: (urlString: string, params: Record) => string; -export declare const buildSearchParams: (query: Record) => URLSearchParams; -export declare const replaceUrlProtocol: (urlString: string, protocol: "ws" | "http") => string; -export declare const removeIndexString: (urlString: string) => string; -export declare function deepMerge(target: T, source: Record): T; -/** - * Shortcut to get a consumable response from `hc`'s fetch calls (Response), with types inference. - * - * Smartly parse the response data, throwing a structured error if the response is not `ok`. ({@link DetailedError}) - * - * @example const result = await parseResponse(client.posts.$get()) - */ -export declare function parseResponse>(fetchRes: T | Promise): Promise> extends never ? undefined : FilterClientResponseByStatusCode> extends ClientResponse ? RF extends 'json' ? RT : RT extends string ? RT : string : undefined>; diff --git a/node_modules/hono/dist/types/compose.d.ts b/node_modules/hono/dist/types/compose.d.ts deleted file mode 100644 index 937905e..0000000 --- a/node_modules/hono/dist/types/compose.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Context } from './context'; -import type { Env, ErrorHandler, Next, NotFoundHandler } from './types'; -/** - * Compose middleware functions into a single function based on `koa-compose` package. - * - * @template E - The environment type. - * - * @param {[[Function, unknown], unknown][] | [[Function]][]} middleware - An array of middleware functions and their corresponding parameters. - * @param {ErrorHandler} [onError] - An optional error handler function. - * @param {NotFoundHandler} [onNotFound] - An optional not-found handler function. - * - * @returns {(context: Context, next?: Next) => Promise} - A composed middleware function. - */ -export declare const compose: (middleware: [[Function, unknown], unknown][] | [[Function]][], onError?: ErrorHandler, onNotFound?: NotFoundHandler) => ((context: Context, next?: Next) => Promise); diff --git a/node_modules/hono/dist/types/context.d.ts b/node_modules/hono/dist/types/context.d.ts deleted file mode 100644 index 6ad1223..0000000 --- a/node_modules/hono/dist/types/context.d.ts +++ /dev/null @@ -1,451 +0,0 @@ -import { HonoRequest } from './request'; -import type { Result } from './router'; -import type { Env, FetchEventLike, H, Input, NotFoundHandler, RouterRoute, TypedResponse } from './types'; -import type { ResponseHeader } from './utils/headers'; -import type { ContentfulStatusCode, RedirectStatusCode, StatusCode } from './utils/http-status'; -import type { BaseMime } from './utils/mime'; -import type { InvalidJSONValue, IsAny, JSONParsed, JSONValue } from './utils/types'; -type HeaderRecord = Record<'Content-Type', BaseMime> | Record | Record; -/** - * Data type can be a string, ArrayBuffer, Uint8Array (buffer), or ReadableStream. - */ -export type Data = string | ArrayBuffer | ReadableStream | Uint8Array; -/** - * Interface for the execution context in a web worker or similar environment. - */ -export interface ExecutionContext { - /** - * Extends the lifetime of the event callback until the promise is settled. - * - * @param promise - A promise to wait for. - */ - waitUntil(promise: Promise): void; - /** - * Allows the event to be passed through to subsequent event listeners. - */ - passThroughOnException(): void; - /** - * For compatibility with Wrangler 4.x. - */ - props: any; -} -/** - * Interface for context variable mapping. - */ -export interface ContextVariableMap { -} -/** - * Interface for context renderer. - */ -export interface ContextRenderer { -} -/** - * Interface representing a renderer for content. - * - * @interface DefaultRenderer - * @param {string | Promise} content - The content to be rendered, which can be either a string or a Promise resolving to a string. - * @returns {Response | Promise} - The response after rendering the content, which can be either a Response or a Promise resolving to a Response. - */ -interface DefaultRenderer { - (content: string | Promise): Response | Promise; -} -/** - * Renderer type which can either be a ContextRenderer or DefaultRenderer. - */ -export type Renderer = ContextRenderer extends Function ? ContextRenderer : DefaultRenderer; -/** - * Extracts the props for the renderer. - */ -export type PropsForRenderer = [...Required>] extends [unknown, infer Props] ? Props : unknown; -export type Layout> = (props: T) => any; -/** - * Interface for getting context variables. - * - * @template E - Environment type. - */ -interface Get { - (key: Key): E['Variables'][Key]; - (key: Key): ContextVariableMap[Key]; -} -/** - * Interface for setting context variables. - * - * @template E - Environment type. - */ -interface Set { - (key: Key, value: E['Variables'][Key]): void; - (key: Key, value: ContextVariableMap[Key]): void; -} -/** - * Interface for creating a new response. - */ -interface NewResponse { - (data: Data | null, status?: StatusCode, headers?: HeaderRecord): Response; - (data: Data | null, init?: ResponseOrInit): Response; -} -/** - * Interface for responding with a body. - */ -interface BodyRespond { - (data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse; - (data: T, init?: ResponseOrInit): Response & TypedResponse; - (data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse; - (data: T, init?: ResponseOrInit): Response & TypedResponse; -} -/** - * Interface for responding with text. - * - * @interface TextRespond - * @template T - The type of the text content. - * @template U - The type of the status code. - * - * @param {T} text - The text content to be included in the response. - * @param {U} [status] - An optional status code for the response. - * @param {HeaderRecord} [headers] - An optional record of headers to include in the response. - * - * @returns {Response & TypedResponse} - The response after rendering the text content, typed with the provided text and status code types. - */ -interface TextRespond { - (text: T, status?: U, headers?: HeaderRecord): Response & TypedResponse; - (text: T, init?: ResponseOrInit): Response & TypedResponse; -} -/** - * Interface for responding with JSON. - * - * @interface JSONRespond - * @template T - The type of the JSON value or simplified unknown type. - * @template U - The type of the status code. - * - * @param {T} object - The JSON object to be included in the response. - * @param {U} [status] - An optional status code for the response. - * @param {HeaderRecord} [headers] - An optional record of headers to include in the response. - * - * @returns {JSONRespondReturn} - The response after rendering the JSON object, typed with the provided object and status code types. - */ -interface JSONRespond { - (object: T, status?: U, headers?: HeaderRecord): JSONRespondReturn; - (object: T, init?: ResponseOrInit): JSONRespondReturn; -} -/** - * @template T - The type of the JSON value or simplified unknown type. - * @template U - The type of the status code. - * - * @returns {Response & TypedResponse, U, 'json'>} - The response after rendering the JSON object, typed with the provided object and status code types. - */ -type JSONRespondReturn = Response & TypedResponse, U, 'json'>; -/** - * Interface representing a function that responds with HTML content. - * - * @param html - The HTML content to respond with, which can be a string or a Promise that resolves to a string. - * @param status - (Optional) The HTTP status code for the response. - * @param headers - (Optional) A record of headers to include in the response. - * @param init - (Optional) The response initialization object. - * - * @returns A Response object or a Promise that resolves to a Response object. - */ -interface HTMLRespond { - >(html: T, status?: ContentfulStatusCode, headers?: HeaderRecord): T extends string ? Response : Promise; - >(html: T, init?: ResponseOrInit): T extends string ? Response : Promise; -} -/** - * Options for configuring the context. - * - * @template E - Environment type. - */ -type ContextOptions = { - /** - * Bindings for the environment. - */ - env: E['Bindings']; - /** - * Execution context for the request. - */ - executionCtx?: FetchEventLike | ExecutionContext | undefined; - /** - * Handler for not found responses. - */ - notFoundHandler?: NotFoundHandler; - matchResult?: Result<[H, RouterRoute]>; - path?: string; -}; -interface SetHeadersOptions { - append?: boolean; -} -interface SetHeaders { - (name: 'Content-Type', value?: BaseMime, options?: SetHeadersOptions): void; - (name: ResponseHeader, value?: string, options?: SetHeadersOptions): void; - (name: string, value?: string, options?: SetHeadersOptions): void; -} -type ResponseHeadersInit = [string, string][] | Record<'Content-Type', BaseMime> | Record | Record | Headers; -interface ResponseInit { - headers?: ResponseHeadersInit; - status?: T; - statusText?: string; -} -type ResponseOrInit = ResponseInit | Response; -export declare const TEXT_PLAIN = "text/plain; charset=UTF-8"; -export declare class Context { - - /** - * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers. - * - * @see {@link https://hono.dev/docs/api/context#env} - * - * @example - * ```ts - * // Environment object for Cloudflare Workers - * app.get('*', async c => { - * const counter = c.env.COUNTER - * }) - * ``` - */ - env: E['Bindings']; - finalized: boolean; - /** - * `.error` can get the error object from the middleware if the Handler throws an error. - * - * @see {@link https://hono.dev/docs/api/context#error} - * - * @example - * ```ts - * app.use('*', async (c, next) => { - * await next() - * if (c.error) { - * // do something... - * } - * }) - * ``` - */ - error: Error | undefined; - /** - * Creates an instance of the Context class. - * - * @param req - The Request object. - * @param options - Optional configuration options for the context. - */ - constructor(req: Request, options?: ContextOptions); - /** - * `.req` is the instance of {@link HonoRequest}. - */ - get req(): HonoRequest; - /** - * @see {@link https://hono.dev/docs/api/context#event} - * The FetchEvent associated with the current request. - * - * @throws Will throw an error if the context does not have a FetchEvent. - */ - get event(): FetchEventLike; - /** - * @see {@link https://hono.dev/docs/api/context#executionctx} - * The ExecutionContext associated with the current request. - * - * @throws Will throw an error if the context does not have an ExecutionContext. - */ - get executionCtx(): ExecutionContext; - /** - * @see {@link https://hono.dev/docs/api/context#res} - * The Response object for the current request. - */ - get res(): Response; - /** - * Sets the Response object for the current request. - * - * @param _res - The Response object to set. - */ - set res(_res: Response | undefined); - /** - * `.render()` can create a response within a layout. - * - * @see {@link https://hono.dev/docs/api/context#render-setrenderer} - * - * @example - * ```ts - * app.get('/', (c) => { - * return c.render('Hello!') - * }) - * ``` - */ - render: Renderer; - /** - * Sets the layout for the response. - * - * @param layout - The layout to set. - * @returns The layout function. - */ - setLayout: (layout: Layout) => Layout; - /** - * Gets the current layout for the response. - * - * @returns The current layout function. - */ - getLayout: () => Layout | undefined; - /** - * `.setRenderer()` can set the layout in the custom middleware. - * - * @see {@link https://hono.dev/docs/api/context#render-setrenderer} - * - * @example - * ```tsx - * app.use('*', async (c, next) => { - * c.setRenderer((content) => { - * return c.html( - * - * - *

{content}

- * - * - * ) - * }) - * await next() - * }) - * ``` - */ - setRenderer: (renderer: Renderer) => void; - /** - * `.header()` can set headers. - * - * @see {@link https://hono.dev/docs/api/context#header} - * - * @example - * ```ts - * app.get('/welcome', (c) => { - * // Set headers - * c.header('X-Message', 'Hello!') - * c.header('Content-Type', 'text/plain') - * - * return c.body('Thank you for coming') - * }) - * ``` - */ - header: SetHeaders; - status: (status: StatusCode) => void; - /** - * `.set()` can set the value specified by the key. - * - * @see {@link https://hono.dev/docs/api/context#set-get} - * - * @example - * ```ts - * app.use('*', async (c, next) => { - * c.set('message', 'Hono is hot!!') - * await next() - * }) - * ``` - */ - set: Set extends true ? { - Variables: ContextVariableMap & Record; - } : E>; - /** - * `.get()` can use the value specified by the key. - * - * @see {@link https://hono.dev/docs/api/context#set-get} - * - * @example - * ```ts - * app.get('/', (c) => { - * const message = c.get('message') - * return c.text(`The message is "${message}"`) - * }) - * ``` - */ - get: Get extends true ? { - Variables: ContextVariableMap & Record; - } : E>; - /** - * `.var` can access the value of a variable. - * - * @see {@link https://hono.dev/docs/api/context#var} - * - * @example - * ```ts - * const result = c.var.client.oneMethod() - * ``` - */ - get var(): Readonly extends true ? Record : E['Variables'])>; - newResponse: NewResponse; - /** - * `.body()` can return the HTTP response. - * You can set headers with `.header()` and set HTTP status code with `.status`. - * This can also be set in `.text()`, `.json()` and so on. - * - * @see {@link https://hono.dev/docs/api/context#body} - * - * @example - * ```ts - * app.get('/welcome', (c) => { - * // Set headers - * c.header('X-Message', 'Hello!') - * c.header('Content-Type', 'text/plain') - * // Set HTTP status code - * c.status(201) - * - * // Return the response body - * return c.body('Thank you for coming') - * }) - * ``` - */ - body: BodyRespond; - /** - * `.text()` can render text as `Content-Type:text/plain`. - * - * @see {@link https://hono.dev/docs/api/context#text} - * - * @example - * ```ts - * app.get('/say', (c) => { - * return c.text('Hello!') - * }) - * ``` - */ - text: TextRespond; - /** - * `.json()` can render JSON as `Content-Type:application/json`. - * - * @see {@link https://hono.dev/docs/api/context#json} - * - * @example - * ```ts - * app.get('/api', (c) => { - * return c.json({ message: 'Hello!' }) - * }) - * ``` - */ - json: JSONRespond; - html: HTMLRespond; - /** - * `.redirect()` can Redirect, default status code is 302. - * - * @see {@link https://hono.dev/docs/api/context#redirect} - * - * @example - * ```ts - * app.get('/redirect', (c) => { - * return c.redirect('/') - * }) - * app.get('/redirect-permanently', (c) => { - * return c.redirect('/', 301) - * }) - * ``` - */ - redirect: (location: string | URL, status?: T) => Response & TypedResponse; - /** - * `.notFound()` can return the Not Found Response. - * - * @see {@link https://hono.dev/docs/api/context#notfound} - * - * @example - * ```ts - * app.get('/notfound', (c) => { - * return c.notFound() - * }) - * ``` - */ - notFound: () => ReturnType; -} -export {}; diff --git a/node_modules/hono/dist/types/helper/accepts/accepts.d.ts b/node_modules/hono/dist/types/helper/accepts/accepts.d.ts deleted file mode 100644 index 55cbee1..0000000 --- a/node_modules/hono/dist/types/helper/accepts/accepts.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { Context } from '../../context'; -import type { AcceptHeader } from '../../utils/headers'; -export interface Accept { - type: string; - params: Record; - q: number; -} -export interface acceptsConfig { - header: AcceptHeader; - supports: string[]; - default: string; -} -export interface acceptsOptions extends acceptsConfig { - match?: (accepts: Accept[], config: acceptsConfig) => string; -} -export declare const defaultMatch: (accepts: Accept[], config: acceptsConfig) => string; -/** - * Match the accept header with the given options. - * @example - * ```ts - * app.get('/users', (c) => { - * const lang = accepts(c, { - * header: 'Accept-Language', - * supports: ['en', 'zh'], - * default: 'en', - * }) - * }) - * ``` - */ -export declare const accepts: (c: Context, options: acceptsOptions) => string; diff --git a/node_modules/hono/dist/types/helper/accepts/index.d.ts b/node_modules/hono/dist/types/helper/accepts/index.d.ts deleted file mode 100644 index 946d23e..0000000 --- a/node_modules/hono/dist/types/helper/accepts/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @module - * Accepts Helper for Hono. - */ -export { accepts } from './accepts'; diff --git a/node_modules/hono/dist/types/helper/adapter/index.d.ts b/node_modules/hono/dist/types/helper/adapter/index.d.ts deleted file mode 100644 index 838391a..0000000 --- a/node_modules/hono/dist/types/helper/adapter/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @module - * Adapter Helper for Hono. - */ -import type { Context } from '../../context'; -export type Runtime = 'node' | 'deno' | 'bun' | 'workerd' | 'fastly' | 'edge-light' | 'other'; -export declare const env: , C extends Context = Context<{ - Bindings: T; -}>>(c: T extends Record ? Context : C, runtime?: Runtime) => T & C["env"]; -export declare const knownUserAgents: Partial>; -export declare const getRuntimeKey: () => Runtime; -export declare const checkUserAgentEquals: (platform: string) => boolean; diff --git a/node_modules/hono/dist/types/helper/conninfo/index.d.ts b/node_modules/hono/dist/types/helper/conninfo/index.d.ts deleted file mode 100644 index 876fb1d..0000000 --- a/node_modules/hono/dist/types/helper/conninfo/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @module - * ConnInfo Helper for Hono. - */ -export type { AddressType, NetAddrInfo, ConnInfo, GetConnInfo } from './types'; diff --git a/node_modules/hono/dist/types/helper/conninfo/types.d.ts b/node_modules/hono/dist/types/helper/conninfo/types.d.ts deleted file mode 100644 index 466af76..0000000 --- a/node_modules/hono/dist/types/helper/conninfo/types.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { Context } from '../../context'; -export type AddressType = 'IPv6' | 'IPv4' | undefined; -export type NetAddrInfo = { - /** - * Transport protocol type - */ - transport?: 'tcp' | 'udp'; - /** - * Transport port number - */ - port?: number; - address?: string; - addressType?: AddressType; -} & ({ - /** - * Host name such as IP Addr - */ - address: string; - /** - * Host name type - */ - addressType: AddressType; -} | {}); -/** - * HTTP Connection information - */ -export interface ConnInfo { - /** - * Remote information - */ - remote: NetAddrInfo; -} -/** - * Helper type - */ -export type GetConnInfo = (c: Context) => ConnInfo; diff --git a/node_modules/hono/dist/types/helper/cookie/index.d.ts b/node_modules/hono/dist/types/helper/cookie/index.d.ts deleted file mode 100644 index cc421b9..0000000 --- a/node_modules/hono/dist/types/helper/cookie/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @module - * Cookie Helper for Hono. - */ -import type { Context } from '../../context'; -import type { Cookie, CookieOptions, CookiePrefixOptions, SignedCookie } from '../../utils/cookie'; -interface GetCookie { - (c: Context, key: string): string | undefined; - (c: Context): Cookie; - (c: Context, key: string, prefixOptions?: CookiePrefixOptions): string | undefined; -} -interface GetSignedCookie { - (c: Context, secret: string | BufferSource, key: string): Promise; - (c: Context, secret: string | BufferSource): Promise; - (c: Context, secret: string | BufferSource, key: string, prefixOptions?: CookiePrefixOptions): Promise; -} -export declare const getCookie: GetCookie; -export declare const getSignedCookie: GetSignedCookie; -export declare const generateCookie: (name: string, value: string, opt?: CookieOptions) => string; -export declare const setCookie: (c: Context, name: string, value: string, opt?: CookieOptions) => void; -export declare const generateSignedCookie: (name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise; -export declare const setSignedCookie: (c: Context, name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise; -export declare const deleteCookie: (c: Context, name: string, opt?: CookieOptions) => string | undefined; -export {}; diff --git a/node_modules/hono/dist/types/helper/css/common.d.ts b/node_modules/hono/dist/types/helper/css/common.d.ts deleted file mode 100644 index a71ff80..0000000 --- a/node_modules/hono/dist/types/helper/css/common.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export declare const PSEUDO_GLOBAL_SELECTOR = ":-hono-global"; -export declare const isPseudoGlobalSelectorRe: RegExp; -export declare const DEFAULT_STYLE_ID = "hono-css"; -export declare const SELECTOR: unique symbol; -export declare const CLASS_NAME: unique symbol; -export declare const STYLE_STRING: unique symbol; -export declare const SELECTORS: unique symbol; -export declare const EXTERNAL_CLASS_NAMES: unique symbol; -declare const CSS_ESCAPED: unique symbol; -export interface CssClassName { - [SELECTOR]: string; - [CLASS_NAME]: string; - [STYLE_STRING]: string; - [SELECTORS]: CssClassName[]; - [EXTERNAL_CLASS_NAMES]: string[]; -} -export declare const IS_CSS_ESCAPED: unique symbol; -interface CssEscapedString { - [CSS_ESCAPED]: string; -} -/** - * @experimental - * `rawCssString` is an experimental feature. - * The API might be changed. - */ -export declare const rawCssString: (value: string) => CssEscapedString; -export declare const minify: (css: string) => string; -type CssVariableBasicType = CssClassName | CssEscapedString | string | number | boolean | null | undefined; -type CssVariableAsyncType = Promise; -type CssVariableArrayType = (CssVariableBasicType | CssVariableAsyncType)[]; -export type CssVariableType = CssVariableBasicType | CssVariableAsyncType | CssVariableArrayType; -export declare const buildStyleString: (strings: TemplateStringsArray, values: CssVariableType[]) => [string, string, CssClassName[], string[]]; -export declare const cssCommon: (strings: TemplateStringsArray, values: CssVariableType[]) => CssClassName; -export declare const cxCommon: (args: (string | boolean | null | undefined | CssClassName)[]) => (string | boolean | null | undefined | CssClassName)[]; -export declare const keyframesCommon: (strings: TemplateStringsArray, ...values: CssVariableType[]) => CssClassName; -type ViewTransitionType = { - (strings: TemplateStringsArray, values: CssVariableType[]): CssClassName; - (content: CssClassName): CssClassName; - (): CssClassName; -}; -export declare const viewTransitionCommon: ViewTransitionType; -export {}; diff --git a/node_modules/hono/dist/types/helper/css/index.d.ts b/node_modules/hono/dist/types/helper/css/index.d.ts deleted file mode 100644 index 9a74aae..0000000 --- a/node_modules/hono/dist/types/helper/css/index.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @module - * css Helper for Hono. - */ -import type { HtmlEscapedString } from '../../utils/html'; -import type { CssClassName as CssClassNameCommon, CssVariableType } from './common'; -export { rawCssString } from './common'; -type CssClassName = HtmlEscapedString & CssClassNameCommon; -interface CssType { - (strings: TemplateStringsArray, ...values: CssVariableType[]): Promise; -} -interface CxType { - (...args: (CssClassName | Promise | string | boolean | null | undefined)[]): Promise; -} -interface KeyframesType { - (strings: TemplateStringsArray, ...values: CssVariableType[]): CssClassNameCommon; -} -interface ViewTransitionType { - (strings: TemplateStringsArray, ...values: CssVariableType[]): Promise; - (content: Promise): Promise; - (): Promise; -} -interface StyleType { - (args?: { - children?: Promise; - nonce?: string; - }): HtmlEscapedString; -} -/** - * @experimental - * `createCssContext` is an experimental feature. - * The API might be changed. - */ -export declare const createCssContext: ({ id }: { - id: Readonly; -}) => DefaultContextType; -interface DefaultContextType { - css: CssType; - cx: CxType; - keyframes: KeyframesType; - viewTransition: ViewTransitionType; - Style: StyleType; -} -/** - * @experimental - * `css` is an experimental feature. - * The API might be changed. - */ -export declare const css: CssType; -/** - * @experimental - * `cx` is an experimental feature. - * The API might be changed. - */ -export declare const cx: CxType; -/** - * @experimental - * `keyframes` is an experimental feature. - * The API might be changed. - */ -export declare const keyframes: KeyframesType; -/** - * @experimental - * `viewTransition` is an experimental feature. - * The API might be changed. - */ -export declare const viewTransition: ViewTransitionType; -/** - * @experimental - * `Style` is an experimental feature. - * The API might be changed. - */ -export declare const Style: StyleType; diff --git a/node_modules/hono/dist/types/helper/dev/index.d.ts b/node_modules/hono/dist/types/helper/dev/index.d.ts deleted file mode 100644 index 28eb408..0000000 --- a/node_modules/hono/dist/types/helper/dev/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @module - * Dev Helper for Hono. - */ -import type { Hono } from '../../hono'; -import type { Env } from '../../types'; -interface ShowRoutesOptions { - verbose?: boolean; - colorize?: boolean; -} -interface RouteData { - path: string; - method: string; - name: string; - isMiddleware: boolean; -} -export declare const inspectRoutes: (hono: Hono) => RouteData[]; -export declare const showRoutes: (hono: Hono, opts?: ShowRoutesOptions) => void; -export declare const getRouterName: (app: Hono) => string; -export {}; diff --git a/node_modules/hono/dist/types/helper/factory/index.d.ts b/node_modules/hono/dist/types/helper/factory/index.d.ts deleted file mode 100644 index f14b48a..0000000 --- a/node_modules/hono/dist/types/helper/factory/index.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @module - * Factory Helper for Hono. - */ -import { Hono } from '../../hono'; -import type { HonoOptions } from '../../hono-base'; -import type { Env, H, HandlerResponse, Input, IntersectNonAnyTypes, MiddlewareHandler } from '../../types'; -type InitApp = (app: Hono) => void; -export interface CreateHandlersInterface { - = any, E2 extends Env = E>(handler1: H): [H]; - = any, R2 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(handler1: H, handler2: H): [H, H]; - = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(handler1: H, handler2: H, handler3: H): [H, H, H]; - = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(handler1: H, handler2: H, handler3: H, handler4: H): [H, H, H, H]; - = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H): [H, H, H, H, H]; - = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H): [ - H, - H, - H, - H, - H, - H - ]; - = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, R7 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H, handler7: H): [ - H, - H, - H, - H, - H, - H, - H - ]; - = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, R7 extends HandlerResponse = any, R8 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H, handler7: H, handler8: H): [ - H, - H, - H, - H, - H, - H, - H, - H - ]; - = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, R7 extends HandlerResponse = any, R8 extends HandlerResponse = any, R9 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H, handler7: H, handler8: H, handler9: H): [ - H, - H, - H, - H, - H, - H, - H, - H, - H - ]; - = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, R7 extends HandlerResponse = any, R8 extends HandlerResponse = any, R9 extends HandlerResponse = any, R10 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H, handler7: H, handler8: H, handler9: H, handler10: H): [ - H, - H, - H, - H, - H, - H, - H, - H, - H, - H - ]; -} -export declare class Factory { - - private initApp?; - constructor(init?: { - initApp?: InitApp; - defaultAppOptions?: HonoOptions; - }); - createApp: (options?: HonoOptions) => Hono; - createMiddleware: | void = void>(middleware: MiddlewareHandler) => MiddlewareHandler; - createHandlers: CreateHandlersInterface; -} -export declare const createFactory: (init?: { - initApp?: InitApp; - defaultAppOptions?: HonoOptions; -}) => Factory; -export declare const createMiddleware: | void = void>(middleware: MiddlewareHandler) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/helper/html/index.d.ts b/node_modules/hono/dist/types/helper/html/index.d.ts deleted file mode 100644 index ce17eac..0000000 --- a/node_modules/hono/dist/types/helper/html/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module - * html Helper for Hono. - */ -import { raw } from '../../utils/html'; -import type { HtmlEscapedString } from '../../utils/html'; -export { raw }; -export declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => HtmlEscapedString | Promise; diff --git a/node_modules/hono/dist/types/helper/proxy/index.d.ts b/node_modules/hono/dist/types/helper/proxy/index.d.ts deleted file mode 100644 index 4a5b334..0000000 --- a/node_modules/hono/dist/types/helper/proxy/index.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @module - * Proxy Helper for Hono. - */ -import type { RequestHeader } from '../../utils/headers'; -interface ProxyRequestInit extends Omit { - raw?: Request; - headers?: HeadersInit | [string, string][] | Record | Record; - customFetch?: (request: Request) => Promise; - /** - * Enable strict RFC 9110 compliance for Connection header processing. - * - * - `false` (default): Ignores Connection header to prevent potential - * Hop-by-Hop Header Injection attacks. Recommended for untrusted clients. - * - `true`: Processes Connection header per RFC 9110 and removes listed headers. - * Only use in trusted environments. - * - * @default false - * @see https://datatracker.ietf.org/doc/html/rfc9110#section-7.6.1 - */ - strictConnectionProcessing?: boolean; -} -interface ProxyFetch { - (input: string | URL | Request, init?: ProxyRequestInit): Promise; -} -/** - * Fetch API wrapper for proxy. - * The parameters and return value are the same as for `fetch` (except for the proxy-specific options). - * - * The “Accept-Encoding” header is replaced with an encoding that the current runtime can handle. - * Unnecessary response headers are deleted and a Response object is returned that can be returned - * as is as a response from the handler. - * - * @example - * ```ts - * app.get('/proxy/:path', (c) => { - * return proxy(`http://${originServer}/${c.req.param('path')}`, { - * headers: { - * ...c.req.header(), // optional, specify only when forwarding all the request data (including credentials) is necessary. - * 'X-Forwarded-For': '127.0.0.1', - * 'X-Forwarded-Host': c.req.header('host'), - * Authorization: undefined, // do not propagate request headers contained in c.req.header('Authorization') - * }, - * }).then((res) => { - * res.headers.delete('Set-Cookie') - * return res - * }) - * }) - * - * app.all('/proxy/:path', (c) => { - * return proxy(`http://${originServer}/${c.req.param('path')}`, { - * ...c.req, // optional, specify only when forwarding all the request data (including credentials) is necessary. - * headers: { - * ...c.req.header(), - * 'X-Forwarded-For': '127.0.0.1', - * 'X-Forwarded-Host': c.req.header('host'), - * Authorization: undefined, // do not propagate request headers contained in c.req.header('Authorization') - * }, - * }) - * }) - * - * // Strict RFC compliance mode (use only in trusted environments) - * app.get('/internal-proxy/:path', (c) => { - * return proxy(`http://${internalServer}/${c.req.param('path')}`, { - * ...c.req, - * strictConnectionProcessing: true, - * }) - * }) - * ``` - */ -export declare const proxy: ProxyFetch; -export {}; diff --git a/node_modules/hono/dist/types/helper/route/index.d.ts b/node_modules/hono/dist/types/helper/route/index.d.ts deleted file mode 100644 index f5af1e6..0000000 --- a/node_modules/hono/dist/types/helper/route/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type { Context } from '../../context'; -import type { RouterRoute } from '../../types'; -/** - * Get matched routes in the handler - * - * @param {Context} c - The context object - * @returns An array of matched routes - * - * @example - * ```ts - * import { matchedRoutes } from 'hono/route' - * - * app.use('*', async function logger(c, next) { - * await next() - * matchedRoutes(c).forEach(({ handler, method, path }, i) => { - * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') - * console.log( - * method, - * ' ', - * path, - * ' '.repeat(Math.max(10 - path.length, 0)), - * name, - * i === c.req.routeIndex ? '<- respond from here' : '' - * ) - * }) - * }) - * ``` - */ -export declare const matchedRoutes: (c: Context) => RouterRoute[]; -/** - * Get the route path registered within the handler - * - * @param {Context} c - The context object - * @param {number} index - The index of the root from which to retrieve the path, similar to Array.prototype.at(), where a negative number is the index counted from the end of the matching root. Defaults to the current root index. - * @returns The route path registered within the handler - * - * @example - * ```ts - * import { routePath } from 'hono/route' - * - * app.use('*', (c, next) => { - * console.log(routePath(c)) // '*' - * console.log(routePath(c, -1)) // '/posts/:id' - * return next() - * }) - * - * app.get('/posts/:id', (c) => { - * return c.text(routePath(c)) // '/posts/:id' - * }) - * ``` - */ -export declare const routePath: (c: Context, index?: number) => string; -/** - * Get the basePath of the as-is route specified by routing. - * - * @param {Context} c - The context object - * @param {number} index - The index of the root from which to retrieve the path, similar to Array.prototype.at(), where a negative number is the index counted from the end of the matching root. Defaults to the current root index. - * @returns The basePath of the as-is route specified by routing. - * - * @example - * ```ts - * import { baseRoutePath } from 'hono/route' - * - * const app = new Hono() - * - * const subApp = new Hono() - * subApp.get('/posts/:id', (c) => { - * return c.text(baseRoutePath(c)) // '/:sub' - * }) - * - * app.route('/:sub', subApp) - * ``` - */ -export declare const baseRoutePath: (c: Context, index?: number) => string; -export declare const basePath: (c: Context, index?: number) => string; diff --git a/node_modules/hono/dist/types/helper/ssg/index.d.ts b/node_modules/hono/dist/types/helper/ssg/index.d.ts deleted file mode 100644 index 4e12417..0000000 --- a/node_modules/hono/dist/types/helper/ssg/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @module - * SSG Helper for Hono. - */ -export * from './ssg'; -export { X_HONO_DISABLE_SSG_HEADER_KEY, ssgParams, isSSGContext, disableSSG, onlySSG, } from './middleware'; diff --git a/node_modules/hono/dist/types/helper/ssg/middleware.d.ts b/node_modules/hono/dist/types/helper/ssg/middleware.d.ts deleted file mode 100644 index 791ee40..0000000 --- a/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { Context } from '../../context'; -import type { Env, MiddlewareHandler } from '../../types'; -export declare const SSG_CONTEXT = "HONO_SSG_CONTEXT"; -export declare const X_HONO_DISABLE_SSG_HEADER_KEY = "x-hono-disable-ssg"; -/** - * @deprecated - * Use `X_HONO_DISABLE_SSG_HEADER_KEY` instead. - * This constant will be removed in the next minor version. - */ -export declare const SSG_DISABLED_RESPONSE: Response; -interface SSGParam { - [key: string]: string; -} -export type SSGParams = SSGParam[]; -interface SSGParamsMiddleware { - (generateParams: (c: Context) => SSGParams | Promise): MiddlewareHandler; - (params: SSGParams): MiddlewareHandler; -} -export type AddedSSGDataRequest = Request & { - ssgParams?: SSGParams; -}; -/** - * Define SSG Route - */ -export declare const ssgParams: SSGParamsMiddleware; -/** - * @experimental - * `isSSGContext` is an experimental feature. - * The API might be changed. - */ -export declare const isSSGContext: (c: Context) => boolean; -/** - * @experimental - * `disableSSG` is an experimental feature. - * The API might be changed. - */ -export declare const disableSSG: () => MiddlewareHandler; -/** - * @experimental - * `onlySSG` is an experimental feature. - * The API might be changed. - */ -export declare const onlySSG: () => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/helper/ssg/ssg.d.ts b/node_modules/hono/dist/types/helper/ssg/ssg.d.ts deleted file mode 100644 index 026cde2..0000000 --- a/node_modules/hono/dist/types/helper/ssg/ssg.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -import type { Hono } from '../../hono'; -import type { Env, Schema } from '../../types'; -export declare const DEFAULT_OUTPUT_DIR = "./static"; -/** - * @experimental - * `FileSystemModule` is an experimental feature. - * The API might be changed. - */ -export interface FileSystemModule { - writeFile(path: string, data: string | Uint8Array): Promise; - mkdir(path: string, options: { - recursive: boolean; - }): Promise; -} -/** - * @experimental - * `ToSSGResult` is an experimental feature. - * The API might be changed. - */ -export interface ToSSGResult { - success: boolean; - files: string[]; - error?: Error; -} -export declare const defaultExtensionMap: Record; -export type BeforeRequestHook = (req: Request) => Request | false | Promise; -export type AfterResponseHook = (res: Response) => Response | false | Promise; -export type AfterGenerateHook = (result: ToSSGResult, fsModule: FileSystemModule, options?: ToSSGOptions) => void | Promise; -export declare const combineBeforeRequestHooks: (hooks: BeforeRequestHook | BeforeRequestHook[]) => BeforeRequestHook; -export declare const combineAfterResponseHooks: (hooks: AfterResponseHook | AfterResponseHook[]) => AfterResponseHook; -export declare const combineAfterGenerateHooks: (hooks: AfterGenerateHook | AfterGenerateHook[], fsModule: FileSystemModule, options?: ToSSGOptions) => AfterGenerateHook; -export interface SSGPlugin { - beforeRequestHook?: BeforeRequestHook | BeforeRequestHook[]; - afterResponseHook?: AfterResponseHook | AfterResponseHook[]; - afterGenerateHook?: AfterGenerateHook | AfterGenerateHook[]; -} -export interface ToSSGOptions { - dir?: string; - /** - * @deprecated Use plugins[].beforeRequestHook instead. - */ - beforeRequestHook?: BeforeRequestHook | BeforeRequestHook[]; - /** - * @deprecated Use plugins[].afterResponseHook instead. - */ - afterResponseHook?: AfterResponseHook | AfterResponseHook[]; - /** - * @deprecated Use plugins[].afterGenerateHook instead. - */ - afterGenerateHook?: AfterGenerateHook | AfterGenerateHook[]; - concurrency?: number; - extensionMap?: Record; - plugins?: SSGPlugin[]; -} -/** - * @experimental - * `fetchRoutesContent` is an experimental feature. - * The API might be changed. - */ -export declare const fetchRoutesContent: (app: Hono, beforeRequestHook?: BeforeRequestHook, afterResponseHook?: AfterResponseHook, concurrency?: number) => Generator> | undefined>>; -export declare const saveContentToFile: (data: Promise<{ - routePath: string; - content: string | ArrayBuffer; - mimeType: string; -} | undefined>, fsModule: FileSystemModule, outDir: string, extensionMap?: Record) => Promise; -/** - * @experimental - * `ToSSGInterface` is an experimental feature. - * The API might be changed. - */ -export interface ToSSGInterface { - (app: Hono, fsModule: FileSystemModule, options?: ToSSGOptions): Promise; -} -/** - * @experimental - * `ToSSGAdaptorInterface` is an experimental feature. - * The API might be changed. - */ -export interface ToSSGAdaptorInterface { - (app: Hono, options?: ToSSGOptions): Promise; -} -/** - * The default plugin that defines the recommended behavior. - * - * @experimental - * `defaultPlugin` is an experimental feature. - * The API might be changed. - */ -export declare const defaultPlugin: SSGPlugin; -/** - * @experimental - * `toSSG` is an experimental feature. - * The API might be changed. - */ -export declare const toSSG: ToSSGInterface; diff --git a/node_modules/hono/dist/types/helper/ssg/utils.d.ts b/node_modules/hono/dist/types/helper/ssg/utils.d.ts deleted file mode 100644 index 9553bf4..0000000 --- a/node_modules/hono/dist/types/helper/ssg/utils.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Hono } from '../../hono'; -import type { Env } from '../../types'; -/** - * Get dirname - * @param path File Path - * @returns Parent dir path - */ -export declare const dirname: (path: string) => string; -export declare const joinPaths: (...paths: string[]) => string; -interface FilterStaticGenerateRouteData { - path: string; -} -export declare const filterStaticGenerateRoutes: (hono: Hono) => FilterStaticGenerateRouteData[]; -export declare const isDynamicRoute: (path: string) => boolean; -export {}; diff --git a/node_modules/hono/dist/types/helper/streaming/index.d.ts b/node_modules/hono/dist/types/helper/streaming/index.d.ts deleted file mode 100644 index c89d67e..0000000 --- a/node_modules/hono/dist/types/helper/streaming/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module - * Streaming Helper for Hono. - */ -export { stream } from './stream'; -export type { SSEMessage } from './sse'; -export { streamSSE, SSEStreamingApi } from './sse'; -export { streamText } from './text'; diff --git a/node_modules/hono/dist/types/helper/streaming/sse.d.ts b/node_modules/hono/dist/types/helper/streaming/sse.d.ts deleted file mode 100644 index c4cf659..0000000 --- a/node_modules/hono/dist/types/helper/streaming/sse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Context } from '../../context'; -import { StreamingApi } from '../../utils/stream'; -export interface SSEMessage { - data: string | Promise; - event?: string; - id?: string; - retry?: number; -} -export declare class SSEStreamingApi extends StreamingApi { - constructor(writable: WritableStream, readable: ReadableStream); - writeSSE(message: SSEMessage): Promise; -} -export declare const streamSSE: (c: Context, cb: (stream: SSEStreamingApi) => Promise, onError?: (e: Error, stream: SSEStreamingApi) => Promise) => Response; diff --git a/node_modules/hono/dist/types/helper/streaming/stream.d.ts b/node_modules/hono/dist/types/helper/streaming/stream.d.ts deleted file mode 100644 index 2c34ef8..0000000 --- a/node_modules/hono/dist/types/helper/streaming/stream.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Context } from '../../context'; -import { StreamingApi } from '../../utils/stream'; -export declare const stream: (c: Context, cb: (stream: StreamingApi) => Promise, onError?: (e: Error, stream: StreamingApi) => Promise) => Response; diff --git a/node_modules/hono/dist/types/helper/streaming/text.d.ts b/node_modules/hono/dist/types/helper/streaming/text.d.ts deleted file mode 100644 index 39934dc..0000000 --- a/node_modules/hono/dist/types/helper/streaming/text.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Context } from '../../context'; -import type { StreamingApi } from '../../utils/stream'; -export declare const streamText: (c: Context, cb: (stream: StreamingApi) => Promise, onError?: (e: Error, stream: StreamingApi) => Promise) => Response; diff --git a/node_modules/hono/dist/types/helper/streaming/utils.d.ts b/node_modules/hono/dist/types/helper/streaming/utils.d.ts deleted file mode 100644 index 8ae4c76..0000000 --- a/node_modules/hono/dist/types/helper/streaming/utils.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare let isOldBunVersion: () => boolean; diff --git a/node_modules/hono/dist/types/helper/testing/index.d.ts b/node_modules/hono/dist/types/helper/testing/index.d.ts deleted file mode 100644 index 208d310..0000000 --- a/node_modules/hono/dist/types/helper/testing/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @module - * Testing Helper for Hono. - */ -import type { Client, ClientRequestOptions } from '../../client/types'; -import type { ExecutionContext } from '../../context'; -import type { Hono } from '../../hono'; -import type { Schema } from '../../types'; -import type { UnionToIntersection } from '../../utils/types'; -type ExtractEnv = T extends Hono ? E : never; -export declare const testClient: >(app: T, Env?: ExtractEnv["Bindings"] | {}, executionCtx?: ExecutionContext, options?: Omit) => UnionToIntersection>; -export {}; diff --git a/node_modules/hono/dist/types/helper/websocket/index.d.ts b/node_modules/hono/dist/types/helper/websocket/index.d.ts deleted file mode 100644 index 0d7ebbb..0000000 --- a/node_modules/hono/dist/types/helper/websocket/index.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @module - * WebSocket Helper for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler, TypedResponse } from '../../types'; -import type { StatusCode } from '../../utils/http-status'; -/** - * WebSocket Event Listeners type - */ -export interface WSEvents { - onOpen?: (evt: Event, ws: WSContext) => void; - onMessage?: (evt: MessageEvent, ws: WSContext) => void; - onClose?: (evt: CloseEvent, ws: WSContext) => void; - onError?: (evt: Event, ws: WSContext) => void; -} -/** - * Upgrade WebSocket Type - */ -export interface UpgradeWebSocket> { - (createEvents: (c: Context) => _WSEvents | Promise<_WSEvents>, options?: U): MiddlewareHandler; - (c: Context, events: _WSEvents, options?: U): Promise>; -} -/** - * ReadyState for WebSocket - */ -export type WSReadyState = 0 | 1 | 2 | 3; -/** - * An argument for WSContext class - */ -export interface WSContextInit { - send(data: string | ArrayBuffer | Uint8Array, options: SendOptions): void; - close(code?: number, reason?: string): void; - raw?: T; - readyState: WSReadyState; - url?: string | URL | null; - protocol?: string | null; -} -/** - * Options for sending message - */ -export interface SendOptions { - compress?: boolean; -} -/** - * A context for controlling WebSockets - */ -export declare class WSContext { - - constructor(init: WSContextInit); - send(source: string | ArrayBuffer | Uint8Array, options?: SendOptions): void; - raw?: T; - binaryType: BinaryType; - get readyState(): WSReadyState; - url: URL | null; - protocol: string | null; - close(code?: number, reason?: string): void; -} -export type WSMessageReceive = string | Blob | ArrayBufferLike; -export declare const createWSMessageEvent: (source: WSMessageReceive) => MessageEvent; -export interface WebSocketHelperDefineContext { -} -export type WebSocketHelperDefineHandler = (c: Context, events: WSEvents, options?: U) => Promise | Response | void; -/** - * Create a WebSocket adapter/helper - */ -export declare const defineWebSocketHelper: (handler: WebSocketHelperDefineHandler) => UpgradeWebSocket; diff --git a/node_modules/hono/dist/types/hono-base.d.ts b/node_modules/hono/dist/types/hono-base.d.ts deleted file mode 100644 index 1f01271..0000000 --- a/node_modules/hono/dist/types/hono-base.d.ts +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @module - * This module is the base module for the Hono object. - */ -import { Context } from './context'; -import type { ExecutionContext } from './context'; -import type { Router } from './router'; -import type { Env, ErrorHandler, H, HandlerInterface, MergePath, MergeSchemaPath, MiddlewareHandlerInterface, NotFoundHandler, OnHandlerInterface, RouterRoute, Schema } from './types'; -type GetPath = (request: Request, options?: { - env?: E['Bindings']; -}) => string; -export type HonoOptions = { - /** - * `strict` option specifies whether to distinguish whether the last path is a directory or not. - * - * @see {@link https://hono.dev/docs/api/hono#strict-mode} - * - * @default true - */ - strict?: boolean; - /** - * `router` option specifies which router to use. - * - * @see {@link https://hono.dev/docs/api/hono#router-option} - * - * @example - * ```ts - * const app = new Hono({ router: new RegExpRouter() }) - * ``` - */ - router?: Router<[H, RouterRoute]>; - /** - * `getPath` can handle the host header value. - * - * @see {@link https://hono.dev/docs/api/routing#routing-with-host-header-value} - * - * @example - * ```ts - * const app = new Hono({ - * getPath: (req) => - * '/' + req.headers.get('host') + req.url.replace(/^https?:\/\/[^/]+(\/[^?]*)/, '$1'), - * }) - * - * app.get('/www1.example.com/hello', () => c.text('hello www1')) - * - * // A following request will match the route: - * // new Request('http://www1.example.com/hello', { - * // headers: { host: 'www1.example.com' }, - * // }) - * ``` - */ - getPath?: GetPath; -}; -type MountOptionHandler = (c: Context) => unknown; -type MountReplaceRequest = (originalRequest: Request) => Request; -type MountOptions = MountOptionHandler | { - optionHandler?: MountOptionHandler; - replaceRequest?: MountReplaceRequest | false; -}; -declare class Hono { - - get: HandlerInterface; - post: HandlerInterface; - put: HandlerInterface; - delete: HandlerInterface; - options: HandlerInterface; - patch: HandlerInterface; - all: HandlerInterface; - on: OnHandlerInterface; - use: MiddlewareHandlerInterface; - router: Router<[H, RouterRoute]>; - readonly getPath: GetPath; - private _basePath; - routes: RouterRoute[]; - constructor(options?: HonoOptions); - private errorHandler; - /** - * `.route()` allows grouping other Hono instance in routes. - * - * @see {@link https://hono.dev/docs/api/routing#grouping} - * - * @param {string} path - base Path - * @param {Hono} app - other Hono instance - * @returns {Hono} routed Hono instance - * - * @example - * ```ts - * const app = new Hono() - * const app2 = new Hono() - * - * app2.get("/user", (c) => c.text("user")) - * app.route("/api", app2) // GET /api/user - * ``` - */ - route(path: SubPath, app: Hono): Hono> | S, BasePath, CurrentPath>; - /** - * `.basePath()` allows base paths to be specified. - * - * @see {@link https://hono.dev/docs/api/routing#base-path} - * - * @param {string} path - base Path - * @returns {Hono} changed Hono instance - * - * @example - * ```ts - * const api = new Hono().basePath('/api') - * ``` - */ - basePath(path: SubPath): Hono, MergePath>; - /** - * `.onError()` handles an error and returns a customized Response. - * - * @see {@link https://hono.dev/docs/api/hono#error-handling} - * - * @param {ErrorHandler} handler - request Handler for error - * @returns {Hono} changed Hono instance - * - * @example - * ```ts - * app.onError((err, c) => { - * console.error(`${err}`) - * return c.text('Custom Error Message', 500) - * }) - * ``` - */ - onError: (handler: ErrorHandler) => Hono; - /** - * `.notFound()` allows you to customize a Not Found Response. - * - * @see {@link https://hono.dev/docs/api/hono#not-found} - * - * @param {NotFoundHandler} handler - request handler for not-found - * @returns {Hono} changed Hono instance - * - * @example - * ```ts - * app.notFound((c) => { - * return c.text('Custom 404 Message', 404) - * }) - * ``` - */ - notFound: (handler: NotFoundHandler) => Hono; - /** - * `.mount()` allows you to mount applications built with other frameworks into your Hono application. - * - * @see {@link https://hono.dev/docs/api/hono#mount} - * - * @param {string} path - base Path - * @param {Function} applicationHandler - other Request Handler - * @param {MountOptions} [options] - options of `.mount()` - * @returns {Hono} mounted Hono instance - * - * @example - * ```ts - * import { Router as IttyRouter } from 'itty-router' - * import { Hono } from 'hono' - * // Create itty-router application - * const ittyRouter = IttyRouter() - * // GET /itty-router/hello - * ittyRouter.get('/hello', () => new Response('Hello from itty-router')) - * - * const app = new Hono() - * app.mount('/itty-router', ittyRouter.handle) - * ``` - * - * @example - * ```ts - * const app = new Hono() - * // Send the request to another application without modification. - * app.mount('/app', anotherApp, { - * replaceRequest: (req) => req, - * }) - * ``` - */ - mount(path: string, applicationHandler: (request: Request, ...args: any) => Response | Promise, options?: MountOptions): Hono; - /** - * `.fetch()` will be entry point of your app. - * - * @see {@link https://hono.dev/docs/api/hono#fetch} - * - * @param {Request} request - request Object of request - * @param {Env} Env - env Object - * @param {ExecutionContext} - context of execution - * @returns {Response | Promise} response of request - * - */ - fetch: (request: Request, Env?: E['Bindings'] | {}, executionCtx?: ExecutionContext) => Response | Promise; - /** - * `.request()` is a useful method for testing. - * You can pass a URL or pathname to send a GET request. - * app will return a Response object. - * ```ts - * test('GET /hello is ok', async () => { - * const res = await app.request('/hello') - * expect(res.status).toBe(200) - * }) - * ``` - * @see https://hono.dev/docs/api/hono#request - */ - request: (input: RequestInfo | URL, requestInit?: RequestInit, Env?: E["Bindings"] | {}, executionCtx?: ExecutionContext) => Response | Promise; - /** - * `.fire()` automatically adds a global fetch event listener. - * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers. - * @deprecated - * Use `fire` from `hono/service-worker` instead. - * ```ts - * import { Hono } from 'hono' - * import { fire } from 'hono/service-worker' - * - * const app = new Hono() - * // ... - * fire(app) - * ``` - * @see https://hono.dev/docs/api/hono#fire - * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API - * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ - */ - fire: () => void; -} -export { Hono as HonoBase }; diff --git a/node_modules/hono/dist/types/hono.d.ts b/node_modules/hono/dist/types/hono.d.ts deleted file mode 100644 index caeb4dc..0000000 --- a/node_modules/hono/dist/types/hono.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { HonoBase } from './hono-base'; -import type { HonoOptions } from './hono-base'; -import type { BlankEnv, BlankSchema, Env, Schema } from './types'; -/** - * The Hono class extends the functionality of the HonoBase class. - * It sets up routing and allows for custom options to be passed. - * - * @template E - The environment type. - * @template S - The schema type. - * @template BasePath - The base path type. - */ -export declare class Hono extends HonoBase { - /** - * Creates an instance of the Hono class. - * - * @param options - Optional configuration options for the Hono instance. - */ - constructor(options?: HonoOptions); -} diff --git a/node_modules/hono/dist/types/http-exception.d.ts b/node_modules/hono/dist/types/http-exception.d.ts deleted file mode 100644 index 8b90cca..0000000 --- a/node_modules/hono/dist/types/http-exception.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @module - * This module provides the `HTTPException` class. - */ -import type { ContentfulStatusCode } from './utils/http-status'; -/** - * Options for creating an `HTTPException`. - * @property res - Optional response object to use. - * @property message - Optional custom error message. - * @property cause - Optional cause of the error. - */ -type HTTPExceptionOptions = { - res?: Response; - message?: string; - cause?: unknown; -}; -/** - * `HTTPException` must be used when a fatal error such as authentication failure occurs. - * - * @see {@link https://hono.dev/docs/api/exception} - * - * @param {StatusCode} status - status code of HTTPException - * @param {HTTPExceptionOptions} options - options of HTTPException - * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException - * @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException - * @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException - * - * @example - * ```ts - * import { HTTPException } from 'hono/http-exception' - * - * // ... - * - * app.post('/auth', async (c, next) => { - * // authentication - * if (authorized === false) { - * throw new HTTPException(401, { message: 'Custom error message' }) - * } - * await next() - * }) - * ``` - */ -export declare class HTTPException extends Error { - readonly res?: Response; - readonly status: ContentfulStatusCode; - /** - * Creates an instance of `HTTPException`. - * @param status - HTTP status code for the exception. Defaults to 500. - * @param options - Additional options for the exception. - */ - constructor(status?: ContentfulStatusCode, options?: HTTPExceptionOptions); - /** - * Returns the response object associated with the exception. - * If a response object is not provided, a new response is created with the error message and status code. - * @returns The response object. - */ - getResponse(): Response; -} -export {}; diff --git a/node_modules/hono/dist/types/index.d.ts b/node_modules/hono/dist/types/index.d.ts deleted file mode 100644 index 2e861bf..0000000 --- a/node_modules/hono/dist/types/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @module - * - * Hono - Web Framework built on Web Standards - * - * @example - * ```ts - * import { Hono } from 'hono' - * const app = new Hono() - * - * app.get('/', (c) => c.text('Hono!')) - * - * export default app - * ``` - */ -import { Hono } from './hono'; -/** - * Types for environment variables, error handlers, handlers, middleware handlers, and more. - */ -export type { Env, ErrorHandler, Handler, MiddlewareHandler, Next, NotFoundResponse, NotFoundHandler, ValidationTargets, Input, Schema, ToSchema, TypedResponse, } from './types'; -/** - * Types for context, context variable map, context renderer, and execution context. - */ -export type { Context, ContextVariableMap, ContextRenderer, ExecutionContext } from './context'; -/** - * Type for HonoRequest. - */ -export type { HonoRequest } from './request'; -/** - * Types for inferring request and response types and client request options. - */ -export type { InferRequestType, InferResponseType, ClientRequestOptions } from './client'; -/** - * Hono framework for building web applications. - */ -export { Hono }; diff --git a/node_modules/hono/dist/types/jsx/base.d.ts b/node_modules/hono/dist/types/jsx/base.d.ts deleted file mode 100644 index 488d5c4..0000000 --- a/node_modules/hono/dist/types/jsx/base.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { HtmlEscaped, HtmlEscapedString, StringBufferWithCallbacks } from '../utils/html'; -import { DOM_MEMO } from './constants'; -import type { Context } from './context'; -import type { JSX as HonoJSX, IntrinsicElements as IntrinsicElementsDefined } from './intrinsic-elements'; -export type Props = Record; -export type FC

= { - (props: P): HtmlEscapedString | Promise | null; - defaultProps?: Partial

| undefined; - displayName?: string | undefined; -}; -export type DOMAttributes = HonoJSX.HTMLAttributes; -export declare namespace JSX { - type Element = HtmlEscapedString | Promise; - interface ElementChildrenAttribute { - children: Child; - } - interface IntrinsicElements extends IntrinsicElementsDefined { - [tagName: string]: Props; - } - interface IntrinsicAttributes { - key?: string | number | bigint | null | undefined; - } -} -export declare const getNameSpaceContext: () => Context | undefined; -export declare const booleanAttributes: string[]; -type LocalContexts = [Context, unknown][]; -export type Child = string | Promise | number | JSXNode | null | undefined | boolean | Child[]; -export declare class JSXNode implements HtmlEscaped { - tag: string | Function; - props: Props; - key?: string; - children: Child[]; - isEscaped: true; - localContexts?: LocalContexts; - constructor(tag: string | Function, props: Props, children: Child[]); - get type(): string | Function; - get ref(): any; - toString(): string | Promise; - toStringToBuffer(buffer: StringBufferWithCallbacks): void; -} -export declare class JSXFragmentNode extends JSXNode { - toStringToBuffer(buffer: StringBufferWithCallbacks): void; -} -export declare const jsx: (tag: string | Function, props: Props | null, ...children: (string | number | HtmlEscapedString)[]) => JSXNode; -export declare const jsxFn: (tag: string | Function, props: Props, children: (string | number | HtmlEscapedString)[]) => JSXNode; -export declare const shallowEqual: (a: Props, b: Props) => boolean; -export type MemorableFC = FC & { - [DOM_MEMO]: (prevProps: Readonly, nextProps: Readonly) => boolean; -}; -export declare const memo: (component: FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => FC; -export declare const Fragment: ({ children, }: { - key?: string; - children?: Child | HtmlEscapedString; -}) => HtmlEscapedString; -export declare const isValidElement: (element: unknown) => element is JSXNode; -export declare const cloneElement: (element: T, props: Partial, ...children: Child[]) => T; -export declare const reactAPICompatVersion = "19.0.0-hono-jsx"; -export {}; diff --git a/node_modules/hono/dist/types/jsx/children.d.ts b/node_modules/hono/dist/types/jsx/children.d.ts deleted file mode 100644 index 7e13b27..0000000 --- a/node_modules/hono/dist/types/jsx/children.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Child } from './base'; -export declare const toArray: (children: Child) => Child[]; -export declare const Children: { - map: (children: Child[], fn: (child: Child, index: number) => Child) => Child[]; - forEach: (children: Child[], fn: (child: Child, index: number) => void) => void; - count: (children: Child[]) => number; - only: (_children: Child[]) => Child; - toArray: (children: Child) => Child[]; -}; diff --git a/node_modules/hono/dist/types/jsx/components.d.ts b/node_modules/hono/dist/types/jsx/components.d.ts deleted file mode 100644 index ede9201..0000000 --- a/node_modules/hono/dist/types/jsx/components.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { HtmlEscapedString } from '../utils/html'; -import type { Child, FC, PropsWithChildren } from './'; -export declare const childrenToString: (children: Child[]) => Promise; -export type ErrorHandler = (error: Error) => void; -export type FallbackRender = (error: Error) => Child; -/** - * @experimental - * `ErrorBoundary` is an experimental feature. - * The API might be changed. - */ -export declare const ErrorBoundary: FC>; diff --git a/node_modules/hono/dist/types/jsx/constants.d.ts b/node_modules/hono/dist/types/jsx/constants.d.ts deleted file mode 100644 index 27b9606..0000000 --- a/node_modules/hono/dist/types/jsx/constants.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare const DOM_RENDERER: unique symbol; -export declare const DOM_ERROR_HANDLER: unique symbol; -export declare const DOM_STASH: unique symbol; -export declare const DOM_INTERNAL_TAG: unique symbol; -export declare const DOM_MEMO: unique symbol; -export declare const PERMALINK: unique symbol; diff --git a/node_modules/hono/dist/types/jsx/context.d.ts b/node_modules/hono/dist/types/jsx/context.d.ts deleted file mode 100644 index 64ac66c..0000000 --- a/node_modules/hono/dist/types/jsx/context.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FC, PropsWithChildren } from './'; -export interface Context extends FC> { - values: T[]; - Provider: FC>; -} -export declare const globalContexts: Context[]; -export declare const createContext: (defaultValue: T) => Context; -export declare const useContext: (context: Context) => T; diff --git a/node_modules/hono/dist/types/jsx/dom/client.d.ts b/node_modules/hono/dist/types/jsx/dom/client.d.ts deleted file mode 100644 index a30e3e4..0000000 --- a/node_modules/hono/dist/types/jsx/dom/client.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @module - * This module provides APIs for `hono/jsx/dom/client`, which is compatible with `react-dom/client`. - */ -import type { Child } from '../base'; -export interface Root { - render(children: Child): void; - unmount(): void; -} -export type RootOptions = Record; -/** - * Create a root object for rendering - * @param element Render target - * @param options Options for createRoot (not supported yet) - * @returns Root object has `render` and `unmount` methods - */ -export declare const createRoot: (element: HTMLElement | DocumentFragment, options?: RootOptions) => Root; -/** - * Create a root object and hydrate app to the target element. - * In hono/jsx/dom, hydrate is equivalent to render. - * @param element Render target - * @param reactNode A JSXNode to render - * @param options Options for createRoot (not supported yet) - * @returns Root object has `render` and `unmount` methods - */ -export declare const hydrateRoot: (element: HTMLElement | DocumentFragment, reactNode: Child, options?: RootOptions) => Root; -declare const _default: { - createRoot: (element: HTMLElement | DocumentFragment, options?: RootOptions) => Root; - hydrateRoot: (element: HTMLElement | DocumentFragment, reactNode: Child, options?: RootOptions) => Root; -}; -export default _default; diff --git a/node_modules/hono/dist/types/jsx/dom/components.d.ts b/node_modules/hono/dist/types/jsx/dom/components.d.ts deleted file mode 100644 index 54beaef..0000000 --- a/node_modules/hono/dist/types/jsx/dom/components.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Child, FC, PropsWithChildren } from '../'; -import type { ErrorHandler, FallbackRender } from '../components'; -export declare const ErrorBoundary: FC>; -export declare const Suspense: FC>; diff --git a/node_modules/hono/dist/types/jsx/dom/context.d.ts b/node_modules/hono/dist/types/jsx/dom/context.d.ts deleted file mode 100644 index ba9b54b..0000000 --- a/node_modules/hono/dist/types/jsx/dom/context.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Context } from '../context'; -export declare const createContextProviderFunction: (values: T[]) => Function; -export declare const createContext: (defaultValue: T) => Context; diff --git a/node_modules/hono/dist/types/jsx/dom/css.d.ts b/node_modules/hono/dist/types/jsx/dom/css.d.ts deleted file mode 100644 index cf6ea22..0000000 --- a/node_modules/hono/dist/types/jsx/dom/css.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @module - * This module provides APIs that enable `hono/jsx/dom` to support. - */ -import type { FC, PropsWithChildren } from '../'; -import type { CssClassName, CssVariableType } from '../../helper/css/common'; -export { rawCssString } from '../../helper/css/common'; -interface CreateCssJsxDomObjectsType { - (args: { - id: Readonly; - }): readonly [ - { - toString(this: CssClassName): string; - }, - FC> - ]; -} -export declare const createCssJsxDomObjects: CreateCssJsxDomObjectsType; -interface CssType { - (strings: TemplateStringsArray, ...values: CssVariableType[]): string; -} -interface CxType { - (...args: (string | boolean | null | undefined)[]): string; -} -interface KeyframesType { - (strings: TemplateStringsArray, ...values: CssVariableType[]): CssClassName; -} -interface ViewTransitionType { - (strings: TemplateStringsArray, ...values: CssVariableType[]): string; - (content: string): string; - (): string; -} -interface DefaultContextType { - css: CssType; - cx: CxType; - keyframes: KeyframesType; - viewTransition: ViewTransitionType; - Style: FC>; -} -/** - * @experimental - * `createCssContext` is an experimental feature. - * The API might be changed. - */ -export declare const createCssContext: ({ id }: { - id: Readonly; -}) => DefaultContextType; -/** - * @experimental - * `css` is an experimental feature. - * The API might be changed. - */ -export declare const css: CssType; -/** - * @experimental - * `cx` is an experimental feature. - * The API might be changed. - */ -export declare const cx: CxType; -/** - * @experimental - * `keyframes` is an experimental feature. - * The API might be changed. - */ -export declare const keyframes: KeyframesType; -/** - * @experimental - * `viewTransition` is an experimental feature. - * The API might be changed. - */ -export declare const viewTransition: ViewTransitionType; -/** - * @experimental - * `Style` is an experimental feature. - * The API might be changed. - */ -export declare const Style: FC>; diff --git a/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts b/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts deleted file mode 100644 index eca26ae..0000000 --- a/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Provide hooks used only in jsx/dom - */ -import type { Context } from '../../context'; -type FormStatus = { - pending: false; - data: null; - method: null; - action: null; -} | { - pending: true; - data: FormData; - method: 'get' | 'post'; - action: string | ((formData: FormData) => void | Promise); -}; -export declare const FormContext: Context; -export declare const registerAction: (action: Promise) => void; -/** - * This hook returns the current form status - * @returns FormStatus - */ -export declare const useFormStatus: () => FormStatus; -/** - * This hook returns the current state and a function to update the state optimistically - * The current state is updated optimistically and then reverted to the original state when all actions are resolved - * @param state - * @param updateState - * @returns [T, (action: N) => void] - */ -export declare const useOptimistic: (state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void]; -/** - * This hook returns the current state and a function to update the state by form action - * @param fn - * @param initialState - * @param permalink - * @returns [T, (data: FormData) => void] - */ -export declare const useActionState: (fn: Function, initialState: T, permalink?: string) => [T, Function]; -export {}; diff --git a/node_modules/hono/dist/types/jsx/dom/index.d.ts b/node_modules/hono/dist/types/jsx/dom/index.d.ts deleted file mode 100644 index a3cfe59..0000000 --- a/node_modules/hono/dist/types/jsx/dom/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @module - * This module provides APIs for `hono/jsx/dom`. - */ -import { isValidElement, reactAPICompatVersion } from '../base'; -import type { Child, DOMAttributes, JSX, JSXNode, Props, FC } from '../base'; -import { Children } from '../children'; -import { useContext } from '../context'; -import { createRef, forwardRef, startTransition, startViewTransition, use, useCallback, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition } from '../hooks'; -import { ErrorBoundary, Suspense } from './components'; -import { createContext } from './context'; -import { useActionState, useFormStatus, useOptimistic } from './hooks'; -import { Fragment } from './jsx-runtime'; -import { createPortal, flushSync } from './render'; -export { render } from './render'; -declare const createElement: (tag: string | ((props: Props) => JSXNode), props: Props | null, ...children: Child[]) => JSXNode; -declare const cloneElement: (element: T, props: Props, ...children: Child[]) => T; -declare const memo: (component: FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => FC; -export { reactAPICompatVersion as version, createElement as jsx, useState, useEffect, useRef, useCallback, use, startTransition, useTransition, useDeferredValue, startViewTransition, useViewTransition, useMemo, useLayoutEffect, useInsertionEffect, useReducer, useId, useDebugValue, createRef, forwardRef, useImperativeHandle, useSyncExternalStore, useFormStatus, useActionState, useOptimistic, Suspense, ErrorBoundary, createContext, useContext, memo, isValidElement, createElement, cloneElement, Children, Fragment, Fragment as StrictMode, DOMAttributes, flushSync, createPortal, }; -declare const _default: { - version: string; - useState: { - (initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void]; - (): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void]; - }; - useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; - useRef: (initialValue: T | null) => import("..").RefObject; - useCallback: (callback: T, deps: readonly unknown[]) => T; - use: (promise: Promise) => T; - startTransition: (callback: () => void) => void; - useTransition: () => [boolean, (callback: () => void | Promise) => void]; - useDeferredValue: (value: T, initialValue?: T) => T; - startViewTransition: (callback: () => void) => void; - useViewTransition: () => [boolean, (callback: () => void) => void]; - useMemo: (factory: () => T, deps: readonly unknown[]) => T; - useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; - useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; - useReducer: (reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void]; - useId: () => string; - useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void; - createRef: () => import("..").RefObject; - forwardRef: (Component: (props: P, ref?: import("..").RefObject) => JSX.Element) => ((props: P & { - ref?: import("..").RefObject; - }) => JSX.Element); - useImperativeHandle: (ref: import("..").RefObject, createHandle: () => T, deps: readonly unknown[]) => void; - useSyncExternalStore: (subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T; - useFormStatus: () => { - pending: false; - data: null; - method: null; - action: null; - } | { - pending: true; - data: FormData; - method: "get" | "post"; - action: string | ((formData: FormData) => void | Promise); - }; - useActionState: (fn: Function, initialState: T, permalink?: string) => [T, Function]; - useOptimistic: (state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void]; - Suspense: FC>; - ErrorBoundary: FC>; - createContext: (defaultValue: T) => import("..").Context; - useContext: (context: import("..").Context) => T; - memo: (component: FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => FC; - isValidElement: (element: unknown) => element is JSXNode; - createElement: (tag: string | ((props: Props) => JSXNode), props: Props | null, ...children: Child[]) => JSXNode; - cloneElement: (element: T, props: Props, ...children: Child[]) => T; - Children: { - map: (children: Child[], fn: (child: Child, index: number) => Child) => Child[]; - forEach: (children: Child[], fn: (child: Child, index: number) => void) => void; - count: (children: Child[]) => number; - only: (_children: Child[]) => Child; - toArray: (children: Child) => Child[]; - }; - Fragment: (props: Record) => JSXNode; - StrictMode: (props: Record) => JSXNode; - flushSync: (callback: () => void) => void; - createPortal: (children: Child, container: HTMLElement, key?: string) => Child; -}; -export default _default; -export type { Context } from '../context'; -export type * from '../types'; diff --git a/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts b/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts deleted file mode 100644 index 53f879a..0000000 --- a/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { IntrinsicElements } from '../../intrinsic-elements'; -import type { FC, PropsWithChildren, RefObject } from '../../types'; -export declare const clearCache: () => void; -export declare const composeRef: (ref: RefObject | Function | undefined, cb: (e: T) => void | (() => void)) => ((e: T) => () => void); -export declare const title: FC; -export declare const script: FC>; -export declare const style: FC>; -export declare const link: FC>; -export declare const meta: FC; -export declare const form: FC | ((e: HTMLFormElement | null) => void | (() => void)); -}>>; -export declare const input: FC>; -export declare const button: FC>; diff --git a/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts b/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts deleted file mode 100644 index 2316d31..0000000 --- a/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module - * This module provides the `hono/jsx/dom` dev runtime. - */ -import type { JSXNode, Props } from '../base'; -export type { JSX } from '../base'; -export declare const jsxDEV: (tag: string | Function, props: Props, key?: string) => JSXNode; -export declare const Fragment: (props: Record) => JSXNode; diff --git a/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts b/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts deleted file mode 100644 index 884ccb9..0000000 --- a/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @module - * This module provides the `hono/jsx/dom` runtime. - */ -export { jsxDEV as jsx, Fragment } from './jsx-dev-runtime'; -export { jsxDEV as jsxs } from './jsx-dev-runtime'; -export type { JSX } from './jsx-dev-runtime'; diff --git a/node_modules/hono/dist/types/jsx/dom/render.d.ts b/node_modules/hono/dist/types/jsx/dom/render.d.ts deleted file mode 100644 index 5b12d55..0000000 --- a/node_modules/hono/dist/types/jsx/dom/render.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -import type { Child, FC, JSXNode, Props } from '../base'; -import { DOM_RENDERER, DOM_STASH } from '../constants'; -import type { Context as JSXContext } from '../context'; -export type HasRenderToDom = FC & { - [DOM_RENDERER]: FC; -}; -export type ErrorHandler = (error: any, retry: () => void) => Child | undefined; -type Container = HTMLElement | DocumentFragment; -type LocalJSXContexts = [JSXContext, unknown][] | undefined; -type SupportedElement = HTMLElement | SVGElement | MathMLElement; -export type PreserveNodeType = 1 | 2; -export type NodeObject = { - pP: Props | undefined; - nN: Node | undefined; - vC: Node[]; - pC?: Node[]; - vR: Node[]; - n?: string; - f?: boolean; - s?: boolean; - c: Container | undefined; - e: SupportedElement | Text | undefined; - p?: PreserveNodeType; - a?: boolean; - o?: NodeObject; - [DOM_STASH]: [ - number, - any[][], - LocalJSXContexts, - [ - Context, - Function, - NodeObject - ] - ] | [number, any[][]]; -} & JSXNode; -type NodeString = { - t: string; - d: boolean; - s?: boolean; -} & { - e?: Text; - vC: undefined; - nN: undefined; - p?: true; - key: undefined; - tag: undefined; -}; -export type Node = NodeString | NodeObject; -export type PendingType = 0 | 1 | 2; -export type UpdateHook = (context: Context, node: Node, cb: (context: Context) => void) => Promise; -export type Context = [ - PendingType, - boolean, - UpdateHook, - boolean, - boolean, - [ - Context, - Function, - NodeObject - ][] -] | [PendingType, boolean, UpdateHook, boolean] | [PendingType, boolean, UpdateHook] | [PendingType, boolean] | [PendingType] | []; -export declare const buildDataStack: [Context, Node][]; -export declare const getNameSpaceContext: () => JSXContext | undefined; -export declare const build: (context: Context, node: NodeObject, children?: Child[]) => void; -export declare const buildNode: (node: Child) => Node | undefined; -export declare const update: (context: Context, node: NodeObject) => Promise; -export declare const renderNode: (node: NodeObject, container: Container) => void; -export declare const render: (jsxNode: Child, container: Container) => void; -export declare const flushSync: (callback: () => void) => void; -export declare const createPortal: (children: Child, container: HTMLElement, key?: string) => Child; -export {}; diff --git a/node_modules/hono/dist/types/jsx/dom/server.d.ts b/node_modules/hono/dist/types/jsx/dom/server.d.ts deleted file mode 100644 index 7de82cc..0000000 --- a/node_modules/hono/dist/types/jsx/dom/server.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @module - * This module provides APIs for `hono/jsx/server`, which is compatible with `react-dom/server`. - */ -import type { Child } from '../base'; -import version from './'; -export interface RenderToStringOptions { - identifierPrefix?: string; -} -/** - * Render JSX element to string. - * @param element JSX element to render. - * @param options Options for rendering. - * @returns Rendered string. - */ -declare const renderToString: (element: Child, options?: RenderToStringOptions) => string; -export interface RenderToReadableStreamOptions { - identifierPrefix?: string; - namespaceURI?: string; - nonce?: string; - bootstrapScriptContent?: string; - bootstrapScripts?: string[]; - bootstrapModules?: string[]; - progressiveChunkSize?: number; - signal?: AbortSignal; - onError?: (error: unknown) => string | void; -} -/** - * Render JSX element to readable stream. - * @param element JSX element to render. - * @param options Options for rendering. - * @returns Rendered readable stream. - */ -declare const renderToReadableStream: (element: Child, options?: RenderToReadableStreamOptions) => Promise>; -export { renderToString, renderToReadableStream, version }; -declare const _default: { - renderToString: (element: Child, options?: RenderToStringOptions) => string; - renderToReadableStream: (element: Child, options?: RenderToReadableStreamOptions) => Promise>; - version: { - version: string; - useState: { - (initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void]; - (): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void]; - }; - useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; - useRef: (initialValue: T | null) => import("..").RefObject; - useCallback: (callback: T, deps: readonly unknown[]) => T; - use: (promise: Promise) => T; - startTransition: (callback: () => void) => void; - useTransition: () => [boolean, (callback: () => void | Promise) => void]; - useDeferredValue: (value: T, initialValue?: T) => T; - startViewTransition: (callback: () => void) => void; - useViewTransition: () => [boolean, (callback: () => void) => void]; - useMemo: (factory: () => T, deps: readonly unknown[]) => T; - useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; - useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; - useReducer: (reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void]; - useId: () => string; - useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void; - createRef: () => import("..").RefObject; - forwardRef: (Component: (props: P, ref?: import("..").RefObject) => import("./jsx-dev-runtime").JSX.Element) => ((props: P & { - ref?: import("..").RefObject; - }) => import("./jsx-dev-runtime").JSX.Element); - useImperativeHandle: (ref: import("..").RefObject, createHandle: () => T, deps: readonly unknown[]) => void; - useSyncExternalStore: (subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T; - useFormStatus: () => { - pending: false; - data: null; - method: null; - action: null; - } | { - pending: true; - data: FormData; - method: "get" | "post"; - action: string | ((formData: FormData) => void | Promise); - }; - useActionState: (fn: Function, initialState: T, permalink?: string) => [T, Function]; - useOptimistic: (state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void]; - Suspense: import("..").FC>; - ErrorBoundary: import("..").FC>; - createContext: (defaultValue: T) => import("..").Context; - useContext: (context: import("..").Context) => T; - memo: (component: import("..").FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => import("..").FC; - isValidElement: (element: unknown) => element is import("..").JSXNode; - createElement: (tag: string | ((props: import("../base").Props) => import("..").JSXNode), props: import("../base").Props | null, ...children: Child[]) => import("..").JSXNode; - cloneElement: (element: T, props: import("../base").Props, ...children: Child[]) => T; - Children: { - map: (children: Child[], fn: (child: Child, index: number) => Child) => Child[]; - forEach: (children: Child[], fn: (child: Child, index: number) => void) => void; - count: (children: Child[]) => number; - only: (_children: Child[]) => Child; - toArray: (children: Child) => Child[]; - }; - Fragment: (props: Record) => import("..").JSXNode; - StrictMode: (props: Record) => import("..").JSXNode; - flushSync: (callback: () => void) => void; - createPortal: (children: Child, container: HTMLElement, key?: string) => Child; - }; -}; -export default _default; diff --git a/node_modules/hono/dist/types/jsx/dom/utils.d.ts b/node_modules/hono/dist/types/jsx/dom/utils.d.ts deleted file mode 100644 index b1d29f6..0000000 --- a/node_modules/hono/dist/types/jsx/dom/utils.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const setInternalTagFlag: (fn: Function) => Function; diff --git a/node_modules/hono/dist/types/jsx/hooks/index.d.ts b/node_modules/hono/dist/types/jsx/hooks/index.d.ts deleted file mode 100644 index 929e315..0000000 --- a/node_modules/hono/dist/types/jsx/hooks/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { JSX } from '../base'; -type UpdateStateFunction = (newState: T | ((currentState: T) => T)) => void; -export declare const STASH_EFFECT = 1; -export type EffectData = [ - readonly unknown[] | undefined, - // deps - (() => void | (() => void)) | undefined, - // layout effect - (() => void) | undefined, - // cleanup - (() => void) | undefined, - // effect - (() => void) | undefined -]; -export declare const startViewTransition: (callback: () => void) => void; -export declare const useViewTransition: () => [boolean, (callback: () => void) => void]; -export declare const startTransition: (callback: () => void) => void; -export declare const useTransition: () => [boolean, (callback: () => void | Promise) => void]; -type UseDeferredValue = (value: T, initialValue?: T) => T; -export declare const useDeferredValue: UseDeferredValue; -type UseStateType = { - (initialState: T | (() => T)): [T, UpdateStateFunction]; - (): [T | undefined, UpdateStateFunction]; -}; -export declare const useState: UseStateType; -export declare const useReducer: (reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void]; -export declare const useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; -export declare const useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; -export declare const useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; -export declare const useCallback: (callback: T, deps: readonly unknown[]) => T; -export type RefObject = { - current: T | null; -}; -export declare const useRef: (initialValue: T | null) => RefObject; -export declare const use: (promise: Promise) => T; -export declare const useMemo: (factory: () => T, deps: readonly unknown[]) => T; -export declare const useId: () => string; -export declare const useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void; -export declare const createRef: () => RefObject; -export declare const forwardRef: (Component: (props: P, ref?: RefObject) => JSX.Element) => ((props: P & { - ref?: RefObject; -}) => JSX.Element); -export declare const useImperativeHandle: (ref: RefObject, createHandle: () => T, deps: readonly unknown[]) => void; -export declare const useSyncExternalStore: (subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T; -export {}; diff --git a/node_modules/hono/dist/types/jsx/index.d.ts b/node_modules/hono/dist/types/jsx/index.d.ts deleted file mode 100644 index 63d20b6..0000000 --- a/node_modules/hono/dist/types/jsx/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @module - * JSX for Hono. - */ -import { Fragment, cloneElement, isValidElement, jsx, memo, reactAPICompatVersion } from './base'; -import type { DOMAttributes } from './base'; -import { Children } from './children'; -import { ErrorBoundary } from './components'; -import { createContext, useContext } from './context'; -import { useActionState, useOptimistic } from './dom/hooks'; -import { createRef, forwardRef, startTransition, startViewTransition, use, useCallback, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition } from './hooks'; -import { Suspense } from './streaming'; -export { reactAPICompatVersion as version, jsx, memo, Fragment, Fragment as StrictMode, isValidElement, jsx as createElement, cloneElement, ErrorBoundary, createContext, useContext, useState, useEffect, useRef, useCallback, useReducer, useId, useDebugValue, use, startTransition, useTransition, useDeferredValue, startViewTransition, useViewTransition, useMemo, useLayoutEffect, useInsertionEffect, createRef, forwardRef, useImperativeHandle, useSyncExternalStore, useActionState, useOptimistic, Suspense, Children, DOMAttributes, }; -declare const _default: { - version: string; - memo: (component: import("./base").FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => import("./base").FC; - Fragment: ({ children, }: { - key?: string; - children?: import("./base").Child | import("../utils/html").HtmlEscapedString; - }) => import("../utils/html").HtmlEscapedString; - StrictMode: ({ children, }: { - key?: string; - children?: import("./base").Child | import("../utils/html").HtmlEscapedString; - }) => import("../utils/html").HtmlEscapedString; - isValidElement: (element: unknown) => element is import("./base").JSXNode; - createElement: (tag: string | Function, props: import("./base").Props | null, ...children: (string | number | import("../utils/html").HtmlEscapedString)[]) => import("./base").JSXNode; - cloneElement: (element: T, props: Partial, ...children: import("./base").Child[]) => T; - ErrorBoundary: import("./base").FC>; - createContext: (defaultValue: T) => import("./context").Context; - useContext: (context: import("./context").Context) => T; - useState: { - (initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void]; - (): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void]; - }; - useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; - useRef: (initialValue: T | null) => import("./hooks").RefObject; - useCallback: (callback: T, deps: readonly unknown[]) => T; - useReducer: (reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void]; - useId: () => string; - useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void; - use: (promise: Promise) => T; - startTransition: (callback: () => void) => void; - useTransition: () => [boolean, (callback: () => void | Promise) => void]; - useDeferredValue: (value: T, initialValue?: T) => T; - startViewTransition: (callback: () => void) => void; - useViewTransition: () => [boolean, (callback: () => void) => void]; - useMemo: (factory: () => T, deps: readonly unknown[]) => T; - useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; - useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; - createRef: () => import("./hooks").RefObject; - forwardRef: (Component: (props: P, ref?: import("./hooks").RefObject) => import("./base").JSX.Element) => ((props: P & { - ref?: import("./hooks").RefObject; - }) => import("./base").JSX.Element); - useImperativeHandle: (ref: import("./hooks").RefObject, createHandle: () => T, deps: readonly unknown[]) => void; - useSyncExternalStore: (subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T; - useActionState: (fn: Function, initialState: T, permalink?: string) => [T, Function]; - useOptimistic: (state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void]; - Suspense: import("./base").FC>; - Children: { - map: (children: import("./base").Child[], fn: (child: import("./base").Child, index: number) => import("./base").Child) => import("./base").Child[]; - forEach: (children: import("./base").Child[], fn: (child: import("./base").Child, index: number) => void) => void; - count: (children: import("./base").Child[]) => number; - only: (_children: import("./base").Child[]) => import("./base").Child; - toArray: (children: import("./base").Child) => import("./base").Child[]; - }; -}; -export default _default; -export type * from './types'; -export type { JSX } from './intrinsic-elements'; diff --git a/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts b/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts deleted file mode 100644 index b095aa6..0000000 --- a/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const deDupeKeyMap: Record; -export declare const domRenderers: Record; -export declare const dataPrecedenceAttr = "data-precedence"; diff --git a/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts b/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts deleted file mode 100644 index 77d0849..0000000 --- a/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { IntrinsicElements } from '../intrinsic-elements'; -import type { FC, PropsWithChildren } from '../types'; -export declare const title: FC; -export declare const script: FC>; -export declare const style: FC>; -export declare const link: FC>; -export declare const meta: FC; -export declare const form: FC>; -export declare const input: (props: PropsWithChildren) => unknown; -export declare const button: (props: PropsWithChildren) => unknown; diff --git a/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts b/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts deleted file mode 100644 index f35b34f..0000000 --- a/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts +++ /dev/null @@ -1,722 +0,0 @@ -import type { BaseMime } from '../utils/mime'; -import type { StringLiteralUnion } from '../utils/types'; -/** - * This code is based on React. - * https://github.com/facebook/react - * MIT License - * Copyright (c) Meta Platforms, Inc. and affiliates. - */ -export declare namespace JSX { - export type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined; - export interface CSSProperties { - [propertyKey: string]: unknown; - } - type AnyAttributes = { - [attributeName: string]: any; - }; - interface JSXAttributes { - dangerouslySetInnerHTML?: { - __html: string; - }; - } - interface EventAttributes { - onScroll?: (event: Event) => void; - onScrollCapture?: (event: Event) => void; - onScrollEnd?: (event: Event) => void; - onScrollEndCapture?: (event: Event) => void; - onWheel?: (event: WheelEvent) => void; - onWheelCapture?: (event: WheelEvent) => void; - onAnimationCancel?: (event: AnimationEvent) => void; - onAnimationCancelCapture?: (event: AnimationEvent) => void; - onAnimationEnd?: (event: AnimationEvent) => void; - onAnimationEndCapture?: (event: AnimationEvent) => void; - onAnimationIteration?: (event: AnimationEvent) => void; - onAnimationIterationCapture?: (event: AnimationEvent) => void; - onAnimationStart?: (event: AnimationEvent) => void; - onAnimationStartCapture?: (event: AnimationEvent) => void; - onCopy?: (event: ClipboardEvent) => void; - onCopyCapture?: (event: ClipboardEvent) => void; - onCut?: (event: ClipboardEvent) => void; - onCutCapture?: (event: ClipboardEvent) => void; - onPaste?: (event: ClipboardEvent) => void; - onPasteCapture?: (event: ClipboardEvent) => void; - onCompositionEnd?: (event: CompositionEvent) => void; - onCompositionEndCapture?: (event: CompositionEvent) => void; - onCompositionStart?: (event: CompositionEvent) => void; - onCompositionStartCapture?: (event: CompositionEvent) => void; - onCompositionUpdate?: (event: CompositionEvent) => void; - onCompositionUpdateCapture?: (event: CompositionEvent) => void; - onBlur?: (event: FocusEvent) => void; - onBlurCapture?: (event: FocusEvent) => void; - onFocus?: (event: FocusEvent) => void; - onFocusCapture?: (event: FocusEvent) => void; - onFocusIn?: (event: FocusEvent) => void; - onFocusInCapture?: (event: FocusEvent) => void; - onFocusOut?: (event: FocusEvent) => void; - onFocusOutCapture?: (event: FocusEvent) => void; - onFullscreenChange?: (event: Event) => void; - onFullscreenChangeCapture?: (event: Event) => void; - onFullscreenError?: (event: Event) => void; - onFullscreenErrorCapture?: (event: Event) => void; - onKeyDown?: (event: KeyboardEvent) => void; - onKeyDownCapture?: (event: KeyboardEvent) => void; - onKeyPress?: (event: KeyboardEvent) => void; - onKeyPressCapture?: (event: KeyboardEvent) => void; - onKeyUp?: (event: KeyboardEvent) => void; - onKeyUpCapture?: (event: KeyboardEvent) => void; - onAuxClick?: (event: MouseEvent) => void; - onAuxClickCapture?: (event: MouseEvent) => void; - onClick?: (event: MouseEvent) => void; - onClickCapture?: (event: MouseEvent) => void; - onContextMenu?: (event: MouseEvent) => void; - onContextMenuCapture?: (event: MouseEvent) => void; - onDoubleClick?: (event: MouseEvent) => void; - onDoubleClickCapture?: (event: MouseEvent) => void; - onMouseDown?: (event: MouseEvent) => void; - onMouseDownCapture?: (event: MouseEvent) => void; - onMouseEnter?: (event: MouseEvent) => void; - onMouseEnterCapture?: (event: MouseEvent) => void; - onMouseLeave?: (event: MouseEvent) => void; - onMouseLeaveCapture?: (event: MouseEvent) => void; - onMouseMove?: (event: MouseEvent) => void; - onMouseMoveCapture?: (event: MouseEvent) => void; - onMouseOut?: (event: MouseEvent) => void; - onMouseOutCapture?: (event: MouseEvent) => void; - onMouseOver?: (event: MouseEvent) => void; - onMouseOverCapture?: (event: MouseEvent) => void; - onMouseUp?: (event: MouseEvent) => void; - onMouseUpCapture?: (event: MouseEvent) => void; - onMouseWheel?: (event: WheelEvent) => void; - onMouseWheelCapture?: (event: WheelEvent) => void; - onGotPointerCapture?: (event: PointerEvent) => void; - onGotPointerCaptureCapture?: (event: PointerEvent) => void; - onLostPointerCapture?: (event: PointerEvent) => void; - onLostPointerCaptureCapture?: (event: PointerEvent) => void; - onPointerCancel?: (event: PointerEvent) => void; - onPointerCancelCapture?: (event: PointerEvent) => void; - onPointerDown?: (event: PointerEvent) => void; - onPointerDownCapture?: (event: PointerEvent) => void; - onPointerEnter?: (event: PointerEvent) => void; - onPointerEnterCapture?: (event: PointerEvent) => void; - onPointerLeave?: (event: PointerEvent) => void; - onPointerLeaveCapture?: (event: PointerEvent) => void; - onPointerMove?: (event: PointerEvent) => void; - onPointerMoveCapture?: (event: PointerEvent) => void; - onPointerOut?: (event: PointerEvent) => void; - onPointerOutCapture?: (event: PointerEvent) => void; - onPointerOver?: (event: PointerEvent) => void; - onPointerOverCapture?: (event: PointerEvent) => void; - onPointerUp?: (event: PointerEvent) => void; - onPointerUpCapture?: (event: PointerEvent) => void; - onTouchCancel?: (event: TouchEvent) => void; - onTouchCancelCapture?: (event: TouchEvent) => void; - onTouchEnd?: (event: TouchEvent) => void; - onTouchEndCapture?: (event: TouchEvent) => void; - onTouchMove?: (event: TouchEvent) => void; - onTouchMoveCapture?: (event: TouchEvent) => void; - onTouchStart?: (event: TouchEvent) => void; - onTouchStartCapture?: (event: TouchEvent) => void; - onTransitionCancel?: (event: TransitionEvent) => void; - onTransitionCancelCapture?: (event: TransitionEvent) => void; - onTransitionEnd?: (event: TransitionEvent) => void; - onTransitionEndCapture?: (event: TransitionEvent) => void; - onTransitionRun?: (event: TransitionEvent) => void; - onTransitionRunCapture?: (event: TransitionEvent) => void; - onTransitionStart?: (event: TransitionEvent) => void; - onTransitionStartCapture?: (event: TransitionEvent) => void; - onFormData?: (event: FormDataEvent) => void; - onFormDataCapture?: (event: FormDataEvent) => void; - onReset?: (event: Event) => void; - onResetCapture?: (event: Event) => void; - onSubmit?: (event: Event) => void; - onSubmitCapture?: (event: Event) => void; - onInvalid?: (event: Event) => void; - onInvalidCapture?: (event: Event) => void; - onSelect?: (event: Event) => void; - onSelectCapture?: (event: Event) => void; - onSelectChange?: (event: Event) => void; - onSelectChangeCapture?: (event: Event) => void; - onInput?: (event: InputEvent) => void; - onInputCapture?: (event: InputEvent) => void; - onBeforeInput?: (event: InputEvent) => void; - onBeforeInputCapture?: (event: InputEvent) => void; - onChange?: (event: Event) => void; - onChangeCapture?: (event: Event) => void; - } - export interface HTMLAttributes extends JSXAttributes, EventAttributes, AnyAttributes { - accesskey?: string | undefined; - autocapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters' | undefined; - autofocus?: boolean | undefined; - class?: string | Promise | undefined; - contenteditable?: boolean | 'inherit' | 'plaintext-only' | undefined; - contextmenu?: string | undefined; - dir?: string | undefined; - draggable?: 'true' | 'false' | boolean | undefined; - enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined; - hidden?: boolean | undefined; - id?: string | undefined; - inert?: boolean | undefined; - inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' | undefined; - is?: string | undefined; - itemid?: string | undefined; - itemprop?: string | undefined; - itemref?: string | undefined; - itemscope?: boolean | undefined; - itemtype?: string | undefined; - lang?: string | undefined; - nonce?: string | undefined; - placeholder?: string | undefined; - /** @see https://developer.mozilla.org/en-US/docs/Web/API/Popover_API */ - popover?: boolean | 'auto' | 'manual' | undefined; - slot?: string | undefined; - spellcheck?: boolean | undefined; - style?: CSSProperties | string | undefined; - tabindex?: number | undefined; - title?: string | undefined; - translate?: 'yes' | 'no' | undefined; - itemProp?: string | undefined; - } - type HTMLAttributeReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; - type HTMLAttributeAnchorTarget = StringLiteralUnion<'_self' | '_blank' | '_parent' | '_top'>; - interface AnchorHTMLAttributes extends HTMLAttributes { - download?: string | boolean | undefined; - href?: string | undefined; - hreflang?: string | undefined; - media?: string | undefined; - ping?: string | undefined; - target?: HTMLAttributeAnchorTarget | undefined; - type?: StringLiteralUnion | undefined; - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; - } - interface AudioHTMLAttributes extends MediaHTMLAttributes { - } - interface AreaHTMLAttributes extends HTMLAttributes { - alt?: string | undefined; - coords?: string | undefined; - download?: string | boolean | undefined; - href?: string | undefined; - hreflang?: string | undefined; - media?: string | undefined; - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; - shape?: string | undefined; - target?: HTMLAttributeAnchorTarget | undefined; - } - interface BaseHTMLAttributes extends HTMLAttributes { - href?: string | undefined; - target?: HTMLAttributeAnchorTarget | undefined; - } - interface BlockquoteHTMLAttributes extends HTMLAttributes { - cite?: string | undefined; - } - /** @see https://developer.mozilla.org/en-US/docs/Web/API/Popover_API */ - type HTMLAttributePopoverTargetAction = 'show' | 'hide' | 'toggle'; - interface ButtonHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined; - form?: string | undefined; - formenctype?: HTMLAttributeFormEnctype | undefined; - formmethod?: HTMLAttributeFormMethod | undefined; - formnovalidate?: boolean | undefined; - formtarget?: HTMLAttributeAnchorTarget | undefined; - name?: string | undefined; - type?: 'submit' | 'reset' | 'button' | undefined; - value?: string | ReadonlyArray | number | undefined; - popovertarget?: string | undefined; - popovertargetaction?: HTMLAttributePopoverTargetAction | undefined; - formAction?: string | Function | undefined; - } - interface CanvasHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined; - width?: number | string | undefined; - } - interface ColHTMLAttributes extends HTMLAttributes { - span?: number | undefined; - width?: number | string | undefined; - } - interface ColgroupHTMLAttributes extends HTMLAttributes { - span?: number | undefined; - } - interface DataHTMLAttributes extends HTMLAttributes { - value?: string | ReadonlyArray | number | undefined; - } - interface DetailsHTMLAttributes extends HTMLAttributes { - open?: boolean | undefined; - } - interface DelHTMLAttributes extends HTMLAttributes { - cite?: string | undefined; - dateTime?: string | undefined; - } - interface DialogHTMLAttributes extends HTMLAttributes { - open?: boolean | undefined; - } - interface EmbedHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined; - src?: string | undefined; - type?: StringLiteralUnion | undefined; - width?: number | string | undefined; - } - interface FieldsetHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined; - form?: string | undefined; - name?: string | undefined; - } - /** @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#method */ - type HTMLAttributeFormMethod = 'get' | 'post' | 'dialog'; - /** @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#enctype */ - type HTMLAttributeFormEnctype = 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'; - /** @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#autocomplete */ - type HTMLAttributeFormAutocomplete = 'on' | 'off'; - interface FormHTMLAttributes extends HTMLAttributes { - 'accept-charset'?: StringLiteralUnion<'utf-8'> | undefined; - autocomplete?: HTMLAttributeFormAutocomplete | undefined; - enctype?: HTMLAttributeFormEnctype | undefined; - method?: HTMLAttributeFormMethod | undefined; - name?: string | undefined; - novalidate?: boolean | undefined; - target?: HTMLAttributeAnchorTarget | undefined; - action?: string | Function | undefined; - } - interface HtmlHTMLAttributes extends HTMLAttributes { - manifest?: string | undefined; - } - interface IframeHTMLAttributes extends HTMLAttributes { - allow?: string | undefined; - allowfullscreen?: boolean | undefined; - height?: number | string | undefined; - loading?: 'eager' | 'lazy' | undefined; - name?: string | undefined; - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; - sandbox?: string | undefined; - seamless?: boolean | undefined; - src?: string | undefined; - srcdoc?: string | undefined; - width?: number | string | undefined; - } - interface ImgHTMLAttributes extends HTMLAttributes { - alt?: string | undefined; - crossorigin?: CrossOrigin; - decoding?: 'async' | 'auto' | 'sync' | undefined; - height?: number | string | undefined; - loading?: 'eager' | 'lazy' | undefined; - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; - sizes?: string | undefined; - src?: string | undefined; - srcset?: string | undefined; - usemap?: string | undefined; - width?: number | string | undefined; - } - interface InsHTMLAttributes extends HTMLAttributes { - cite?: string | undefined; - datetime?: string | undefined; - } - type HTMLInputTypeAttribute = StringLiteralUnion<'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week'>; - type AutoFillAddressKind = 'billing' | 'shipping'; - type AutoFillBase = '' | 'off' | 'on'; - type AutoFillContactField = 'email' | 'tel' | 'tel-area-code' | 'tel-country-code' | 'tel-extension' | 'tel-local' | 'tel-local-prefix' | 'tel-local-suffix' | 'tel-national'; - type AutoFillContactKind = 'home' | 'mobile' | 'work'; - type AutoFillCredentialField = 'webauthn'; - type AutoFillNormalField = 'additional-name' | 'address-level1' | 'address-level2' | 'address-level3' | 'address-level4' | 'address-line1' | 'address-line2' | 'address-line3' | 'bday-day' | 'bday-month' | 'bday-year' | 'cc-csc' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-family-name' | 'cc-given-name' | 'cc-name' | 'cc-number' | 'cc-type' | 'country' | 'country-name' | 'current-password' | 'family-name' | 'given-name' | 'honorific-prefix' | 'honorific-suffix' | 'name' | 'new-password' | 'one-time-code' | 'organization' | 'postal-code' | 'street-address' | 'transaction-amount' | 'transaction-currency' | 'username'; - type OptionalPrefixToken = `${T} ` | ''; - type OptionalPostfixToken = ` ${T}` | ''; - type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken}${AutoFillContactField}`; - type AutoFillSection = `section-${string}`; - type AutoFill = AutoFillBase | `${OptionalPrefixToken}${OptionalPrefixToken}${AutoFillField}${OptionalPostfixToken}`; - interface InputHTMLAttributes extends HTMLAttributes { - accept?: string | undefined; - alt?: string | undefined; - autocomplete?: StringLiteralUnion | undefined; - capture?: boolean | 'user' | 'environment' | undefined; - checked?: boolean | undefined; - disabled?: boolean | undefined; - form?: string | undefined; - formenctype?: HTMLAttributeFormEnctype | undefined; - formmethod?: HTMLAttributeFormMethod | undefined; - formnovalidate?: boolean | undefined; - formtarget?: HTMLAttributeAnchorTarget | undefined; - height?: number | string | undefined; - list?: string | undefined; - max?: number | string | undefined; - maxlength?: number | undefined; - min?: number | string | undefined; - minlength?: number | undefined; - multiple?: boolean | undefined; - name?: string | undefined; - pattern?: string | undefined; - placeholder?: string | undefined; - readonly?: boolean | undefined; - required?: boolean | undefined; - size?: number | undefined; - src?: string | undefined; - step?: number | string | undefined; - type?: HTMLInputTypeAttribute | undefined; - value?: string | ReadonlyArray | number | undefined; - width?: number | string | undefined; - popovertarget?: string | undefined; - popovertargetaction?: HTMLAttributePopoverTargetAction | undefined; - formAction?: string | Function | undefined; - } - interface KeygenHTMLAttributes extends HTMLAttributes { - challenge?: string | undefined; - disabled?: boolean | undefined; - form?: string | undefined; - keytype?: string | undefined; - name?: string | undefined; - } - interface LabelHTMLAttributes extends HTMLAttributes { - form?: string | undefined; - for?: string | undefined; - } - interface LiHTMLAttributes extends HTMLAttributes { - value?: string | ReadonlyArray | number | undefined; - } - interface LinkHTMLAttributes extends HTMLAttributes { - as?: string | undefined; - crossorigin?: CrossOrigin; - href?: string | undefined; - hreflang?: string | undefined; - integrity?: string | undefined; - media?: string | undefined; - imagesrcset?: string | undefined; - imagesizes?: string | undefined; - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; - sizes?: string | undefined; - type?: StringLiteralUnion | undefined; - charSet?: string | undefined; - rel?: string | undefined; - precedence?: string | undefined; - title?: string | undefined; - disabled?: boolean | undefined; - onError?: ((event: Event) => void) | undefined; - onLoad?: ((event: Event) => void) | undefined; - blocking?: 'render' | undefined; - } - interface MapHTMLAttributes extends HTMLAttributes { - name?: string | undefined; - } - interface MenuHTMLAttributes extends HTMLAttributes { - type?: string | undefined; - } - interface MediaHTMLAttributes extends HTMLAttributes { - autoplay?: boolean | undefined; - controls?: boolean | undefined; - controlslist?: string | undefined; - crossorigin?: CrossOrigin; - loop?: boolean | undefined; - mediagroup?: string | undefined; - muted?: boolean | undefined; - playsinline?: boolean | undefined; - preload?: string | undefined; - src?: string | undefined; - } - /** - * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#http-equiv - */ - type MetaHttpEquiv = 'content-security-policy' | 'content-type' | 'default-style' | 'x-ua-compatible' | 'refresh'; - /** - * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name - */ - type MetaName = 'application-name' | 'author' | 'description' | 'generator' | 'keywords' | 'referrer' | 'theme-color' | 'color-scheme' | 'viewport' | 'creator' | 'googlebot' | 'publisher' | 'robots'; - /** - * @see https://ogp.me/ - */ - type MetaProperty = 'og:title' | 'og:type' | 'og:image' | 'og:url' | 'og:audio' | 'og:description' | 'og:determiner' | 'og:locale' | 'og:locale:alternate' | 'og:site_name' | 'og:video' | 'og:image:url' | 'og:image:secure_url' | 'og:image:type' | 'og:image:width' | 'og:image:height' | 'og:image:alt'; - interface MetaHTMLAttributes extends HTMLAttributes { - charset?: StringLiteralUnion<'utf-8'> | undefined; - 'http-equiv'?: StringLiteralUnion | undefined; - name?: StringLiteralUnion | undefined; - media?: string | undefined; - content?: string | undefined; - property?: StringLiteralUnion | undefined; - httpEquiv?: StringLiteralUnion | undefined; - } - interface MeterHTMLAttributes extends HTMLAttributes { - form?: string | undefined; - high?: number | undefined; - low?: number | undefined; - max?: number | string | undefined; - min?: number | string | undefined; - optimum?: number | undefined; - value?: string | ReadonlyArray | number | undefined; - } - interface QuoteHTMLAttributes extends HTMLAttributes { - cite?: string | undefined; - } - interface ObjectHTMLAttributes extends HTMLAttributes { - data?: string | undefined; - form?: string | undefined; - height?: number | string | undefined; - name?: string | undefined; - type?: StringLiteralUnion | undefined; - usemap?: string | undefined; - width?: number | string | undefined; - } - interface OlHTMLAttributes extends HTMLAttributes { - reversed?: boolean | undefined; - start?: number | undefined; - type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined; - } - interface OptgroupHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined; - label?: string | undefined; - } - interface OptionHTMLAttributes extends HTMLAttributes { - disabled?: boolean | undefined; - label?: string | undefined; - selected?: boolean | undefined; - value?: string | ReadonlyArray | number | undefined; - } - interface OutputHTMLAttributes extends HTMLAttributes { - form?: string | undefined; - for?: string | undefined; - name?: string | undefined; - } - interface ParamHTMLAttributes extends HTMLAttributes { - name?: string | undefined; - value?: string | ReadonlyArray | number | undefined; - } - interface ProgressHTMLAttributes extends HTMLAttributes { - max?: number | string | undefined; - value?: string | ReadonlyArray | number | undefined; - } - interface SlotHTMLAttributes extends HTMLAttributes { - name?: string | undefined; - } - interface ScriptHTMLAttributes extends HTMLAttributes { - async?: boolean | undefined; - crossorigin?: CrossOrigin; - defer?: boolean | undefined; - integrity?: string | undefined; - nomodule?: boolean | undefined; - referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; - src?: string | undefined; - /** - * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type - */ - type?: StringLiteralUnion<'' | 'text/javascript' | 'importmap' | 'module'> | undefined; - crossOrigin?: CrossOrigin; - fetchPriority?: string | undefined; - noModule?: boolean | undefined; - referrer?: HTMLAttributeReferrerPolicy | undefined; - onError?: ((event: Event) => void) | undefined; - onLoad?: ((event: Event) => void) | undefined; - blocking?: 'render' | undefined; - } - interface SelectHTMLAttributes extends HTMLAttributes { - autocomplete?: string | undefined; - disabled?: boolean | undefined; - form?: string | undefined; - multiple?: boolean | undefined; - name?: string | undefined; - required?: boolean | undefined; - size?: number | undefined; - value?: string | ReadonlyArray | number | undefined; - } - type MediaMime = BaseMime & (`image/${string}` | `audio/${string}` | `video/${string}`); - interface SourceHTMLAttributes extends HTMLAttributes { - height?: number | string | undefined; - media?: string | undefined; - sizes?: string | undefined; - src?: string | undefined; - srcset?: string | undefined; - type?: StringLiteralUnion | undefined; - width?: number | string | undefined; - } - interface StyleHTMLAttributes extends HTMLAttributes { - media?: string | undefined; - scoped?: boolean | undefined; - /** - * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style#type - */ - type?: '' | 'text/css' | undefined; - href?: string | undefined; - precedence?: string | undefined; - title?: string | undefined; - disabled?: boolean | undefined; - blocking?: 'render' | undefined; - } - interface TableHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | undefined; - bgcolor?: string | undefined; - border?: number | undefined; - cellpadding?: number | string | undefined; - cellspacing?: number | string | undefined; - frame?: boolean | undefined; - rules?: 'none' | 'groups' | 'rows' | 'columns' | 'all' | undefined; - summary?: string | undefined; - width?: number | string | undefined; - } - interface TextareaHTMLAttributes extends HTMLAttributes { - autocomplete?: string | undefined; - cols?: number | undefined; - dirname?: string | undefined; - disabled?: boolean | undefined; - form?: string | undefined; - maxlength?: number | undefined; - minlength?: number | undefined; - name?: string | undefined; - placeholder?: string | undefined; - readonly?: boolean | undefined; - required?: boolean | undefined; - rows?: number | undefined; - value?: string | ReadonlyArray | number | undefined; - wrap?: string | undefined; - } - interface TdHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; - colspan?: number | undefined; - headers?: string | undefined; - rowspan?: number | undefined; - scope?: string | undefined; - abbr?: string | undefined; - height?: number | string | undefined; - width?: number | string | undefined; - valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined; - } - interface ThHTMLAttributes extends HTMLAttributes { - align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; - colspan?: number | undefined; - headers?: string | undefined; - rowspan?: number | undefined; - scope?: 'row' | 'col' | 'rowgroup' | 'colgroup' | string | undefined; - abbr?: string | undefined; - } - interface TimeHTMLAttributes extends HTMLAttributes { - datetime?: string | undefined; - } - interface TrackHTMLAttributes extends HTMLAttributes { - default?: boolean | undefined; - kind?: string | undefined; - label?: string | undefined; - src?: string | undefined; - srclang?: string | undefined; - } - interface VideoHTMLAttributes extends MediaHTMLAttributes { - height?: number | string | undefined; - playsinline?: boolean | undefined; - poster?: string | undefined; - width?: number | string | undefined; - disablePictureInPicture?: boolean | undefined; - disableRemotePlayback?: boolean | undefined; - } - export interface IntrinsicElements { - a: AnchorHTMLAttributes; - abbr: HTMLAttributes; - address: HTMLAttributes; - area: AreaHTMLAttributes; - article: HTMLAttributes; - aside: HTMLAttributes; - audio: AudioHTMLAttributes; - b: HTMLAttributes; - base: BaseHTMLAttributes; - bdi: HTMLAttributes; - bdo: HTMLAttributes; - big: HTMLAttributes; - blockquote: BlockquoteHTMLAttributes; - body: HTMLAttributes; - br: HTMLAttributes; - button: ButtonHTMLAttributes; - canvas: CanvasHTMLAttributes; - caption: HTMLAttributes; - center: HTMLAttributes; - cite: HTMLAttributes; - code: HTMLAttributes; - col: ColHTMLAttributes; - colgroup: ColgroupHTMLAttributes; - data: DataHTMLAttributes; - datalist: HTMLAttributes; - dd: HTMLAttributes; - del: DelHTMLAttributes; - details: DetailsHTMLAttributes; - dfn: HTMLAttributes; - dialog: DialogHTMLAttributes; - div: HTMLAttributes; - dl: HTMLAttributes; - dt: HTMLAttributes; - em: HTMLAttributes; - embed: EmbedHTMLAttributes; - fieldset: FieldsetHTMLAttributes; - figcaption: HTMLAttributes; - figure: HTMLAttributes; - footer: HTMLAttributes; - form: FormHTMLAttributes; - h1: HTMLAttributes; - h2: HTMLAttributes; - h3: HTMLAttributes; - h4: HTMLAttributes; - h5: HTMLAttributes; - h6: HTMLAttributes; - head: HTMLAttributes; - header: HTMLAttributes; - hgroup: HTMLAttributes; - hr: HTMLAttributes; - html: HtmlHTMLAttributes; - i: HTMLAttributes; - iframe: IframeHTMLAttributes; - img: ImgHTMLAttributes; - input: InputHTMLAttributes; - ins: InsHTMLAttributes; - kbd: HTMLAttributes; - keygen: KeygenHTMLAttributes; - label: LabelHTMLAttributes; - legend: HTMLAttributes; - li: LiHTMLAttributes; - link: LinkHTMLAttributes; - main: HTMLAttributes; - map: MapHTMLAttributes; - mark: HTMLAttributes; - menu: MenuHTMLAttributes; - menuitem: HTMLAttributes; - meta: MetaHTMLAttributes; - meter: MeterHTMLAttributes; - nav: HTMLAttributes; - noscript: HTMLAttributes; - object: ObjectHTMLAttributes; - ol: OlHTMLAttributes; - optgroup: OptgroupHTMLAttributes; - option: OptionHTMLAttributes; - output: OutputHTMLAttributes; - p: HTMLAttributes; - param: ParamHTMLAttributes; - picture: HTMLAttributes; - pre: HTMLAttributes; - progress: ProgressHTMLAttributes; - q: QuoteHTMLAttributes; - rp: HTMLAttributes; - rt: HTMLAttributes; - ruby: HTMLAttributes; - s: HTMLAttributes; - samp: HTMLAttributes; - search: HTMLAttributes; - slot: SlotHTMLAttributes; - script: ScriptHTMLAttributes; - section: HTMLAttributes; - select: SelectHTMLAttributes; - small: HTMLAttributes; - source: SourceHTMLAttributes; - span: HTMLAttributes; - strong: HTMLAttributes; - style: StyleHTMLAttributes; - sub: HTMLAttributes; - summary: HTMLAttributes; - sup: HTMLAttributes; - table: TableHTMLAttributes; - template: HTMLAttributes; - tbody: HTMLAttributes; - td: TdHTMLAttributes; - textarea: TextareaHTMLAttributes; - tfoot: HTMLAttributes; - th: ThHTMLAttributes; - thead: HTMLAttributes; - time: TimeHTMLAttributes; - title: HTMLAttributes; - tr: HTMLAttributes; - track: TrackHTMLAttributes; - u: HTMLAttributes; - ul: HTMLAttributes; - var: HTMLAttributes; - video: VideoHTMLAttributes; - wbr: HTMLAttributes; - } - export {}; -} -export interface IntrinsicElements extends JSX.IntrinsicElements { -} diff --git a/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts b/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts deleted file mode 100644 index aa11518..0000000 --- a/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module - * This module provides Hono's JSX dev runtime. - */ -import type { JSXNode } from './base'; -export { Fragment } from './base'; -export type { JSX } from './base'; -export declare function jsxDEV(tag: string | Function, props: Record, key?: string): JSXNode; diff --git a/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts b/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts deleted file mode 100644 index 41ab669..0000000 --- a/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @module - * This module provides Hono's JSX runtime. - */ -export { jsxDEV as jsx, Fragment } from './jsx-dev-runtime'; -export { jsxDEV as jsxs } from './jsx-dev-runtime'; -export type { JSX } from './jsx-dev-runtime'; -import { html } from '../helper/html'; -import type { HtmlEscapedString } from '../utils/html'; -export { html as jsxTemplate }; -export declare const jsxAttr: (key: string, v: string | Promise | Record) => HtmlEscapedString | Promise; -export declare const jsxEscape: (value: string) => string; diff --git a/node_modules/hono/dist/types/jsx/streaming.d.ts b/node_modules/hono/dist/types/jsx/streaming.d.ts deleted file mode 100644 index 6c85bae..0000000 --- a/node_modules/hono/dist/types/jsx/streaming.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @module - * This module enables JSX to supports streaming Response. - */ -import type { HtmlEscapedString } from '../utils/html'; -import { JSXNode } from './base'; -import type { FC, PropsWithChildren, Context as JSXContext } from './'; -/** - * Used to specify nonce for scripts generated by `Suspense` and `ErrorBoundary`. - * - * @example - * ```tsx - * - * Loading...

}> - * - * - * - * ``` - */ -export declare const StreamingContext: JSXContext<{ - scriptNonce: string; -} | null>; -/** - * @experimental - * `Suspense` is an experimental feature. - * The API might be changed. - */ -export declare const Suspense: FC>; -/** - * @experimental - * `renderToReadableStream()` is an experimental feature. - * The API might be changed. - */ -export declare const renderToReadableStream: (content: HtmlEscapedString | JSXNode | Promise, onError?: (e: unknown) => string | void) => ReadableStream; diff --git a/node_modules/hono/dist/types/jsx/types.d.ts b/node_modules/hono/dist/types/jsx/types.d.ts deleted file mode 100644 index 2251ba7..0000000 --- a/node_modules/hono/dist/types/jsx/types.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * All types exported from "hono/jsx" are in this file. - */ -import type { Child, JSXNode } from './base'; -import type { JSX } from './intrinsic-elements'; -export type { Child, JSXNode, FC } from './base'; -export type { RefObject } from './hooks'; -export type { Context } from './context'; -export type PropsWithChildren

= P & { - children?: Child | undefined; -}; -export type CSSProperties = JSX.CSSProperties; -/** - * React types - */ -type ReactElement

= JSXNode & { - type: T; - props: P; - key: string | null; -}; -type ReactNode = ReactElement | string | number | boolean | null | undefined; -type ComponentClass

= unknown; -export type { ReactElement, ReactNode, ComponentClass }; -export type Event = globalThis.Event; -export type MouseEvent = globalThis.MouseEvent; -export type KeyboardEvent = globalThis.KeyboardEvent; -export type FocusEvent = globalThis.FocusEvent; -export type ClipboardEvent = globalThis.ClipboardEvent; -export type InputEvent = globalThis.InputEvent; -export type PointerEvent = globalThis.PointerEvent; -export type TouchEvent = globalThis.TouchEvent; -export type WheelEvent = globalThis.WheelEvent; -export type AnimationEvent = globalThis.AnimationEvent; -export type TransitionEvent = globalThis.TransitionEvent; -export type DragEvent = globalThis.DragEvent; diff --git a/node_modules/hono/dist/types/jsx/utils.d.ts b/node_modules/hono/dist/types/jsx/utils.d.ts deleted file mode 100644 index 8dd469a..0000000 --- a/node_modules/hono/dist/types/jsx/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const normalizeIntrinsicElementKey: (key: string) => string; -export declare const styleObjectForEach: (style: Record, fn: (key: string, value: string | null) => void) => void; diff --git a/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts b/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts deleted file mode 100644 index 80cb793..0000000 --- a/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @module - * Basic Auth Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -type MessageFunction = (c: Context) => string | object | Promise; -type BasicAuthOptions = { - username: string; - password: string; - realm?: string; - hashFunction?: Function; - invalidUserMessage?: string | object | MessageFunction; -} | { - verifyUser: (username: string, password: string, c: Context) => boolean | Promise; - realm?: string; - hashFunction?: Function; - invalidUserMessage?: string | object | MessageFunction; -}; -/** - * Basic Auth Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/basic-auth} - * - * @param {BasicAuthOptions} options - The options for the basic authentication middleware. - * @param {string} options.username - The username for authentication. - * @param {string} options.password - The password for authentication. - * @param {string} [options.realm="Secure Area"] - The realm attribute for the WWW-Authenticate header. - * @param {Function} [options.hashFunction] - The hash function used for secure comparison. - * @param {Function} [options.verifyUser] - The function to verify user credentials. - * @param {string | object | MessageFunction} [options.invalidUserMessage="Unauthorized"] - The invalid user message. - * @returns {MiddlewareHandler} The middleware handler function. - * @throws {HTTPException} If neither "username and password" nor "verifyUser" options are provided. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use( - * '/auth/*', - * basicAuth({ - * username: 'hono', - * password: 'ahotproject', - * }) - * ) - * - * app.get('/auth/page', (c) => { - * return c.text('You are authorized') - * }) - * ``` - */ -export declare const basicAuth: (options: BasicAuthOptions, ...users: { - username: string; - password: string; -}[]) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts b/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts deleted file mode 100644 index 6164585..0000000 --- a/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @module - * Bearer Auth Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -type MessageFunction = (c: Context) => string | object | Promise; -type CustomizedErrorResponseOptions = { - wwwAuthenticateHeader?: string | object | MessageFunction; - message?: string | object | MessageFunction; -}; -type BearerAuthOptions = { - token: string | string[]; - realm?: string; - prefix?: string; - headerName?: string; - hashFunction?: Function; - /** - * @deprecated Use noAuthenticationHeader.message instead - */ - noAuthenticationHeaderMessage?: string | object | MessageFunction; - noAuthenticationHeader?: CustomizedErrorResponseOptions; - /** - * @deprecated Use invalidAuthenticationHeader.message instead - */ - invalidAuthenticationHeaderMessage?: string | object | MessageFunction; - invalidAuthenticationHeader?: CustomizedErrorResponseOptions; - /** - * @deprecated Use invalidToken.message instead - */ - invalidTokenMessage?: string | object | MessageFunction; - invalidToken?: CustomizedErrorResponseOptions; -} | { - realm?: string; - prefix?: string; - headerName?: string; - verifyToken: (token: string, c: Context) => boolean | Promise; - hashFunction?: Function; - /** - * @deprecated Use noAuthenticationHeader.message instead - */ - noAuthenticationHeaderMessage?: string | object | MessageFunction; - noAuthenticationHeader?: CustomizedErrorResponseOptions; - /** - * @deprecated Use invalidAuthenticationHeader.message instead - */ - invalidAuthenticationHeaderMessage?: string | object | MessageFunction; - invalidAuthenticationHeader?: CustomizedErrorResponseOptions; - /** - * @deprecated Use invalidToken.message instead - */ - invalidTokenMessage?: string | object | MessageFunction; - invalidToken?: CustomizedErrorResponseOptions; -}; -/** - * Bearer Auth Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/bearer-auth} - * - * @param {BearerAuthOptions} options - The options for the bearer authentication middleware. - * @param {string | string[]} [options.token] - The string or array of strings to validate the incoming bearer token against. - * @param {Function} [options.verifyToken] - The function to verify the token. - * @param {string} [options.realm=""] - The domain name of the realm, as part of the returned WWW-Authenticate challenge header. - * @param {string} [options.prefix="Bearer"] - The prefix (or known as `schema`) for the Authorization header value. If set to the empty string, no prefix is expected. - * @param {string} [options.headerName=Authorization] - The header name. - * @param {Function} [options.hashFunction] - A function to handle hashing for safe comparison of authentication tokens. - * @param {string | object | MessageFunction} [options.noAuthenticationHeader.message="Unauthorized"] - The no authentication header message. - * @param {string | object | MessageFunction} [options.noAuthenticationHeader.wwwAuthenticateHeader="Bearer realm=\"\""] - The response header value for the WWW-Authenticate header when no authentication header is provided. - * @param {string | object | MessageFunction} [options.invalidAuthenticationHeader.message="Bad Request"] - The invalid authentication header message. - * @param {string | object | MessageFunction} [options.invalidAuthenticationHeader.wwwAuthenticateHeader="Bearer error=\"invalid_request\""] - The response header value for the WWW-Authenticate header when authentication header is invalid. - * @param {string | object | MessageFunction} [options.invalidToken.message="Unauthorized"] - The invalid token message. - * @param {string | object | MessageFunction} [options.invalidToken.wwwAuthenticateHeader="Bearer error=\"invalid_token\""] - The response header value for the WWW-Authenticate header when token is invalid. - * @returns {MiddlewareHandler} The middleware handler function. - * @throws {Error} If neither "token" nor "verifyToken" options are provided. - * @throws {HTTPException} If authentication fails, with 401 status code for missing or invalid token, or 400 status code for invalid request. - * - * @example - * ```ts - * const app = new Hono() - * - * const token = 'honoishot' - * - * app.use('/api/*', bearerAuth({ token })) - * - * app.get('/api/page', (c) => { - * return c.json({ message: 'You are authorized' }) - * }) - * ``` - */ -export declare const bearerAuth: (options: BearerAuthOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/body-limit/index.d.ts b/node_modules/hono/dist/types/middleware/body-limit/index.d.ts deleted file mode 100644 index 754e9ec..0000000 --- a/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @module - * Body Limit Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -type OnError = (c: Context) => Response | Promise; -type BodyLimitOptions = { - maxSize: number; - onError?: OnError; -}; -/** - * Body Limit Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/body-limit} - * - * @param {BodyLimitOptions} options - The options for the body limit middleware. - * @param {number} options.maxSize - The maximum body size allowed. - * @param {OnError} [options.onError] - The error handler to be invoked if the specified body size is exceeded. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.post( - * '/upload', - * bodyLimit({ - * maxSize: 50 * 1024, // 50kb - * onError: (c) => { - * return c.text('overflow :(', 413) - * }, - * }), - * async (c) => { - * const body = await c.req.parseBody() - * if (body['file'] instanceof File) { - * console.log(`Got file sized: ${body['file'].size}`) - * } - * return c.text('pass :)') - * } - * ) - * ``` - */ -export declare const bodyLimit: (options: BodyLimitOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/cache/index.d.ts b/node_modules/hono/dist/types/middleware/cache/index.d.ts deleted file mode 100644 index 5d03727..0000000 --- a/node_modules/hono/dist/types/middleware/cache/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @module - * Cache Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -import type { StatusCode } from '../../utils/http-status'; -/** - * Cache Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/cache} - * - * @param {Object} options - The options for the cache middleware. - * @param {string | Function} options.cacheName - The name of the cache. Can be used to store multiple caches with different identifiers. - * @param {boolean} [options.wait=false] - A boolean indicating if Hono should wait for the Promise of the `cache.put` function to resolve before continuing with the request. Required to be true for the Deno environment. - * @param {string} [options.cacheControl] - A string of directives for the `Cache-Control` header. - * @param {string | string[]} [options.vary] - Sets the `Vary` header in the response. If the original response header already contains a `Vary` header, the values are merged, removing any duplicates. - * @param {Function} [options.keyGenerator] - Generates keys for every request in the `cacheName` store. This can be used to cache data based on request parameters or context parameters. - * @param {number[]} [options.cacheableStatusCodes=[200]] - An array of status codes that can be cached. - * @returns {MiddlewareHandler} The middleware handler function. - * @throws {Error} If the `vary` option includes "*". - * - * @example - * ```ts - * app.get( - * '*', - * cache({ - * cacheName: 'my-app', - * cacheControl: 'max-age=3600', - * }) - * ) - * ``` - */ -export declare const cache: (options: { - cacheName: string | ((c: Context) => Promise | string); - wait?: boolean; - cacheControl?: string; - vary?: string | string[]; - keyGenerator?: (c: Context) => Promise | string; - cacheableStatusCodes?: StatusCode[]; -}) => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/middleware/combine/index.d.ts b/node_modules/hono/dist/types/middleware/combine/index.d.ts deleted file mode 100644 index 57e53dc..0000000 --- a/node_modules/hono/dist/types/middleware/combine/index.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @module - * Combine Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -type Condition = (c: Context) => boolean; -/** - * Create a composed middleware that runs the first middleware that returns true. - * - * @param middleware - An array of MiddlewareHandler or Condition functions. - * Middleware is applied in the order it is passed, and if any middleware exits without returning - * an exception first, subsequent middleware will not be executed. - * You can also pass a condition function that returns a boolean value. If returns true - * the evaluation will be halted, and rest of the middleware will not be executed. - * @returns A composed middleware. - * - * @example - * ```ts - * import { some } from 'hono/combine' - * import { bearerAuth } from 'hono/bearer-auth' - * import { myRateLimit } from '@/rate-limit' - * - * // If client has a valid token, then skip rate limiting. - * // Otherwise, apply rate limiting. - * app.use('/api/*', some( - * bearerAuth({ token }), - * myRateLimit({ limit: 100 }), - * )); - * ``` - */ -export declare const some: (...middleware: (MiddlewareHandler | Condition)[]) => MiddlewareHandler; -/** - * Create a composed middleware that runs all middleware and throws an error if any of them fail. - * - * @param middleware - An array of MiddlewareHandler or Condition functions. - * Middleware is applied in the order it is passed, and if any middleware throws an error, - * subsequent middleware will not be executed. - * You can also pass a condition function that returns a boolean value. If returns false - * the evaluation will be halted, and rest of the middleware will not be executed. - * @returns A composed middleware. - * - * @example - * ```ts - * import { some, every } from 'hono/combine' - * import { bearerAuth } from 'hono/bearer-auth' - * import { myCheckLocalNetwork } from '@/check-local-network' - * import { myRateLimit } from '@/rate-limit' - * - * // If client is in local network, then skip authentication and rate limiting. - * // Otherwise, apply authentication and rate limiting. - * app.use('/api/*', some( - * myCheckLocalNetwork(), - * every( - * bearerAuth({ token }), - * myRateLimit({ limit: 100 }), - * ), - * )); - * ``` - */ -export declare const every: (...middleware: (MiddlewareHandler | Condition)[]) => MiddlewareHandler; -/** - * Create a composed middleware that runs all middleware except when the condition is met. - * - * @param condition - A string or Condition function. - * If there are multiple targets to match any of them, they can be passed as an array. - * If a string is passed, it will be treated as a path pattern to match. - * If a Condition function is passed, it will be evaluated against the request context. - * @param middleware - A composed middleware - * - * @example - * ```ts - * import { except } from 'hono/combine' - * import { bearerAuth } from 'hono/bearer-auth - * - * // If client is accessing public API, then skip authentication. - * // Otherwise, require a valid token. - * app.use('/api/*', except( - * '/api/public/*', - * bearerAuth({ token }), - * )); - * ``` - */ -export declare const except: (condition: string | Condition | (string | Condition)[], ...middleware: MiddlewareHandler[]) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/compress/index.d.ts b/node_modules/hono/dist/types/middleware/compress/index.d.ts deleted file mode 100644 index aa8f937..0000000 --- a/node_modules/hono/dist/types/middleware/compress/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @module - * Compress Middleware for Hono. - */ -import type { MiddlewareHandler } from '../../types'; -declare const ENCODING_TYPES: readonly ["gzip", "deflate"]; -interface CompressionOptions { - encoding?: (typeof ENCODING_TYPES)[number]; - threshold?: number; -} -/** - * Compress Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/compress} - * - * @param {CompressionOptions} [options] - The options for the compress middleware. - * @param {'gzip' | 'deflate'} [options.encoding] - The compression scheme to allow for response compression. Either 'gzip' or 'deflate'. If not defined, both are allowed and will be used based on the Accept-Encoding header. 'gzip' is prioritized if this option is not provided and the client provides both in the Accept-Encoding header. - * @param {number} [options.threshold=1024] - The minimum size in bytes to compress. Defaults to 1024 bytes. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use(compress()) - * ``` - */ -export declare const compress: (options?: CompressionOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/context-storage/index.d.ts b/node_modules/hono/dist/types/middleware/context-storage/index.d.ts deleted file mode 100644 index 6e6301b..0000000 --- a/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @module - * Context Storage Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { Env, MiddlewareHandler } from '../../types'; -/** - * Context Storage Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/context-storage} - * - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * type Env = { - * Variables: { - * message: string - * } - * } - * - * const app = new Hono() - * - * app.use(contextStorage()) - * - * app.use(async (c, next) => { - * c.set('message', 'Hono is hot!!) - * await next() - * }) - * - * app.get('/', async (c) => { c.text(getMessage()) }) - * - * const getMessage = () => { - * return getContext().var.message - * } - * ``` - */ -export declare const contextStorage: () => MiddlewareHandler; -export declare const tryGetContext: () => Context | undefined; -export declare const getContext: () => Context; diff --git a/node_modules/hono/dist/types/middleware/cors/index.d.ts b/node_modules/hono/dist/types/middleware/cors/index.d.ts deleted file mode 100644 index c23fb3e..0000000 --- a/node_modules/hono/dist/types/middleware/cors/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @module - * CORS Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -type CORSOptions = { - origin: string | string[] | ((origin: string, c: Context) => Promise | string | undefined | null); - allowMethods?: string[] | ((origin: string, c: Context) => Promise | string[]); - allowHeaders?: string[]; - maxAge?: number; - credentials?: boolean; - exposeHeaders?: string[]; -}; -/** - * CORS Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/cors} - * - * @param {CORSOptions} [options] - The options for the CORS middleware. - * @param {string | string[] | ((origin: string, c: Context) => Promise | string | undefined | null)} [options.origin='*'] - The value of "Access-Control-Allow-Origin" CORS header. - * @param {string[] | ((origin: string, c: Context) => Promise | string[])} [options.allowMethods=['GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'PATCH']] - The value of "Access-Control-Allow-Methods" CORS header. - * @param {string[]} [options.allowHeaders=[]] - The value of "Access-Control-Allow-Headers" CORS header. - * @param {number} [options.maxAge] - The value of "Access-Control-Max-Age" CORS header. - * @param {boolean} [options.credentials] - The value of "Access-Control-Allow-Credentials" CORS header. - * @param {string[]} [options.exposeHeaders=[]] - The value of "Access-Control-Expose-Headers" CORS header. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use('/api/*', cors()) - * app.use( - * '/api2/*', - * cors({ - * origin: 'http://example.com', - * allowHeaders: ['X-Custom-Header', 'Upgrade-Insecure-Requests'], - * allowMethods: ['POST', 'GET', 'OPTIONS'], - * exposeHeaders: ['Content-Length', 'X-Kuma-Revision'], - * maxAge: 600, - * credentials: true, - * }) - * ) - * - * app.all('/api/abc', (c) => { - * return c.json({ success: true }) - * }) - * app.all('/api2/abc', (c) => { - * return c.json({ success: true }) - * }) - * ``` - */ -export declare const cors: (options?: CORSOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/csrf/index.d.ts b/node_modules/hono/dist/types/middleware/csrf/index.d.ts deleted file mode 100644 index fc47854..0000000 --- a/node_modules/hono/dist/types/middleware/csrf/index.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @module - * CSRF Protection Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -type IsAllowedOriginHandler = (origin: string, context: Context) => boolean | Promise; -declare const secFetchSiteValues: readonly ["same-origin", "same-site", "none", "cross-site"]; -type SecFetchSite = (typeof secFetchSiteValues)[number]; -type IsAllowedSecFetchSiteHandler = (secFetchSite: SecFetchSite, context: Context) => boolean | Promise; -interface CSRFOptions { - origin?: string | string[] | IsAllowedOriginHandler; - secFetchSite?: SecFetchSite | SecFetchSite[] | IsAllowedSecFetchSiteHandler; -} -/** - * CSRF Protection Middleware for Hono. - * - * Protects against Cross-Site Request Forgery attacks by validating request origins - * and sec-fetch-site headers. The request is allowed if either validation passes. - * - * @see {@link https://hono.dev/docs/middleware/builtin/csrf} - * - * @param {CSRFOptions} [options] - The options for the CSRF protection middleware. - * @param {string|string[]|(origin: string, context: Context) => boolean} [options.origin] - - * Allowed origins for requests. - * - string: Single allowed origin (e.g., 'https://example.com') - * - string[]: Multiple allowed origins - * - function: Custom validation logic - * - Default: Only same origin as the request URL - * @param {string|string[]|(secFetchSite: string, context: Context) => boolean} [options.secFetchSite] - - * Sec-Fetch-Site header validation. Standard values include 'same-origin', 'same-site', 'cross-site', 'none'. - * - string: Single allowed value (e.g., 'same-origin') - * - string[]: Multiple allowed values (e.g., ['same-origin', 'same-site']) - * - function: Custom validation with access to context - * - Default: Only allows 'same-origin' - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * // Default: both origin and sec-fetch-site validation - * app.use('*', csrf()) - * - * // Allow specific origins - * app.use('*', csrf({ origin: 'https://example.com' })) - * app.use('*', csrf({ origin: ['https://app.com', 'https://api.com'] })) - * - * // Allow specific sec-fetch-site values - * app.use('*', csrf({ secFetchSite: 'same-origin' })) - * app.use('*', csrf({ secFetchSite: ['same-origin', 'same-site'] })) - * - * // Dynamic sec-fetch-site validation - * app.use('*', csrf({ - * secFetchSite: (secFetchSite, c) => { - * // Always allow same-origin - * if (secFetchSite === 'same-origin') return true - * // Allow cross-site for webhook endpoints - * if (secFetchSite === 'cross-site' && c.req.path.startsWith('/webhook/')) { - * return true - * } - * return false - * } - * })) - * - * // Dynamic origin validation - * app.use('*', csrf({ - * origin: (origin, c) => { - * // Allow same origin - * if (origin === new URL(c.req.url).origin) return true - * // Allow specific trusted domains - * return ['https://app.example.com', 'https://admin.example.com'].includes(origin) - * } - * })) - * ``` - */ -export declare const csrf: (options?: CSRFOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/etag/digest.d.ts b/node_modules/hono/dist/types/middleware/etag/digest.d.ts deleted file mode 100644 index dcc773a..0000000 --- a/node_modules/hono/dist/types/middleware/etag/digest.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const generateDigest: (stream: ReadableStream> | null, generator: (body: Uint8Array) => ArrayBuffer | Promise) => Promise; diff --git a/node_modules/hono/dist/types/middleware/etag/index.d.ts b/node_modules/hono/dist/types/middleware/etag/index.d.ts deleted file mode 100644 index 415d028..0000000 --- a/node_modules/hono/dist/types/middleware/etag/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @module - * ETag Middleware for Hono. - */ -import type { MiddlewareHandler } from '../../types'; -type ETagOptions = { - retainedHeaders?: string[]; - weak?: boolean; - generateDigest?: (body: Uint8Array) => ArrayBuffer | Promise; -}; -/** - * Default headers to pass through on 304 responses. From the spec: - * > The response must not contain a body and must include the headers that - * > would have been sent in an equivalent 200 OK response: Cache-Control, - * > Content-Location, Date, ETag, Expires, and Vary. - */ -export declare const RETAINED_304_HEADERS: string[]; -/** - * ETag Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/etag} - * - * @param {ETagOptions} [options] - The options for the ETag middleware. - * @param {boolean} [options.weak=false] - Define using or not using a weak validation. If true is set, then `W/` is added to the prefix of the value. - * @param {string[]} [options.retainedHeaders=RETAINED_304_HEADERS] - The headers that you want to retain in the 304 Response. - * @param {function(Uint8Array): ArrayBuffer | Promise} [options.generateDigest] - - * A custom digest generation function. By default, it uses 'SHA-1' - * This function is called with the response body as a `Uint8Array` and should return a hash as an `ArrayBuffer` or a Promise of one. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use('/etag/*', etag()) - * app.get('/etag/abc', (c) => { - * return c.text('Hono is hot') - * }) - * ``` - */ -export declare const etag: (options?: ETagOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts b/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts deleted file mode 100644 index a21aa0b..0000000 --- a/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * IP Restriction Middleware for Hono - * @module - */ -import type { Context, MiddlewareHandler } from '../..'; -import type { AddressType, GetConnInfo } from '../../helper/conninfo'; -/** - * Function to get IP Address - */ -type GetIPAddr = GetConnInfo | ((c: Context) => string); -export type IPRestrictionRule = string | ((addr: { - addr: string; - type: AddressType; -}) => boolean); -/** - * Rules for IP Restriction Middleware - */ -export interface IPRestrictionRules { - denyList?: IPRestrictionRule[]; - allowList?: IPRestrictionRule[]; -} -/** - * IP Restriction Middleware - * - * @param getIP function to get IP Address - */ -export declare const ipRestriction: (getIP: GetIPAddr, { denyList, allowList }: IPRestrictionRules, onError?: (remote: { - addr: string; - type: AddressType; -}, c: Context) => Response | Promise) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts b/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts deleted file mode 100644 index f5bfc57..0000000 --- a/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @module - * JSX Renderer Middleware for Hono. - */ -import type { Context, PropsForRenderer } from '../../context'; -import type { FC, Context as JSXContext, PropsWithChildren } from '../../jsx'; -import type { Env, Input, MiddlewareHandler } from '../../types'; -import type { HtmlEscapedString } from '../../utils/html'; -export declare const RequestContext: JSXContext | null>; -type RendererOptions = { - docType?: boolean | string; - stream?: boolean | Record; -}; -type ComponentWithChildren = (props: PropsWithChildren, c: Context) => HtmlEscapedString | Promise; -/** - * JSX Renderer Middleware for hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/jsx-renderer} - * - * @param {ComponentWithChildren} [component] - The component to render, which can accept children and props. - * @param {RendererOptions} [options] - The options for the JSX renderer middleware. - * @param {boolean | string} [options.docType=true] - The DOCTYPE to be added at the beginning of the HTML. If set to false, no DOCTYPE will be added. - * @param {boolean | Record} [options.stream=false] - If set to true, enables streaming response with default headers. If a record is provided, custom headers will be used. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.get( - * '/page/*', - * jsxRenderer(({ children }) => { - * return ( - * - * - *

Menu
- *
{children}
- * - * - * ) - * }) - * ) - * - * app.get('/page/about', (c) => { - * return c.render(

About me!

) - * }) - * ``` - */ -export declare const jsxRenderer: (component?: ComponentWithChildren, options?: RendererOptions) => MiddlewareHandler; -/** - * useRequestContext for Hono. - * - * @template E - The environment type. - * @template P - The parameter type. - * @template I - The input type. - * @returns {Context} An instance of Context. - * - * @example - * ```ts - * const RequestUrlBadge: FC = () => { - * const c = useRequestContext() - * return {c.req.url} - * } - * - * app.get('/page/info', (c) => { - * return c.render( - *
- * You are accessing: - *
- * ) - * }) - * ``` - */ -export declare const useRequestContext: () => Context; -export {}; diff --git a/node_modules/hono/dist/types/middleware/jwk/index.d.ts b/node_modules/hono/dist/types/middleware/jwk/index.d.ts deleted file mode 100644 index ff7158d..0000000 --- a/node_modules/hono/dist/types/middleware/jwk/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { jwk } from './jwk'; diff --git a/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts b/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts deleted file mode 100644 index e0b3dc3..0000000 --- a/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @module - * JWK Auth Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -import type { CookiePrefixOptions } from '../../utils/cookie'; -import '../../context'; -import type { AsymmetricAlgorithm } from '../../utils/jwt/jwa'; -import type { HonoJsonWebKey } from '../../utils/jwt/jws'; -import type { VerifyOptions } from '../../utils/jwt/jwt'; -/** - * JWK Auth Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/jwk} - * - * @param {object} options - The options for the JWK middleware. - * @param {HonoJsonWebKey[] | ((ctx: Context) => Promise | HonoJsonWebKey[])} [options.keys] - The public keys used for JWK verification, or a function that returns them. - * @param {string | ((ctx: Context) => Promise | string)} [options.jwks_uri] - If set to a URI string or a function that returns a URI string, attempt to fetch JWKs from it. The response must be a JSON object containing a `keys` array, which will be merged with the `keys` option. - * @param {boolean} [options.allow_anon] - If set to `true`, the middleware allows requests without a token to proceed without authentication. - * @param {string} [options.cookie] - If set, the middleware attempts to retrieve the token from a cookie with these options (optionally signed) only if no token is found in the header. - * @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'. - * @param {AsymmetricAlgorithm[]} options.alg - An array of allowed asymmetric algorithms for JWT verification. Only tokens signed with these algorithms will be accepted. - * @param {RequestInit} [init] - Optional init options for the `fetch` request when retrieving JWKS from a URI. - * @param {VerifyOptions} [options.verification] - Additional options for JWK payload verification. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use("/auth/*", jwk({ - * jwks_uri: (c) => `https://${c.env.authServer}/.well-known/jwks.json`, - * headerName: 'x-custom-auth-header', // Optional, default is 'Authorization' - * })) - * - * app.get('/auth/page', (c) => { - * return c.text('You are authorized') - * }) - * ``` - */ -export declare const jwk: (options: { - keys?: HonoJsonWebKey[] | ((ctx: Context) => Promise | HonoJsonWebKey[]); - jwks_uri?: string | ((ctx: Context) => Promise | string); - allow_anon?: boolean; - cookie?: string | { - key: string; - secret?: string | BufferSource; - prefixOptions?: CookiePrefixOptions; - }; - headerName?: string; - alg: AsymmetricAlgorithm[]; - verification?: VerifyOptions; -}, init?: RequestInit) => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/middleware/jwt/index.d.ts b/node_modules/hono/dist/types/middleware/jwt/index.d.ts deleted file mode 100644 index 40ab4bc..0000000 --- a/node_modules/hono/dist/types/middleware/jwt/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JwtVariables } from './jwt'; -export type { JwtVariables }; -export { jwt, verifyWithJwks, verify, decode, sign } from './jwt'; -export { AlgorithmTypes } from '../../utils/jwt/jwa'; -declare module '../..' { - interface ContextVariableMap extends JwtVariables { - } -} diff --git a/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts b/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts deleted file mode 100644 index aabbd2b..0000000 --- a/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @module - * JWT Auth Middleware for Hono. - */ -import type { MiddlewareHandler } from '../../types'; -import type { CookiePrefixOptions } from '../../utils/cookie'; -import '../../context'; -import type { SignatureAlgorithm } from '../../utils/jwt/jwa'; -import type { SignatureKey } from '../../utils/jwt/jws'; -import type { VerifyOptions } from '../../utils/jwt/jwt'; -export type JwtVariables = { - jwtPayload: T; -}; -/** - * JWT Auth Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/jwt} - * - * @param {object} options - The options for the JWT middleware. - * @param {SignatureKey} [options.secret] - A value of your secret key. - * @param {string} [options.cookie] - If this value is set, then the value is retrieved from the cookie header using that value as a key, which is then validated as a token. - * @param {SignatureAlgorithm} options.alg - An algorithm type that is used for verifying (required). Available types are `HS256` | `HS384` | `HS512` | `RS256` | `RS384` | `RS512` | `PS256` | `PS384` | `PS512` | `ES256` | `ES384` | `ES512` | `EdDSA`. - * @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'. - * @param {VerifyOptions} [options.verification] - Additional options for JWT payload verification. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use( - * '/auth/*', - * jwt({ - * secret: 'it-is-very-secret', - * alg: 'HS256', - * headerName: 'x-custom-auth-header', // Optional, default is 'Authorization' - * }) - * ) - * - * app.get('/auth/page', (c) => { - * return c.text('You are authorized') - * }) - * ``` - */ -export declare const jwt: (options: { - secret: SignatureKey; - cookie?: string | { - key: string; - secret?: string | BufferSource; - prefixOptions?: CookiePrefixOptions; - }; - alg: SignatureAlgorithm; - headerName?: string; - verification?: VerifyOptions; -}) => MiddlewareHandler; -export declare const verifyWithJwks: (token: string, options: { - keys?: import("../../utils/jwt/jws").HonoJsonWebKey[]; - jwks_uri?: string; - verification?: VerifyOptions; - allowedAlgorithms: readonly import("../../utils/jwt/jwa").AsymmetricAlgorithm[]; -}, init?: RequestInit) => Promise; -export declare const verify: (token: string, publicKey: SignatureKey, algOrOptions: SignatureAlgorithm | import("../../utils/jwt/jwt").VerifyOptionsWithAlg) => Promise; -export declare const decode: (token: string) => { - header: import("../../utils/jwt/jwt").TokenHeader; - payload: import("../../utils/jwt/types").JWTPayload; -}; -export declare const sign: (payload: import("../../utils/jwt/types").JWTPayload, privateKey: SignatureKey, alg?: SignatureAlgorithm) => Promise; diff --git a/node_modules/hono/dist/types/middleware/language/index.d.ts b/node_modules/hono/dist/types/middleware/language/index.d.ts deleted file mode 100644 index 51cc2ee..0000000 --- a/node_modules/hono/dist/types/middleware/language/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { LanguageVariables, DetectorOptions, DetectorType, CacheType } from './language'; -export type { LanguageVariables, DetectorOptions, DetectorType, CacheType }; -export { languageDetector, detectFromCookie, detectFromHeader, detectFromPath, detectFromQuery, } from './language'; -declare module '../..' { - interface ContextVariableMap extends LanguageVariables { - } -} diff --git a/node_modules/hono/dist/types/middleware/language/language.d.ts b/node_modules/hono/dist/types/middleware/language/language.d.ts deleted file mode 100644 index d4be43b..0000000 --- a/node_modules/hono/dist/types/middleware/language/language.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @module - * Language module for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -export type DetectorType = 'path' | 'querystring' | 'cookie' | 'header'; -export type CacheType = 'cookie'; -export interface DetectorOptions { - /** Order of language detection strategies */ - order: DetectorType[]; - /** Query parameter name for language */ - lookupQueryString: string; - /** Cookie name for language */ - lookupCookie: string; - /** Index in URL path where language code appears */ - lookupFromPathIndex: number; - /** Header key for language detection */ - lookupFromHeaderKey: string; - /** Caching strategies */ - caches: CacheType[] | false; - /** Cookie configuration options */ - cookieOptions?: { - domain?: string; - path?: string; - sameSite?: 'Strict' | 'Lax' | 'None'; - secure?: boolean; - maxAge?: number; - httpOnly?: boolean; - }; - /** Whether to ignore case in language codes */ - ignoreCase: boolean; - /** Default language if none detected */ - fallbackLanguage: string; - /** List of supported language codes */ - supportedLanguages: string[]; - /** Optional function to transform detected language codes */ - convertDetectedLanguage?: (lang: string) => string; - /** Enable debug logging */ - debug?: boolean; -} -export interface LanguageVariables { - language: string; -} -export declare const DEFAULT_OPTIONS: DetectorOptions; -/** - * Parse Accept-Language header values with quality scores - * @param header Accept-Language header string - * @returns Array of parsed languages with quality scores - */ -export declare function parseAcceptLanguage(header: string): Array<{ - lang: string; - q: number; -}>; -/** - * Validate and normalize language codes - * @param lang Language code to normalize - * @param options Detector options - * @returns Normalized language code or undefined - */ -export declare const normalizeLanguage: (lang: string | null | undefined, options: DetectorOptions) => string | undefined; -/** - * Detects language from query parameter - */ -export declare const detectFromQuery: (c: Context, options: DetectorOptions) => string | undefined; -/** - * Detects language from cookie - */ -export declare const detectFromCookie: (c: Context, options: DetectorOptions) => string | undefined; -/** - * Detects language from Accept-Language header - */ -export declare function detectFromHeader(c: Context, options: DetectorOptions): string | undefined; -/** - * Detects language from URL path - */ -export declare function detectFromPath(c: Context, options: DetectorOptions): string | undefined; -/** - * Collection of all language detection strategies - */ -export declare const detectors: { - readonly querystring: (c: Context, options: DetectorOptions) => string | undefined; - readonly cookie: (c: Context, options: DetectorOptions) => string | undefined; - readonly header: typeof detectFromHeader; - readonly path: typeof detectFromPath; -}; -/** Type for detector functions */ -export type DetectorFunction = (c: Context, options: DetectorOptions) => string | undefined; -/** Type-safe detector map */ -export type Detectors = Record; -/** - * Validate detector options - * @param options Detector options to validate - * @throws Error if options are invalid - */ -export declare function validateOptions(options: DetectorOptions): void; -/** - * Language detector middleware factory - * @param userOptions Configuration options for the language detector - * @returns Hono middleware function - */ -export declare const languageDetector: (userOptions: Partial) => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/middleware/logger/index.d.ts b/node_modules/hono/dist/types/middleware/logger/index.d.ts deleted file mode 100644 index a36100e..0000000 --- a/node_modules/hono/dist/types/middleware/logger/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @module - * Logger Middleware for Hono. - */ -import type { MiddlewareHandler } from '../../types'; -type PrintFunc = (str: string, ...rest: string[]) => void; -/** - * Logger Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/logger} - * - * @param {PrintFunc} [fn=console.log] - Optional function for customized logging behavior. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use(logger()) - * app.get('/', (c) => c.text('Hello Hono!')) - * ``` - */ -export declare const logger: (fn?: PrintFunc) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/method-override/index.d.ts b/node_modules/hono/dist/types/middleware/method-override/index.d.ts deleted file mode 100644 index 0217975..0000000 --- a/node_modules/hono/dist/types/middleware/method-override/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @module - * Method Override Middleware for Hono. - */ -import type { Hono } from '../../hono'; -import type { MiddlewareHandler } from '../../types'; -type MethodOverrideOptions = { - app: Hono; -} & ({ - form?: string; - header?: never; - query?: never; -} | { - form?: never; - header: string; - query?: never; -} | { - form?: never; - header?: never; - query: string; -}); -/** - * Method Override Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/method-override} - * - * @param {MethodOverrideOptions} options - The options for the method override middleware. - * @param {Hono} options.app - The instance of Hono is used in your application. - * @param {string} [options.form=_method] - Form key with a value containing the method name. - * @param {string} [options.header] - Header name with a value containing the method name. - * @param {string} [options.query] - Query parameter key with a value containing the method name. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * // If no options are specified, the value of `_method` in the form, - * // e.g. DELETE, is used as the method. - * app.use('/posts', methodOverride({ app })) - * - * app.delete('/posts', (c) => { - * // .... - * }) - * ``` - */ -export declare const methodOverride: (options: MethodOverrideOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/powered-by/index.d.ts b/node_modules/hono/dist/types/middleware/powered-by/index.d.ts deleted file mode 100644 index 9091970..0000000 --- a/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @module - * Powered By Middleware for Hono. - */ -import type { MiddlewareHandler } from '../../types'; -type PoweredByOptions = { - /** - * The value for X-Powered-By header. - * @default Hono - */ - serverName?: string; -}; -/** - * Powered By Middleware for Hono. - * - * @param options - The options for the Powered By Middleware. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * import { poweredBy } from 'hono/powered-by' - * - * const app = new Hono() - * - * app.use(poweredBy()) // With options: poweredBy({ serverName: "My Server" }) - * ``` - */ -export declare const poweredBy: (options?: PoweredByOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts b/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts deleted file mode 100644 index 256d4ce..0000000 --- a/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @module - * Pretty JSON Middleware for Hono. - */ -import type { MiddlewareHandler } from '../../types'; -interface PrettyOptions { - /** - * Number of spaces for indentation. - * @default 2 - */ - space?: number; - /** - * Query conditions for when to Pretty. - * @default 'pretty' - */ - query?: string; - /** - * Force prettification of JSON responses regardless of query parameters. - * @default false - */ - force?: boolean; -} -/** - * Pretty JSON Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/pretty-json} - * - * @param options - The options for the pretty JSON middleware. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use(prettyJSON()) // With options: prettyJSON({ space: 4 }) - * app.get('/', (c) => { - * return c.json({ message: 'Hono!' }) - * }) - * ``` - */ -export declare const prettyJSON: (options?: PrettyOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/request-id/index.d.ts b/node_modules/hono/dist/types/middleware/request-id/index.d.ts deleted file mode 100644 index dc895b9..0000000 --- a/node_modules/hono/dist/types/middleware/request-id/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { RequestIdVariables } from './request-id'; -export type { RequestIdVariables }; -export { requestId } from './request-id'; -declare module '../..' { - interface ContextVariableMap extends RequestIdVariables { - } -} diff --git a/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts b/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts deleted file mode 100644 index dd1fdea..0000000 --- a/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @module - * Request ID Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -export type RequestIdVariables = { - requestId: string; -}; -export type RequestIdOptions = { - limitLength?: number; - headerName?: string; - generator?: (c: Context) => string; -}; -/** - * Request ID Middleware for Hono. - * - * @param {object} options - Options for Request ID middleware. - * @param {number} [options.limitLength=255] - The maximum length of request id. - * @param {string} [options.headerName=X-Request-Id] - The header name used in request id. - * @param {generator} [options.generator=() => crypto.randomUUID()] - The request id generation function. - * - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * type Variables = RequestIdVariables - * const app = new Hono<{Variables: Variables}>() - * - * app.use(requestId()) - * app.get('/', (c) => { - * console.log(c.get('requestId')) // Debug - * return c.text('Hello World!') - * }) - * ``` - */ -export declare const requestId: ({ limitLength, headerName, generator, }?: RequestIdOptions) => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts b/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts deleted file mode 100644 index 6e351a8..0000000 --- a/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export type { ContentSecurityPolicyOptionHandler } from './secure-headers'; -export { NONCE, secureHeaders } from './secure-headers'; -import type { SecureHeadersVariables } from './secure-headers'; -export type { SecureHeadersVariables }; -declare module '../..' { - interface ContextVariableMap extends SecureHeadersVariables { - } -} diff --git a/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts b/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts deleted file mode 100644 index 1a4c40e..0000000 --- a/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type PermissionsPolicyDirective = StandardizedFeatures | ProposedFeatures | ExperimentalFeatures; -/** - * These features have been declared in a published version of the respective specification. - */ -type StandardizedFeatures = 'accelerometer' | 'ambientLightSensor' | 'attributionReporting' | 'autoplay' | 'battery' | 'bluetooth' | 'camera' | 'chUa' | 'chUaArch' | 'chUaBitness' | 'chUaFullVersion' | 'chUaFullVersionList' | 'chUaMobile' | 'chUaModel' | 'chUaPlatform' | 'chUaPlatformVersion' | 'chUaWow64' | 'computePressure' | 'crossOriginIsolated' | 'directSockets' | 'displayCapture' | 'encryptedMedia' | 'executionWhileNotRendered' | 'executionWhileOutOfViewport' | 'fullscreen' | 'geolocation' | 'gyroscope' | 'hid' | 'identityCredentialsGet' | 'idleDetection' | 'keyboardMap' | 'magnetometer' | 'microphone' | 'midi' | 'navigationOverride' | 'payment' | 'pictureInPicture' | 'publickeyCredentialsGet' | 'screenWakeLock' | 'serial' | 'storageAccess' | 'syncXhr' | 'usb' | 'webShare' | 'windowManagement' | 'xrSpatialTracking'; -/** - * These features have been proposed, but the definitions have not yet been integrated into their respective specs. - */ -type ProposedFeatures = 'clipboardRead' | 'clipboardWrite' | 'gamepad' | 'sharedAutofill' | 'speakerSelection'; -/** - * These features generally have an explainer only, but may be available for experimentation by web developers. - */ -type ExperimentalFeatures = 'allScreensCapture' | 'browsingTopics' | 'capturedSurfaceControl' | 'conversionMeasurement' | 'digitalCredentialsGet' | 'focusWithoutUserActivation' | 'joinAdInterestGroup' | 'localFonts' | 'runAdAuction' | 'smartCard' | 'syncScript' | 'trustTokenRedemption' | 'unload' | 'verticalScroll'; -export {}; diff --git a/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts b/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts deleted file mode 100644 index a632b52..0000000 --- a/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @module - * Secure Headers Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -import type { PermissionsPolicyDirective } from './permissions-policy'; -export type SecureHeadersVariables = { - secureHeadersNonce?: string; -}; -export type ContentSecurityPolicyOptionHandler = (ctx: Context, directive: string) => string; -type ContentSecurityPolicyOptionValue = (string | ContentSecurityPolicyOptionHandler)[]; -interface ContentSecurityPolicyOptions { - defaultSrc?: ContentSecurityPolicyOptionValue; - baseUri?: ContentSecurityPolicyOptionValue; - childSrc?: ContentSecurityPolicyOptionValue; - connectSrc?: ContentSecurityPolicyOptionValue; - fontSrc?: ContentSecurityPolicyOptionValue; - formAction?: ContentSecurityPolicyOptionValue; - frameAncestors?: ContentSecurityPolicyOptionValue; - frameSrc?: ContentSecurityPolicyOptionValue; - imgSrc?: ContentSecurityPolicyOptionValue; - manifestSrc?: ContentSecurityPolicyOptionValue; - mediaSrc?: ContentSecurityPolicyOptionValue; - objectSrc?: ContentSecurityPolicyOptionValue; - reportTo?: string; - reportUri?: string | string[]; - sandbox?: ContentSecurityPolicyOptionValue; - scriptSrc?: ContentSecurityPolicyOptionValue; - scriptSrcAttr?: ContentSecurityPolicyOptionValue; - scriptSrcElem?: ContentSecurityPolicyOptionValue; - styleSrc?: ContentSecurityPolicyOptionValue; - styleSrcAttr?: ContentSecurityPolicyOptionValue; - styleSrcElem?: ContentSecurityPolicyOptionValue; - upgradeInsecureRequests?: ContentSecurityPolicyOptionValue; - workerSrc?: ContentSecurityPolicyOptionValue; - requireTrustedTypesFor?: ContentSecurityPolicyOptionValue; - trustedTypes?: ContentSecurityPolicyOptionValue; -} -interface ReportToOptions { - group: string; - max_age: number; - endpoints: ReportToEndpoint[]; -} -interface ReportToEndpoint { - url: string; -} -interface ReportingEndpointOptions { - name: string; - url: string; -} -type PermissionsPolicyValue = '*' | 'self' | 'src' | 'none' | string; -type PermissionsPolicyOptions = Partial>; -type overridableHeader = boolean | string; -interface SecureHeadersOptions { - contentSecurityPolicy?: ContentSecurityPolicyOptions; - contentSecurityPolicyReportOnly?: ContentSecurityPolicyOptions; - crossOriginEmbedderPolicy?: overridableHeader; - crossOriginResourcePolicy?: overridableHeader; - crossOriginOpenerPolicy?: overridableHeader; - originAgentCluster?: overridableHeader; - referrerPolicy?: overridableHeader; - reportingEndpoints?: ReportingEndpointOptions[]; - reportTo?: ReportToOptions[]; - strictTransportSecurity?: overridableHeader; - xContentTypeOptions?: overridableHeader; - xDnsPrefetchControl?: overridableHeader; - xDownloadOptions?: overridableHeader; - xFrameOptions?: overridableHeader; - xPermittedCrossDomainPolicies?: overridableHeader; - xXssProtection?: overridableHeader; - removePoweredBy?: boolean; - permissionsPolicy?: PermissionsPolicyOptions; -} -export declare const NONCE: ContentSecurityPolicyOptionHandler; -/** - * Secure Headers Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/secure-headers} - * - * @param {Partial} [customOptions] - The options for the secure headers middleware. - * @param {ContentSecurityPolicyOptions} [customOptions.contentSecurityPolicy] - Settings for the Content-Security-Policy header. - * @param {ContentSecurityPolicyOptions} [customOptions.contentSecurityPolicyReportOnly] - Settings for the Content-Security-Policy-Report-Only header. - * @param {overridableHeader} [customOptions.crossOriginEmbedderPolicy=false] - Settings for the Cross-Origin-Embedder-Policy header. - * @param {overridableHeader} [customOptions.crossOriginResourcePolicy=true] - Settings for the Cross-Origin-Resource-Policy header. - * @param {overridableHeader} [customOptions.crossOriginOpenerPolicy=true] - Settings for the Cross-Origin-Opener-Policy header. - * @param {overridableHeader} [customOptions.originAgentCluster=true] - Settings for the Origin-Agent-Cluster header. - * @param {overridableHeader} [customOptions.referrerPolicy=true] - Settings for the Referrer-Policy header. - * @param {ReportingEndpointOptions[]} [customOptions.reportingEndpoints] - Settings for the Reporting-Endpoints header. - * @param {ReportToOptions[]} [customOptions.reportTo] - Settings for the Report-To header. - * @param {overridableHeader} [customOptions.strictTransportSecurity=true] - Settings for the Strict-Transport-Security header. - * @param {overridableHeader} [customOptions.xContentTypeOptions=true] - Settings for the X-Content-Type-Options header. - * @param {overridableHeader} [customOptions.xDnsPrefetchControl=true] - Settings for the X-DNS-Prefetch-Control header. - * @param {overridableHeader} [customOptions.xDownloadOptions=true] - Settings for the X-Download-Options header. - * @param {overridableHeader} [customOptions.xFrameOptions=true] - Settings for the X-Frame-Options header. - * @param {overridableHeader} [customOptions.xPermittedCrossDomainPolicies=true] - Settings for the X-Permitted-Cross-Domain-Policies header. - * @param {overridableHeader} [customOptions.xXssProtection=true] - Settings for the X-XSS-Protection header. - * @param {boolean} [customOptions.removePoweredBy=true] - Settings for remove X-Powered-By header. - * @param {PermissionsPolicyOptions} [customOptions.permissionsPolicy] - Settings for the Permissions-Policy header. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * app.use(secureHeaders()) - * ``` - */ -export declare const secureHeaders: (customOptions?: SecureHeadersOptions) => MiddlewareHandler; -export {}; diff --git a/node_modules/hono/dist/types/middleware/serve-static/index.d.ts b/node_modules/hono/dist/types/middleware/serve-static/index.d.ts deleted file mode 100644 index f8fd606..0000000 --- a/node_modules/hono/dist/types/middleware/serve-static/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @module - * Serve Static Middleware for Hono. - */ -import type { Context, Data } from '../../context'; -import type { Env, MiddlewareHandler } from '../../types'; -export type ServeStaticOptions = { - root?: string; - path?: string; - precompressed?: boolean; - mimes?: Record; - rewriteRequestPath?: (path: string) => string; - onFound?: (path: string, c: Context) => void | Promise; - onNotFound?: (path: string, c: Context) => void | Promise; -}; -/** - * This middleware is not directly used by the user. Create a wrapper specifying `getContent()` by the environment such as Deno or Bun. - */ -export declare const serveStatic: (options: ServeStaticOptions & { - getContent: (path: string, c: Context) => Promise; - /** - * - * `join` option according to the runtime. Example `import { join } from 'node:path`. If not specified, it will fall back to the default join function.` - */ - join?: (...paths: string[]) => string; - /** - * @deprecated Currently, `pathResolve` is no longer used. - */ - pathResolve?: (path: string) => string; - isDir?: (path: string) => boolean | undefined | Promise; -}) => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/middleware/serve-static/path.d.ts b/node_modules/hono/dist/types/middleware/serve-static/path.d.ts deleted file mode 100644 index 4d2e95e..0000000 --- a/node_modules/hono/dist/types/middleware/serve-static/path.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * `defaultJoin` does not support Windows paths and always uses `/` separators. - * If you need Windows path support, please use `join` exported from `node:path` etc. instead. - */ -export declare const defaultJoin: (...paths: string[]) => string; diff --git a/node_modules/hono/dist/types/middleware/timeout/index.d.ts b/node_modules/hono/dist/types/middleware/timeout/index.d.ts deleted file mode 100644 index 28d533f..0000000 --- a/node_modules/hono/dist/types/middleware/timeout/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @module - * Timeout Middleware for Hono. - */ -import type { Context } from '../../context'; -import { HTTPException } from '../../http-exception'; -import type { MiddlewareHandler } from '../../types'; -export type HTTPExceptionFunction = (context: Context) => HTTPException; -/** - * Timeout Middleware for Hono. - * - * @param {number} duration - The timeout duration in milliseconds. - * @param {HTTPExceptionFunction | HTTPException} [exception=defaultTimeoutException] - The exception to throw when the timeout occurs. Can be a function that returns an HTTPException or an HTTPException object. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use( - * '/long-request', - * timeout(5000) // Set timeout to 5 seconds - * ) - * - * app.get('/long-request', async (c) => { - * await someLongRunningFunction() - * return c.text('Completed within time limit') - * }) - * ``` - */ -export declare const timeout: (duration: number, exception?: HTTPExceptionFunction | HTTPException) => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/middleware/timing/index.d.ts b/node_modules/hono/dist/types/middleware/timing/index.d.ts deleted file mode 100644 index a627bc6..0000000 --- a/node_modules/hono/dist/types/middleware/timing/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { TimingVariables } from './timing'; -export { TimingVariables }; -export { timing, setMetric, startTime, endTime, wrapTime } from './timing'; -declare module '../..' { - interface ContextVariableMap extends TimingVariables { - } -} diff --git a/node_modules/hono/dist/types/middleware/timing/timing.d.ts b/node_modules/hono/dist/types/middleware/timing/timing.d.ts deleted file mode 100644 index b4d2170..0000000 --- a/node_modules/hono/dist/types/middleware/timing/timing.d.ts +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @module - * Server-Timing Middleware for Hono. - */ -import type { Context } from '../../context'; -import type { MiddlewareHandler } from '../../types'; -import '../../context'; -export type TimingVariables = { - metric?: { - headers: string[]; - timers: Map; - }; -}; -interface Timer { - description?: string; - start: number; -} -interface TimingOptions { - total?: boolean; - enabled?: boolean | ((c: Context) => boolean); - totalDescription?: string; - autoEnd?: boolean; - crossOrigin?: boolean | string | ((c: Context) => boolean | string); -} -/** - * Server-Timing Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/timing} - * - * @param {TimingOptions} [config] - The options for the timing middleware. - * @param {boolean} [config.total=true] - Show the total response time. - * @param {boolean | ((c: Context) => boolean)} [config.enabled=true] - Whether timings should be added to the headers or not. - * @param {string} [config.totalDescription=Total Response Time] - Description for the total response time. - * @param {boolean} [config.autoEnd=true] - If `startTime()` should end automatically at the end of the request. - * @param {boolean | string | ((c: Context) => boolean | string)} [config.crossOrigin=false] - The origin this timings header should be readable. - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * // add the middleware to your router - * app.use(timing()); - * - * app.get('/', async (c) => { - * // add custom metrics - * setMetric(c, 'region', 'europe-west3') - * - * // add custom metrics with timing, must be in milliseconds - * setMetric(c, 'custom', 23.8, 'My custom Metric') - * - * // start a new timer - * startTime(c, 'db'); - * - * const data = await db.findMany(...); - * - * // end the timer - * endTime(c, 'db'); - * - * return c.json({ response: data }); - * }); - * ``` - */ -export declare const timing: (config?: TimingOptions) => MiddlewareHandler; -interface SetMetric { - (c: Context, name: string, value: number, description?: string, precision?: number): void; - (c: Context, name: string, description?: string): void; -} -/** - * Set a metric for the timing middleware. - * - * @param {Context} c - The context of the request. - * @param {string} name - The name of the metric. - * @param {number | string} [valueDescription] - The value or description of the metric. - * @param {string} [description] - The description of the metric. - * @param {number} [precision] - The precision of the metric value. - * - * @example - * ```ts - * setMetric(c, 'region', 'europe-west3') - * setMetric(c, 'custom', 23.8, 'My custom Metric') - * ``` - */ -export declare const setMetric: SetMetric; -/** - * Start a timer for the timing middleware. - * - * @param {Context} c - The context of the request. - * @param {string} name - The name of the timer. - * @param {string} [description] - The description of the timer. - * - * @example - * ```ts - * startTime(c, 'db') - * ``` - */ -export declare const startTime: (c: Context, name: string, description?: string) => void; -/** - * End a timer for the timing middleware. - * - * @param {Context} c - The context of the request. - * @param {string} name - The name of the timer. - * @param {number} [precision] - The precision of the timer value. - * - * @example - * ```ts - * endTime(c, 'db') - * ``` - */ -export declare const endTime: (c: Context, name: string, precision?: number) => void; -/** - * Wrap a Promise to capture its duration. - * @param {Context} c - The context of the request. - * @param {string} name - The name of the timer. - * @param {Promise} callable - The Promise to time. - * @param {string} [description] - The description of the timer. - * @param {number} [precision] - The precision of the timer value. - * - * @example - * ```ts - * // Instead of this: - * const data = await db.findMany(...); - * - * // do this: - * const data = await wrapTime(c, 'query', db.findMany(...)); - * ``` - * */ -export declare function wrapTime(c: Context, name: string, callable: Promise, description?: string, precision?: number): Promise; -export {}; diff --git a/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts b/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts deleted file mode 100644 index 9b1d12d..0000000 --- a/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @module - * Trailing Slash Middleware for Hono. - */ -import type { MiddlewareHandler } from '../../types'; -/** - * Trailing Slash Middleware for Hono. - * - * @see {@link https://hono.dev/docs/middleware/builtin/trailing-slash} - * - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use(trimTrailingSlash()) - * app.get('/about/me/', (c) => c.text('With Trailing Slash')) - * ``` - */ -export declare const trimTrailingSlash: () => MiddlewareHandler; -/** - * Append trailing slash middleware for Hono. - * Append a trailing slash to the URL if it doesn't have one. For example, `/path/to/page` will be redirected to `/path/to/page/`. - * - * @see {@link https://hono.dev/docs/middleware/builtin/trailing-slash} - * - * @returns {MiddlewareHandler} The middleware handler function. - * - * @example - * ```ts - * const app = new Hono() - * - * app.use(appendTrailingSlash()) - * ``` - */ -export declare const appendTrailingSlash: () => MiddlewareHandler; diff --git a/node_modules/hono/dist/types/package.json b/node_modules/hono/dist/types/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/node_modules/hono/dist/types/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/hono/dist/types/preset/quick.d.ts b/node_modules/hono/dist/types/preset/quick.d.ts deleted file mode 100644 index d53dea3..0000000 --- a/node_modules/hono/dist/types/preset/quick.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @module - * The preset that uses `LinearRouter`. - */ -import { HonoBase } from '../hono-base'; -import type { HonoOptions } from '../hono-base'; -import type { BlankEnv, BlankSchema, Env, Schema } from '../types'; -export declare class Hono extends HonoBase { - constructor(options?: HonoOptions); -} diff --git a/node_modules/hono/dist/types/preset/tiny.d.ts b/node_modules/hono/dist/types/preset/tiny.d.ts deleted file mode 100644 index 4f75f72..0000000 --- a/node_modules/hono/dist/types/preset/tiny.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @module - * The preset that uses `PatternRouter`. - */ -import { HonoBase } from '../hono-base'; -import type { HonoOptions } from '../hono-base'; -import type { BlankEnv, BlankSchema, Env, Schema } from '../types'; -export declare class Hono extends HonoBase { - constructor(options?: HonoOptions); -} diff --git a/node_modules/hono/dist/types/request.d.ts b/node_modules/hono/dist/types/request.d.ts deleted file mode 100644 index 0047aa7..0000000 --- a/node_modules/hono/dist/types/request.d.ts +++ /dev/null @@ -1,313 +0,0 @@ -import { GET_MATCH_RESULT } from './request/constants'; -import type { Result } from './router'; -import type { Input, InputToDataByTarget, ParamKeyToRecord, ParamKeys, RemoveQuestion, RouterRoute, ValidationTargets } from './types'; -import type { BodyData, ParseBodyOptions } from './utils/body'; -import type { CustomHeader, RequestHeader } from './utils/headers'; -import type { Simplify, UnionToIntersection } from './utils/types'; -type Body = { - json: any; - text: string; - arrayBuffer: ArrayBuffer; - blob: Blob; - formData: FormData; -}; -type BodyCache = Partial; -export declare class HonoRequest

{ - - /** - * `.raw` can get the raw Request object. - * - * @see {@link https://hono.dev/docs/api/request#raw} - * - * @example - * ```ts - * // For Cloudflare Workers - * app.post('/', async (c) => { - * const metadata = c.req.raw.cf?.hostMetadata? - * ... - * }) - * ``` - */ - raw: Request; - routeIndex: number; - /** - * `.path` can get the pathname of the request. - * - * @see {@link https://hono.dev/docs/api/request#path} - * - * @example - * ```ts - * app.get('/about/me', (c) => { - * const pathname = c.req.path // `/about/me` - * }) - * ``` - */ - path: string; - bodyCache: BodyCache; - constructor(request: Request, path?: string, matchResult?: Result<[unknown, RouterRoute]>); - /** - * `.req.param()` gets the path parameters. - * - * @see {@link https://hono.dev/docs/api/routing#path-parameter} - * - * @example - * ```ts - * const name = c.req.param('name') - * // or all parameters at once - * const { id, comment_id } = c.req.param() - * ``` - */ - param = ParamKeys

>(key: P2 extends `${infer _}?` ? never : P2): string; - param> = RemoveQuestion>>(key: P2): string | undefined; - param(key: string): string | undefined; - param(): Simplify>>>; - /** - * `.query()` can get querystring parameters. - * - * @see {@link https://hono.dev/docs/api/request#query} - * - * @example - * ```ts - * // Query params - * app.get('/search', (c) => { - * const query = c.req.query('q') - * }) - * - * // Get all params at once - * app.get('/search', (c) => { - * const { q, limit, offset } = c.req.query() - * }) - * ``` - */ - query(key: string): string | undefined; - query(): Record; - /** - * `.queries()` can get multiple querystring parameter values, e.g. /search?tags=A&tags=B - * - * @see {@link https://hono.dev/docs/api/request#queries} - * - * @example - * ```ts - * app.get('/search', (c) => { - * // tags will be string[] - * const tags = c.req.queries('tags') - * }) - * ``` - */ - queries(key: string): string[] | undefined; - queries(): Record; - /** - * `.header()` can get the request header value. - * - * @see {@link https://hono.dev/docs/api/request#header} - * - * @example - * ```ts - * app.get('/', (c) => { - * const userAgent = c.req.header('User-Agent') - * }) - * ``` - */ - header(name: RequestHeader): string | undefined; - header(name: string): string | undefined; - header(): Record; - /** - * `.parseBody()` can parse Request body of type `multipart/form-data` or `application/x-www-form-urlencoded` - * - * @see {@link https://hono.dev/docs/api/request#parsebody} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.parseBody() - * }) - * ``` - */ - parseBody, T extends BodyData>(options?: Options): Promise; - parseBody(options?: Partial): Promise; - /** - * `.json()` can parse Request body of type `application/json` - * - * @see {@link https://hono.dev/docs/api/request#json} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.json() - * }) - * ``` - */ - json(): Promise; - /** - * `.text()` can parse Request body of type `text/plain` - * - * @see {@link https://hono.dev/docs/api/request#text} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.text() - * }) - * ``` - */ - text(): Promise; - /** - * `.arrayBuffer()` parse Request body as an `ArrayBuffer` - * - * @see {@link https://hono.dev/docs/api/request#arraybuffer} - * - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.arrayBuffer() - * }) - * ``` - */ - arrayBuffer(): Promise; - /** - * Parses the request body as a `Blob`. - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.blob(); - * }); - * ``` - * @see https://hono.dev/docs/api/request#blob - */ - blob(): Promise; - /** - * Parses the request body as `FormData`. - * @example - * ```ts - * app.post('/entry', async (c) => { - * const body = await c.req.formData(); - * }); - * ``` - * @see https://hono.dev/docs/api/request#formdata - */ - formData(): Promise; - /** - * Adds validated data to the request. - * - * @param target - The target of the validation. - * @param data - The validated data to add. - */ - addValidatedData(target: keyof ValidationTargets, data: {}): void; - /** - * Gets validated data from the request. - * - * @param target - The target of the validation. - * @returns The validated data. - * - * @see https://hono.dev/docs/api/request#valid - */ - valid(target: T): InputToDataByTarget; - /** - * `.url()` can get the request url strings. - * - * @see {@link https://hono.dev/docs/api/request#url} - * - * @example - * ```ts - * app.get('/about/me', (c) => { - * const url = c.req.url // `http://localhost:8787/about/me` - * ... - * }) - * ``` - */ - get url(): string; - /** - * `.method()` can get the method name of the request. - * - * @see {@link https://hono.dev/docs/api/request#method} - * - * @example - * ```ts - * app.get('/about/me', (c) => { - * const method = c.req.method // `GET` - * }) - * ``` - */ - get method(): string; - get [GET_MATCH_RESULT](): Result<[unknown, RouterRoute]>; - /** - * `.matchedRoutes()` can return a matched route in the handler - * - * @deprecated - * - * Use matchedRoutes helper defined in "hono/route" instead. - * - * @see {@link https://hono.dev/docs/api/request#matchedroutes} - * - * @example - * ```ts - * app.use('*', async function logger(c, next) { - * await next() - * c.req.matchedRoutes.forEach(({ handler, method, path }, i) => { - * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') - * console.log( - * method, - * ' ', - * path, - * ' '.repeat(Math.max(10 - path.length, 0)), - * name, - * i === c.req.routeIndex ? '<- respond from here' : '' - * ) - * }) - * }) - * ``` - */ - get matchedRoutes(): RouterRoute[]; - /** - * `routePath()` can retrieve the path registered within the handler - * - * @deprecated - * - * Use routePath helper defined in "hono/route" instead. - * - * @see {@link https://hono.dev/docs/api/request#routepath} - * - * @example - * ```ts - * app.get('/posts/:id', (c) => { - * return c.json({ path: c.req.routePath }) - * }) - * ``` - */ - get routePath(): string; -} -/** - * Clones a HonoRequest's underlying raw Request object. - * - * This utility handles both consumed and unconsumed request bodies: - * - If the request body hasn't been consumed, it uses the native `clone()` method - * - If the request body has been consumed, it reconstructs a new Request using cached body data - * - * This is particularly useful when you need to: - * - Process the same request body multiple times - * - Pass requests to external services after validation - * - * @param req - The HonoRequest object to clone - * @returns A Promise that resolves to a new Request object with the same properties - * @throws {HTTPException} If the request body was consumed directly via `req.raw` - * without using HonoRequest methods (e.g., `req.json()`, `req.text()`), making it - * impossible to reconstruct the body from cache - * - * @example - * ```ts - * // Clone after consuming the body (e.g., after validation) - * app.post('/forward', - * validator('json', (data) => data), - * async (c) => { - * const validated = c.req.valid('json') - * // Body has been consumed, but cloneRawRequest still works - * const clonedReq = await cloneRawRequest(c.req) - * return fetch('http://backend-service.com', clonedReq) - * } - * ) - * ``` - */ -export declare const cloneRawRequest: (req: HonoRequest) => Promise; -export {}; diff --git a/node_modules/hono/dist/types/request/constants.d.ts b/node_modules/hono/dist/types/request/constants.d.ts deleted file mode 100644 index e1317d5..0000000 --- a/node_modules/hono/dist/types/request/constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const GET_MATCH_RESULT: unique symbol; diff --git a/node_modules/hono/dist/types/router.d.ts b/node_modules/hono/dist/types/router.d.ts deleted file mode 100644 index abe9f03..0000000 --- a/node_modules/hono/dist/types/router.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @module - * This module provides types definitions and variables for the routers. - */ -/** - * Constant representing all HTTP methods in uppercase. - */ -export declare const METHOD_NAME_ALL: "ALL"; -/** - * Constant representing all HTTP methods in lowercase. - */ -export declare const METHOD_NAME_ALL_LOWERCASE: "all"; -/** - * Array of supported HTTP methods. - */ -export declare const METHODS: readonly ["get", "post", "put", "delete", "options", "patch"]; -/** - * Error message indicating that a route cannot be added because the matcher is already built. - */ -export declare const MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built."; -/** - * Interface representing a router. - * - * @template T - The type of the handler. - */ -export interface Router { - /** - * The name of the router. - */ - name: string; - /** - * Adds a route to the router. - * - * @param method - The HTTP method (e.g., 'get', 'post'). - * @param path - The path for the route. - * @param handler - The handler for the route. - */ - add(method: string, path: string, handler: T): void; - /** - * Matches a route based on the given method and path. - * - * @param method - The HTTP method (e.g., 'get', 'post'). - * @param path - The path to match. - * @returns The result of the match. - */ - match(method: string, path: string): Result; -} -/** - * Type representing a map of parameter indices. - */ -export type ParamIndexMap = Record; -/** - * Type representing a stash of parameters. - */ -export type ParamStash = string[]; -/** - * Type representing a map of parameters. - */ -export type Params = Record; -/** - * Type representing the result of a route match. - * - * The result can be in one of two formats: - * 1. An array of handlers with their corresponding parameter index maps, followed by a parameter stash. - * 2. An array of handlers with their corresponding parameter maps. - * - * Example: - * - * [[handler, paramIndexMap][], paramArray] - * ```typescript - * [ - * [ - * [middlewareA, {}], // '*' - * [funcA, {'id': 0}], // '/user/:id/*' - * [funcB, {'id': 0, 'action': 1}], // '/user/:id/:action' - * ], - * ['123', 'abc'] - * ] - * ``` - * - * [[handler, params][]] - * ```typescript - * [ - * [ - * [middlewareA, {}], // '*' - * [funcA, {'id': '123'}], // '/user/:id/*' - * [funcB, {'id': '123', 'action': 'abc'}], // '/user/:id/:action' - * ] - * ] - * ``` - */ -export type Result = [[T, ParamIndexMap][], ParamStash] | [[T, Params][]]; -/** - * Error class representing an unsupported path error. - */ -export declare class UnsupportedPathError extends Error { -} diff --git a/node_modules/hono/dist/types/router/linear-router/index.d.ts b/node_modules/hono/dist/types/router/linear-router/index.d.ts deleted file mode 100644 index 899f66e..0000000 --- a/node_modules/hono/dist/types/router/linear-router/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @module - * LinearRouter for Hono. - */ -export { LinearRouter } from './router'; diff --git a/node_modules/hono/dist/types/router/linear-router/router.d.ts b/node_modules/hono/dist/types/router/linear-router/router.d.ts deleted file mode 100644 index 45d563a..0000000 --- a/node_modules/hono/dist/types/router/linear-router/router.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Result, Router } from '../../router'; -export declare class LinearRouter implements Router { - - name: string; - add(method: string, path: string, handler: T): void; - match(method: string, path: string): Result; -} diff --git a/node_modules/hono/dist/types/router/pattern-router/index.d.ts b/node_modules/hono/dist/types/router/pattern-router/index.d.ts deleted file mode 100644 index 26f9f23..0000000 --- a/node_modules/hono/dist/types/router/pattern-router/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @module - * PatternRouter for Hono. - */ -export { PatternRouter } from './router'; diff --git a/node_modules/hono/dist/types/router/pattern-router/router.d.ts b/node_modules/hono/dist/types/router/pattern-router/router.d.ts deleted file mode 100644 index 299811d..0000000 --- a/node_modules/hono/dist/types/router/pattern-router/router.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Result, Router } from '../../router'; -export declare class PatternRouter implements Router { - - name: string; - add(method: string, path: string, handler: T): void; - match(method: string, path: string): Result; -} diff --git a/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts b/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts deleted file mode 100644 index 25c2363..0000000 --- a/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @module - * RegExpRouter for Hono. - */ -export { RegExpRouter } from './router'; -export { PreparedRegExpRouter, buildInitParams, serializeInitParams } from './prepared-router'; diff --git a/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts b/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts deleted file mode 100644 index 721ec4b..0000000 --- a/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ParamIndexMap, Result, Router } from '../../router'; -export type HandlerData = [T, ParamIndexMap][]; -export type StaticMap = Record>; -export type Matcher = [RegExp, HandlerData[], StaticMap]; -export type MatcherMap = Record | null>; -export declare const emptyParam: string[]; -export declare function match, T>(this: R, method: string, path: string): Result; diff --git a/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts b/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts deleted file mode 100644 index 76f1c53..0000000 --- a/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare const PATH_ERROR: unique symbol; -export type ParamAssocArray = [string, number][]; -export interface Context { - varIndex: number; -} -export declare class Node { - - insert(tokens: readonly string[], index: number, paramMap: ParamAssocArray, context: Context, pathErrorCheckOnly: boolean): void; - buildRegExpStr(): string; -} diff --git a/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts b/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts deleted file mode 100644 index de9f39e..0000000 --- a/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ParamIndexMap, Router } from '../../router'; -import type { MatcherMap } from './matcher'; -import { match } from './matcher'; -type RelocateMap = Record; -export declare class PreparedRegExpRouter implements Router { - - name: string; - constructor(matchers: MatcherMap, relocateMap: RelocateMap); - add(method: string, path: string, handler: T): void; - protected buildAllMatchers(): MatcherMap; - match: typeof match, T>; -} -export declare const buildInitParams: (params: { - paths: string[]; -}) => ConstructorParameters; -export declare const serializeInitParams: (params: ConstructorParameters) => string; -export {}; diff --git a/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts b/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts deleted file mode 100644 index fda1ebb..0000000 --- a/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Router } from '../../router'; -import type { MatcherMap } from './matcher'; -import { match } from './matcher'; -export declare class RegExpRouter implements Router { - - name: string; - constructor(); - add(method: string, path: string, handler: T): void; - match: typeof match, T>; - protected buildAllMatchers(): MatcherMap; -} diff --git a/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts b/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts deleted file mode 100644 index a1f1a80..0000000 --- a/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ParamAssocArray } from './node'; -export type ReplacementMap = number[]; -export declare class Trie { - - insert(path: string, index: number, pathErrorCheckOnly: boolean): ParamAssocArray; - buildRegExp(): [RegExp, ReplacementMap, ReplacementMap]; -} diff --git a/node_modules/hono/dist/types/router/smart-router/index.d.ts b/node_modules/hono/dist/types/router/smart-router/index.d.ts deleted file mode 100644 index e7801b8..0000000 --- a/node_modules/hono/dist/types/router/smart-router/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @module - * SmartRouter for Hono. - */ -export { SmartRouter } from './router'; diff --git a/node_modules/hono/dist/types/router/smart-router/router.d.ts b/node_modules/hono/dist/types/router/smart-router/router.d.ts deleted file mode 100644 index 94a4de3..0000000 --- a/node_modules/hono/dist/types/router/smart-router/router.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Result, Router } from '../../router'; -export declare class SmartRouter implements Router { - - name: string; - constructor(init: { - routers: Router[]; - }); - add(method: string, path: string, handler: T): void; - match(method: string, path: string): Result; - get activeRouter(): Router; -} diff --git a/node_modules/hono/dist/types/router/trie-router/index.d.ts b/node_modules/hono/dist/types/router/trie-router/index.d.ts deleted file mode 100644 index 44ace76..0000000 --- a/node_modules/hono/dist/types/router/trie-router/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @module - * TrieRouter for Hono. - */ -export { TrieRouter } from './router'; diff --git a/node_modules/hono/dist/types/router/trie-router/node.d.ts b/node_modules/hono/dist/types/router/trie-router/node.d.ts deleted file mode 100644 index 81b9cc5..0000000 --- a/node_modules/hono/dist/types/router/trie-router/node.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Params } from '../../router'; -export declare class Node { - - constructor(method?: string, handler?: T, children?: Record>); - insert(method: string, path: string, handler: T): Node; - search(method: string, path: string): [[T, Params][]]; -} diff --git a/node_modules/hono/dist/types/router/trie-router/router.d.ts b/node_modules/hono/dist/types/router/trie-router/router.d.ts deleted file mode 100644 index 50990db..0000000 --- a/node_modules/hono/dist/types/router/trie-router/router.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Result, Router } from '../../router'; -export declare class TrieRouter implements Router { - - name: string; - constructor(); - add(method: string, path: string, handler: T): void; - match(method: string, path: string): Result; -} diff --git a/node_modules/hono/dist/types/types.d.ts b/node_modules/hono/dist/types/types.d.ts deleted file mode 100644 index 856f412..0000000 --- a/node_modules/hono/dist/types/types.d.ts +++ /dev/null @@ -1,573 +0,0 @@ -/** - * @module - * This module contains some type definitions for the Hono modules. - */ -import type { Context } from './context'; -import type { HonoBase } from './hono-base'; -import type { CustomHeader, RequestHeader } from './utils/headers'; -import type { StatusCode } from './utils/http-status'; -import type { IfAnyThenEmptyObject, IsAny, JSONValue, RemoveBlankRecord, Simplify, UnionToIntersection } from './utils/types'; -export type Bindings = object; -export type Variables = object; -export type BlankEnv = {}; -export type Env = { - Bindings?: Bindings; - Variables?: Variables; -}; -export type Next = () => Promise; -export type ExtractInput = I extends Input ? unknown extends I['in'] ? {} : I['in'] : I; -export type Input = { - in?: {}; - out?: {}; - outputFormat?: ResponseFormat; -}; -export type BlankSchema = {}; -export type BlankInput = {}; -export interface RouterRoute { - basePath: string; - path: string; - method: string; - handler: H; -} -export type HandlerResponse = Response | TypedResponse | Promise> | Promise; -export type Handler = any> = (c: Context, next: Next) => R; -export type MiddlewareHandler = Response> = (c: Context, next: Next) => Promise; -export type H = any> = Handler | MiddlewareHandler; -/** - * You can extend this interface to define a custom `c.notFound()` Response type. - * - * @example - * declare module 'hono' { - * interface NotFoundResponse extends Response, TypedResponse {} - * } - */ -export interface NotFoundResponse { -} -export type NotFoundHandler = (c: Context) => NotFoundResponse extends Response ? NotFoundResponse | Promise : Response | Promise; -export interface HTTPResponseError extends Error { - getResponse: () => Response; -} -export type ErrorHandler = (err: Error | HTTPResponseError, c: Context) => Response | Promise; -export interface HandlerInterface { -

= any, E2 extends Env = E>(handler: H): HonoBase, S & ToSchema>, BasePath, CurrentPath>; -

= any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H = H>(...handlers: [H & M1, H]): HonoBase, S & ToSchema | MergeMiddlewareResponse>, BasePath, CurrentPath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, E2 extends Env = E>(path: P, handler: H): HonoBase, S, M, P, I, BasePath>, BasePath, MergePath>; -

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H = H, M2 extends H = H>(...handlers: [H & M1, H & M2, H]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H = H>(path: P, ...handlers: [H & M1, H]): HonoBase | MergeMiddlewareResponse, S, M, P, I2, BasePath>, BasePath, MergePath>; -

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H = H, M2 extends H = H, M3 extends H = H>(...handlers: [H & M1, H & M2, H & M3, H]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H = H, M2 extends H = H>(path: P, ...handlers: [H & M1, H & M2, H]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I3, BasePath>, BasePath, MergePath>; -

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H>(...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H - ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H = H, M2 extends H = H, M3 extends H = H>(path: P, ...handlers: [ - H & M1, - H & M2, - H & M3, - H - ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I4, BasePath>, BasePath, MergePath>; -

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H>(...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H - ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H>(path: P, ...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H - ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I5, BasePath>, BasePath, MergePath>; -

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H>(...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H & M6, - H - ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H>(path: P, ...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H - ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I6, BasePath>, BasePath, MergePath>; -

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H>(...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H & M6, - H & M7, - H - ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H>(path: P, ...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H & M6, - H - ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I7, BasePath>, BasePath, MergePath>; -

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H>(...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H & M6, - H & M7, - H & M8, - H - ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H>(path: P, ...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H & M6, - H & M7, - H - ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I8, BasePath>, BasePath, MergePath>; -

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H, M9 extends H = H>(...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H & M6, - H & M7, - H & M8, - H & M9, - H - ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H>(path: P, ...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H & M6, - H & M7, - H & M8, - H - ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I9, BasePath>, BasePath, MergePath>; -

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H, M9 extends H = H>(path: P, ...handlers: [ - H & M1, - H & M2, - H & M3, - H & M4, - H & M5, - H & M6, - H & M7, - H & M8, - H & M9, - H - ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I10, BasePath>, BasePath, MergePath>; -

= any>(...handlers: H[]): HonoBase>, BasePath, CurrentPath>; -

= any>(path: P, ...handlers: [H, I, R>, ...H, I, R>[]]): HonoBase, I, MergeTypedResponse>, BasePath, MergePath>; -

= any, I extends Input = BlankInput>(path: P): HonoBase, I, MergeTypedResponse>, BasePath, MergePath>; -} -export interface MiddlewareHandlerInterface { - (...handlers: MiddlewareHandler>[]): HonoBase, S, BasePath, MergePath>; - (handler: MiddlewareHandler>): HonoBase, S, BasePath, MergePath>; - , P extends string = MergePath>(...handlers: [MiddlewareHandler, MiddlewareHandler]): HonoBase, S, BasePath, P>; -

, E2 extends Env = E>(path: P, handler: MiddlewareHandler): HonoBase, S, BasePath, MergedPath>; - , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, P extends string = MergePath>(...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, P>; -

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(path: P, ...handlers: [MiddlewareHandler, MiddlewareHandler]): HonoBase, S, BasePath, MergedPath>; - , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, P extends string = MergePath>(...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, P>; -

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(path: P, ...handlers: [MiddlewareHandler, MiddlewareHandler, MiddlewareHandler]): HonoBase, S, BasePath, MergedPath>; - , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, P extends string = MergePath>(...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, P>; -

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(path: P, ...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, MergedPath>; - , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, P extends string = MergePath>(...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, P>; -

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(path: P, ...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, MergedPath>; - , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, P extends string = MergePath>(...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, P>; -

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(path: P, ...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, MergedPath>; - , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, P extends string = MergePath>(...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, P>; -

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(path: P, ...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, MergedPath>; - , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, P extends string = MergePath>(...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, P>; -

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(path: P, ...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, MergedPath>; - , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, P extends string = MergePath>(...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, P>; -

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(path: P, ...handlers: [ - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler, - MiddlewareHandler - ]): HonoBase, S, BasePath, MergedPath>; -

(path: P, ...handlers: MiddlewareHandler>[]): HonoBase>; -} -export interface OnHandlerInterface { - , R extends HandlerResponse = any, I extends Input = BlankInput, E2 extends Env = E>(method: M, path: P, handler: H): HonoBase, S & ToSchema, I, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(method: M, path: P, ...handlers: [H, H]): HonoBase, S & ToSchema, I2, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(method: M, path: P, ...handlers: [H, H, H]): HonoBase, S & ToSchema, I3, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(method: M, path: P, ...handlers: [ - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I4, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(method: M, path: P, ...handlers: [ - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I5, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(method: M, path: P, ...handlers: [ - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I6, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(method: M, path: P, ...handlers: [ - H, - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I7, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(method: M, path: P, ...handlers: [ - H, - H, - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I8, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(method: M, path: P, ...handlers: [ - H, - H, - H, - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I9, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(method: M, path: P, ...handlers: [ - H, - H, - H, - H, - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I10, MergeTypedResponse>>, BasePath, MergePath>; - = any, I extends Input = BlankInput>(method: M, path: P, ...handlers: [H, I, R>, ...H, I, R>[]]): HonoBase, I, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, E2 extends Env = E>(methods: M[], path: P, handler: H): HonoBase, S & ToSchema, I, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(methods: M[], path: P, ...handlers: [H, H]): HonoBase, S & ToSchema, I2, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(methods: M[], path: P, ...handlers: [H, H, H]): HonoBase, S & ToSchema, I3, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(methods: M[], path: P, ...handlers: [ - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I4, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(methods: M[], path: P, ...handlers: [ - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I5, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(methods: M[], path: P, ...handlers: [ - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I6, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(methods: M[], path: P, ...handlers: [ - H, - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I7, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(methods: M[], path: P, ...handlers: [ - H, - H, - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I8, MergeTypedResponse>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(methods: M[], path: P, ...handlers: [ - H, - H, - H, - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I9, MergeTypedResponse>>, BasePath, MergePath>; - , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(methods: M[], path: P, ...handlers: [ - H, - H, - H, - H, - H, - H, - H, - H, - H, - H - ]): HonoBase, S & ToSchema, I10, MergeTypedResponse>>, BasePath, MergePath>; - = any, I extends Input = BlankInput>(methods: M[], path: P, ...handlers: [H, I, R>, ...H, I, R>[]]): HonoBase, I, MergeTypedResponse>, BasePath, MergePath>; - = any, E2 extends Env = E>(methods: M | M[], paths: Ps, ...handlers: H, I, R>[]): HonoBase, I, MergeTypedResponse>, BasePath, Ps extends [...string[], infer LastPath extends string] ? MergePath : never>; -} -type ToSchemaOutput = RorO extends TypedResponse ? { - output: unknown extends T ? {} : T; - outputFormat: I extends { - outputFormat: string; - } ? I['outputFormat'] : F; - status: U; -} : { - output: unknown extends RorO ? {} : RorO; - outputFormat: unknown extends RorO ? 'json' : I extends { - outputFormat: string; - } ? I['outputFormat'] : 'json'; - status: StatusCode; -}; -export type ToSchema = IsAny extends true ? { - [K in P]: { - [K2 in M as AddDollar]: { - input: AddParam, P>; - output: {}; - outputFormat: ResponseFormat; - status: StatusCode; - }; - }; -} : [RorO] extends [never] ? {} : [RorO] extends [Promise] ? {} : { - [K in P]: { - [K2 in M as AddDollar]: Simplify<{ - input: AddParam, P>; - } & ToSchemaOutput>; - }; -}; -export type Schema = { - [Path: string]: { - [Method: `$${Lowercase}`]: Endpoint; - }; -}; -type AddSchemaIfHasResponse = [Merged] extends [Promise] ? S : S & ToSchema, I, Merged>; -export type Endpoint = { - input: any; - output: any; - outputFormat: ResponseFormat; - status: StatusCode; -}; -type ExtractParams = string extends Path ? Record : Path extends `${infer _Start}:${infer Param}/${infer Rest}` ? { - [K in Param | keyof ExtractParams<`/${Rest}`>]: string; -} : Path extends `${infer _Start}:${infer Param}` ? { - [K in Param]: string; -} : never; -type FlattenIfIntersect = T extends infer O ? { - [K in keyof O]: O[K]; -} : never; -export type MergeSchemaPath = { - [P in keyof OrigSchema as MergePath]: [OrigSchema[P]] extends [ - Record - ] ? { - [M in keyof OrigSchema[P]]: MergeEndpointParamsWithPath; - } : never; -}; -type MergeEndpointParamsWithPath = T extends unknown ? { - input: T['input'] extends { - param: infer _; - } ? ExtractParams extends never ? T['input'] : FlattenIfIntersect as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string; - }; - }> : RemoveBlankRecord> extends never ? T['input'] : T['input'] & { - param: { - [K in keyof ExtractParams as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string; - }; - }; - output: T['output']; - outputFormat: T['outputFormat']; - status: T['status']; -} : never; -export type AddParam = ParamKeys

extends never ? I : I extends { - param: infer _; -} ? I : I & { - param: UnionToIntersection>>; -}; -type AddDollar = `$${Lowercase}`; -export type MergePath = B extends '' ? MergePath : A extends '' ? B : A extends '/' ? B : A extends `${infer P}/` ? B extends `/${infer Q}` ? `${P}/${Q}` : `${P}/${B}` : B extends `/${infer Q}` ? Q extends '' ? A : `${A}/${Q}` : `${A}/${B}`; -export type KnownResponseFormat = 'json' | 'text' | 'redirect'; -export type ResponseFormat = KnownResponseFormat | string; -export type TypedResponse = { - _data: T; - _status: U; - _format: F; -}; -type MergeTypedResponse = T extends Promise ? T : T extends Promise ? T2 extends TypedResponse ? T2 : TypedResponse : T extends TypedResponse ? T : TypedResponse; -type ExtractTypedResponseOnly = T extends TypedResponse ? T : never; -type MergeMiddlewareResponse = T extends (c: any, next: any) => Promise ? Exclude extends never ? never : Exclude extends Response | TypedResponse ? ExtractTypedResponseOnly> : never : T extends (c: any, next: any) => infer R ? R extends Response | TypedResponse ? ExtractTypedResponseOnly : never : never; -export type FormValue = string | Blob; -export type ParsedFormValue = string | File; -export type ValidationTargets = { - json: any; - form: Record; - query: Record; - param: Record; - header: Record; - cookie: Record; -}; -type ParamKey = Component extends `:${infer NameWithPattern}` ? NameWithPattern extends `${infer Name}{${infer Rest}` ? Rest extends `${infer _Pattern}?` ? `${Name}?` : Name : NameWithPattern : never; -export type ParamKeys = Path extends `${infer Component}/${infer Rest}` ? ParamKey | ParamKeys : ParamKey; -export type ParamKeyToRecord = T extends `${infer R}?` ? Record : { - [K in T]: string; -}; -export type InputToDataByTarget = T extends { - [K in Target]: infer R; -} ? R : never; -export type RemoveQuestion = T extends `${infer R}?` ? R : T; -export type ExtractSchema = UnionToIntersection ? S : never>; -export type ExtractSchemaForStatusCode = { - [Path in keyof ExtractSchema]: { - [Method in keyof ExtractSchema[Path]]: Extract[Path][Method], { - status: Status; - }>; - }; -}; -export type ExtractHandlerResponse = T extends (c: any, next: any) => Promise ? Exclude extends never ? never : Exclude extends Response | TypedResponse ? Exclude : never : T extends (c: any, next: any) => infer R ? R extends Response | TypedResponse ? R : never : never; -type ProcessHead = IfAnyThenEmptyObject; -export type IntersectNonAnyTypes = T extends [infer Head, ...infer Rest] ? ProcessHead & IntersectNonAnyTypes : {}; -export declare abstract class FetchEventLike { - abstract readonly request: Request; - abstract respondWith(promise: Response | Promise): void; - abstract passThroughOnException(): void; - abstract waitUntil(promise: Promise): void; -} -export {}; diff --git a/node_modules/hono/dist/types/utils/accept.d.ts b/node_modules/hono/dist/types/utils/accept.d.ts deleted file mode 100644 index 75c37e8..0000000 --- a/node_modules/hono/dist/types/utils/accept.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface Accept { - type: string; - params: Record; - q: number; -} -/** - * Parse an Accept header into an array of objects with type, parameters, and quality score. - * @param acceptHeader The Accept header string - * @returns An array of parsed Accept values - */ -export declare const parseAccept: (acceptHeader: string) => Accept[]; diff --git a/node_modules/hono/dist/types/utils/basic-auth.d.ts b/node_modules/hono/dist/types/utils/basic-auth.d.ts deleted file mode 100644 index 4741a4e..0000000 --- a/node_modules/hono/dist/types/utils/basic-auth.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type Auth = (req: Request) => { - username: string; - password: string; -} | undefined; -export declare const auth: Auth; diff --git a/node_modules/hono/dist/types/utils/body.d.ts b/node_modules/hono/dist/types/utils/body.d.ts deleted file mode 100644 index 5c37a1f..0000000 --- a/node_modules/hono/dist/types/utils/body.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @module - * Body utility. - */ -import { HonoRequest } from '../request'; -type BodyDataValueDot = { - [x: string]: string | File | BodyDataValueDot; -}; -type BodyDataValueDotAll = { - [x: string]: string | File | (string | File)[] | BodyDataValueDotAll; -}; -type SimplifyBodyData = { - [K in keyof T]: string | File | (string | File)[] | BodyDataValueDotAll extends T[K] ? string | File | (string | File)[] | BodyDataValueDotAll : string | File | BodyDataValueDot extends T[K] ? string | File | BodyDataValueDot : string | File | (string | File)[] extends T[K] ? string | File | (string | File)[] : string | File; -} & {}; -type BodyDataValueComponent = string | File | (T extends { - all: false; -} ? never : T extends { - all: true; -} | { - all: boolean; -} ? (string | File)[] : never); -type BodyDataValueObject = { - [key: string]: BodyDataValueComponent | BodyDataValueObject; -}; -type BodyDataValue = BodyDataValueComponent | (T extends { - dot: false; -} ? never : T extends { - dot: true; -} | { - dot: boolean; -} ? BodyDataValueObject : never); -export type BodyData = {}> = SimplifyBodyData>>; -export type ParseBodyOptions = { - /** - * Determines whether all fields with multiple values should be parsed as arrays. - * @default false - * @example - * const data = new FormData() - * data.append('file', 'aaa') - * data.append('file', 'bbb') - * data.append('message', 'hello') - * - * If all is false: - * parseBody should return { file: 'bbb', message: 'hello' } - * - * If all is true: - * parseBody should return { file: ['aaa', 'bbb'], message: 'hello' } - */ - all: boolean; - /** - * Determines whether all fields with dot notation should be parsed as nested objects. - * @default false - * @example - * const data = new FormData() - * data.append('obj.key1', 'value1') - * data.append('obj.key2', 'value2') - * - * If dot is false: - * parseBody should return { 'obj.key1': 'value1', 'obj.key2': 'value2' } - * - * If dot is true: - * parseBody should return { obj: { key1: 'value1', key2: 'value2' } } - */ - dot: boolean; -}; -/** - * Parses the body of a request based on the provided options. - * - * @template T - The type of the parsed body data. - * @param {HonoRequest | Request} request - The request object to parse. - * @param {Partial} [options] - Options for parsing the body. - * @returns {Promise} The parsed body data. - */ -interface ParseBody { - , T extends BodyData>(request: HonoRequest | Request, options?: Options): Promise; - (request: HonoRequest | Request, options?: Partial): Promise; -} -export declare const parseBody: ParseBody; -export {}; diff --git a/node_modules/hono/dist/types/utils/buffer.d.ts b/node_modules/hono/dist/types/utils/buffer.d.ts deleted file mode 100644 index 71396bc..0000000 --- a/node_modules/hono/dist/types/utils/buffer.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module - * Buffer utility. - */ -export declare const equal: (a: ArrayBuffer, b: ArrayBuffer) => boolean; -export declare const timingSafeEqual: (a: string | object | boolean, b: string | object | boolean, hashFunction?: Function) => Promise; -export declare const bufferToString: (buffer: ArrayBuffer) => string; -export declare const bufferToFormData: (arrayBuffer: ArrayBuffer, contentType: string) => Promise; diff --git a/node_modules/hono/dist/types/utils/color.d.ts b/node_modules/hono/dist/types/utils/color.d.ts deleted file mode 100644 index f57d739..0000000 --- a/node_modules/hono/dist/types/utils/color.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @module - * Color utility. - */ -/** - * Get whether color change on terminal is enabled or disabled. - * If `NO_COLOR` environment variable is set, this function returns `false`. - * Unlike getColorEnabledAsync(), this cannot check Cloudflare environment variables. - * @see {@link https://no-color.org/} - * - * @returns {boolean} - */ -export declare function getColorEnabled(): boolean; -/** - * Get whether color change on terminal is enabled or disabled. - * If `NO_COLOR` environment variable is set, this function returns `false`. - * @see {@link https://no-color.org/} - * - * @returns {boolean} - */ -export declare function getColorEnabledAsync(): Promise; diff --git a/node_modules/hono/dist/types/utils/compress.d.ts b/node_modules/hono/dist/types/utils/compress.d.ts deleted file mode 100644 index 01666b8..0000000 --- a/node_modules/hono/dist/types/utils/compress.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module - * Constants for compression. - */ -/** - * Match for compressible content type. - */ -export declare const COMPRESSIBLE_CONTENT_TYPE_REGEX: RegExp; diff --git a/node_modules/hono/dist/types/utils/concurrent.d.ts b/node_modules/hono/dist/types/utils/concurrent.d.ts deleted file mode 100644 index 24abe69..0000000 --- a/node_modules/hono/dist/types/utils/concurrent.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @module - * Concurrent utility. - */ -export interface Pool { - run(fn: () => T): Promise; -} -export declare const createPool: ({ concurrency, interval, }?: { - concurrency?: number; - interval?: number; -}) => Pool; diff --git a/node_modules/hono/dist/types/utils/constants.d.ts b/node_modules/hono/dist/types/utils/constants.d.ts deleted file mode 100644 index 733c0ef..0000000 --- a/node_modules/hono/dist/types/utils/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Constant used to mark a composed handler. - */ -export declare const COMPOSED_HANDLER = "__COMPOSED_HANDLER"; diff --git a/node_modules/hono/dist/types/utils/cookie.d.ts b/node_modules/hono/dist/types/utils/cookie.d.ts deleted file mode 100644 index d6f75f9..0000000 --- a/node_modules/hono/dist/types/utils/cookie.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @module - * Cookie utility. - */ -export type Cookie = Record; -export type SignedCookie = Record; -type PartitionedCookieConstraint = { - partitioned: true; - secure: true; -} | { - partitioned?: boolean; - secure?: boolean; -}; -type SecureCookieConstraint = { - secure: true; -}; -type HostCookieConstraint = { - secure: true; - path: '/'; - domain?: undefined; -}; -export type CookieOptions = { - domain?: string; - expires?: Date; - httpOnly?: boolean; - maxAge?: number; - path?: string; - secure?: boolean; - sameSite?: 'Strict' | 'Lax' | 'None' | 'strict' | 'lax' | 'none'; - partitioned?: boolean; - priority?: 'Low' | 'Medium' | 'High' | 'low' | 'medium' | 'high'; - prefix?: CookiePrefixOptions; -} & PartitionedCookieConstraint; -export type CookiePrefixOptions = 'host' | 'secure'; -export type CookieConstraint = Name extends `__Secure-${string}` ? CookieOptions & SecureCookieConstraint : Name extends `__Host-${string}` ? CookieOptions & HostCookieConstraint : CookieOptions; -export declare const parse: (cookie: string, name?: string) => Cookie; -export declare const parseSigned: (cookie: string, secret: string | BufferSource, name?: string) => Promise; -export declare const serialize: (name: Name, value: string, opt?: CookieConstraint) => string; -export declare const serializeSigned: (name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise; -export {}; diff --git a/node_modules/hono/dist/types/utils/crypto.d.ts b/node_modules/hono/dist/types/utils/crypto.d.ts deleted file mode 100644 index 5974286..0000000 --- a/node_modules/hono/dist/types/utils/crypto.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @module - * Crypto utility. - */ -import type { JSONValue } from './types'; -type Algorithm = { - name: string; - alias: string; -}; -type Data = string | boolean | number | JSONValue | ArrayBufferView | ArrayBuffer; -export declare const sha256: (data: Data) => Promise; -export declare const sha1: (data: Data) => Promise; -export declare const md5: (data: Data) => Promise; -export declare const createHash: (data: Data, algorithm: Algorithm) => Promise; -export {}; diff --git a/node_modules/hono/dist/types/utils/encode.d.ts b/node_modules/hono/dist/types/utils/encode.d.ts deleted file mode 100644 index c60d6e7..0000000 --- a/node_modules/hono/dist/types/utils/encode.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module - * Encode utility. - */ -export declare const decodeBase64Url: (str: string) => Uint8Array; -export declare const encodeBase64Url: (buf: ArrayBufferLike) => string; -export declare const encodeBase64: (buf: ArrayBufferLike) => string; -export declare const decodeBase64: (str: string) => Uint8Array; diff --git a/node_modules/hono/dist/types/utils/filepath.d.ts b/node_modules/hono/dist/types/utils/filepath.d.ts deleted file mode 100644 index b266925..0000000 --- a/node_modules/hono/dist/types/utils/filepath.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @module - * FilePath utility. - */ -type FilePathOptions = { - filename: string; - root?: string; - defaultDocument?: string; -}; -export declare const getFilePath: (options: FilePathOptions) => string | undefined; -export declare const getFilePathWithoutDefaultDocument: (options: Omit) => string | undefined; -export {}; diff --git a/node_modules/hono/dist/types/utils/handler.d.ts b/node_modules/hono/dist/types/utils/handler.d.ts deleted file mode 100644 index 6b593c5..0000000 --- a/node_modules/hono/dist/types/utils/handler.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @module - * Handler utility. - */ -export declare const isMiddleware: (handler: Function) => boolean; -export declare const findTargetHandler: (handler: Function) => Function; diff --git a/node_modules/hono/dist/types/utils/headers.d.ts b/node_modules/hono/dist/types/utils/headers.d.ts deleted file mode 100644 index 0c1bc9c..0000000 --- a/node_modules/hono/dist/types/utils/headers.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module - * HTTP Headers utility. - */ -export type RequestHeader = 'A-IM' | 'Accept' | 'Accept-Additions' | 'Accept-CH' | 'Accept-Charset' | 'Accept-Datetime' | 'Accept-Encoding' | 'Accept-Features' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Ranges' | 'Accept-Signature' | 'Access-Control' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Age' | 'Allow' | 'ALPN' | 'Alt-Svc' | 'Alt-Used' | 'Alternates' | 'AMP-Cache-Transform' | 'Apply-To-Redirect-Ref' | 'Authentication-Control' | 'Authentication-Info' | 'Authorization' | 'Available-Dictionary' | 'C-Ext' | 'C-Man' | 'C-Opt' | 'C-PEP' | 'C-PEP-Info' | 'Cache-Control' | 'Cache-Status' | 'Cal-Managed-ID' | 'CalDAV-Timezones' | 'Capsule-Protocol' | 'CDN-Cache-Control' | 'CDN-Loop' | 'Cert-Not-After' | 'Cert-Not-Before' | 'Clear-Site-Data' | 'Client-Cert' | 'Client-Cert-Chain' | 'Close' | 'CMCD-Object' | 'CMCD-Request' | 'CMCD-Session' | 'CMCD-Status' | 'CMSD-Dynamic' | 'CMSD-Static' | 'Concealed-Auth-Export' | 'Configuration-Context' | 'Connection' | 'Content-Base' | 'Content-Digest' | 'Content-Disposition' | 'Content-Encoding' | 'Content-ID' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-MD5' | 'Content-Range' | 'Content-Script-Type' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Style-Type' | 'Content-Type' | 'Content-Version' | 'Cookie' | 'Cookie2' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Embedder-Policy-Report-Only' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Opener-Policy-Report-Only' | 'Cross-Origin-Resource-Policy' | 'CTA-Common-Access-Token' | 'DASL' | 'Date' | 'DAV' | 'Default-Style' | 'Delta-Base' | 'Deprecation' | 'Depth' | 'Derived-From' | 'Destination' | 'Differential-ID' | 'Dictionary-ID' | 'Digest' | 'DPoP' | 'DPoP-Nonce' | 'Early-Data' | 'EDIINT-Features' | 'ETag' | 'Expect' | 'Expect-CT' | 'Expires' | 'Ext' | 'Forwarded' | 'From' | 'GetProfile' | 'Hobareg' | 'Host' | 'HTTP2-Settings' | 'If' | 'If-Match' | 'If-Modified-Since' | 'If-None-Match' | 'If-Range' | 'If-Schedule-Tag-Match' | 'If-Unmodified-Since' | 'IM' | 'Include-Referred-Token-Binding-ID' | 'Isolation' | 'Keep-Alive' | 'Label' | 'Last-Event-ID' | 'Last-Modified' | 'Link' | 'Link-Template' | 'Location' | 'Lock-Token' | 'Man' | 'Max-Forwards' | 'Memento-Datetime' | 'Meter' | 'Method-Check' | 'Method-Check-Expires' | 'MIME-Version' | 'Negotiate' | 'NEL' | 'OData-EntityId' | 'OData-Isolation' | 'OData-MaxVersion' | 'OData-Version' | 'Opt' | 'Optional-WWW-Authenticate' | 'Ordering-Type' | 'Origin' | 'Origin-Agent-Cluster' | 'OSCORE' | 'OSLC-Core-Version' | 'Overwrite' | 'P3P' | 'PEP' | 'PEP-Info' | 'Permissions-Policy' | 'PICS-Label' | 'Ping-From' | 'Ping-To' | 'Position' | 'Pragma' | 'Prefer' | 'Preference-Applied' | 'Priority' | 'ProfileObject' | 'Protocol' | 'Protocol-Info' | 'Protocol-Query' | 'Protocol-Request' | 'Proxy-Authenticate' | 'Proxy-Authentication-Info' | 'Proxy-Authorization' | 'Proxy-Features' | 'Proxy-Instruction' | 'Proxy-Status' | 'Public' | 'Public-Key-Pins' | 'Public-Key-Pins-Report-Only' | 'Range' | 'Redirect-Ref' | 'Referer' | 'Referer-Root' | 'Referrer-Policy' | 'Refresh' | 'Repeatability-Client-ID' | 'Repeatability-First-Sent' | 'Repeatability-Request-ID' | 'Repeatability-Result' | 'Replay-Nonce' | 'Reporting-Endpoints' | 'Repr-Digest' | 'Retry-After' | 'Safe' | 'Schedule-Reply' | 'Schedule-Tag' | 'Sec-GPC' | 'Sec-Purpose' | 'Sec-Token-Binding' | 'Sec-WebSocket-Accept' | 'Sec-WebSocket-Extensions' | 'Sec-WebSocket-Key' | 'Sec-WebSocket-Protocol' | 'Sec-WebSocket-Version' | 'Security-Scheme' | 'Server' | 'Server-Timing' | 'Set-Cookie' | 'Set-Cookie2' | 'SetProfile' | 'Signature' | 'Signature-Input' | 'SLUG' | 'SoapAction' | 'Status-URI' | 'Strict-Transport-Security' | 'Sunset' | 'Surrogate-Capability' | 'Surrogate-Control' | 'TCN' | 'TE' | 'Timeout' | 'Timing-Allow-Origin' | 'Topic' | 'Traceparent' | 'Tracestate' | 'Trailer' | 'Transfer-Encoding' | 'TTL' | 'Upgrade' | 'Urgency' | 'URI' | 'Use-As-Dictionary' | 'User-Agent' | 'Variant-Vary' | 'Vary' | 'Via' | 'Want-Content-Digest' | 'Want-Digest' | 'Want-Repr-Digest' | 'Warning' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-Frame-Options'; -export type ResponseHeader = 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Age' | 'Allow' | 'Cache-Control' | 'Clear-Site-Data' | 'Content-Disposition' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Range' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Type' | 'Cookie' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Resource-Policy' | 'Date' | 'ETag' | 'Expires' | 'Last-Modified' | 'Location' | 'Permissions-Policy' | 'Pragma' | 'Retry-After' | 'Save-Data' | 'Sec-CH-Prefers-Color-Scheme' | 'Sec-CH-Prefers-Reduced-Motion' | 'Sec-CH-UA' | 'Sec-CH-UA-Arch' | 'Sec-CH-UA-Bitness' | 'Sec-CH-UA-Form-Factor' | 'Sec-CH-UA-Full-Version' | 'Sec-CH-UA-Full-Version-List' | 'Sec-CH-UA-Mobile' | 'Sec-CH-UA-Model' | 'Sec-CH-UA-Platform' | 'Sec-CH-UA-Platform-Version' | 'Sec-CH-UA-WoW64' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-User' | 'Sec-GPC' | 'Server' | 'Server-Timing' | 'Service-Worker-Navigation-Preload' | 'Set-Cookie' | 'Strict-Transport-Security' | 'Timing-Allow-Origin' | 'Trailer' | 'Transfer-Encoding' | 'Upgrade' | 'Vary' | 'WWW-Authenticate' | 'Warning' | 'X-Content-Type-Options' | 'X-DNS-Prefetch-Control' | 'X-Frame-Options' | 'X-Permitted-Cross-Domain-Policies' | 'X-Powered-By' | 'X-Robots-Tag' | 'X-XSS-Protection'; -export type AcceptHeader = 'Accept' | 'Accept-Charset' | 'Accept-Encoding' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Ranges'; -export type CustomHeader = string & {}; diff --git a/node_modules/hono/dist/types/utils/html.d.ts b/node_modules/hono/dist/types/utils/html.d.ts deleted file mode 100644 index 35475cb..0000000 --- a/node_modules/hono/dist/types/utils/html.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @module - * HTML utility. - */ -export declare const HtmlEscapedCallbackPhase: { - readonly Stringify: 1; - readonly BeforeStream: 2; - readonly Stream: 3; -}; -type HtmlEscapedCallbackOpts = { - buffer?: [string]; - phase: (typeof HtmlEscapedCallbackPhase)[keyof typeof HtmlEscapedCallbackPhase]; - context: Readonly; -}; -export type HtmlEscapedCallback = (opts: HtmlEscapedCallbackOpts) => Promise | undefined; -export type HtmlEscaped = { - isEscaped: true; - callbacks?: HtmlEscapedCallback[]; -}; -export type HtmlEscapedString = string & HtmlEscaped; -/** - * StringBuffer contains string and Promise alternately - * The length of the array will be odd, the odd numbered element will be a string, - * and the even numbered element will be a Promise. - * When concatenating into a single string, it must be processed from the tail. - * @example - * [ - * 'framework.', - * Promise.resolve('ultra fast'), - * 'a ', - * Promise.resolve('is '), - * 'Hono', - * ] - */ -export type StringBuffer = (string | Promise)[]; -export type StringBufferWithCallbacks = StringBuffer & { - callbacks: HtmlEscapedCallback[]; -}; -export declare const raw: (value: unknown, callbacks?: HtmlEscapedCallback[]) => HtmlEscapedString; -export declare const stringBufferToString: (buffer: StringBuffer, callbacks: HtmlEscapedCallback[] | undefined) => Promise; -export declare const escapeToBuffer: (str: string, buffer: StringBuffer) => void; -export declare const resolveCallbackSync: (str: string | HtmlEscapedString) => string; -export declare const resolveCallback: (str: string | HtmlEscapedString | Promise, phase: (typeof HtmlEscapedCallbackPhase)[keyof typeof HtmlEscapedCallbackPhase], preserveCallbacks: boolean, context: object, buffer?: [string]) => Promise; -export {}; diff --git a/node_modules/hono/dist/types/utils/http-status.d.ts b/node_modules/hono/dist/types/utils/http-status.d.ts deleted file mode 100644 index f0cb67c..0000000 --- a/node_modules/hono/dist/types/utils/http-status.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @module - * HTTP Status utility. - */ -export type InfoStatusCode = 100 | 101 | 102 | 103; -export type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226; -export type DeprecatedStatusCode = 305 | 306; -export type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308; -export type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451; -export type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511; -/** - * `UnofficialStatusCode` can be used to specify an unofficial status code. - * @example - * - * ```ts - * app.get('/unknown', (c) => { - * return c.text("Unknown Error", 520 as UnofficialStatusCode) - * }) - * ``` - */ -export type UnofficialStatusCode = -1; -/** - * @deprecated - * Use `UnofficialStatusCode` instead. - */ -export type UnOfficalStatusCode = UnofficialStatusCode; -/** - * If you want to use an unofficial status, use `UnofficialStatusCode`. - */ -export type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode; -export type ContentlessStatusCode = 101 | 204 | 205 | 304; -export type ContentfulStatusCode = Exclude; diff --git a/node_modules/hono/dist/types/utils/ipaddr.d.ts b/node_modules/hono/dist/types/utils/ipaddr.d.ts deleted file mode 100644 index ae97e71..0000000 --- a/node_modules/hono/dist/types/utils/ipaddr.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Utils for IP Addresses - * @module - */ -import type { AddressType } from '../helper/conninfo'; -/** - * Expand IPv6 Address - * @param ipV6 Shorten IPv6 Address - * @return expanded IPv6 Address - */ -export declare const expandIPv6: (ipV6: string) => string; -/** - * Distinct Remote Addr - * @param remoteAddr Remote Addr - */ -export declare const distinctRemoteAddr: (remoteAddr: string) => AddressType; -/** - * Convert IPv4 to Uint8Array - * @param ipv4 IPv4 Address - * @returns BigInt - */ -export declare const convertIPv4ToBinary: (ipv4: string) => bigint; -/** - * Convert IPv6 to Uint8Array - * @param ipv6 IPv6 Address - * @returns BigInt - */ -export declare const convertIPv6ToBinary: (ipv6: string) => bigint; -/** - * Convert a binary representation of an IPv4 address to a string. - * @param ipV4 binary IPv4 Address - * @return IPv4 Address in string - */ -export declare const convertIPv4BinaryToString: (ipV4: bigint) => string; -/** - * Convert a binary representation of an IPv6 address to a string. - * @param ipV6 binary IPv6 Address - * @return normalized IPv6 Address in string - */ -export declare const convertIPv6BinaryToString: (ipV6: bigint) => string; diff --git a/node_modules/hono/dist/types/utils/jwt/index.d.ts b/node_modules/hono/dist/types/utils/jwt/index.d.ts deleted file mode 100644 index 5d89310..0000000 --- a/node_modules/hono/dist/types/utils/jwt/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @module - * JWT utility. - */ -export declare const Jwt: { - sign: (payload: import("./types").JWTPayload, privateKey: import("./jws").SignatureKey, alg?: import("./jwa").SignatureAlgorithm) => Promise; - verify: (token: string, publicKey: import("./jws").SignatureKey, algOrOptions: import("./jwa").SignatureAlgorithm | import("./jwt").VerifyOptionsWithAlg) => Promise; - decode: (token: string) => { - header: import("./jwt").TokenHeader; - payload: import("./types").JWTPayload; - }; - verifyWithJwks: (token: string, options: { - keys?: import("./jws").HonoJsonWebKey[]; - jwks_uri?: string; - verification?: import("./jwt").VerifyOptions; - allowedAlgorithms: readonly import("./jwa").AsymmetricAlgorithm[]; - }, init?: RequestInit) => Promise; -}; diff --git a/node_modules/hono/dist/types/utils/jwt/jwa.d.ts b/node_modules/hono/dist/types/utils/jwt/jwa.d.ts deleted file mode 100644 index 72b51f4..0000000 --- a/node_modules/hono/dist/types/utils/jwt/jwa.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @module - * JSON Web Algorithms (JWA) - * https://datatracker.ietf.org/doc/html/rfc7518 - */ -export declare enum AlgorithmTypes { - HS256 = "HS256", - HS384 = "HS384", - HS512 = "HS512", - RS256 = "RS256", - RS384 = "RS384", - RS512 = "RS512", - PS256 = "PS256", - PS384 = "PS384", - PS512 = "PS512", - ES256 = "ES256", - ES384 = "ES384", - ES512 = "ES512", - EdDSA = "EdDSA" -} -export type SignatureAlgorithm = keyof typeof AlgorithmTypes; -export type SymmetricAlgorithm = 'HS256' | 'HS384' | 'HS512'; -export type AsymmetricAlgorithm = 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512' | 'ES256' | 'ES384' | 'ES512' | 'EdDSA'; diff --git a/node_modules/hono/dist/types/utils/jwt/jws.d.ts b/node_modules/hono/dist/types/utils/jwt/jws.d.ts deleted file mode 100644 index 63605f6..0000000 --- a/node_modules/hono/dist/types/utils/jwt/jws.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @module - * JSON Web Signature (JWS) - * https://datatracker.ietf.org/doc/html/rfc7515 - */ -import type { SignatureAlgorithm } from './jwa'; -export interface HonoJsonWebKey extends JsonWebKey { - kid?: string; -} -export type SignatureKey = string | HonoJsonWebKey | CryptoKey; -export declare function signing(privateKey: SignatureKey, alg: SignatureAlgorithm, data: BufferSource): Promise; -export declare function verifying(publicKey: SignatureKey, alg: SignatureAlgorithm, signature: BufferSource, data: BufferSource): Promise; diff --git a/node_modules/hono/dist/types/utils/jwt/jwt.d.ts b/node_modules/hono/dist/types/utils/jwt/jwt.d.ts deleted file mode 100644 index e8fed89..0000000 --- a/node_modules/hono/dist/types/utils/jwt/jwt.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @module - * JSON Web Token (JWT) - * https://datatracker.ietf.org/doc/html/rfc7519 - */ -import type { AsymmetricAlgorithm, SignatureAlgorithm } from './jwa'; -import type { HonoJsonWebKey, SignatureKey } from './jws'; -import type { JWTPayload } from './types'; -export interface TokenHeader { - alg: SignatureAlgorithm; - typ?: 'JWT'; - kid?: string; -} -export declare function isTokenHeader(obj: unknown): obj is TokenHeader; -export declare const sign: (payload: JWTPayload, privateKey: SignatureKey, alg?: SignatureAlgorithm) => Promise; -export type VerifyOptions = { - /** The expected issuer used for verifying the token */ - iss?: string | RegExp; - /** Verify the `nbf` claim (default: `true`) */ - nbf?: boolean; - /** Verify the `exp` claim (default: `true`) */ - exp?: boolean; - /** Verify the `iat` claim (default: `true`) */ - iat?: boolean; - /** Acceptable audience(s) for the token */ - aud?: string | string[] | RegExp; -}; -export type VerifyOptionsWithAlg = { - /** The algorithm used for decoding the token */ - alg: SignatureAlgorithm; -} & VerifyOptions; -export declare const verify: (token: string, publicKey: SignatureKey, algOrOptions: SignatureAlgorithm | VerifyOptionsWithAlg) => Promise; -export declare const verifyWithJwks: (token: string, options: { - keys?: HonoJsonWebKey[]; - jwks_uri?: string; - verification?: VerifyOptions; - allowedAlgorithms: readonly AsymmetricAlgorithm[]; -}, init?: RequestInit) => Promise; -export declare const decode: (token: string) => { - header: TokenHeader; - payload: JWTPayload; -}; -export declare const decodeHeader: (token: string) => TokenHeader; diff --git a/node_modules/hono/dist/types/utils/jwt/types.d.ts b/node_modules/hono/dist/types/utils/jwt/types.d.ts deleted file mode 100644 index d5ccf85..0000000 --- a/node_modules/hono/dist/types/utils/jwt/types.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @module - * Type definitions for JWT utilities. - */ -export declare class JwtAlgorithmNotImplemented extends Error { - constructor(alg: string); -} -export declare class JwtAlgorithmRequired extends Error { - constructor(); -} -export declare class JwtAlgorithmMismatch extends Error { - constructor(expected: string, actual: string); -} -export declare class JwtTokenInvalid extends Error { - constructor(token: string); -} -export declare class JwtTokenNotBefore extends Error { - constructor(token: string); -} -export declare class JwtTokenExpired extends Error { - constructor(token: string); -} -export declare class JwtTokenIssuedAt extends Error { - constructor(currentTimestamp: number, iat: number); -} -export declare class JwtTokenIssuer extends Error { - constructor(expected: string | RegExp, iss: string | null); -} -export declare class JwtHeaderInvalid extends Error { - constructor(header: object); -} -export declare class JwtHeaderRequiresKid extends Error { - constructor(header: object); -} -export declare class JwtSymmetricAlgorithmNotAllowed extends Error { - constructor(alg: string); -} -export declare class JwtAlgorithmNotAllowed extends Error { - constructor(alg: string, allowedAlgorithms: readonly string[]); -} -export declare class JwtTokenSignatureMismatched extends Error { - constructor(token: string); -} -export declare class JwtPayloadRequiresAud extends Error { - constructor(payload: object); -} -export declare class JwtTokenAudience extends Error { - constructor(expected: string | string[] | RegExp, aud: string | string[]); -} -export declare enum CryptoKeyUsage { - Encrypt = "encrypt", - Decrypt = "decrypt", - Sign = "sign", - Verify = "verify", - DeriveKey = "deriveKey", - DeriveBits = "deriveBits", - WrapKey = "wrapKey", - UnwrapKey = "unwrapKey" -} -/** - * JWT Payload - */ -export type JWTPayload = { - [key: string]: unknown; - /** - * The token is checked to ensure it has not expired. - */ - exp?: number; - /** - * The token is checked to ensure it is not being used before a specified time. - */ - nbf?: number; - /** - * The token is checked to ensure it is not issued in the future. - */ - iat?: number; - /** - * The token is checked to ensure it has been issued by a trusted issuer. - */ - iss?: string; - /** - * The token is checked to ensure it is intended for a specific audience. - */ - aud?: string | string[]; -}; -export type { HonoJsonWebKey } from './jws'; diff --git a/node_modules/hono/dist/types/utils/jwt/utf8.d.ts b/node_modules/hono/dist/types/utils/jwt/utf8.d.ts deleted file mode 100644 index ff9fc1c..0000000 --- a/node_modules/hono/dist/types/utils/jwt/utf8.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @module - * Functions for encoding/decoding UTF8. - */ -export declare const utf8Encoder: TextEncoder; -export declare const utf8Decoder: TextDecoder; diff --git a/node_modules/hono/dist/types/utils/mime.d.ts b/node_modules/hono/dist/types/utils/mime.d.ts deleted file mode 100644 index b83bcec..0000000 --- a/node_modules/hono/dist/types/utils/mime.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @module - * MIME utility. - */ -export declare const getMimeType: (filename: string, mimes?: Record) => string | undefined; -export declare const getExtension: (mimeType: string) => string | undefined; -export { baseMimes as mimes }; -/** - * Union types for BaseMime - */ -export type BaseMime = (typeof _baseMimes)[keyof typeof _baseMimes]; -declare const _baseMimes: { - readonly aac: "audio/aac"; - readonly avi: "video/x-msvideo"; - readonly avif: "image/avif"; - readonly av1: "video/av1"; - readonly bin: "application/octet-stream"; - readonly bmp: "image/bmp"; - readonly css: "text/css"; - readonly csv: "text/csv"; - readonly eot: "application/vnd.ms-fontobject"; - readonly epub: "application/epub+zip"; - readonly gif: "image/gif"; - readonly gz: "application/gzip"; - readonly htm: "text/html"; - readonly html: "text/html"; - readonly ico: "image/x-icon"; - readonly ics: "text/calendar"; - readonly jpeg: "image/jpeg"; - readonly jpg: "image/jpeg"; - readonly js: "text/javascript"; - readonly json: "application/json"; - readonly jsonld: "application/ld+json"; - readonly map: "application/json"; - readonly mid: "audio/x-midi"; - readonly midi: "audio/x-midi"; - readonly mjs: "text/javascript"; - readonly mp3: "audio/mpeg"; - readonly mp4: "video/mp4"; - readonly mpeg: "video/mpeg"; - readonly oga: "audio/ogg"; - readonly ogv: "video/ogg"; - readonly ogx: "application/ogg"; - readonly opus: "audio/opus"; - readonly otf: "font/otf"; - readonly pdf: "application/pdf"; - readonly png: "image/png"; - readonly rtf: "application/rtf"; - readonly svg: "image/svg+xml"; - readonly tif: "image/tiff"; - readonly tiff: "image/tiff"; - readonly ts: "video/mp2t"; - readonly ttf: "font/ttf"; - readonly txt: "text/plain"; - readonly wasm: "application/wasm"; - readonly webm: "video/webm"; - readonly weba: "audio/webm"; - readonly webmanifest: "application/manifest+json"; - readonly webp: "image/webp"; - readonly woff: "font/woff"; - readonly woff2: "font/woff2"; - readonly xhtml: "application/xhtml+xml"; - readonly xml: "application/xml"; - readonly zip: "application/zip"; - readonly '3gp': "video/3gpp"; - readonly '3g2': "video/3gpp2"; - readonly gltf: "model/gltf+json"; - readonly glb: "model/gltf-binary"; -}; -declare const baseMimes: Record; diff --git a/node_modules/hono/dist/types/utils/stream.d.ts b/node_modules/hono/dist/types/utils/stream.d.ts deleted file mode 100644 index 51c46e6..0000000 --- a/node_modules/hono/dist/types/utils/stream.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @module - * Stream utility. - */ -export declare class StreamingApi { - private writer; - private encoder; - private writable; - private abortSubscribers; - responseReadable: ReadableStream; - /** - * Whether the stream has been aborted. - */ - aborted: boolean; - /** - * Whether the stream has been closed normally. - */ - closed: boolean; - constructor(writable: WritableStream, _readable: ReadableStream); - write(input: Uint8Array | string): Promise; - writeln(input: string): Promise; - sleep(ms: number): Promise; - close(): Promise; - pipe(body: ReadableStream): Promise; - onAbort(listener: () => void | Promise): void; - /** - * Abort the stream. - * You can call this method when stream is aborted by external event. - */ - abort(): void; -} diff --git a/node_modules/hono/dist/types/utils/types.d.ts b/node_modules/hono/dist/types/utils/types.d.ts deleted file mode 100644 index 8dce20d..0000000 --- a/node_modules/hono/dist/types/utils/types.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @module - * Types utility. - */ -export type Expect = T; -export type Equal = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? true : false; -export type NotEqual = true extends Equal ? false : true; -export type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; -export type RemoveBlankRecord = T extends Record ? (K extends string ? T : never) : never; -export type IfAnyThenEmptyObject = 0 extends 1 & T ? {} : T; -export type JSONPrimitive = string | boolean | number | null; -export type JSONArray = (JSONPrimitive | JSONObject | JSONArray)[]; -export type JSONObject = { - [key: string]: JSONPrimitive | JSONArray | JSONObject | object | InvalidJSONValue; -}; -export type InvalidJSONValue = undefined | symbol | ((...args: unknown[]) => unknown); -type InvalidToNull = T extends InvalidJSONValue ? null : T; -type IsInvalid = T extends InvalidJSONValue ? true : false; -/** - * symbol keys are omitted through `JSON.stringify` - */ -type OmitSymbolKeys = { - [K in keyof T as K extends symbol ? never : K]: T[K]; -}; -export type JSONValue = JSONObject | JSONArray | JSONPrimitive; -/** - * Convert a type to a JSON-compatible type. - * - * Non-JSON values such as `Date` implement `.toJSON()`, - * so they can be transformed to a value assignable to `JSONObject` - * - * `JSON.stringify()` throws a `TypeError` when it encounters a `bigint` value, - * unless a custom `replacer` function or `.toJSON()` method is provided. - * - * This behaviour can be controlled by the `TError` generic type parameter, - * which defaults to `bigint | ReadonlyArray`. - * You can set it to `never` to disable this check. - */ -export type JSONParsed> = T extends { - toJSON(): infer J; -} ? (() => J) extends () => JSONPrimitive ? J : (() => J) extends () => { - toJSON(): unknown; -} ? {} : JSONParsed : T extends JSONPrimitive ? T : T extends InvalidJSONValue ? never : T extends ReadonlyArray ? { - [K in keyof T]: JSONParsed, TError>; -} : T extends Set | Map | Record ? {} : T extends object ? T[keyof T] extends TError ? never : { - [K in keyof OmitSymbolKeys as IsInvalid extends true ? never : K]: boolean extends IsInvalid ? JSONParsed | undefined : JSONParsed; -} : T extends unknown ? T extends TError ? never : JSONValue : never; -/** - * Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability. - * @copyright from sindresorhus/type-fest - */ -export type Simplify = { - [KeyType in keyof T]: T[KeyType]; -} & {}; -/** - * A simple extension of Simplify that will deeply traverse array elements. - */ -export type SimplifyDeepArray = T extends any[] ? { - [E in keyof T]: SimplifyDeepArray; -} : Simplify; -export type InterfaceToType = T extends Function ? T : { - [K in keyof T]: InterfaceToType; -}; -export type RequiredKeysOf = Exclude<{ - [Key in keyof BaseType]: BaseType extends Record ? Key : never; -}[keyof BaseType], undefined>; -export type HasRequiredKeys = RequiredKeysOf extends never ? false : true; -export type IsAny = boolean extends (T extends never ? true : false) ? true : false; -/** - * String literal types with auto-completion - * @see https://github.com/Microsoft/TypeScript/issues/29729 - */ -export type StringLiteralUnion = T | (string & Record); -export {}; diff --git a/node_modules/hono/dist/types/utils/url.d.ts b/node_modules/hono/dist/types/utils/url.d.ts deleted file mode 100644 index dc94f1e..0000000 --- a/node_modules/hono/dist/types/utils/url.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @module - * URL utility. - */ -export type Pattern = readonly [string, string, RegExp | true] | '*'; -export declare const splitPath: (path: string) => string[]; -export declare const splitRoutingPath: (routePath: string) => string[]; -export declare const getPattern: (label: string, next?: string) => Pattern | null; -type Decoder = (str: string) => string; -export declare const tryDecode: (str: string, decoder: Decoder) => string; -export declare const getPath: (request: Request) => string; -export declare const getQueryStrings: (url: string) => string; -export declare const getPathNoStrict: (request: Request) => string; -/** - * Merge paths. - * @param {string[]} ...paths - The paths to merge. - * @returns {string} The merged path. - * @example - * mergePath('/api', '/users') // '/api/users' - * mergePath('/api/', '/users') // '/api/users' - * mergePath('/api', '/') // '/api' - * mergePath('/api/', '/') // '/api/' - */ -export declare const mergePath: (...paths: string[]) => string; -export declare const checkOptionalParameter: (path: string) => string[] | null; -export declare const getQueryParam: (url: string, key?: string) => string | undefined | Record; -export declare const getQueryParams: (url: string, key?: string) => string[] | undefined | Record; -export declare const decodeURIComponent_: typeof decodeURIComponent; -export {}; diff --git a/node_modules/hono/dist/types/validator/index.d.ts b/node_modules/hono/dist/types/validator/index.d.ts deleted file mode 100644 index 149b255..0000000 --- a/node_modules/hono/dist/types/validator/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @module - * Validator for Hono. - */ -export { validator } from './validator'; -export type { ValidationFunction } from './validator'; -export type { InferInput } from './utils'; diff --git a/node_modules/hono/dist/types/validator/utils.d.ts b/node_modules/hono/dist/types/validator/utils.d.ts deleted file mode 100644 index 4fef73d..0000000 --- a/node_modules/hono/dist/types/validator/utils.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { FormValue, ParsedFormValue, ValidationTargets } from '../types'; -import type { UnionToIntersection } from '../utils/types'; -/** - * Checks if T is a literal union type (e.g., 'asc' | 'desc') - * that should be preserved in input types. - * Returns true for union literals, false for single literals or wide types. - */ -export type IsLiteralUnion = [Exclude] extends [Base] ? [Exclude] extends [UnionToIntersection>] ? false : true : false; -type IsOptionalUnion = [unknown] extends [T] ? false : undefined extends T ? true : false; -type SimplifyDeep = { - [K in keyof T]: T[K]; -} & {}; -type InferInputInner = SimplifyDeep<{ - [K in keyof Output]: IsLiteralUnion extends true ? Output[K] : IsOptionalUnion extends true ? Output[K] : Target extends 'form' ? T | T[] : Target extends 'query' ? string | string[] : Target extends 'param' ? string : Target extends 'header' ? string : Target extends 'cookie' ? string : unknown; -}>; -/** - * Utility type to infer input types for validation targets. - * Preserves literal union types (e.g., 'asc' | 'desc') while using - * the default ValidationTargets type for other values. - * - * @example - * ```ts - * // In @hono/zod-validator or similar: - * type Input = InferInput, 'query'> - * // { orderBy: 'asc' | 'desc', page: string | string[] } - * ``` - */ -export type InferInput = [Exclude] extends [never] ? {} : [Exclude] extends [object] ? undefined extends Output ? SimplifyDeep, Target, T>> | undefined : SimplifyDeep> : {}; -export {}; diff --git a/node_modules/hono/dist/types/validator/validator.d.ts b/node_modules/hono/dist/types/validator/validator.d.ts deleted file mode 100644 index 0a94947..0000000 --- a/node_modules/hono/dist/types/validator/validator.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Context } from '../context'; -import type { Env, MiddlewareHandler, TypedResponse, ValidationTargets, FormValue } from '../types'; -import type { InferInput } from './utils'; -type ValidationTargetKeysWithBody = 'form' | 'json'; -type ValidationTargetByMethod = M extends 'get' | 'head' ? Exclude : keyof ValidationTargets; -export type ValidationFunction = (value: InputType, c: Context) => OutputType | TypedResponse | Promise | Promise; -export type ExtractValidationResponse = VF extends (value: any, c: any) => infer R ? R extends Promise ? PR extends TypedResponse ? TypedResponse : PR extends Response ? PR : PR extends undefined ? never : never : R extends TypedResponse ? TypedResponse : R extends Response ? R : R extends undefined ? never : never : never; -export declare const validator: , P2 extends string = P, VF extends (value: unknown extends InputType ? ValidationTargets[U] : InputType, c: Context) => any = (value: unknown extends InputType ? ValidationTargets[U] : InputType, c: Context) => any, V extends { - in: { [K in U]: K extends "json" ? unknown extends InputType ? ExtractValidatorOutput : InputType : InferInput, K, FormValue>; }; - out: { [K in U]: ExtractValidatorOutput; }; -} = { - in: { [K in U]: K extends "json" ? unknown extends InputType ? ExtractValidatorOutput : InputType : InferInput, K, FormValue>; }; - out: { [K in U]: ExtractValidatorOutput; }; -}, E extends Env = any>(target: U, validationFunc: VF) => MiddlewareHandler>; -export type ExtractValidatorOutput = VF extends (value: any, c: any) => infer R ? R extends Promise ? PR extends Response | TypedResponse ? never : PR : R extends Response | TypedResponse ? never : R : never; -export {}; diff --git a/node_modules/hono/dist/utils/accept.js b/node_modules/hono/dist/utils/accept.js deleted file mode 100644 index 2d72f1f..0000000 --- a/node_modules/hono/dist/utils/accept.js +++ /dev/null @@ -1,63 +0,0 @@ -// src/utils/accept.ts -var parseAccept = (acceptHeader) => { - if (!acceptHeader) { - return []; - } - const acceptValues = acceptHeader.split(",").map((value, index) => ({ value, index })); - return acceptValues.map(parseAcceptValue).filter((item) => Boolean(item)).sort(sortByQualityAndIndex).map(({ type, params, q }) => ({ type, params, q })); -}; -var parseAcceptValueRegex = /;(?=(?:(?:[^"]*"){2})*[^"]*$)/; -var parseAcceptValue = ({ value, index }) => { - const parts = value.trim().split(parseAcceptValueRegex).map((s) => s.trim()); - const type = parts[0]; - if (!type) { - return null; - } - const params = parseParams(parts.slice(1)); - const q = parseQuality(params.q); - return { type, params, q, index }; -}; -var parseParams = (paramParts) => { - return paramParts.reduce((acc, param) => { - const [key, val] = param.split("=").map((s) => s.trim()); - if (key && val) { - acc[key] = val; - } - return acc; - }, {}); -}; -var parseQuality = (qVal) => { - if (qVal === void 0) { - return 1; - } - if (qVal === "") { - return 1; - } - if (qVal === "NaN") { - return 0; - } - const num = Number(qVal); - if (num === Infinity) { - return 1; - } - if (num === -Infinity) { - return 0; - } - if (Number.isNaN(num)) { - return 1; - } - if (num < 0 || num > 1) { - return 1; - } - return num; -}; -var sortByQualityAndIndex = (a, b) => { - const qDiff = b.q - a.q; - if (qDiff !== 0) { - return qDiff; - } - return a.index - b.index; -}; -export { - parseAccept -}; diff --git a/node_modules/hono/dist/utils/basic-auth.js b/node_modules/hono/dist/utils/basic-auth.js deleted file mode 100644 index 579a665..0000000 --- a/node_modules/hono/dist/utils/basic-auth.js +++ /dev/null @@ -1,23 +0,0 @@ -// src/utils/basic-auth.ts -import { decodeBase64 } from "./encode.js"; -var CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/; -var USER_PASS_REGEXP = /^([^:]*):(.*)$/; -var utf8Decoder = new TextDecoder(); -var auth = (req) => { - const match = CREDENTIALS_REGEXP.exec(req.headers.get("Authorization") || ""); - if (!match) { - return void 0; - } - let userPass = void 0; - try { - userPass = USER_PASS_REGEXP.exec(utf8Decoder.decode(decodeBase64(match[1]))); - } catch { - } - if (!userPass) { - return void 0; - } - return { username: userPass[1], password: userPass[2] }; -}; -export { - auth -}; diff --git a/node_modules/hono/dist/utils/body.js b/node_modules/hono/dist/utils/body.js deleted file mode 100644 index d636562..0000000 --- a/node_modules/hono/dist/utils/body.js +++ /dev/null @@ -1,72 +0,0 @@ -// src/utils/body.ts -import { HonoRequest } from "../request.js"; -var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => { - const { all = false, dot = false } = options; - const headers = request instanceof HonoRequest ? request.raw.headers : request.headers; - const contentType = headers.get("Content-Type"); - if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) { - return parseFormData(request, { all, dot }); - } - return {}; -}; -async function parseFormData(request, options) { - const formData = await request.formData(); - if (formData) { - return convertFormDataToBodyData(formData, options); - } - return {}; -} -function convertFormDataToBodyData(formData, options) { - const form = /* @__PURE__ */ Object.create(null); - formData.forEach((value, key) => { - const shouldParseAllValues = options.all || key.endsWith("[]"); - if (!shouldParseAllValues) { - form[key] = value; - } else { - handleParsingAllValues(form, key, value); - } - }); - if (options.dot) { - Object.entries(form).forEach(([key, value]) => { - const shouldParseDotValues = key.includes("."); - if (shouldParseDotValues) { - handleParsingNestedValues(form, key, value); - delete form[key]; - } - }); - } - return form; -} -var handleParsingAllValues = (form, key, value) => { - if (form[key] !== void 0) { - if (Array.isArray(form[key])) { - ; - form[key].push(value); - } else { - form[key] = [form[key], value]; - } - } else { - if (!key.endsWith("[]")) { - form[key] = value; - } else { - form[key] = [value]; - } - } -}; -var handleParsingNestedValues = (form, key, value) => { - let nestedForm = form; - const keys = key.split("."); - keys.forEach((key2, index) => { - if (index === keys.length - 1) { - nestedForm[key2] = value; - } else { - if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) { - nestedForm[key2] = /* @__PURE__ */ Object.create(null); - } - nestedForm = nestedForm[key2]; - } - }); -}; -export { - parseBody -}; diff --git a/node_modules/hono/dist/utils/buffer.js b/node_modules/hono/dist/utils/buffer.js deleted file mode 100644 index 241b9c1..0000000 --- a/node_modules/hono/dist/utils/buffer.js +++ /dev/null @@ -1,50 +0,0 @@ -// src/utils/buffer.ts -import { sha256 } from "./crypto.js"; -var equal = (a, b) => { - if (a === b) { - return true; - } - if (a.byteLength !== b.byteLength) { - return false; - } - const va = new DataView(a); - const vb = new DataView(b); - let i = va.byteLength; - while (i--) { - if (va.getUint8(i) !== vb.getUint8(i)) { - return false; - } - } - return true; -}; -var timingSafeEqual = async (a, b, hashFunction) => { - if (!hashFunction) { - hashFunction = sha256; - } - const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]); - if (!sa || !sb) { - return false; - } - return sa === sb && a === b; -}; -var bufferToString = (buffer) => { - if (buffer instanceof ArrayBuffer) { - const enc = new TextDecoder("utf-8"); - return enc.decode(buffer); - } - return buffer; -}; -var bufferToFormData = (arrayBuffer, contentType) => { - const response = new Response(arrayBuffer, { - headers: { - "Content-Type": contentType - } - }); - return response.formData(); -}; -export { - bufferToFormData, - bufferToString, - equal, - timingSafeEqual -}; diff --git a/node_modules/hono/dist/utils/color.js b/node_modules/hono/dist/utils/color.js deleted file mode 100644 index e867195..0000000 --- a/node_modules/hono/dist/utils/color.js +++ /dev/null @@ -1,25 +0,0 @@ -// src/utils/color.ts -function getColorEnabled() { - const { process, Deno } = globalThis; - const isNoColor = typeof Deno?.noColor === "boolean" ? Deno.noColor : process !== void 0 ? ( - // eslint-disable-next-line no-unsafe-optional-chaining - "NO_COLOR" in process?.env - ) : false; - return !isNoColor; -} -async function getColorEnabledAsync() { - const { navigator } = globalThis; - const cfWorkers = "cloudflare:workers"; - const isNoColor = navigator !== void 0 && navigator.userAgent === "Cloudflare-Workers" ? await (async () => { - try { - return "NO_COLOR" in ((await import(cfWorkers)).env ?? {}); - } catch { - return false; - } - })() : !getColorEnabled(); - return !isNoColor; -} -export { - getColorEnabled, - getColorEnabledAsync -}; diff --git a/node_modules/hono/dist/utils/compress.js b/node_modules/hono/dist/utils/compress.js deleted file mode 100644 index 52b39b4..0000000 --- a/node_modules/hono/dist/utils/compress.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/utils/compress.ts -var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/(?!event-stream(?:[;\s]|$))[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i; -export { - COMPRESSIBLE_CONTENT_TYPE_REGEX -}; diff --git a/node_modules/hono/dist/utils/concurrent.js b/node_modules/hono/dist/utils/concurrent.js deleted file mode 100644 index a9d4b6c..0000000 --- a/node_modules/hono/dist/utils/concurrent.js +++ /dev/null @@ -1,39 +0,0 @@ -// src/utils/concurrent.ts -var DEFAULT_CONCURRENCY = 1024; -var createPool = ({ - concurrency, - interval -} = {}) => { - concurrency ||= DEFAULT_CONCURRENCY; - if (concurrency === Infinity) { - return { - run: async (fn) => fn() - }; - } - const pool = /* @__PURE__ */ new Set(); - const run = async (fn, promise, resolve) => { - if (pool.size >= concurrency) { - promise ||= new Promise((r) => resolve = r); - setTimeout(() => run(fn, promise, resolve)); - return promise; - } - const marker = {}; - pool.add(marker); - const result = await fn(); - if (interval) { - setTimeout(() => pool.delete(marker), interval); - } else { - pool.delete(marker); - } - if (resolve) { - resolve(result); - return promise; - } else { - return result; - } - }; - return { run }; -}; -export { - createPool -}; diff --git a/node_modules/hono/dist/utils/constants.js b/node_modules/hono/dist/utils/constants.js deleted file mode 100644 index 1c63165..0000000 --- a/node_modules/hono/dist/utils/constants.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/utils/constants.ts -var COMPOSED_HANDLER = "__COMPOSED_HANDLER"; -export { - COMPOSED_HANDLER -}; diff --git a/node_modules/hono/dist/utils/cookie.js b/node_modules/hono/dist/utils/cookie.js deleted file mode 100644 index c1281f4..0000000 --- a/node_modules/hono/dist/utils/cookie.js +++ /dev/null @@ -1,147 +0,0 @@ -// src/utils/cookie.ts -import { decodeURIComponent_, tryDecode } from "./url.js"; -var algorithm = { name: "HMAC", hash: "SHA-256" }; -var getCryptoKey = async (secret) => { - const secretBuf = typeof secret === "string" ? new TextEncoder().encode(secret) : secret; - return await crypto.subtle.importKey("raw", secretBuf, algorithm, false, ["sign", "verify"]); -}; -var makeSignature = async (value, secret) => { - const key = await getCryptoKey(secret); - const signature = await crypto.subtle.sign(algorithm.name, key, new TextEncoder().encode(value)); - return btoa(String.fromCharCode(...new Uint8Array(signature))); -}; -var verifySignature = async (base64Signature, value, secret) => { - try { - const signatureBinStr = atob(base64Signature); - const signature = new Uint8Array(signatureBinStr.length); - for (let i = 0, len = signatureBinStr.length; i < len; i++) { - signature[i] = signatureBinStr.charCodeAt(i); - } - return await crypto.subtle.verify(algorithm, secret, signature, new TextEncoder().encode(value)); - } catch { - return false; - } -}; -var validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/; -var validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/; -var parse = (cookie, name) => { - if (name && cookie.indexOf(name) === -1) { - return {}; - } - const pairs = cookie.trim().split(";"); - const parsedCookie = {}; - for (let pairStr of pairs) { - pairStr = pairStr.trim(); - const valueStartPos = pairStr.indexOf("="); - if (valueStartPos === -1) { - continue; - } - const cookieName = pairStr.substring(0, valueStartPos).trim(); - if (name && name !== cookieName || !validCookieNameRegEx.test(cookieName)) { - continue; - } - let cookieValue = pairStr.substring(valueStartPos + 1).trim(); - if (cookieValue.startsWith('"') && cookieValue.endsWith('"')) { - cookieValue = cookieValue.slice(1, -1); - } - if (validCookieValueRegEx.test(cookieValue)) { - parsedCookie[cookieName] = cookieValue.indexOf("%") !== -1 ? tryDecode(cookieValue, decodeURIComponent_) : cookieValue; - if (name) { - break; - } - } - } - return parsedCookie; -}; -var parseSigned = async (cookie, secret, name) => { - const parsedCookie = {}; - const secretKey = await getCryptoKey(secret); - for (const [key, value] of Object.entries(parse(cookie, name))) { - const signatureStartPos = value.lastIndexOf("."); - if (signatureStartPos < 1) { - continue; - } - const signedValue = value.substring(0, signatureStartPos); - const signature = value.substring(signatureStartPos + 1); - if (signature.length !== 44 || !signature.endsWith("=")) { - continue; - } - const isVerified = await verifySignature(signature, signedValue, secretKey); - parsedCookie[key] = isVerified ? signedValue : false; - } - return parsedCookie; -}; -var _serialize = (name, value, opt = {}) => { - let cookie = `${name}=${value}`; - if (name.startsWith("__Secure-") && !opt.secure) { - throw new Error("__Secure- Cookie must have Secure attributes"); - } - if (name.startsWith("__Host-")) { - if (!opt.secure) { - throw new Error("__Host- Cookie must have Secure attributes"); - } - if (opt.path !== "/") { - throw new Error('__Host- Cookie must have Path attributes with "/"'); - } - if (opt.domain) { - throw new Error("__Host- Cookie must not have Domain attributes"); - } - } - if (opt && typeof opt.maxAge === "number" && opt.maxAge >= 0) { - if (opt.maxAge > 3456e4) { - throw new Error( - "Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration." - ); - } - cookie += `; Max-Age=${opt.maxAge | 0}`; - } - if (opt.domain && opt.prefix !== "host") { - cookie += `; Domain=${opt.domain}`; - } - if (opt.path) { - cookie += `; Path=${opt.path}`; - } - if (opt.expires) { - if (opt.expires.getTime() - Date.now() > 3456e7) { - throw new Error( - "Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future." - ); - } - cookie += `; Expires=${opt.expires.toUTCString()}`; - } - if (opt.httpOnly) { - cookie += "; HttpOnly"; - } - if (opt.secure) { - cookie += "; Secure"; - } - if (opt.sameSite) { - cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`; - } - if (opt.priority) { - cookie += `; Priority=${opt.priority.charAt(0).toUpperCase() + opt.priority.slice(1)}`; - } - if (opt.partitioned) { - if (!opt.secure) { - throw new Error("Partitioned Cookie must have Secure attributes"); - } - cookie += "; Partitioned"; - } - return cookie; -}; -var serialize = (name, value, opt) => { - value = encodeURIComponent(value); - return _serialize(name, value, opt); -}; -var serializeSigned = async (name, value, secret, opt = {}) => { - const signature = await makeSignature(value, secret); - value = `${value}.${signature}`; - value = encodeURIComponent(value); - return _serialize(name, value, opt); -}; -export { - parse, - parseSigned, - serialize, - serializeSigned -}; diff --git a/node_modules/hono/dist/utils/crypto.js b/node_modules/hono/dist/utils/crypto.js deleted file mode 100644 index 36772c4..0000000 --- a/node_modules/hono/dist/utils/crypto.js +++ /dev/null @@ -1,44 +0,0 @@ -// src/utils/crypto.ts -var sha256 = async (data) => { - const algorithm = { name: "SHA-256", alias: "sha256" }; - const hash = await createHash(data, algorithm); - return hash; -}; -var sha1 = async (data) => { - const algorithm = { name: "SHA-1", alias: "sha1" }; - const hash = await createHash(data, algorithm); - return hash; -}; -var md5 = async (data) => { - const algorithm = { name: "MD5", alias: "md5" }; - const hash = await createHash(data, algorithm); - return hash; -}; -var createHash = async (data, algorithm) => { - let sourceBuffer; - if (ArrayBuffer.isView(data) || data instanceof ArrayBuffer) { - sourceBuffer = data; - } else { - if (typeof data === "object") { - data = JSON.stringify(data); - } - sourceBuffer = new TextEncoder().encode(String(data)); - } - if (crypto && crypto.subtle) { - const buffer = await crypto.subtle.digest( - { - name: algorithm.name - }, - sourceBuffer - ); - const hash = Array.prototype.map.call(new Uint8Array(buffer), (x) => ("00" + x.toString(16)).slice(-2)).join(""); - return hash; - } - return null; -}; -export { - createHash, - md5, - sha1, - sha256 -}; diff --git a/node_modules/hono/dist/utils/encode.js b/node_modules/hono/dist/utils/encode.js deleted file mode 100644 index d4ce6a7..0000000 --- a/node_modules/hono/dist/utils/encode.js +++ /dev/null @@ -1,29 +0,0 @@ -// 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 -}; diff --git a/node_modules/hono/dist/utils/filepath.js b/node_modules/hono/dist/utils/filepath.js deleted file mode 100644 index 7807be5..0000000 --- a/node_modules/hono/dist/utils/filepath.js +++ /dev/null @@ -1,35 +0,0 @@ -// src/utils/filepath.ts -var getFilePath = (options) => { - let filename = options.filename; - const defaultDocument = options.defaultDocument || "index.html"; - if (filename.endsWith("/")) { - filename = filename.concat(defaultDocument); - } else if (!filename.match(/\.[a-zA-Z0-9_-]+$/)) { - filename = filename.concat("/" + defaultDocument); - } - const path = getFilePathWithoutDefaultDocument({ - root: options.root, - filename - }); - return path; -}; -var getFilePathWithoutDefaultDocument = (options) => { - let root = options.root || ""; - let filename = options.filename; - if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) { - return; - } - filename = filename.replace(/^\.?[\/\\]/, ""); - filename = filename.replace(/\\/, "/"); - root = root.replace(/\/$/, ""); - let path = root ? root + "/" + filename : filename; - path = path.replace(/^\.?\//, ""); - if (root[0] !== "/" && path[0] === "/") { - return; - } - return path; -}; -export { - getFilePath, - getFilePathWithoutDefaultDocument -}; diff --git a/node_modules/hono/dist/utils/handler.js b/node_modules/hono/dist/utils/handler.js deleted file mode 100644 index 317ae65..0000000 --- a/node_modules/hono/dist/utils/handler.js +++ /dev/null @@ -1,13 +0,0 @@ -// src/utils/handler.ts -import { COMPOSED_HANDLER } from "./constants.js"; -var isMiddleware = (handler) => handler.length > 1; -var findTargetHandler = (handler) => { - return handler[COMPOSED_HANDLER] ? ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - findTargetHandler(handler[COMPOSED_HANDLER]) - ) : handler; -}; -export { - findTargetHandler, - isMiddleware -}; diff --git a/node_modules/hono/dist/utils/headers.js b/node_modules/hono/dist/utils/headers.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/utils/html.js b/node_modules/hono/dist/utils/html.js deleted file mode 100644 index 79f7772..0000000 --- a/node_modules/hono/dist/utils/html.js +++ /dev/null @@ -1,123 +0,0 @@ -// src/utils/html.ts -var HtmlEscapedCallbackPhase = { - Stringify: 1, - BeforeStream: 2, - Stream: 3 -}; -var raw = (value, callbacks) => { - const escapedString = new String(value); - escapedString.isEscaped = true; - escapedString.callbacks = callbacks; - return escapedString; -}; -var escapeRe = /[&<>'"]/; -var stringBufferToString = async (buffer, callbacks) => { - let str = ""; - callbacks ||= []; - const resolvedBuffer = await Promise.all(buffer); - for (let i = resolvedBuffer.length - 1; ; i--) { - str += resolvedBuffer[i]; - i--; - if (i < 0) { - break; - } - let r = resolvedBuffer[i]; - if (typeof r === "object") { - callbacks.push(...r.callbacks || []); - } - const isEscaped = r.isEscaped; - r = await (typeof r === "object" ? r.toString() : r); - if (typeof r === "object") { - callbacks.push(...r.callbacks || []); - } - if (r.isEscaped ?? isEscaped) { - str += r; - } else { - const buf = [str]; - escapeToBuffer(r, buf); - str = buf[0]; - } - } - return raw(str, callbacks); -}; -var escapeToBuffer = (str, buffer) => { - const match = str.search(escapeRe); - if (match === -1) { - buffer[0] += str; - return; - } - let escape; - let index; - let lastIndex = 0; - for (index = match; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: - escape = """; - break; - case 39: - escape = "'"; - break; - case 38: - escape = "&"; - break; - case 60: - escape = "<"; - break; - case 62: - escape = ">"; - break; - default: - continue; - } - buffer[0] += str.substring(lastIndex, index) + escape; - lastIndex = index + 1; - } - buffer[0] += str.substring(lastIndex, index); -}; -var resolveCallbackSync = (str) => { - const callbacks = str.callbacks; - if (!callbacks?.length) { - return str; - } - const buffer = [str]; - const context = {}; - callbacks.forEach((c) => c({ phase: HtmlEscapedCallbackPhase.Stringify, buffer, context })); - return buffer[0]; -}; -var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => { - if (typeof str === "object" && !(str instanceof String)) { - if (!(str instanceof Promise)) { - str = str.toString(); - } - if (str instanceof Promise) { - str = await str; - } - } - const callbacks = str.callbacks; - if (!callbacks?.length) { - return Promise.resolve(str); - } - if (buffer) { - buffer[0] += str; - } else { - buffer = [str]; - } - const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then( - (res) => Promise.all( - res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer)) - ).then(() => buffer[0]) - ); - if (preserveCallbacks) { - return raw(await resStr, callbacks); - } else { - return resStr; - } -}; -export { - HtmlEscapedCallbackPhase, - escapeToBuffer, - raw, - resolveCallback, - resolveCallbackSync, - stringBufferToString -}; diff --git a/node_modules/hono/dist/utils/http-status.js b/node_modules/hono/dist/utils/http-status.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/utils/ipaddr.js b/node_modules/hono/dist/utils/ipaddr.js deleted file mode 100644 index d4a059c..0000000 --- a/node_modules/hono/dist/utils/ipaddr.js +++ /dev/null @@ -1,102 +0,0 @@ -// src/utils/ipaddr.ts -var expandIPv6 = (ipV6) => { - const sections = ipV6.split(":"); - if (IPV4_REGEX.test(sections.at(-1))) { - sections.splice( - -1, - 1, - ...convertIPv6BinaryToString(convertIPv4ToBinary(sections.at(-1))).substring(2).split(":") - // => ['7f00', '0001'] - ); - } - for (let i = 0; i < sections.length; i++) { - const node = sections[i]; - if (node !== "") { - sections[i] = node.padStart(4, "0"); - } else { - sections[i + 1] === "" && sections.splice(i + 1, 1); - sections[i] = new Array(8 - sections.length + 1).fill("0000").join(":"); - } - } - return sections.join(":"); -}; -var IPV4_OCTET_PART = "(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])"; -var IPV4_REGEX = new RegExp(`^(?:${IPV4_OCTET_PART}\\.){3}${IPV4_OCTET_PART}$`); -var distinctRemoteAddr = (remoteAddr) => { - if (IPV4_REGEX.test(remoteAddr)) { - return "IPv4"; - } - if (remoteAddr.includes(":")) { - return "IPv6"; - } -}; -var convertIPv4ToBinary = (ipv4) => { - const parts = ipv4.split("."); - let result = 0n; - for (let i = 0; i < 4; i++) { - result <<= 8n; - result += BigInt(parts[i]); - } - return result; -}; -var convertIPv6ToBinary = (ipv6) => { - const sections = expandIPv6(ipv6).split(":"); - let result = 0n; - for (let i = 0; i < 8; i++) { - result <<= 16n; - result += BigInt(parseInt(sections[i], 16)); - } - return result; -}; -var convertIPv4BinaryToString = (ipV4) => { - const sections = []; - for (let i = 0; i < 4; i++) { - sections.push(ipV4 >> BigInt(8 * (3 - i)) & 0xffn); - } - return sections.join("."); -}; -var convertIPv6BinaryToString = (ipV6) => { - if (ipV6 >> 32n === 0xffffn) { - return `::ffff:${convertIPv4BinaryToString(ipV6 & 0xffffffffn)}`; - } - const sections = []; - for (let i = 0; i < 8; i++) { - sections.push((ipV6 >> BigInt(16 * (7 - i)) & 0xffffn).toString(16)); - } - let currentZeroStart = -1; - let maxZeroStart = -1; - let maxZeroEnd = -1; - for (let i = 0; i < 8; i++) { - if (sections[i] === "0") { - if (currentZeroStart === -1) { - currentZeroStart = i; - } - } else { - if (currentZeroStart > -1) { - if (i - currentZeroStart > maxZeroEnd - maxZeroStart) { - maxZeroStart = currentZeroStart; - maxZeroEnd = i; - } - currentZeroStart = -1; - } - } - } - if (currentZeroStart > -1) { - if (8 - currentZeroStart > maxZeroEnd - maxZeroStart) { - maxZeroStart = currentZeroStart; - maxZeroEnd = 8; - } - } - if (maxZeroStart !== -1) { - sections.splice(maxZeroStart, maxZeroEnd - maxZeroStart, ":"); - } - return sections.join(":").replace(/:{2,}/g, "::"); -}; -export { - convertIPv4BinaryToString, - convertIPv4ToBinary, - convertIPv6BinaryToString, - convertIPv6ToBinary, - distinctRemoteAddr, - expandIPv6 -}; diff --git a/node_modules/hono/dist/utils/jwt/index.js b/node_modules/hono/dist/utils/jwt/index.js deleted file mode 100644 index 25467d1..0000000 --- a/node_modules/hono/dist/utils/jwt/index.js +++ /dev/null @@ -1,6 +0,0 @@ -// src/utils/jwt/index.ts -import { decode, sign, verify, verifyWithJwks } from "./jwt.js"; -var Jwt = { sign, verify, decode, verifyWithJwks }; -export { - Jwt -}; diff --git a/node_modules/hono/dist/utils/jwt/jwa.js b/node_modules/hono/dist/utils/jwt/jwa.js deleted file mode 100644 index 6331192..0000000 --- a/node_modules/hono/dist/utils/jwt/jwa.js +++ /dev/null @@ -1,20 +0,0 @@ -// src/utils/jwt/jwa.ts -var AlgorithmTypes = /* @__PURE__ */ ((AlgorithmTypes2) => { - AlgorithmTypes2["HS256"] = "HS256"; - AlgorithmTypes2["HS384"] = "HS384"; - AlgorithmTypes2["HS512"] = "HS512"; - AlgorithmTypes2["RS256"] = "RS256"; - AlgorithmTypes2["RS384"] = "RS384"; - AlgorithmTypes2["RS512"] = "RS512"; - AlgorithmTypes2["PS256"] = "PS256"; - AlgorithmTypes2["PS384"] = "PS384"; - AlgorithmTypes2["PS512"] = "PS512"; - AlgorithmTypes2["ES256"] = "ES256"; - AlgorithmTypes2["ES384"] = "ES384"; - AlgorithmTypes2["ES512"] = "ES512"; - AlgorithmTypes2["EdDSA"] = "EdDSA"; - return AlgorithmTypes2; -})(AlgorithmTypes || {}); -export { - AlgorithmTypes -}; diff --git a/node_modules/hono/dist/utils/jwt/jws.js b/node_modules/hono/dist/utils/jwt/jws.js deleted file mode 100644 index 2832b9c..0000000 --- a/node_modules/hono/dist/utils/jwt/jws.js +++ /dev/null @@ -1,192 +0,0 @@ -// src/utils/jwt/jws.ts -import { getRuntimeKey } from "../../helper/adapter/index.js"; -import { decodeBase64 } from "../encode.js"; -import { CryptoKeyUsage, JwtAlgorithmNotImplemented } from "./types.js"; -import { utf8Encoder } from "./utf8.js"; -async function signing(privateKey, alg, data) { - const algorithm = getKeyAlgorithm(alg); - const cryptoKey = await importPrivateKey(privateKey, algorithm); - return await crypto.subtle.sign(algorithm, cryptoKey, data); -} -async function verifying(publicKey, alg, signature, data) { - const algorithm = getKeyAlgorithm(alg); - const cryptoKey = await importPublicKey(publicKey, algorithm); - return await crypto.subtle.verify(algorithm, cryptoKey, signature, data); -} -function pemToBinary(pem) { - return decodeBase64(pem.replace(/-+(BEGIN|END).*/g, "").replace(/\s/g, "")); -} -async function importPrivateKey(key, alg) { - if (!crypto.subtle || !crypto.subtle.importKey) { - throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); - } - if (isCryptoKey(key)) { - if (key.type !== "private" && key.type !== "secret") { - throw new Error( - `unexpected key type: CryptoKey.type is ${key.type}, expected private or secret` - ); - } - return key; - } - const usages = [CryptoKeyUsage.Sign]; - if (typeof key === "object") { - return await crypto.subtle.importKey("jwk", key, alg, false, usages); - } - if (key.includes("PRIVATE")) { - return await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, false, usages); - } - return await crypto.subtle.importKey("raw", utf8Encoder.encode(key), alg, false, usages); -} -async function importPublicKey(key, alg) { - if (!crypto.subtle || !crypto.subtle.importKey) { - throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); - } - if (isCryptoKey(key)) { - if (key.type === "public" || key.type === "secret") { - return key; - } - key = await exportPublicJwkFrom(key); - } - if (typeof key === "string" && key.includes("PRIVATE")) { - const privateKey = await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, true, [ - CryptoKeyUsage.Sign - ]); - key = await exportPublicJwkFrom(privateKey); - } - const usages = [CryptoKeyUsage.Verify]; - if (typeof key === "object") { - return await crypto.subtle.importKey("jwk", key, alg, false, usages); - } - if (key.includes("PUBLIC")) { - return await crypto.subtle.importKey("spki", pemToBinary(key), alg, false, usages); - } - return await crypto.subtle.importKey("raw", utf8Encoder.encode(key), alg, false, usages); -} -async function exportPublicJwkFrom(privateKey) { - if (privateKey.type !== "private") { - throw new Error(`unexpected key type: ${privateKey.type}`); - } - if (!privateKey.extractable) { - throw new Error("unexpected private key is unextractable"); - } - const jwk = await crypto.subtle.exportKey("jwk", privateKey); - const { kty } = jwk; - const { alg, e, n } = jwk; - const { crv, x, y } = jwk; - return { kty, alg, e, n, crv, x, y, key_ops: [CryptoKeyUsage.Verify] }; -} -function getKeyAlgorithm(name) { - switch (name) { - case "HS256": - return { - name: "HMAC", - hash: { - name: "SHA-256" - } - }; - case "HS384": - return { - name: "HMAC", - hash: { - name: "SHA-384" - } - }; - case "HS512": - return { - name: "HMAC", - hash: { - name: "SHA-512" - } - }; - case "RS256": - return { - name: "RSASSA-PKCS1-v1_5", - hash: { - name: "SHA-256" - } - }; - case "RS384": - return { - name: "RSASSA-PKCS1-v1_5", - hash: { - name: "SHA-384" - } - }; - case "RS512": - return { - name: "RSASSA-PKCS1-v1_5", - hash: { - name: "SHA-512" - } - }; - case "PS256": - return { - name: "RSA-PSS", - hash: { - name: "SHA-256" - }, - saltLength: 32 - // 256 >> 3 - }; - case "PS384": - return { - name: "RSA-PSS", - hash: { - name: "SHA-384" - }, - saltLength: 48 - // 384 >> 3 - }; - case "PS512": - return { - name: "RSA-PSS", - hash: { - name: "SHA-512" - }, - saltLength: 64 - // 512 >> 3, - }; - case "ES256": - return { - name: "ECDSA", - hash: { - name: "SHA-256" - }, - namedCurve: "P-256" - }; - case "ES384": - return { - name: "ECDSA", - hash: { - name: "SHA-384" - }, - namedCurve: "P-384" - }; - case "ES512": - return { - name: "ECDSA", - hash: { - name: "SHA-512" - }, - namedCurve: "P-521" - }; - case "EdDSA": - return { - name: "Ed25519", - namedCurve: "Ed25519" - }; - default: - throw new JwtAlgorithmNotImplemented(name); - } -} -function isCryptoKey(key) { - const runtime = getRuntimeKey(); - if (runtime === "node" && !!crypto.webcrypto) { - return key instanceof crypto.webcrypto.CryptoKey; - } - return key instanceof CryptoKey; -} -export { - signing, - verifying -}; diff --git a/node_modules/hono/dist/utils/jwt/jwt.js b/node_modules/hono/dist/utils/jwt/jwt.js deleted file mode 100644 index e9d7852..0000000 --- a/node_modules/hono/dist/utils/jwt/jwt.js +++ /dev/null @@ -1,197 +0,0 @@ -// src/utils/jwt/jwt.ts -import { decodeBase64Url, encodeBase64Url } from "../../utils/encode.js"; -import { AlgorithmTypes } from "./jwa.js"; -import { signing, verifying } from "./jws.js"; -import { - JwtAlgorithmMismatch, - JwtAlgorithmNotAllowed, - JwtAlgorithmRequired, - JwtHeaderInvalid, - JwtHeaderRequiresKid, - JwtPayloadRequiresAud, - JwtSymmetricAlgorithmNotAllowed, - JwtTokenAudience, - JwtTokenExpired, - JwtTokenInvalid, - JwtTokenIssuedAt, - JwtTokenIssuer, - JwtTokenNotBefore, - JwtTokenSignatureMismatched -} from "./types.js"; -import { utf8Decoder, utf8Encoder } from "./utf8.js"; -var encodeJwtPart = (part) => encodeBase64Url(utf8Encoder.encode(JSON.stringify(part)).buffer).replace(/=/g, ""); -var encodeSignaturePart = (buf) => encodeBase64Url(buf).replace(/=/g, ""); -var decodeJwtPart = (part) => JSON.parse(utf8Decoder.decode(decodeBase64Url(part))); -function isTokenHeader(obj) { - if (typeof obj === "object" && obj !== null) { - const objWithAlg = obj; - return "alg" in objWithAlg && Object.values(AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT"); - } - return false; -} -var sign = async (payload, privateKey, alg = "HS256") => { - const encodedPayload = encodeJwtPart(payload); - let encodedHeader; - if (typeof privateKey === "object" && "alg" in privateKey) { - alg = privateKey.alg; - encodedHeader = encodeJwtPart({ alg, typ: "JWT", kid: privateKey.kid }); - } else { - encodedHeader = encodeJwtPart({ alg, typ: "JWT" }); - } - const partialToken = `${encodedHeader}.${encodedPayload}`; - const signaturePart = await signing(privateKey, alg, utf8Encoder.encode(partialToken)); - const signature = encodeSignaturePart(signaturePart); - return `${partialToken}.${signature}`; -}; -var verify = async (token, publicKey, algOrOptions) => { - if (!algOrOptions) { - throw new JwtAlgorithmRequired(); - } - const { - alg, - iss, - nbf = true, - exp = true, - iat = true, - aud - } = typeof algOrOptions === "string" ? { alg: algOrOptions } : algOrOptions; - if (!alg) { - throw new JwtAlgorithmRequired(); - } - const tokenParts = token.split("."); - if (tokenParts.length !== 3) { - throw new JwtTokenInvalid(token); - } - const { header, payload } = decode(token); - if (!isTokenHeader(header)) { - throw new JwtHeaderInvalid(header); - } - if (header.alg !== alg) { - throw new JwtAlgorithmMismatch(alg, header.alg); - } - const now = Date.now() / 1e3 | 0; - if (nbf && payload.nbf && payload.nbf > now) { - throw new JwtTokenNotBefore(token); - } - if (exp && payload.exp && payload.exp <= now) { - throw new JwtTokenExpired(token); - } - if (iat && payload.iat && now < payload.iat) { - throw new JwtTokenIssuedAt(now, payload.iat); - } - if (iss) { - if (!payload.iss) { - throw new JwtTokenIssuer(iss, null); - } - if (typeof iss === "string" && payload.iss !== iss) { - throw new JwtTokenIssuer(iss, payload.iss); - } - if (iss instanceof RegExp && !iss.test(payload.iss)) { - throw new JwtTokenIssuer(iss, payload.iss); - } - } - if (aud) { - if (!payload.aud) { - throw new JwtPayloadRequiresAud(payload); - } - const audiences = Array.isArray(payload.aud) ? payload.aud : [payload.aud]; - const matched = audiences.some( - (payloadAud) => aud instanceof RegExp ? aud.test(payloadAud) : typeof aud === "string" ? payloadAud === aud : Array.isArray(aud) && aud.includes(payloadAud) - ); - if (!matched) { - throw new JwtTokenAudience(aud, payload.aud); - } - } - const headerPayload = token.substring(0, token.lastIndexOf(".")); - const verified = await verifying( - publicKey, - alg, - decodeBase64Url(tokenParts[2]), - utf8Encoder.encode(headerPayload) - ); - if (!verified) { - throw new JwtTokenSignatureMismatched(token); - } - return payload; -}; -var symmetricAlgorithms = [ - AlgorithmTypes.HS256, - AlgorithmTypes.HS384, - AlgorithmTypes.HS512 -]; -var verifyWithJwks = async (token, options, init) => { - const verifyOpts = options.verification || {}; - const header = decodeHeader(token); - if (!isTokenHeader(header)) { - throw new JwtHeaderInvalid(header); - } - if (!header.kid) { - throw new JwtHeaderRequiresKid(header); - } - if (symmetricAlgorithms.includes(header.alg)) { - throw new JwtSymmetricAlgorithmNotAllowed(header.alg); - } - if (!options.allowedAlgorithms.includes(header.alg)) { - throw new JwtAlgorithmNotAllowed(header.alg, options.allowedAlgorithms); - } - if (options.jwks_uri) { - const response = await fetch(options.jwks_uri, init); - if (!response.ok) { - throw new Error(`failed to fetch JWKS from ${options.jwks_uri}`); - } - const data = await response.json(); - if (!data.keys) { - throw new Error('invalid JWKS response. "keys" field is missing'); - } - if (!Array.isArray(data.keys)) { - throw new Error('invalid JWKS response. "keys" field is not an array'); - } - if (options.keys) { - options.keys.push(...data.keys); - } else { - options.keys = data.keys; - } - } else if (!options.keys) { - throw new Error('verifyWithJwks requires options for either "keys" or "jwks_uri" or both'); - } - const matchingKey = options.keys.find((key) => key.kid === header.kid); - if (!matchingKey) { - throw new JwtTokenInvalid(token); - } - if (matchingKey.alg && matchingKey.alg !== header.alg) { - throw new JwtAlgorithmMismatch(matchingKey.alg, header.alg); - } - return await verify(token, matchingKey, { - alg: header.alg, - ...verifyOpts - }); -}; -var decode = (token) => { - try { - const [h, p] = token.split("."); - const header = decodeJwtPart(h); - const payload = decodeJwtPart(p); - return { - header, - payload - }; - } catch { - throw new JwtTokenInvalid(token); - } -}; -var decodeHeader = (token) => { - try { - const [h] = token.split("."); - return decodeJwtPart(h); - } catch { - throw new JwtTokenInvalid(token); - } -}; -export { - decode, - decodeHeader, - isTokenHeader, - sign, - verify, - verifyWithJwks -}; diff --git a/node_modules/hono/dist/utils/jwt/types.js b/node_modules/hono/dist/utils/jwt/types.js deleted file mode 100644 index 253427c..0000000 --- a/node_modules/hono/dist/utils/jwt/types.js +++ /dev/null @@ -1,124 +0,0 @@ -// src/utils/jwt/types.ts -var JwtAlgorithmNotImplemented = class extends Error { - constructor(alg) { - super(`${alg} is not an implemented algorithm`); - this.name = "JwtAlgorithmNotImplemented"; - } -}; -var JwtAlgorithmRequired = class extends Error { - constructor() { - super('JWT verification requires "alg" option to be specified'); - this.name = "JwtAlgorithmRequired"; - } -}; -var JwtAlgorithmMismatch = class extends Error { - constructor(expected, actual) { - super(`JWT algorithm mismatch: expected "${expected}", got "${actual}"`); - this.name = "JwtAlgorithmMismatch"; - } -}; -var JwtTokenInvalid = class extends Error { - constructor(token) { - super(`invalid JWT token: ${token}`); - this.name = "JwtTokenInvalid"; - } -}; -var JwtTokenNotBefore = class extends Error { - constructor(token) { - super(`token (${token}) is being used before it's valid`); - this.name = "JwtTokenNotBefore"; - } -}; -var JwtTokenExpired = class extends Error { - constructor(token) { - super(`token (${token}) expired`); - this.name = "JwtTokenExpired"; - } -}; -var JwtTokenIssuedAt = class extends Error { - constructor(currentTimestamp, iat) { - super( - `Invalid "iat" claim, must be a valid number lower than "${currentTimestamp}" (iat: "${iat}")` - ); - this.name = "JwtTokenIssuedAt"; - } -}; -var JwtTokenIssuer = class extends Error { - constructor(expected, iss) { - super(`expected issuer "${expected}", got ${iss ? `"${iss}"` : "none"} `); - this.name = "JwtTokenIssuer"; - } -}; -var JwtHeaderInvalid = class extends Error { - constructor(header) { - super(`jwt header is invalid: ${JSON.stringify(header)}`); - this.name = "JwtHeaderInvalid"; - } -}; -var JwtHeaderRequiresKid = class extends Error { - constructor(header) { - super(`required "kid" in jwt header: ${JSON.stringify(header)}`); - this.name = "JwtHeaderRequiresKid"; - } -}; -var JwtSymmetricAlgorithmNotAllowed = class extends Error { - constructor(alg) { - super(`symmetric algorithm "${alg}" is not allowed for JWK verification`); - this.name = "JwtSymmetricAlgorithmNotAllowed"; - } -}; -var JwtAlgorithmNotAllowed = class extends Error { - constructor(alg, allowedAlgorithms) { - super(`algorithm "${alg}" is not in the allowed list: [${allowedAlgorithms.join(", ")}]`); - this.name = "JwtAlgorithmNotAllowed"; - } -}; -var JwtTokenSignatureMismatched = class extends Error { - constructor(token) { - super(`token(${token}) signature mismatched`); - this.name = "JwtTokenSignatureMismatched"; - } -}; -var JwtPayloadRequiresAud = class extends Error { - constructor(payload) { - super(`required "aud" in jwt payload: ${JSON.stringify(payload)}`); - this.name = "JwtPayloadRequiresAud"; - } -}; -var JwtTokenAudience = class extends Error { - constructor(expected, aud) { - super( - `expected audience "${Array.isArray(expected) ? expected.join(", ") : expected}", got "${aud}"` - ); - this.name = "JwtTokenAudience"; - } -}; -var CryptoKeyUsage = /* @__PURE__ */ ((CryptoKeyUsage2) => { - CryptoKeyUsage2["Encrypt"] = "encrypt"; - CryptoKeyUsage2["Decrypt"] = "decrypt"; - CryptoKeyUsage2["Sign"] = "sign"; - CryptoKeyUsage2["Verify"] = "verify"; - CryptoKeyUsage2["DeriveKey"] = "deriveKey"; - CryptoKeyUsage2["DeriveBits"] = "deriveBits"; - CryptoKeyUsage2["WrapKey"] = "wrapKey"; - CryptoKeyUsage2["UnwrapKey"] = "unwrapKey"; - return CryptoKeyUsage2; -})(CryptoKeyUsage || {}); -export { - CryptoKeyUsage, - JwtAlgorithmMismatch, - JwtAlgorithmNotAllowed, - JwtAlgorithmNotImplemented, - JwtAlgorithmRequired, - JwtHeaderInvalid, - JwtHeaderRequiresKid, - JwtPayloadRequiresAud, - JwtSymmetricAlgorithmNotAllowed, - JwtTokenAudience, - JwtTokenExpired, - JwtTokenInvalid, - JwtTokenIssuedAt, - JwtTokenIssuer, - JwtTokenNotBefore, - JwtTokenSignatureMismatched -}; diff --git a/node_modules/hono/dist/utils/jwt/utf8.js b/node_modules/hono/dist/utils/jwt/utf8.js deleted file mode 100644 index 3cd9f0e..0000000 --- a/node_modules/hono/dist/utils/jwt/utf8.js +++ /dev/null @@ -1,7 +0,0 @@ -// src/utils/jwt/utf8.ts -var utf8Encoder = new TextEncoder(); -var utf8Decoder = new TextDecoder(); -export { - utf8Decoder, - utf8Encoder -}; diff --git a/node_modules/hono/dist/utils/mime.js b/node_modules/hono/dist/utils/mime.js deleted file mode 100644 index 8d9985e..0000000 --- a/node_modules/hono/dist/utils/mime.js +++ /dev/null @@ -1,84 +0,0 @@ -// src/utils/mime.ts -var getMimeType = (filename, mimes = baseMimes) => { - const regexp = /\.([a-zA-Z0-9]+?)$/; - const match = filename.match(regexp); - if (!match) { - return; - } - let mimeType = mimes[match[1]]; - if (mimeType && mimeType.startsWith("text")) { - mimeType += "; charset=utf-8"; - } - return mimeType; -}; -var getExtension = (mimeType) => { - for (const ext in baseMimes) { - if (baseMimes[ext] === mimeType) { - return ext; - } - } -}; -var _baseMimes = { - aac: "audio/aac", - avi: "video/x-msvideo", - avif: "image/avif", - av1: "video/av1", - bin: "application/octet-stream", - bmp: "image/bmp", - css: "text/css", - csv: "text/csv", - eot: "application/vnd.ms-fontobject", - epub: "application/epub+zip", - gif: "image/gif", - gz: "application/gzip", - htm: "text/html", - html: "text/html", - ico: "image/x-icon", - ics: "text/calendar", - jpeg: "image/jpeg", - jpg: "image/jpeg", - js: "text/javascript", - json: "application/json", - jsonld: "application/ld+json", - map: "application/json", - mid: "audio/x-midi", - midi: "audio/x-midi", - mjs: "text/javascript", - mp3: "audio/mpeg", - mp4: "video/mp4", - mpeg: "video/mpeg", - oga: "audio/ogg", - ogv: "video/ogg", - ogx: "application/ogg", - opus: "audio/opus", - otf: "font/otf", - pdf: "application/pdf", - png: "image/png", - rtf: "application/rtf", - svg: "image/svg+xml", - tif: "image/tiff", - tiff: "image/tiff", - ts: "video/mp2t", - ttf: "font/ttf", - txt: "text/plain", - wasm: "application/wasm", - webm: "video/webm", - weba: "audio/webm", - webmanifest: "application/manifest+json", - webp: "image/webp", - woff: "font/woff", - woff2: "font/woff2", - xhtml: "application/xhtml+xml", - xml: "application/xml", - zip: "application/zip", - "3gp": "video/3gpp", - "3g2": "video/3gpp2", - gltf: "model/gltf+json", - glb: "model/gltf-binary" -}; -var baseMimes = _baseMimes; -export { - getExtension, - getMimeType, - baseMimes as mimes -}; diff --git a/node_modules/hono/dist/utils/stream.js b/node_modules/hono/dist/utils/stream.js deleted file mode 100644 index 9fb6191..0000000 --- a/node_modules/hono/dist/utils/stream.js +++ /dev/null @@ -1,79 +0,0 @@ -// src/utils/stream.ts -var StreamingApi = class { - writer; - encoder; - writable; - abortSubscribers = []; - responseReadable; - /** - * Whether the stream has been aborted. - */ - aborted = false; - /** - * Whether the stream has been closed normally. - */ - closed = false; - constructor(writable, _readable) { - this.writable = writable; - this.writer = writable.getWriter(); - this.encoder = new TextEncoder(); - const reader = _readable.getReader(); - this.abortSubscribers.push(async () => { - await reader.cancel(); - }); - this.responseReadable = new ReadableStream({ - async pull(controller) { - const { done, value } = await reader.read(); - done ? controller.close() : controller.enqueue(value); - }, - cancel: () => { - this.abort(); - } - }); - } - async write(input) { - try { - if (typeof input === "string") { - input = this.encoder.encode(input); - } - await this.writer.write(input); - } catch { - } - return this; - } - async writeln(input) { - await this.write(input + "\n"); - return this; - } - sleep(ms) { - return new Promise((res) => setTimeout(res, ms)); - } - async close() { - try { - await this.writer.close(); - } catch { - } - this.closed = true; - } - async pipe(body) { - this.writer.releaseLock(); - await body.pipeTo(this.writable, { preventClose: true }); - this.writer = this.writable.getWriter(); - } - onAbort(listener) { - this.abortSubscribers.push(listener); - } - /** - * Abort the stream. - * You can call this method when stream is aborted by external event. - */ - abort() { - if (!this.aborted) { - this.aborted = true; - this.abortSubscribers.forEach((subscriber) => subscriber()); - } - } -}; -export { - StreamingApi -}; diff --git a/node_modules/hono/dist/utils/types.js b/node_modules/hono/dist/utils/types.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/utils/url.js b/node_modules/hono/dist/utils/url.js deleted file mode 100644 index fd0fbf7..0000000 --- a/node_modules/hono/dist/utils/url.js +++ /dev/null @@ -1,221 +0,0 @@ -// src/utils/url.ts -var splitPath = (path) => { - const paths = path.split("/"); - if (paths[0] === "") { - paths.shift(); - } - return paths; -}; -var splitRoutingPath = (routePath) => { - const { groups, path } = extractGroupsFromPath(routePath); - const paths = splitPath(path); - return replaceGroupMarks(paths, groups); -}; -var extractGroupsFromPath = (path) => { - const groups = []; - path = path.replace(/\{[^}]+\}/g, (match, index) => { - const mark = `@${index}`; - groups.push([mark, match]); - return mark; - }); - return { groups, path }; -}; -var replaceGroupMarks = (paths, groups) => { - for (let i = groups.length - 1; i >= 0; i--) { - const [mark] = groups[i]; - for (let j = paths.length - 1; j >= 0; j--) { - if (paths[j].includes(mark)) { - paths[j] = paths[j].replace(mark, groups[i][1]); - break; - } - } - } - return paths; -}; -var patternCache = {}; -var getPattern = (label, next) => { - if (label === "*") { - return "*"; - } - const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); - if (match) { - const cacheKey = `${label}#${next}`; - if (!patternCache[cacheKey]) { - if (match[2]) { - patternCache[cacheKey] = next && next[0] !== ":" && next[0] !== "*" ? [cacheKey, match[1], new RegExp(`^${match[2]}(?=/${next})`)] : [label, match[1], new RegExp(`^${match[2]}$`)]; - } else { - patternCache[cacheKey] = [label, match[1], true]; - } - } - return patternCache[cacheKey]; - } - return null; -}; -var tryDecode = (str, decoder) => { - try { - return decoder(str); - } catch { - return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => { - try { - return decoder(match); - } catch { - return match; - } - }); - } -}; -var tryDecodeURI = (str) => tryDecode(str, decodeURI); -var getPath = (request) => { - const url = request.url; - const start = url.indexOf("/", url.indexOf(":") + 4); - let i = start; - for (; i < url.length; i++) { - const charCode = url.charCodeAt(i); - if (charCode === 37) { - const queryIndex = url.indexOf("?", i); - const hashIndex = url.indexOf("#", i); - const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex); - const path = url.slice(start, end); - return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path); - } else if (charCode === 63 || charCode === 35) { - break; - } - } - return url.slice(start, i); -}; -var getQueryStrings = (url) => { - const queryIndex = url.indexOf("?", 8); - return queryIndex === -1 ? "" : "?" + url.slice(queryIndex + 1); -}; -var getPathNoStrict = (request) => { - const result = getPath(request); - return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result; -}; -var mergePath = (base, sub, ...rest) => { - if (rest.length) { - sub = mergePath(sub, ...rest); - } - return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`; -}; -var checkOptionalParameter = (path) => { - if (path.charCodeAt(path.length - 1) !== 63 || !path.includes(":")) { - return null; - } - const segments = path.split("/"); - const results = []; - let basePath = ""; - segments.forEach((segment) => { - if (segment !== "" && !/\:/.test(segment)) { - basePath += "/" + segment; - } else if (/\:/.test(segment)) { - if (/\?/.test(segment)) { - if (results.length === 0 && basePath === "") { - results.push("/"); - } else { - results.push(basePath); - } - const optionalSegment = segment.replace("?", ""); - basePath += "/" + optionalSegment; - results.push(basePath); - } else { - basePath += "/" + segment; - } - } - }); - return results.filter((v, i, a) => a.indexOf(v) === i); -}; -var _decodeURI = (value) => { - if (!/[%+]/.test(value)) { - return value; - } - if (value.indexOf("+") !== -1) { - value = value.replace(/\+/g, " "); - } - return value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value; -}; -var _getQueryParam = (url, key, multiple) => { - let encoded; - if (!multiple && key && !/[%+]/.test(key)) { - let keyIndex2 = url.indexOf("?", 8); - if (keyIndex2 === -1) { - return void 0; - } - if (!url.startsWith(key, keyIndex2 + 1)) { - keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1); - } - while (keyIndex2 !== -1) { - const trailingKeyCode = url.charCodeAt(keyIndex2 + key.length + 1); - if (trailingKeyCode === 61) { - const valueIndex = keyIndex2 + key.length + 2; - const endIndex = url.indexOf("&", valueIndex); - return _decodeURI(url.slice(valueIndex, endIndex === -1 ? void 0 : endIndex)); - } else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) { - return ""; - } - keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1); - } - encoded = /[%+]/.test(url); - if (!encoded) { - return void 0; - } - } - const results = {}; - encoded ??= /[%+]/.test(url); - let keyIndex = url.indexOf("?", 8); - while (keyIndex !== -1) { - const nextKeyIndex = url.indexOf("&", keyIndex + 1); - let valueIndex = url.indexOf("=", keyIndex); - if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) { - valueIndex = -1; - } - let name = url.slice( - keyIndex + 1, - valueIndex === -1 ? nextKeyIndex === -1 ? void 0 : nextKeyIndex : valueIndex - ); - if (encoded) { - name = _decodeURI(name); - } - keyIndex = nextKeyIndex; - if (name === "") { - continue; - } - let value; - if (valueIndex === -1) { - value = ""; - } else { - value = url.slice(valueIndex + 1, nextKeyIndex === -1 ? void 0 : nextKeyIndex); - if (encoded) { - value = _decodeURI(value); - } - } - if (multiple) { - if (!(results[name] && Array.isArray(results[name]))) { - results[name] = []; - } - ; - results[name].push(value); - } else { - results[name] ??= value; - } - } - return key ? results[key] : results; -}; -var getQueryParam = _getQueryParam; -var getQueryParams = (url, key) => { - return _getQueryParam(url, key, true); -}; -var decodeURIComponent_ = decodeURIComponent; -export { - checkOptionalParameter, - decodeURIComponent_, - getPath, - getPathNoStrict, - getPattern, - getQueryParam, - getQueryParams, - getQueryStrings, - mergePath, - splitPath, - splitRoutingPath, - tryDecode -}; diff --git a/node_modules/hono/dist/validator/index.js b/node_modules/hono/dist/validator/index.js deleted file mode 100644 index a8f176b..0000000 --- a/node_modules/hono/dist/validator/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// src/validator/index.ts -import { validator } from "./validator.js"; -export { - validator -}; diff --git a/node_modules/hono/dist/validator/utils.js b/node_modules/hono/dist/validator/utils.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/hono/dist/validator/validator.js b/node_modules/hono/dist/validator/validator.js deleted file mode 100644 index 6b3689a..0000000 --- a/node_modules/hono/dist/validator/validator.js +++ /dev/null @@ -1,86 +0,0 @@ -// src/validator/validator.ts -import { getCookie } from "../helper/cookie/index.js"; -import { HTTPException } from "../http-exception.js"; -import { bufferToFormData } from "../utils/buffer.js"; -var jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/; -var multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/; -var urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/; -var validator = (target, validationFunc) => { - return async (c, next) => { - let value = {}; - const contentType = c.req.header("Content-Type"); - switch (target) { - case "json": - if (!contentType || !jsonRegex.test(contentType)) { - break; - } - try { - value = await c.req.json(); - } catch { - const message = "Malformed JSON in request body"; - throw new HTTPException(400, { message }); - } - break; - case "form": { - if (!contentType || !(multipartRegex.test(contentType) || urlencodedRegex.test(contentType))) { - break; - } - let formData; - if (c.req.bodyCache.formData) { - formData = await c.req.bodyCache.formData; - } else { - try { - const arrayBuffer = await c.req.arrayBuffer(); - formData = await bufferToFormData(arrayBuffer, contentType); - c.req.bodyCache.formData = formData; - } catch (e) { - let message = "Malformed FormData request."; - message += e instanceof Error ? ` ${e.message}` : ` ${String(e)}`; - throw new HTTPException(400, { message }); - } - } - const form = {}; - formData.forEach((value2, key) => { - if (key.endsWith("[]")) { - ; - (form[key] ??= []).push(value2); - } else if (Array.isArray(form[key])) { - ; - form[key].push(value2); - } else if (key in form) { - form[key] = [form[key], value2]; - } else { - form[key] = value2; - } - }); - value = form; - break; - } - case "query": - value = Object.fromEntries( - Object.entries(c.req.queries()).map(([k, v]) => { - return v.length === 1 ? [k, v[0]] : [k, v]; - }) - ); - break; - case "param": - value = c.req.param(); - break; - case "header": - value = c.req.header(); - break; - case "cookie": - value = getCookie(c); - break; - } - const res = await validationFunc(value, c); - if (res instanceof Response) { - return res; - } - c.req.addValidatedData(target, res); - return await next(); - }; -}; -export { - validator -}; diff --git a/node_modules/hono/package.json b/node_modules/hono/package.json deleted file mode 100644 index 4f0ad8e..0000000 --- a/node_modules/hono/package.json +++ /dev/null @@ -1,691 +0,0 @@ -{ - "name": "hono", - "version": "4.11.9", - "description": "Web framework built on Web Standards", - "main": "dist/cjs/index.js", - "type": "module", - "module": "dist/index.js", - "types": "dist/types/index.d.ts", - "files": [ - "dist" - ], - "scripts": { - "test": "tsc --noEmit && vitest --run", - "test:watch": "vitest --watch", - "test:deno": "deno test --allow-read --allow-env --allow-write --allow-net -c runtime-tests/deno/deno.json runtime-tests/deno && deno test --no-lock -c runtime-tests/deno-jsx/deno.precompile.json runtime-tests/deno-jsx && deno test --no-lock -c runtime-tests/deno-jsx/deno.react-jsx.json runtime-tests/deno-jsx", - "test:bun": "bun test --jsx-import-source ../../src/jsx runtime-tests/bun/*", - "test:fastly": "vitest --run --project fastly", - "test:node": "vitest --run --project node", - "test:workerd": "vitest --run --project workerd", - "test:lambda": "vitest --run --project lambda", - "test:lambda-edge": "vitest --run --project lambda-edge", - "test:all": "bun run test && bun test:deno && bun test:bun", - "lint": "eslint src runtime-tests build perf-measures benchmarks", - "lint:fix": "eslint src runtime-tests build perf-measures benchmarks --fix", - "format": "prettier --check --cache \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"", - "format:fix": "prettier --write --cache --cache-strategy metadata \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"", - "editorconfig-checker": "editorconfig-checker", - "copy:package.cjs.json": "cp ./package.cjs.json ./dist/cjs/package.json && cp ./package.cjs.json ./dist/types/package.json", - "build": "bun run --shell bun remove-dist && bun ./build/build.ts && bun run copy:package.cjs.json", - "postbuild": "publint", - "watch": "bun run --shell bun remove-dist && bun ./build/build.ts --watch && bun run copy:package.cjs.json", - "coverage": "vitest --run --coverage", - "prerelease": "bun test:deno && bun run build", - "release": "np", - "remove-dist": "rm -rf dist" - }, - "exports": { - ".": { - "types": "./dist/types/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/cjs/index.js" - }, - "./request": { - "types": "./dist/types/request.d.ts", - "import": "./dist/request.js", - "require": "./dist/cjs/request.js" - }, - "./types": { - "types": "./dist/types/types.d.ts", - "import": "./dist/types.js", - "require": "./dist/cjs/types.js" - }, - "./hono-base": { - "types": "./dist/types/hono-base.d.ts", - "import": "./dist/hono-base.js", - "require": "./dist/cjs/hono-base.js" - }, - "./tiny": { - "types": "./dist/types/preset/tiny.d.ts", - "import": "./dist/preset/tiny.js", - "require": "./dist/cjs/preset/tiny.js" - }, - "./quick": { - "types": "./dist/types/preset/quick.d.ts", - "import": "./dist/preset/quick.js", - "require": "./dist/cjs/preset/quick.js" - }, - "./http-exception": { - "types": "./dist/types/http-exception.d.ts", - "import": "./dist/http-exception.js", - "require": "./dist/cjs/http-exception.js" - }, - "./basic-auth": { - "types": "./dist/types/middleware/basic-auth/index.d.ts", - "import": "./dist/middleware/basic-auth/index.js", - "require": "./dist/cjs/middleware/basic-auth/index.js" - }, - "./bearer-auth": { - "types": "./dist/types/middleware/bearer-auth/index.d.ts", - "import": "./dist/middleware/bearer-auth/index.js", - "require": "./dist/cjs/middleware/bearer-auth/index.js" - }, - "./body-limit": { - "types": "./dist/types/middleware/body-limit/index.d.ts", - "import": "./dist/middleware/body-limit/index.js", - "require": "./dist/cjs/middleware/body-limit/index.js" - }, - "./ip-restriction": { - "types": "./dist/types/middleware/ip-restriction/index.d.ts", - "import": "./dist/middleware/ip-restriction/index.js", - "require": "./dist/cjs/middleware/ip-restriction/index.js" - }, - "./cache": { - "types": "./dist/types/middleware/cache/index.d.ts", - "import": "./dist/middleware/cache/index.js", - "require": "./dist/cjs/middleware/cache/index.js" - }, - "./route": { - "types": "./dist/types/helper/route/index.d.ts", - "import": "./dist/helper/route/index.js", - "require": "./dist/cjs/helper/route/index.js" - }, - "./cookie": { - "types": "./dist/types/helper/cookie/index.d.ts", - "import": "./dist/helper/cookie/index.js", - "require": "./dist/cjs/helper/cookie/index.js" - }, - "./accepts": { - "types": "./dist/types/helper/accepts/index.d.ts", - "import": "./dist/helper/accepts/index.js", - "require": "./dist/cjs/helper/accepts/index.js" - }, - "./compress": { - "types": "./dist/types/middleware/compress/index.d.ts", - "import": "./dist/middleware/compress/index.js", - "require": "./dist/cjs/middleware/compress/index.js" - }, - "./context-storage": { - "types": "./dist/types/middleware/context-storage/index.d.ts", - "import": "./dist/middleware/context-storage/index.js", - "require": "./dist/cjs/middleware/context-storage/index.js" - }, - "./cors": { - "types": "./dist/types/middleware/cors/index.d.ts", - "import": "./dist/middleware/cors/index.js", - "require": "./dist/cjs/middleware/cors/index.js" - }, - "./csrf": { - "types": "./dist/types/middleware/csrf/index.d.ts", - "import": "./dist/middleware/csrf/index.js", - "require": "./dist/cjs/middleware/csrf/index.js" - }, - "./etag": { - "types": "./dist/types/middleware/etag/index.d.ts", - "import": "./dist/middleware/etag/index.js", - "require": "./dist/cjs/middleware/etag/index.js" - }, - "./trailing-slash": { - "types": "./dist/types/middleware/trailing-slash/index.d.ts", - "import": "./dist/middleware/trailing-slash/index.js", - "require": "./dist/cjs/middleware/trailing-slash/index.js" - }, - "./html": { - "types": "./dist/types/helper/html/index.d.ts", - "import": "./dist/helper/html/index.js", - "require": "./dist/cjs/helper/html/index.js" - }, - "./css": { - "types": "./dist/types/helper/css/index.d.ts", - "import": "./dist/helper/css/index.js", - "require": "./dist/cjs/helper/css/index.js" - }, - "./jsx": { - "types": "./dist/types/jsx/index.d.ts", - "import": "./dist/jsx/index.js", - "require": "./dist/cjs/jsx/index.js" - }, - "./jsx/jsx-dev-runtime": { - "types": "./dist/types/jsx/jsx-dev-runtime.d.ts", - "import": "./dist/jsx/jsx-dev-runtime.js", - "require": "./dist/cjs/jsx/jsx-dev-runtime.js" - }, - "./jsx/jsx-runtime": { - "types": "./dist/types/jsx/jsx-runtime.d.ts", - "import": "./dist/jsx/jsx-runtime.js", - "require": "./dist/cjs/jsx/jsx-runtime.js" - }, - "./jsx/streaming": { - "types": "./dist/types/jsx/streaming.d.ts", - "import": "./dist/jsx/streaming.js", - "require": "./dist/cjs/jsx/streaming.js" - }, - "./jsx-renderer": { - "types": "./dist/types/middleware/jsx-renderer/index.d.ts", - "import": "./dist/middleware/jsx-renderer/index.js", - "require": "./dist/cjs/middleware/jsx-renderer/index.js" - }, - "./jsx/dom": { - "types": "./dist/types/jsx/dom/index.d.ts", - "import": "./dist/jsx/dom/index.js", - "require": "./dist/cjs/jsx/dom/index.js" - }, - "./jsx/dom/jsx-dev-runtime": { - "types": "./dist/types/jsx/dom/jsx-dev-runtime.d.ts", - "import": "./dist/jsx/dom/jsx-dev-runtime.js", - "require": "./dist/cjs/jsx/dom/jsx-dev-runtime.js" - }, - "./jsx/dom/jsx-runtime": { - "types": "./dist/types/jsx/dom/jsx-runtime.d.ts", - "import": "./dist/jsx/dom/jsx-runtime.js", - "require": "./dist/cjs/jsx/dom/jsx-runtime.js" - }, - "./jsx/dom/client": { - "types": "./dist/types/jsx/dom/client.d.ts", - "import": "./dist/jsx/dom/client.js", - "require": "./dist/cjs/jsx/dom/client.js" - }, - "./jsx/dom/css": { - "types": "./dist/types/jsx/dom/css.d.ts", - "import": "./dist/jsx/dom/css.js", - "require": "./dist/cjs/jsx/dom/css.js" - }, - "./jsx/dom/server": { - "types": "./dist/types/jsx/dom/server.d.ts", - "import": "./dist/jsx/dom/server.js", - "require": "./dist/cjs/jsx/dom/server.js" - }, - "./jwt": { - "types": "./dist/types/middleware/jwt/index.d.ts", - "import": "./dist/middleware/jwt/index.js", - "require": "./dist/cjs/middleware/jwt/index.js" - }, - "./jwk": { - "types": "./dist/types/middleware/jwk/index.d.ts", - "import": "./dist/middleware/jwk/index.js", - "require": "./dist/cjs/middleware/jwk/index.js" - }, - "./timeout": { - "types": "./dist/types/middleware/timeout/index.d.ts", - "import": "./dist/middleware/timeout/index.js", - "require": "./dist/cjs/middleware/timeout/index.js" - }, - "./timing": { - "types": "./dist/types/middleware/timing/index.d.ts", - "import": "./dist/middleware/timing/index.js", - "require": "./dist/cjs/middleware/timing/index.js" - }, - "./logger": { - "types": "./dist/types/middleware/logger/index.d.ts", - "import": "./dist/middleware/logger/index.js", - "require": "./dist/cjs/middleware/logger/index.js" - }, - "./method-override": { - "types": "./dist/types/middleware/method-override/index.d.ts", - "import": "./dist/middleware/method-override/index.js", - "require": "./dist/cjs/middleware/method-override/index.js" - }, - "./powered-by": { - "types": "./dist/types/middleware/powered-by/index.d.ts", - "import": "./dist/middleware/powered-by/index.js", - "require": "./dist/cjs/middleware/powered-by/index.js" - }, - "./pretty-json": { - "types": "./dist/types/middleware/pretty-json/index.d.ts", - "import": "./dist/middleware/pretty-json/index.js", - "require": "./dist/cjs/middleware/pretty-json/index.js" - }, - "./request-id": { - "types": "./dist/types/middleware/request-id/index.d.ts", - "import": "./dist/middleware/request-id/index.js", - "require": "./dist/cjs/middleware/request-id/index.js" - }, - "./language": { - "types": "./dist/types/middleware/language/index.d.ts", - "import": "./dist/middleware/language/index.js", - "require": "./dist/cjs/middleware/language/index.js" - }, - "./secure-headers": { - "types": "./dist/types/middleware/secure-headers/index.d.ts", - "import": "./dist/middleware/secure-headers/index.js", - "require": "./dist/cjs/middleware/secure-headers/index.js" - }, - "./combine": { - "types": "./dist/types/middleware/combine/index.d.ts", - "import": "./dist/middleware/combine/index.js", - "require": "./dist/cjs/middleware/combine/index.js" - }, - "./ssg": { - "types": "./dist/types/helper/ssg/index.d.ts", - "import": "./dist/helper/ssg/index.js", - "require": "./dist/cjs/helper/ssg/index.js" - }, - "./streaming": { - "types": "./dist/types/helper/streaming/index.d.ts", - "import": "./dist/helper/streaming/index.js", - "require": "./dist/cjs/helper/streaming/index.js" - }, - "./validator": { - "types": "./dist/types/validator/index.d.ts", - "import": "./dist/validator/index.js", - "require": "./dist/cjs/validator/index.js" - }, - "./router": { - "types": "./dist/types/router.d.ts", - "import": "./dist/router.js", - "require": "./dist/cjs/router.js" - }, - "./router/reg-exp-router": { - "types": "./dist/types/router/reg-exp-router/index.d.ts", - "import": "./dist/router/reg-exp-router/index.js", - "require": "./dist/cjs/router/reg-exp-router/index.js" - }, - "./router/smart-router": { - "types": "./dist/types/router/smart-router/index.d.ts", - "import": "./dist/router/smart-router/index.js", - "require": "./dist/cjs/router/smart-router/index.js" - }, - "./router/trie-router": { - "types": "./dist/types/router/trie-router/index.d.ts", - "import": "./dist/router/trie-router/index.js", - "require": "./dist/cjs/router/trie-router/index.js" - }, - "./router/pattern-router": { - "types": "./dist/types/router/pattern-router/index.d.ts", - "import": "./dist/router/pattern-router/index.js", - "require": "./dist/cjs/router/pattern-router/index.js" - }, - "./router/linear-router": { - "types": "./dist/types/router/linear-router/index.d.ts", - "import": "./dist/router/linear-router/index.js", - "require": "./dist/cjs/router/linear-router/index.js" - }, - "./utils/jwt": { - "types": "./dist/types/utils/jwt/index.d.ts", - "import": "./dist/utils/jwt/index.js", - "require": "./dist/cjs/utils/jwt/index.js" - }, - "./utils/*": { - "types": "./dist/types/utils/*.d.ts", - "import": "./dist/utils/*.js", - "require": "./dist/cjs/utils/*.js" - }, - "./client": { - "types": "./dist/types/client/index.d.ts", - "import": "./dist/client/index.js", - "require": "./dist/cjs/client/index.js" - }, - "./adapter": { - "types": "./dist/types/helper/adapter/index.d.ts", - "import": "./dist/helper/adapter/index.js", - "require": "./dist/cjs/helper/adapter/index.js" - }, - "./factory": { - "types": "./dist/types/helper/factory/index.d.ts", - "import": "./dist/helper/factory/index.js", - "require": "./dist/cjs/helper/factory/index.js" - }, - "./serve-static": { - "types": "./dist/types/middleware/serve-static/index.d.ts", - "import": "./dist/middleware/serve-static/index.js", - "require": "./dist/cjs/middleware/serve-static/index.js" - }, - "./cloudflare-workers": { - "types": "./dist/types/adapter/cloudflare-workers/index.d.ts", - "import": "./dist/adapter/cloudflare-workers/index.js", - "require": "./dist/cjs/adapter/cloudflare-workers/index.js" - }, - "./cloudflare-pages": { - "types": "./dist/types/adapter/cloudflare-pages/index.d.ts", - "import": "./dist/adapter/cloudflare-pages/index.js", - "require": "./dist/cjs/adapter/cloudflare-pages/index.js" - }, - "./deno": { - "types": "./dist/types/adapter/deno/index.d.ts", - "import": "./dist/adapter/deno/index.js", - "require": "./dist/cjs/adapter/deno/index.js" - }, - "./bun": { - "types": "./dist/types/adapter/bun/index.d.ts", - "import": "./dist/adapter/bun/index.js", - "require": "./dist/cjs/adapter/bun/index.js" - }, - "./aws-lambda": { - "types": "./dist/types/adapter/aws-lambda/index.d.ts", - "import": "./dist/adapter/aws-lambda/index.js", - "require": "./dist/cjs/adapter/aws-lambda/index.js" - }, - "./vercel": { - "types": "./dist/types/adapter/vercel/index.d.ts", - "import": "./dist/adapter/vercel/index.js", - "require": "./dist/cjs/adapter/vercel/index.js" - }, - "./netlify": { - "types": "./dist/types/adapter/netlify/index.d.ts", - "import": "./dist/adapter/netlify/index.js", - "require": "./dist/cjs/adapter/netlify/index.js" - }, - "./lambda-edge": { - "types": "./dist/types/adapter/lambda-edge/index.d.ts", - "import": "./dist/adapter/lambda-edge/index.js", - "require": "./dist/cjs/adapter/lambda-edge/index.js" - }, - "./service-worker": { - "types": "./dist/types/adapter/service-worker/index.d.ts", - "import": "./dist/adapter/service-worker/index.js", - "require": "./dist/cjs/adapter/service-worker/index.js" - }, - "./testing": { - "types": "./dist/types/helper/testing/index.d.ts", - "import": "./dist/helper/testing/index.js", - "require": "./dist/cjs/helper/testing/index.js" - }, - "./dev": { - "types": "./dist/types/helper/dev/index.d.ts", - "import": "./dist/helper/dev/index.js", - "require": "./dist/cjs/helper/dev/index.js" - }, - "./ws": { - "types": "./dist/types/helper/websocket/index.d.ts", - "import": "./dist/helper/websocket/index.js", - "require": "./dist/cjs/helper/websocket/index.js" - }, - "./conninfo": { - "types": "./dist/types/helper/conninfo/index.d.ts", - "import": "./dist/helper/conninfo/index.js", - "require": "./dist/cjs/helper/conninfo/index.js" - }, - "./proxy": { - "types": "./dist/types/helper/proxy/index.d.ts", - "import": "./dist/helper/proxy/index.js", - "require": "./dist/cjs/helper/proxy/index.js" - } - }, - "typesVersions": { - "*": { - "request": [ - "./dist/types/request" - ], - "types": [ - "./dist/types/types" - ], - "hono-base": [ - "./dist/types/hono-base" - ], - "tiny": [ - "./dist/types/preset/tiny" - ], - "quick": [ - "./dist/types/preset/quick" - ], - "http-exception": [ - "./dist/types/http-exception" - ], - "basic-auth": [ - "./dist/types/middleware/basic-auth" - ], - "bearer-auth": [ - "./dist/types/middleware/bearer-auth" - ], - "body-limit": [ - "./dist/types/middleware/body-limit" - ], - "ip-restriction": [ - "./dist/types/middleware/ip-restriction" - ], - "cache": [ - "./dist/types/middleware/cache" - ], - "route": [ - "./dist/types/helper/route" - ], - "cookie": [ - "./dist/types/helper/cookie" - ], - "accepts": [ - "./dist/types/helper/accepts" - ], - "compress": [ - "./dist/types/middleware/compress" - ], - "context-storage": [ - "./dist/types/middleware/context-storage" - ], - "cors": [ - "./dist/types/middleware/cors" - ], - "csrf": [ - "./dist/types/middleware/csrf" - ], - "etag": [ - "./dist/types/middleware/etag" - ], - "trailing-slash": [ - "./dist/types/middleware/trailing-slash" - ], - "html": [ - "./dist/types/helper/html" - ], - "css": [ - "./dist/types/helper/css" - ], - "jsx": [ - "./dist/types/jsx" - ], - "jsx/jsx-runtime": [ - "./dist/types/jsx/jsx-runtime.d.ts" - ], - "jsx/jsx-dev-runtime": [ - "./dist/types/jsx/jsx-dev-runtime.d.ts" - ], - "jsx/streaming": [ - "./dist/types/jsx/streaming.d.ts" - ], - "jsx-renderer": [ - "./dist/types/middleware/jsx-renderer" - ], - "jsx/dom": [ - "./dist/types/jsx/dom" - ], - "jsx/dom/client": [ - "./dist/types/jsx/dom/client.d.ts" - ], - "jsx/dom/css": [ - "./dist/types/jsx/dom/css.d.ts" - ], - "jsx/dom/server": [ - "./dist/types/jsx/dom/server.d.ts" - ], - "jwt": [ - "./dist/types/middleware/jwt" - ], - "timeout": [ - "./dist/types/middleware/timeout" - ], - "timing": [ - "./dist/types/middleware/timing" - ], - "logger": [ - "./dist/types/middleware/logger" - ], - "method-override": [ - "./dist/types/middleware/method-override" - ], - "powered-by": [ - "./dist/types/middleware/powered-by" - ], - "pretty-json": [ - "./dist/types/middleware/pretty-json" - ], - "request-id": [ - "./dist/types/middleware/request-id" - ], - "language": [ - "./dist/types/middleware/language" - ], - "streaming": [ - "./dist/types/helper/streaming" - ], - "ssg": [ - "./dist/types/helper/ssg" - ], - "secure-headers": [ - "./dist/types/middleware/secure-headers" - ], - "combine": [ - "./dist/types/middleware/combine" - ], - "validator": [ - "./dist/types/validator/index.d.ts" - ], - "router": [ - "./dist/types/router.d.ts" - ], - "router/reg-exp-router": [ - "./dist/types/router/reg-exp-router/router.d.ts" - ], - "router/smart-router": [ - "./dist/types/router/smart-router/router.d.ts" - ], - "router/trie-router": [ - "./dist/types/router/trie-router/router.d.ts" - ], - "router/pattern-router": [ - "./dist/types/router/pattern-router/router.d.ts" - ], - "router/linear-router": [ - "./dist/types/router/linear-router/router.d.ts" - ], - "utils/jwt": [ - "./dist/types/utils/jwt/index.d.ts" - ], - "utils/*": [ - "./dist/types/utils/*" - ], - "client": [ - "./dist/types/client/index.d.ts" - ], - "adapter": [ - "./dist/types/helper/adapter/index.d.ts" - ], - "factory": [ - "./dist/types/helper/factory/index.d.ts" - ], - "serve-static": [ - "./dist/types/middleware/serve-static" - ], - "cloudflare-workers": [ - "./dist/types/adapter/cloudflare-workers" - ], - "cloudflare-pages": [ - "./dist/types/adapter/cloudflare-pages" - ], - "deno": [ - "./dist/types/adapter/deno" - ], - "bun": [ - "./dist/types/adapter/bun" - ], - "nextjs": [ - "./dist/types/adapter/nextjs" - ], - "aws-lambda": [ - "./dist/types/adapter/aws-lambda" - ], - "vercel": [ - "./dist/types/adapter/vercel" - ], - "lambda-edge": [ - "./dist/types/adapter/lambda-edge" - ], - "service-worker": [ - "./dist/types/adapter/service-worker" - ], - "testing": [ - "./dist/types/helper/testing" - ], - "dev": [ - "./dist/types/helper/dev" - ], - "ws": [ - "./dist/types/helper/websocket" - ], - "conninfo": [ - "./dist/types/helper/conninfo" - ], - "proxy": [ - "./dist/types/helper/proxy" - ] - } - }, - "author": "Yusuke Wada (https://github.com/yusukebe)", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/honojs/hono.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org" - }, - "homepage": "https://hono.dev", - "keywords": [ - "hono", - "web", - "app", - "http", - "application", - "framework", - "router", - "cloudflare", - "workers", - "fastly", - "compute", - "deno", - "bun", - "lambda", - "nodejs" - ], - "devDependencies": { - "@hono/eslint-config": "^2.0.5", - "@hono/node-server": "^1.13.5", - "@types/glob": "^9.0.0", - "@types/jsdom": "^21.1.7", - "@types/node": "^24.3.0", - "@typescript/native-preview": "7.0.0-dev.20251220.1", - "@vitest/coverage-v8": "^3.2.4", - "arg": "^5.0.2", - "bun-types": "^1.2.20", - "editorconfig-checker": "6.1.1", - "esbuild": "^0.27.1", - "eslint": "9.39.1", - "glob": "^11.0.0", - "jsdom": "22.1.0", - "msw": "^2.6.0", - "np": "10.2.0", - "oxc-parser": "^0.96.0", - "pkg-pr-new": "^0.0.53", - "prettier": "3.7.4", - "publint": "0.3.15", - "typescript": "^5.9.2", - "undici": "^6.21.3", - "vite-plugin-fastly-js-compute": "^0.4.2", - "vitest": "^3.2.4", - "wrangler": "4.12.0", - "ws": "^8.18.0", - "zod": "^3.23.8" - }, - "packageManager": "bun@1.2.20", - "engines": { - "node": ">=16.9.0" - } -} diff --git a/node_modules/http-errors/HISTORY.md b/node_modules/http-errors/HISTORY.md deleted file mode 100644 index 3d81d26..0000000 --- a/node_modules/http-errors/HISTORY.md +++ /dev/null @@ -1,186 +0,0 @@ -2.0.1 / 2025-11-20 -================== - - * deps: use tilde notation for dependencies - * deps: update statuses to 2.0.2 - -2.0.0 / 2021-12-17 -================== - - * Drop support for Node.js 0.6 - * Remove `I'mateapot` export; use `ImATeapot` instead - * Remove support for status being non-first argument - * Rename `UnorderedCollection` constructor to `TooEarly` - * deps: depd@2.0.0 - - Replace internal `eval` usage with `Function` constructor - - Use instance methods on `process` to check for listeners - * deps: statuses@2.0.1 - - Fix messaging casing of `418 I'm a Teapot` - - Remove code 306 - - Rename `425 Unordered Collection` to standard `425 Too Early` - -2021-11-14 / 1.8.1 -================== - - * deps: toidentifier@1.0.1 - -2020-06-29 / 1.8.0 -================== - - * Add `isHttpError` export to determine if value is an HTTP error - * deps: setprototypeof@1.2.0 - -2019-06-24 / 1.7.3 -================== - - * deps: inherits@2.0.4 - -2019-02-18 / 1.7.2 -================== - - * deps: setprototypeof@1.1.1 - -2018-09-08 / 1.7.1 -================== - - * Fix error creating objects in some environments - -2018-07-30 / 1.7.0 -================== - - * Set constructor name when possible - * Use `toidentifier` module to make class names - * deps: statuses@'>= 1.5.0 < 2' - -2018-03-29 / 1.6.3 -================== - - * deps: depd@~1.1.2 - - perf: remove argument reassignment - * deps: setprototypeof@1.1.0 - * deps: statuses@'>= 1.4.0 < 2' - -2017-08-04 / 1.6.2 -================== - - * deps: depd@1.1.1 - - Remove unnecessary `Buffer` loading - -2017-02-20 / 1.6.1 -================== - - * deps: setprototypeof@1.0.3 - - Fix shim for old browsers - -2017-02-14 / 1.6.0 -================== - - * Accept custom 4xx and 5xx status codes in factory - * Add deprecation message to `"I'mateapot"` export - * Deprecate passing status code as anything except first argument in factory - * Deprecate using non-error status codes - * Make `message` property enumerable for `HttpError`s - -2016-11-16 / 1.5.1 -================== - - * deps: inherits@2.0.3 - - Fix issue loading in browser - * deps: setprototypeof@1.0.2 - * deps: statuses@'>= 1.3.1 < 2' - -2016-05-18 / 1.5.0 -================== - - * Support new code `421 Misdirected Request` - * Use `setprototypeof` module to replace `__proto__` setting - * deps: statuses@'>= 1.3.0 < 2' - - Add `421 Misdirected Request` - - perf: enable strict mode - * perf: enable strict mode - -2016-01-28 / 1.4.0 -================== - - * Add `HttpError` export, for `err instanceof createError.HttpError` - * deps: inherits@2.0.1 - * deps: statuses@'>= 1.2.1 < 2' - - Fix message for status 451 - - Remove incorrect nginx status code - -2015-02-02 / 1.3.1 -================== - - * Fix regression where status can be overwritten in `createError` `props` - -2015-02-01 / 1.3.0 -================== - - * Construct errors using defined constructors from `createError` - * Fix error names that are not identifiers - - `createError["I'mateapot"]` is now `createError.ImATeapot` - * Set a meaningful `name` property on constructed errors - -2014-12-09 / 1.2.8 -================== - - * Fix stack trace from exported function - * Remove `arguments.callee` usage - -2014-10-14 / 1.2.7 -================== - - * Remove duplicate line - -2014-10-02 / 1.2.6 -================== - - * Fix `expose` to be `true` for `ClientError` constructor - -2014-09-28 / 1.2.5 -================== - - * deps: statuses@1 - -2014-09-21 / 1.2.4 -================== - - * Fix dependency version to work with old `npm`s - -2014-09-21 / 1.2.3 -================== - - * deps: statuses@~1.1.0 - -2014-09-21 / 1.2.2 -================== - - * Fix publish error - -2014-09-21 / 1.2.1 -================== - - * Support Node.js 0.6 - * Use `inherits` instead of `util` - -2014-09-09 / 1.2.0 -================== - - * Fix the way inheriting functions - * Support `expose` being provided in properties argument - -2014-09-08 / 1.1.0 -================== - - * Default status to 500 - * Support provided `error` to extend - -2014-09-08 / 1.0.1 -================== - - * Fix accepting string message - -2014-09-08 / 1.0.0 -================== - - * Initial release diff --git a/node_modules/http-errors/LICENSE b/node_modules/http-errors/LICENSE deleted file mode 100644 index 82af4df..0000000 --- a/node_modules/http-errors/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com -Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/http-errors/README.md b/node_modules/http-errors/README.md deleted file mode 100644 index a8b7330..0000000 --- a/node_modules/http-errors/README.md +++ /dev/null @@ -1,169 +0,0 @@ -# http-errors - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][node-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Create HTTP errors for Express, Koa, Connect, etc. with ease. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```console -$ npm install http-errors -``` - -## Example - -```js -var createError = require('http-errors') -var express = require('express') -var app = express() - -app.use(function (req, res, next) { - if (!req.user) return next(createError(401, 'Please login to view this page.')) - next() -}) -``` - -## API - -This is the current API, currently extracted from Koa and subject to change. - -### Error Properties - -- `expose` - can be used to signal if `message` should be sent to the client, - defaulting to `false` when `status` >= 500 -- `headers` - can be an object of header names to values to be sent to the - client, defaulting to `undefined`. When defined, the key names should all - be lower-cased -- `message` - the traditional error message, which should be kept short and all - single line -- `status` - the status code of the error, mirroring `statusCode` for general - compatibility -- `statusCode` - the status code of the error, defaulting to `500` - -### createError([status], [message], [properties]) - -Create a new error object with the given message `msg`. -The error object inherits from `createError.HttpError`. - -```js -var err = createError(404, 'This video does not exist!') -``` - -- `status: 500` - the status code as a number -- `message` - the message of the error, defaulting to node's text for that status code. -- `properties` - custom properties to attach to the object - -### createError([status], [error], [properties]) - -Extend the given `error` object with `createError.HttpError` -properties. This will not alter the inheritance of the given -`error` object, and the modified `error` object is the -return value. - - - -```js -fs.readFile('foo.txt', function (err, buf) { - if (err) { - if (err.code === 'ENOENT') { - var httpError = createError(404, err, { expose: false }) - } else { - var httpError = createError(500, err) - } - } -}) -``` - -- `status` - the status code as a number -- `error` - the error object to extend -- `properties` - custom properties to attach to the object - -### createError.isHttpError(val) - -Determine if the provided `val` is an `HttpError`. This will return `true` -if the error inherits from the `HttpError` constructor of this module or -matches the "duck type" for an error this module creates. All outputs from -the `createError` factory will return `true` for this function, including -if an non-`HttpError` was passed into the factory. - -### new createError\[code || name\](\[msg]\)) - -Create a new error object with the given message `msg`. -The error object inherits from `createError.HttpError`. - -```js -var err = new createError.NotFound() -``` - -- `code` - the status code as a number -- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. - -#### List of all constructors - -|Status Code|Constructor Name | -|-----------|-----------------------------| -|400 |BadRequest | -|401 |Unauthorized | -|402 |PaymentRequired | -|403 |Forbidden | -|404 |NotFound | -|405 |MethodNotAllowed | -|406 |NotAcceptable | -|407 |ProxyAuthenticationRequired | -|408 |RequestTimeout | -|409 |Conflict | -|410 |Gone | -|411 |LengthRequired | -|412 |PreconditionFailed | -|413 |PayloadTooLarge | -|414 |URITooLong | -|415 |UnsupportedMediaType | -|416 |RangeNotSatisfiable | -|417 |ExpectationFailed | -|418 |ImATeapot | -|421 |MisdirectedRequest | -|422 |UnprocessableEntity | -|423 |Locked | -|424 |FailedDependency | -|425 |TooEarly | -|426 |UpgradeRequired | -|428 |PreconditionRequired | -|429 |TooManyRequests | -|431 |RequestHeaderFieldsTooLarge | -|451 |UnavailableForLegalReasons | -|500 |InternalServerError | -|501 |NotImplemented | -|502 |BadGateway | -|503 |ServiceUnavailable | -|504 |GatewayTimeout | -|505 |HTTPVersionNotSupported | -|506 |VariantAlsoNegotiates | -|507 |InsufficientStorage | -|508 |LoopDetected | -|509 |BandwidthLimitExceeded | -|510 |NotExtended | -|511 |NetworkAuthenticationRequired| - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/http-errors/master?label=ci -[ci-url]: https://github.com/jshttp/http-errors/actions?query=workflow%3Aci -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master -[coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master -[node-image]: https://badgen.net/npm/node/http-errors -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/http-errors -[npm-url]: https://npmjs.org/package/http-errors -[npm-version-image]: https://badgen.net/npm/v/http-errors -[travis-image]: https://badgen.net/travis/jshttp/http-errors/master -[travis-url]: https://travis-ci.org/jshttp/http-errors diff --git a/node_modules/http-errors/index.js b/node_modules/http-errors/index.js deleted file mode 100644 index 82271f6..0000000 --- a/node_modules/http-errors/index.js +++ /dev/null @@ -1,290 +0,0 @@ -/*! - * http-errors - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var deprecate = require('depd')('http-errors') -var setPrototypeOf = require('setprototypeof') -var statuses = require('statuses') -var inherits = require('inherits') -var toIdentifier = require('toidentifier') - -/** - * Module exports. - * @public - */ - -module.exports = createError -module.exports.HttpError = createHttpErrorConstructor() -module.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError) - -// Populate exports for all constructors -populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError) - -/** - * Get the code class of a status code. - * @private - */ - -function codeClass (status) { - return Number(String(status).charAt(0) + '00') -} - -/** - * Create a new HTTP Error. - * - * @returns {Error} - * @public - */ - -function createError () { - // so much arity going on ~_~ - var err - var msg - var status = 500 - var props = {} - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i] - var type = typeof arg - if (type === 'object' && arg instanceof Error) { - err = arg - status = err.status || err.statusCode || status - } else if (type === 'number' && i === 0) { - status = arg - } else if (type === 'string') { - msg = arg - } else if (type === 'object') { - props = arg - } else { - throw new TypeError('argument #' + (i + 1) + ' unsupported type ' + type) - } - } - - if (typeof status === 'number' && (status < 400 || status >= 600)) { - deprecate('non-error status code; use only 4xx or 5xx status codes') - } - - if (typeof status !== 'number' || - (!statuses.message[status] && (status < 400 || status >= 600))) { - status = 500 - } - - // constructor - var HttpError = createError[status] || createError[codeClass(status)] - - if (!err) { - // create error - err = HttpError - ? new HttpError(msg) - : new Error(msg || statuses.message[status]) - Error.captureStackTrace(err, createError) - } - - if (!HttpError || !(err instanceof HttpError) || err.status !== status) { - // add properties to generic error - err.expose = status < 500 - err.status = err.statusCode = status - } - - for (var key in props) { - if (key !== 'status' && key !== 'statusCode') { - err[key] = props[key] - } - } - - return err -} - -/** - * Create HTTP error abstract base class. - * @private - */ - -function createHttpErrorConstructor () { - function HttpError () { - throw new TypeError('cannot construct abstract class') - } - - inherits(HttpError, Error) - - return HttpError -} - -/** - * Create a constructor for a client error. - * @private - */ - -function createClientErrorConstructor (HttpError, name, code) { - var className = toClassName(name) - - function ClientError (message) { - // create the error object - var msg = message != null ? message : statuses.message[code] - var err = new Error(msg) - - // capture a stack trace to the construction point - Error.captureStackTrace(err, ClientError) - - // adjust the [[Prototype]] - setPrototypeOf(err, ClientError.prototype) - - // redefine the error message - Object.defineProperty(err, 'message', { - enumerable: true, - configurable: true, - value: msg, - writable: true - }) - - // redefine the error name - Object.defineProperty(err, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - - return err - } - - inherits(ClientError, HttpError) - nameFunc(ClientError, className) - - ClientError.prototype.status = code - ClientError.prototype.statusCode = code - ClientError.prototype.expose = true - - return ClientError -} - -/** - * Create function to test is a value is a HttpError. - * @private - */ - -function createIsHttpErrorFunction (HttpError) { - return function isHttpError (val) { - if (!val || typeof val !== 'object') { - return false - } - - if (val instanceof HttpError) { - return true - } - - return val instanceof Error && - typeof val.expose === 'boolean' && - typeof val.statusCode === 'number' && val.status === val.statusCode - } -} - -/** - * Create a constructor for a server error. - * @private - */ - -function createServerErrorConstructor (HttpError, name, code) { - var className = toClassName(name) - - function ServerError (message) { - // create the error object - var msg = message != null ? message : statuses.message[code] - var err = new Error(msg) - - // capture a stack trace to the construction point - Error.captureStackTrace(err, ServerError) - - // adjust the [[Prototype]] - setPrototypeOf(err, ServerError.prototype) - - // redefine the error message - Object.defineProperty(err, 'message', { - enumerable: true, - configurable: true, - value: msg, - writable: true - }) - - // redefine the error name - Object.defineProperty(err, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - - return err - } - - inherits(ServerError, HttpError) - nameFunc(ServerError, className) - - ServerError.prototype.status = code - ServerError.prototype.statusCode = code - ServerError.prototype.expose = false - - return ServerError -} - -/** - * Set the name of a function, if possible. - * @private - */ - -function nameFunc (func, name) { - var desc = Object.getOwnPropertyDescriptor(func, 'name') - - if (desc && desc.configurable) { - desc.value = name - Object.defineProperty(func, 'name', desc) - } -} - -/** - * Populate the exports object with constructors for every error class. - * @private - */ - -function populateConstructorExports (exports, codes, HttpError) { - codes.forEach(function forEachCode (code) { - var CodeError - var name = toIdentifier(statuses.message[code]) - - switch (codeClass(code)) { - case 400: - CodeError = createClientErrorConstructor(HttpError, name, code) - break - case 500: - CodeError = createServerErrorConstructor(HttpError, name, code) - break - } - - if (CodeError) { - // export the constructor - exports[code] = CodeError - exports[name] = CodeError - } - }) -} - -/** - * Get a class name from a name identifier. - * - * @param {string} name - * @returns {string} - * @private - */ - -function toClassName (name) { - return name.slice(-5) === 'Error' ? name : name + 'Error' -} diff --git a/node_modules/http-errors/package.json b/node_modules/http-errors/package.json deleted file mode 100644 index 4b46d62..0000000 --- a/node_modules/http-errors/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "http-errors", - "description": "Create HTTP error objects", - "version": "2.0.1", - "author": "Jonathan Ong (http://jongleberry.com)", - "contributors": [ - "Alan Plum ", - "Douglas Christopher Wilson " - ], - "license": "MIT", - "repository": "jshttp/http-errors", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, - "dependencies": { - "depd": "~2.0.0", - "inherits": "~2.0.4", - "setprototypeof": "~1.2.0", - "statuses": "~2.0.2", - "toidentifier": "~1.0.1" - }, - "devDependencies": { - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.32.0", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.1.3", - "nyc": "15.1.0" - }, - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "lint": "eslint . && node ./scripts/lint-readme-list.js", - "test": "mocha --reporter spec", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" - }, - "keywords": [ - "http", - "error" - ], - "files": [ - "index.js", - "HISTORY.md", - "LICENSE", - "README.md" - ] -} diff --git a/node_modules/iconv-lite/LICENSE b/node_modules/iconv-lite/LICENSE deleted file mode 100644 index d518d83..0000000 --- a/node_modules/iconv-lite/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011 Alexander Shtuchkin - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/iconv-lite/README.md b/node_modules/iconv-lite/README.md deleted file mode 100644 index 78a7a5f..0000000 --- a/node_modules/iconv-lite/README.md +++ /dev/null @@ -1,138 +0,0 @@ -## iconv-lite: Pure JS character encoding conversion - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-downloads-url] -[![License][license-image]][license-url] -[![NPM Install Size][npm-install-size-image]][npm-install-size-url] - -* No need for native code compilation. Quick to install, works on Windows, Web, and in sandboxed environments. -* Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), - [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. -* Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). -* Intuitive encode/decode API, including Streaming support. -* In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). -* Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. -* React Native is supported (need to install `stream` module to enable Streaming API). - -## Usage - -### Basic API - -```javascript -var iconv = require('iconv-lite'); - -// Convert from an encoded buffer to a js string. -str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); - -// Convert from a js string to an encoded buffer. -buf = iconv.encode("Sample input string", 'win1251'); - -// Check if encoding is supported -iconv.encodingExists("us-ascii") -``` - -### Streaming API - -```javascript -// Decode stream (from binary data stream to js strings) -http.createServer(function(req, res) { - var converterStream = iconv.decodeStream('win1251'); - req.pipe(converterStream); - - converterStream.on('data', function(str) { - console.log(str); // Do something with decoded strings, chunk-by-chunk. - }); -}); - -// Convert encoding streaming example -fs.createReadStream('file-in-win1251.txt') - .pipe(iconv.decodeStream('win1251')) - .pipe(iconv.encodeStream('ucs2')) - .pipe(fs.createWriteStream('file-in-ucs2.txt')); - -// Sugar: all encode/decode streams have .collect(cb) method to accumulate data. -http.createServer(function(req, res) { - req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { - assert(typeof body == 'string'); - console.log(body); // full request body string - }); -}); -``` - -## Supported encodings - - * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. - * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. - * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, - IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. - Aliases like 'latin1', 'us-ascii' also supported. - * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. - -See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings). - -Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors! - -Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! - -## Encoding/decoding speed - -Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). -Note: your results may vary, so please always check on your hardware. - - operation iconv@2.1.4 iconv-lite@0.4.7 - ---------------------------------------------------------- - encode('win1251') ~96 Mb/s ~320 Mb/s - decode('win1251') ~95 Mb/s ~246 Mb/s - -## BOM handling - - * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options - (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). - A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. - * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module. - * Encoding: No BOM added, unless overridden by `addBOM: true` option. - -## UTF-16 Encodings - -This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be -smart about endianness in the following ways: - * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be - overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. - * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. - -## UTF-32 Encodings - -This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. - * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. - * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.) - -## Other notes - -When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). -Untranslatable characters are set to � or ?. No transliteration is currently supported. -Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see [#65](https://github.com/ashtuchkin/iconv-lite/issues/65), [#77](https://github.com/ashtuchkin/iconv-lite/issues/77)). - -## Testing - -```sh -git clone git@github.com:ashtuchkin/iconv-lite.git -cd iconv-lite -npm install -npm test - -# To view performance: -npm run test:performance - -# To view test coverage: -npm run test:cov -open coverage/index.html -``` - -[npm-downloads-image]: https://badgen.net/npm/dm/iconv-lite -[npm-downloads-url]: https://npmcharts.com/compare/iconv-lite?minimal=true -[npm-url]: https://npmjs.org/package/iconv-lite -[npm-version-image]: https://badgen.net/npm/v/iconv-lite -[npm-install-size-image]: https://badgen.net/packagephobia/install/iconv-lite -[npm-install-size-url]: https://packagephobia.com/result?p=iconv-lite -[license-image]: https://img.shields.io/npm/l/iconv-lite.svg -[license-url]: https://github.com/ashtuchkin/iconv-lite/blob/HEAD/LICENSE \ No newline at end of file diff --git a/node_modules/iconv-lite/encodings/dbcs-codec.js b/node_modules/iconv-lite/encodings/dbcs-codec.js deleted file mode 100644 index bfec7f2..0000000 --- a/node_modules/iconv-lite/encodings/dbcs-codec.js +++ /dev/null @@ -1,532 +0,0 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer - -// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. -// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. -// To save memory and loading time, we read table files only when requested. - -exports._dbcs = DBCSCodec - -var UNASSIGNED = -1 -var GB18030_CODE = -2 -var SEQ_START = -10 -var NODE_START = -1000 -var UNASSIGNED_NODE = new Array(0x100) -var DEF_CHAR = -1 - -for (var i = 0; i < 0x100; i++) { UNASSIGNED_NODE[i] = UNASSIGNED } - -// Class DBCSCodec reads and initializes mapping tables. -function DBCSCodec (codecOptions, iconv) { - this.encodingName = codecOptions.encodingName - if (!codecOptions) { throw new Error("DBCS codec is called without the data.") } - if (!codecOptions.table) { throw new Error("Encoding '" + this.encodingName + "' has no data.") } - - // Load tables. - var mappingTable = codecOptions.table() - - // Decode tables: MBCS -> Unicode. - - // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. - // Trie root is decodeTables[0]. - // Values: >= 0 -> unicode character code. can be > 0xFFFF - // == UNASSIGNED -> unknown/unassigned sequence. - // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. - // <= NODE_START -> index of the next node in our trie to process next byte. - // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. - this.decodeTables = [] - this.decodeTables[0] = UNASSIGNED_NODE.slice(0) // Create root node. - - // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. - this.decodeTableSeq = [] - - // Actual mapping tables consist of chunks. Use them to fill up decode tables. - for (var i = 0; i < mappingTable.length; i++) { this._addDecodeChunk(mappingTable[i]) } - - // Load & create GB18030 tables when needed. - if (typeof codecOptions.gb18030 === "function") { - this.gb18030 = codecOptions.gb18030() // Load GB18030 ranges. - - // Add GB18030 common decode nodes. - var commonThirdByteNodeIdx = this.decodeTables.length - this.decodeTables.push(UNASSIGNED_NODE.slice(0)) - - var commonFourthByteNodeIdx = this.decodeTables.length - this.decodeTables.push(UNASSIGNED_NODE.slice(0)) - - // Fill out the tree - var firstByteNode = this.decodeTables[0] - for (var i = 0x81; i <= 0xFE; i++) { - var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]] - for (var j = 0x30; j <= 0x39; j++) { - if (secondByteNode[j] === UNASSIGNED) { - secondByteNode[j] = NODE_START - commonThirdByteNodeIdx - } else if (secondByteNode[j] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 2") - } - - var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]] - for (var k = 0x81; k <= 0xFE; k++) { - if (thirdByteNode[k] === UNASSIGNED) { - thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx - } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { - continue - } else if (thirdByteNode[k] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 3") - } - - var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]] - for (var l = 0x30; l <= 0x39; l++) { - if (fourthByteNode[l] === UNASSIGNED) { fourthByteNode[l] = GB18030_CODE } - } - } - } - } - } - - this.defaultCharUnicode = iconv.defaultCharUnicode - - // Encode tables: Unicode -> DBCS. - - // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. - // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. - // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). - // == UNASSIGNED -> no conversion found. Output a default char. - // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. - this.encodeTable = [] - - // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of - // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key - // means end of sequence (needed when one sequence is a strict subsequence of another). - // Objects are kept separately from encodeTable to increase performance. - this.encodeTableSeq = [] - - // Some chars can be decoded, but need not be encoded. - var skipEncodeChars = {} - if (codecOptions.encodeSkipVals) { - for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { - var val = codecOptions.encodeSkipVals[i] - if (typeof val === "number") { skipEncodeChars[val] = true } else { - for (var j = val.from; j <= val.to; j++) { skipEncodeChars[j] = true } - } - } - } - - // Use decode trie to recursively fill out encode tables. - this._fillEncodeTable(0, 0, skipEncodeChars) - - // Add more encoding pairs when needed. - if (codecOptions.encodeAdd) { - for (var uChar in codecOptions.encodeAdd) { - if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) { this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]) } - } - } - - this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)] - if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"] - if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0) -} - -DBCSCodec.prototype.encoder = DBCSEncoder -DBCSCodec.prototype.decoder = DBCSDecoder - -// Decoder helpers -DBCSCodec.prototype._getDecodeTrieNode = function (addr) { - var bytes = [] - for (; addr > 0; addr >>>= 8) { bytes.push(addr & 0xFF) } - if (bytes.length == 0) { bytes.push(0) } - - var node = this.decodeTables[0] - for (var i = bytes.length - 1; i > 0; i--) { // Traverse nodes deeper into the trie. - var val = node[bytes[i]] - - if (val == UNASSIGNED) { // Create new node. - node[bytes[i]] = NODE_START - this.decodeTables.length - this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)) - } else if (val <= NODE_START) { // Existing node. - node = this.decodeTables[NODE_START - val] - } else { throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)) } - } - return node -} - -DBCSCodec.prototype._addDecodeChunk = function (chunk) { - // First element of chunk is the hex mbcs code where we start. - var curAddr = parseInt(chunk[0], 16) - - // Choose the decoding node where we'll write our chars. - var writeTable = this._getDecodeTrieNode(curAddr) - curAddr = curAddr & 0xFF - - // Write all other elements of the chunk to the table. - for (var k = 1; k < chunk.length; k++) { - var part = chunk[k] - if (typeof part === "string") { // String, write as-is. - for (var l = 0; l < part.length;) { - var code = part.charCodeAt(l++) - if (code >= 0xD800 && code < 0xDC00) { // Decode surrogate - var codeTrail = part.charCodeAt(l++) - if (codeTrail >= 0xDC00 && codeTrail < 0xE000) { writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00) } else { throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]) } - } else if (code > 0x0FF0 && code <= 0x0FFF) { // Character sequence (our own encoding used) - var len = 0xFFF - code + 2 - var seq = [] - for (var m = 0; m < len; m++) { seq.push(part.charCodeAt(l++)) } // Simple variation: don't support surrogates or subsequences in seq. - - writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length - this.decodeTableSeq.push(seq) - } else { writeTable[curAddr++] = code } // Basic char - } - } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. - var charCode = writeTable[curAddr - 1] + 1 - for (var l = 0; l < part; l++) { writeTable[curAddr++] = charCode++ } - } else { throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]) } - } - if (curAddr > 0xFF) { throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr) } -} - -// Encoder helpers -DBCSCodec.prototype._getEncodeBucket = function (uCode) { - var high = uCode >> 8 // This could be > 0xFF because of astral characters. - if (this.encodeTable[high] === undefined) { - this.encodeTable[high] = UNASSIGNED_NODE.slice(0) - } // Create bucket on demand. - return this.encodeTable[high] -} - -DBCSCodec.prototype._setEncodeChar = function (uCode, dbcsCode) { - var bucket = this._getEncodeBucket(uCode) - var low = uCode & 0xFF - if (bucket[low] <= SEQ_START) { this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode } // There's already a sequence, set a single-char subsequence of it. - else if (bucket[low] == UNASSIGNED) { bucket[low] = dbcsCode } -} - -DBCSCodec.prototype._setEncodeSequence = function (seq, dbcsCode) { - // Get the root of character tree according to first character of the sequence. - var uCode = seq[0] - var bucket = this._getEncodeBucket(uCode) - var low = uCode & 0xFF - - var node - if (bucket[low] <= SEQ_START) { - // There's already a sequence with - use it. - node = this.encodeTableSeq[SEQ_START - bucket[low]] - } else { - // There was no sequence object - allocate a new one. - node = {} - if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low] // If a char was set before - make it a single-char subsequence. - bucket[low] = SEQ_START - this.encodeTableSeq.length - this.encodeTableSeq.push(node) - } - - // Traverse the character tree, allocating new nodes as needed. - for (var j = 1; j < seq.length - 1; j++) { - var oldVal = node[uCode] - if (typeof oldVal === "object") { node = oldVal } else { - node = node[uCode] = {} - if (oldVal !== undefined) { node[DEF_CHAR] = oldVal } - } - } - - // Set the leaf to given dbcsCode. - uCode = seq[seq.length - 1] - node[uCode] = dbcsCode -} - -DBCSCodec.prototype._fillEncodeTable = function (nodeIdx, prefix, skipEncodeChars) { - var node = this.decodeTables[nodeIdx] - var hasValues = false - var subNodeEmpty = {} - for (var i = 0; i < 0x100; i++) { - var uCode = node[i] - var mbCode = prefix + i - if (skipEncodeChars[mbCode]) { continue } - - if (uCode >= 0) { - this._setEncodeChar(uCode, mbCode) - hasValues = true - } else if (uCode <= NODE_START) { - var subNodeIdx = NODE_START - uCode - if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). - var newPrefix = (mbCode << 8) >>> 0 // NOTE: '>>> 0' keeps 32-bit num positive. - if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) { hasValues = true } else { subNodeEmpty[subNodeIdx] = true } - } - } else if (uCode <= SEQ_START) { - this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode) - hasValues = true - } - } - return hasValues -} - -// == Encoder ================================================================== - -function DBCSEncoder (options, codec) { - // Encoder state - this.leadSurrogate = -1 - this.seqObj = undefined - - // Static data - this.encodeTable = codec.encodeTable - this.encodeTableSeq = codec.encodeTableSeq - this.defaultCharSingleByte = codec.defCharSB - this.gb18030 = codec.gb18030 -} - -DBCSEncoder.prototype.write = function (str) { - var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)) - var leadSurrogate = this.leadSurrogate - var seqObj = this.seqObj - var nextChar = -1 - var i = 0; var j = 0 - - while (true) { - // 0. Get next character. - if (nextChar === -1) { - if (i == str.length) break - var uCode = str.charCodeAt(i++) - } else { - var uCode = nextChar - nextChar = -1 - } - - // 1. Handle surrogates. - if (uCode >= 0xD800 && uCode < 0xE000) { // Char is one of surrogates. - if (uCode < 0xDC00) { // We've got lead surrogate. - if (leadSurrogate === -1) { - leadSurrogate = uCode - continue - } else { - leadSurrogate = uCode - // Double lead surrogate found. - uCode = UNASSIGNED - } - } else { // We've got trail surrogate. - if (leadSurrogate !== -1) { - uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00) - leadSurrogate = -1 - } else { - // Incomplete surrogate pair - only trail surrogate found. - uCode = UNASSIGNED - } - } - } else if (leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - nextChar = uCode; uCode = UNASSIGNED // Write an error, then current char. - leadSurrogate = -1 - } - - // 2. Convert uCode character. - var dbcsCode = UNASSIGNED - if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence - var resCode = seqObj[uCode] - if (typeof resCode === "object") { // Sequence continues. - seqObj = resCode - continue - } else if (typeof resCode === "number") { // Sequence finished. Write it. - dbcsCode = resCode - } else if (resCode == undefined) { // Current character is not part of the sequence. - // Try default character for this sequence - resCode = seqObj[DEF_CHAR] - if (resCode !== undefined) { - dbcsCode = resCode // Found. Write it. - nextChar = uCode // Current character will be written too in the next iteration. - } else { - // TODO: What if we have no default? (resCode == undefined) - // Then, we should write first char of the sequence as-is and try the rest recursively. - // Didn't do it for now because no encoding has this situation yet. - // Currently, just skip the sequence and write current char. - } - } - seqObj = undefined - } else if (uCode >= 0) { // Regular character - var subtable = this.encodeTable[uCode >> 8] - if (subtable !== undefined) { dbcsCode = subtable[uCode & 0xFF] } - - if (dbcsCode <= SEQ_START) { // Sequence start - seqObj = this.encodeTableSeq[SEQ_START - dbcsCode] - continue - } - - if (dbcsCode == UNASSIGNED && this.gb18030) { - // Use GB18030 algorithm to find character(s) to write. - var idx = findIdx(this.gb18030.uChars, uCode) - if (idx != -1) { - var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]) - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600 - newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260 - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10 - newBuf[j++] = 0x30 + dbcsCode - continue - } - } - } - - // 3. Write dbcsCode character. - if (dbcsCode === UNASSIGNED) { dbcsCode = this.defaultCharSingleByte } - - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode - } else if (dbcsCode < 0x10000) { - newBuf[j++] = dbcsCode >> 8 // high byte - newBuf[j++] = dbcsCode & 0xFF // low byte - } else if (dbcsCode < 0x1000000) { - newBuf[j++] = dbcsCode >> 16 - newBuf[j++] = (dbcsCode >> 8) & 0xFF - newBuf[j++] = dbcsCode & 0xFF - } else { - newBuf[j++] = dbcsCode >>> 24 - newBuf[j++] = (dbcsCode >>> 16) & 0xFF - newBuf[j++] = (dbcsCode >>> 8) & 0xFF - newBuf[j++] = dbcsCode & 0xFF - } - } - - this.seqObj = seqObj - this.leadSurrogate = leadSurrogate - return newBuf.slice(0, j) -} - -DBCSEncoder.prototype.end = function () { - if (this.leadSurrogate === -1 && this.seqObj === undefined) { return } // All clean. Most often case. - - var newBuf = Buffer.alloc(10); var j = 0 - - if (this.seqObj) { // We're in the sequence. - var dbcsCode = this.seqObj[DEF_CHAR] - if (dbcsCode !== undefined) { // Write beginning of the sequence. - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode - } else { - newBuf[j++] = dbcsCode >> 8 // high byte - newBuf[j++] = dbcsCode & 0xFF // low byte - } - } else { - // See todo above. - } - this.seqObj = undefined - } - - if (this.leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - newBuf[j++] = this.defaultCharSingleByte - this.leadSurrogate = -1 - } - - return newBuf.slice(0, j) -} - -// Export for testing -DBCSEncoder.prototype.findIdx = findIdx - -// == Decoder ================================================================== - -function DBCSDecoder (options, codec) { - // Decoder state - this.nodeIdx = 0 - this.prevBytes = [] - - // Static data - this.decodeTables = codec.decodeTables - this.decodeTableSeq = codec.decodeTableSeq - this.defaultCharUnicode = codec.defaultCharUnicode - this.gb18030 = codec.gb18030 -} - -DBCSDecoder.prototype.write = function (buf) { - var newBuf = Buffer.alloc(buf.length * 2) - var nodeIdx = this.nodeIdx - var prevBytes = this.prevBytes; var prevOffset = this.prevBytes.length - var seqStart = -this.prevBytes.length // idx of the start of current parsed sequence. - var uCode - - for (var i = 0, j = 0; i < buf.length; i++) { - var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset] - - // Lookup in current trie node. - var uCode = this.decodeTables[nodeIdx][curByte] - - if (uCode >= 0) { - // Normal character, just use it. - } else if (uCode === UNASSIGNED) { // Unknown char. - // TODO: Callback with seq. - uCode = this.defaultCharUnicode.charCodeAt(0) - i = seqStart // Skip one byte ('i' will be incremented by the for loop) and try to parse again. - } else if (uCode === GB18030_CODE) { - if (i >= 3) { - var ptr = (buf[i - 3] - 0x81) * 12600 + (buf[i - 2] - 0x30) * 1260 + (buf[i - 1] - 0x81) * 10 + (curByte - 0x30) - } else { - var ptr = (prevBytes[i - 3 + prevOffset] - 0x81) * 12600 + - (((i - 2 >= 0) ? buf[i - 2] : prevBytes[i - 2 + prevOffset]) - 0x30) * 1260 + - (((i - 1 >= 0) ? buf[i - 1] : prevBytes[i - 1 + prevOffset]) - 0x81) * 10 + - (curByte - 0x30) - } - var idx = findIdx(this.gb18030.gbChars, ptr) - uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx] - } else if (uCode <= NODE_START) { // Go to next trie node. - nodeIdx = NODE_START - uCode - continue - } else if (uCode <= SEQ_START) { // Output a sequence of chars. - var seq = this.decodeTableSeq[SEQ_START - uCode] - for (var k = 0; k < seq.length - 1; k++) { - uCode = seq[k] - newBuf[j++] = uCode & 0xFF - newBuf[j++] = uCode >> 8 - } - uCode = seq[seq.length - 1] - } else { throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte) } - - // Write the character to buffer, handling higher planes using surrogate pair. - if (uCode >= 0x10000) { - uCode -= 0x10000 - var uCodeLead = 0xD800 | (uCode >> 10) - newBuf[j++] = uCodeLead & 0xFF - newBuf[j++] = uCodeLead >> 8 - - uCode = 0xDC00 | (uCode & 0x3FF) - } - newBuf[j++] = uCode & 0xFF - newBuf[j++] = uCode >> 8 - - // Reset trie node. - nodeIdx = 0; seqStart = i + 1 - } - - this.nodeIdx = nodeIdx - this.prevBytes = (seqStart >= 0) - ? Array.prototype.slice.call(buf, seqStart) - : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)) - - return newBuf.slice(0, j).toString("ucs2") -} - -DBCSDecoder.prototype.end = function () { - var ret = "" - - // Try to parse all remaining chars. - while (this.prevBytes.length > 0) { - // Skip 1 character in the buffer. - ret += this.defaultCharUnicode - var bytesArr = this.prevBytes.slice(1) - - // Parse remaining as usual. - this.prevBytes = [] - this.nodeIdx = 0 - if (bytesArr.length > 0) { ret += this.write(bytesArr) } - } - - this.prevBytes = [] - this.nodeIdx = 0 - return ret -} - -// Binary search for GB18030. Returns largest i such that table[i] <= val. -function findIdx (table, val) { - if (table[0] > val) { return -1 } - - var l = 0; var r = table.length - while (l < r - 1) { // always table[l] <= val < table[r] - var mid = l + ((r - l + 1) >> 1) - if (table[mid] <= val) { l = mid } else { r = mid } - } - return l -} diff --git a/node_modules/iconv-lite/encodings/dbcs-data.js b/node_modules/iconv-lite/encodings/dbcs-data.js deleted file mode 100644 index a3858d4..0000000 --- a/node_modules/iconv-lite/encodings/dbcs-data.js +++ /dev/null @@ -1,185 +0,0 @@ -"use strict" - -// Description of supported double byte encodings and aliases. -// Tables are not require()-d until they are needed to speed up library load. -// require()-s are direct to support Browserify. - -module.exports = { - - // == Japanese/ShiftJIS ==================================================== - // All japanese encodings are based on JIS X set of standards: - // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. - // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. - // Has several variations in 1978, 1983, 1990 and 1997. - // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. - // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. - // 2 planes, first is superset of 0208, second - revised 0212. - // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) - - // Byte encodings are: - // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte - // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. - // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. - // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. - // 0x00-0x7F - lower part of 0201 - // 0x8E, 0xA1-0xDF - upper part of 0201 - // (0xA1-0xFE)x2 - 0208 plane (94x94). - // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). - // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. - // Used as-is in ISO2022 family. - // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, - // 0201-1976 Roman, 0208-1978, 0208-1983. - // * ISO2022-JP-1: Adds esc seq for 0212-1990. - // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. - // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. - // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. - // - // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. - // - // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html - - shiftjis: { - type: "_dbcs", - table: function () { return require("./tables/shiftjis.json") }, - encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E }, - encodeSkipVals: [{ from: 0xED40, to: 0xF940 }] - }, - csshiftjis: "shiftjis", - mskanji: "shiftjis", - sjis: "shiftjis", - windows31j: "shiftjis", - ms31j: "shiftjis", - xsjis: "shiftjis", - windows932: "shiftjis", - ms932: "shiftjis", - 932: "shiftjis", - cp932: "shiftjis", - - eucjp: { - type: "_dbcs", - table: function () { return require("./tables/eucjp.json") }, - encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E } - }, - - // TODO: KDDI extension to Shift_JIS - // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. - // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. - - // == Chinese/GBK ========================================================== - // http://en.wikipedia.org/wiki/GBK - // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder - - // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 - gb2312: "cp936", - gb231280: "cp936", - gb23121980: "cp936", - csgb2312: "cp936", - csiso58gb231280: "cp936", - euccn: "cp936", - - // Microsoft's CP936 is a subset and approximation of GBK. - windows936: "cp936", - ms936: "cp936", - 936: "cp936", - cp936: { - type: "_dbcs", - table: function () { return require("./tables/cp936.json") } - }, - - // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. - gbk: { - type: "_dbcs", - table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) } - }, - xgbk: "gbk", - isoir58: "gbk", - - // GB18030 is an algorithmic extension of GBK. - // Main source: https://www.w3.org/TR/encoding/#gbk-encoder - // http://icu-project.org/docs/papers/gb18030.html - // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml - // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 - gb18030: { - type: "_dbcs", - table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) }, - gb18030: function () { return require("./tables/gb18030-ranges.json") }, - encodeSkipVals: [0x80], - encodeAdd: { "€": 0xA2E3 } - }, - - chinese: "gb18030", - - // == Korean =============================================================== - // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. - windows949: "cp949", - ms949: "cp949", - 949: "cp949", - cp949: { - type: "_dbcs", - table: function () { return require("./tables/cp949.json") } - }, - - cseuckr: "cp949", - csksc56011987: "cp949", - euckr: "cp949", - isoir149: "cp949", - korean: "cp949", - ksc56011987: "cp949", - ksc56011989: "cp949", - ksc5601: "cp949", - - // == Big5/Taiwan/Hong Kong ================================================ - // There are lots of tables for Big5 and cp950. Please see the following links for history: - // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html - // Variations, in roughly number of defined chars: - // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT - // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ - // * Big5-2003 (Taiwan standard) almost superset of cp950. - // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. - // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. - // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. - // Plus, it has 4 combining sequences. - // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 - // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. - // Implementations are not consistent within browsers; sometimes labeled as just big5. - // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. - // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 - // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. - // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt - // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt - // - // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder - // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. - - windows950: "cp950", - ms950: "cp950", - 950: "cp950", - cp950: { - type: "_dbcs", - table: function () { return require("./tables/cp950.json") } - }, - - // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. - big5: "big5hkscs", - big5hkscs: { - type: "_dbcs", - table: function () { return require("./tables/cp950.json").concat(require("./tables/big5-added.json")) }, - encodeSkipVals: [ - // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of - // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. - // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. - 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, - 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, - 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, - 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, - 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, - - // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 - 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce - ] - }, - - cnbig5: "big5hkscs", - csbig5: "big5hkscs", - xxbig5: "big5hkscs" -} diff --git a/node_modules/iconv-lite/encodings/index.js b/node_modules/iconv-lite/encodings/index.js deleted file mode 100644 index 9d90e3c..0000000 --- a/node_modules/iconv-lite/encodings/index.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict" - -var mergeModules = require("../lib/helpers/merge-exports") - -// Update this array if you add/rename/remove files in this directory. -// We support Browserify by skipping automatic module discovery and requiring modules directly. -var modules = [ - require("./internal"), - require("./utf32"), - require("./utf16"), - require("./utf7"), - require("./sbcs-codec"), - require("./sbcs-data"), - require("./sbcs-data-generated"), - require("./dbcs-codec"), - require("./dbcs-data") -] - -// Put all encoding/alias/codec definitions to single object and export it. -for (var i = 0; i < modules.length; i++) { - var module = modules[i] - mergeModules(exports, module) -} diff --git a/node_modules/iconv-lite/encodings/internal.js b/node_modules/iconv-lite/encodings/internal.js deleted file mode 100644 index 4e5c3ff..0000000 --- a/node_modules/iconv-lite/encodings/internal.js +++ /dev/null @@ -1,218 +0,0 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer - -// Export Node.js internal encodings. - -module.exports = { - // Encodings - utf8: { type: "_internal", bomAware: true }, - cesu8: { type: "_internal", bomAware: true }, - unicode11utf8: "utf8", - - ucs2: { type: "_internal", bomAware: true }, - utf16le: "ucs2", - - binary: { type: "_internal" }, - base64: { type: "_internal" }, - hex: { type: "_internal" }, - - // Codec. - _internal: InternalCodec -} - -// ------------------------------------------------------------------------------ - -function InternalCodec (codecOptions, iconv) { - this.enc = codecOptions.encodingName - this.bomAware = codecOptions.bomAware - - if (this.enc === "base64") { this.encoder = InternalEncoderBase64 } else if (this.enc === "utf8") { this.encoder = InternalEncoderUtf8 } else if (this.enc === "cesu8") { - this.enc = "utf8" // Use utf8 for decoding. - this.encoder = InternalEncoderCesu8 - - // Add decoder for versions of Node not supporting CESU-8 - if (Buffer.from("eda0bdedb2a9", "hex").toString() !== "💩") { - this.decoder = InternalDecoderCesu8 - this.defaultCharUnicode = iconv.defaultCharUnicode - } - } -} - -InternalCodec.prototype.encoder = InternalEncoder -InternalCodec.prototype.decoder = InternalDecoder - -// ------------------------------------------------------------------------------ - -// We use node.js internal decoder. Its signature is the same as ours. -var StringDecoder = require("string_decoder").StringDecoder - -function InternalDecoder (options, codec) { - this.decoder = new StringDecoder(codec.enc) -} - -InternalDecoder.prototype.write = function (buf) { - if (!Buffer.isBuffer(buf)) { - buf = Buffer.from(buf) - } - - return this.decoder.write(buf) -} - -InternalDecoder.prototype.end = function () { - return this.decoder.end() -} - -// ------------------------------------------------------------------------------ -// Encoder is mostly trivial - -function InternalEncoder (options, codec) { - this.enc = codec.enc -} - -InternalEncoder.prototype.write = function (str) { - return Buffer.from(str, this.enc) -} - -InternalEncoder.prototype.end = function () { -} - -// ------------------------------------------------------------------------------ -// Except base64 encoder, which must keep its state. - -function InternalEncoderBase64 (options, codec) { - this.prevStr = "" -} - -InternalEncoderBase64.prototype.write = function (str) { - str = this.prevStr + str - var completeQuads = str.length - (str.length % 4) - this.prevStr = str.slice(completeQuads) - str = str.slice(0, completeQuads) - - return Buffer.from(str, "base64") -} - -InternalEncoderBase64.prototype.end = function () { - return Buffer.from(this.prevStr, "base64") -} - -// ------------------------------------------------------------------------------ -// CESU-8 encoder is also special. - -function InternalEncoderCesu8 (options, codec) { -} - -InternalEncoderCesu8.prototype.write = function (str) { - var buf = Buffer.alloc(str.length * 3); var bufIdx = 0 - for (var i = 0; i < str.length; i++) { - var charCode = str.charCodeAt(i) - // Naive implementation, but it works because CESU-8 is especially easy - // to convert from UTF-16 (which all JS strings are encoded in). - if (charCode < 0x80) { buf[bufIdx++] = charCode } else if (charCode < 0x800) { - buf[bufIdx++] = 0xC0 + (charCode >>> 6) - buf[bufIdx++] = 0x80 + (charCode & 0x3f) - } else { // charCode will always be < 0x10000 in javascript. - buf[bufIdx++] = 0xE0 + (charCode >>> 12) - buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f) - buf[bufIdx++] = 0x80 + (charCode & 0x3f) - } - } - return buf.slice(0, bufIdx) -} - -InternalEncoderCesu8.prototype.end = function () { -} - -// ------------------------------------------------------------------------------ -// CESU-8 decoder is not implemented in Node v4.0+ - -function InternalDecoderCesu8 (options, codec) { - this.acc = 0 - this.contBytes = 0 - this.accBytes = 0 - this.defaultCharUnicode = codec.defaultCharUnicode -} - -InternalDecoderCesu8.prototype.write = function (buf) { - var acc = this.acc; var contBytes = this.contBytes; var accBytes = this.accBytes - var res = "" - for (var i = 0; i < buf.length; i++) { - var curByte = buf[i] - if ((curByte & 0xC0) !== 0x80) { // Leading byte - if (contBytes > 0) { // Previous code is invalid - res += this.defaultCharUnicode - contBytes = 0 - } - - if (curByte < 0x80) { // Single-byte code - res += String.fromCharCode(curByte) - } else if (curByte < 0xE0) { // Two-byte code - acc = curByte & 0x1F - contBytes = 1; accBytes = 1 - } else if (curByte < 0xF0) { // Three-byte code - acc = curByte & 0x0F - contBytes = 2; accBytes = 1 - } else { // Four or more are not supported for CESU-8. - res += this.defaultCharUnicode - } - } else { // Continuation byte - if (contBytes > 0) { // We're waiting for it. - acc = (acc << 6) | (curByte & 0x3f) - contBytes--; accBytes++ - if (contBytes === 0) { - // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) - if (accBytes === 2 && acc < 0x80 && acc > 0) { - res += this.defaultCharUnicode - } else if (accBytes === 3 && acc < 0x800) { - res += this.defaultCharUnicode - } else { - // Actually add character. - res += String.fromCharCode(acc) - } - } - } else { // Unexpected continuation byte - res += this.defaultCharUnicode - } - } - } - this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes - return res -} - -InternalDecoderCesu8.prototype.end = function () { - var res = 0 - if (this.contBytes > 0) { res += this.defaultCharUnicode } - return res -} - -// ------------------------------------------------------------------------------ -// check the chunk boundaries for surrogate pair - -function InternalEncoderUtf8 (options, codec) { - this.highSurrogate = "" -} - -InternalEncoderUtf8.prototype.write = function (str) { - if (this.highSurrogate) { - str = this.highSurrogate + str - this.highSurrogate = "" - } - - if (str.length > 0) { - var charCode = str.charCodeAt(str.length - 1) - if (charCode >= 0xd800 && charCode < 0xdc00) { - this.highSurrogate = str[str.length - 1] - str = str.slice(0, str.length - 1) - } - } - - return Buffer.from(str, this.enc) -} - -InternalEncoderUtf8.prototype.end = function () { - if (this.highSurrogate) { - var str = this.highSurrogate - this.highSurrogate = "" - return Buffer.from(str, this.enc) - } -} diff --git a/node_modules/iconv-lite/encodings/sbcs-codec.js b/node_modules/iconv-lite/encodings/sbcs-codec.js deleted file mode 100644 index 0e2fc92..0000000 --- a/node_modules/iconv-lite/encodings/sbcs-codec.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer - -// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that -// correspond to encoded bytes (if 128 - then lower half is ASCII). - -exports._sbcs = SBCSCodec -function SBCSCodec (codecOptions, iconv) { - if (!codecOptions) { - throw new Error("SBCS codec is called without the data.") - } - - // Prepare char buffer for decoding. - if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) { - throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)") - } - - if (codecOptions.chars.length === 128) { - var asciiString = "" - for (var i = 0; i < 128; i++) { - asciiString += String.fromCharCode(i) - } - codecOptions.chars = asciiString + codecOptions.chars - } - - this.decodeBuf = Buffer.from(codecOptions.chars, "ucs2") - - // Encoding buffer. - var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)) - - for (var i = 0; i < codecOptions.chars.length; i++) { - encodeBuf[codecOptions.chars.charCodeAt(i)] = i - } - - this.encodeBuf = encodeBuf -} - -SBCSCodec.prototype.encoder = SBCSEncoder -SBCSCodec.prototype.decoder = SBCSDecoder - -function SBCSEncoder (options, codec) { - this.encodeBuf = codec.encodeBuf -} - -SBCSEncoder.prototype.write = function (str) { - var buf = Buffer.alloc(str.length) - for (var i = 0; i < str.length; i++) { - buf[i] = this.encodeBuf[str.charCodeAt(i)] - } - - return buf -} - -SBCSEncoder.prototype.end = function () { -} - -function SBCSDecoder (options, codec) { - this.decodeBuf = codec.decodeBuf -} - -SBCSDecoder.prototype.write = function (buf) { - // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. - var decodeBuf = this.decodeBuf - var newBuf = Buffer.alloc(buf.length * 2) - var idx1 = 0; var idx2 = 0 - for (var i = 0; i < buf.length; i++) { - idx1 = buf[i] * 2; idx2 = i * 2 - newBuf[idx2] = decodeBuf[idx1] - newBuf[idx2 + 1] = decodeBuf[idx1 + 1] - } - return newBuf.toString("ucs2") -} - -SBCSDecoder.prototype.end = function () { -} diff --git a/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/node_modules/iconv-lite/encodings/sbcs-data-generated.js deleted file mode 100644 index 9b48236..0000000 --- a/node_modules/iconv-lite/encodings/sbcs-data-generated.js +++ /dev/null @@ -1,451 +0,0 @@ -"use strict"; - -// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. -module.exports = { - "437": "cp437", - "737": "cp737", - "775": "cp775", - "850": "cp850", - "852": "cp852", - "855": "cp855", - "856": "cp856", - "857": "cp857", - "858": "cp858", - "860": "cp860", - "861": "cp861", - "862": "cp862", - "863": "cp863", - "864": "cp864", - "865": "cp865", - "866": "cp866", - "869": "cp869", - "874": "windows874", - "922": "cp922", - "1046": "cp1046", - "1124": "cp1124", - "1125": "cp1125", - "1129": "cp1129", - "1133": "cp1133", - "1161": "cp1161", - "1162": "cp1162", - "1163": "cp1163", - "1250": "windows1250", - "1251": "windows1251", - "1252": "windows1252", - "1253": "windows1253", - "1254": "windows1254", - "1255": "windows1255", - "1256": "windows1256", - "1257": "windows1257", - "1258": "windows1258", - "28591": "iso88591", - "28592": "iso88592", - "28593": "iso88593", - "28594": "iso88594", - "28595": "iso88595", - "28596": "iso88596", - "28597": "iso88597", - "28598": "iso88598", - "28599": "iso88599", - "28600": "iso885910", - "28601": "iso885911", - "28603": "iso885913", - "28604": "iso885914", - "28605": "iso885915", - "28606": "iso885916", - "windows874": { - "type": "_sbcs", - "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "win874": "windows874", - "cp874": "windows874", - "windows1250": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "win1250": "windows1250", - "cp1250": "windows1250", - "windows1251": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "win1251": "windows1251", - "cp1251": "windows1251", - "windows1252": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "win1252": "windows1252", - "cp1252": "windows1252", - "windows1253": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "win1253": "windows1253", - "cp1253": "windows1253", - "windows1254": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "win1254": "windows1254", - "cp1254": "windows1254", - "windows1255": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "win1255": "windows1255", - "cp1255": "windows1255", - "windows1256": { - "type": "_sbcs", - "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" - }, - "win1256": "windows1256", - "cp1256": "windows1256", - "windows1257": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" - }, - "win1257": "windows1257", - "cp1257": "windows1257", - "windows1258": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "win1258": "windows1258", - "cp1258": "windows1258", - "iso88591": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28591": "iso88591", - "iso88592": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "cp28592": "iso88592", - "iso88593": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" - }, - "cp28593": "iso88593", - "iso88594": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" - }, - "cp28594": "iso88594", - "iso88595": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" - }, - "cp28595": "iso88595", - "iso88596": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" - }, - "cp28596": "iso88596", - "iso88597": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "cp28597": "iso88597", - "iso88598": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "cp28598": "iso88598", - "iso88599": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "cp28599": "iso88599", - "iso885910": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" - }, - "cp28600": "iso885910", - "iso885911": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "cp28601": "iso885911", - "iso885913": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" - }, - "cp28603": "iso885913", - "iso885914": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" - }, - "cp28604": "iso885914", - "iso885915": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28605": "iso885915", - "iso885916": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" - }, - "cp28606": "iso885916", - "cp437": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm437": "cp437", - "csibm437": "cp437", - "cp737": { - "type": "_sbcs", - "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " - }, - "ibm737": "cp737", - "csibm737": "cp737", - "cp775": { - "type": "_sbcs", - "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " - }, - "ibm775": "cp775", - "csibm775": "cp775", - "cp850": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm850": "cp850", - "csibm850": "cp850", - "cp852": { - "type": "_sbcs", - "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " - }, - "ibm852": "cp852", - "csibm852": "cp852", - "cp855": { - "type": "_sbcs", - "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " - }, - "ibm855": "cp855", - "csibm855": "cp855", - "cp856": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm856": "cp856", - "csibm856": "cp856", - "cp857": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " - }, - "ibm857": "cp857", - "csibm857": "cp857", - "cp858": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm858": "cp858", - "csibm858": "cp858", - "cp860": { - "type": "_sbcs", - "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm860": "cp860", - "csibm860": "cp860", - "cp861": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm861": "cp861", - "csibm861": "cp861", - "cp862": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm862": "cp862", - "csibm862": "cp862", - "cp863": { - "type": "_sbcs", - "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm863": "cp863", - "csibm863": "cp863", - "cp864": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" - }, - "ibm864": "cp864", - "csibm864": "cp864", - "cp865": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm865": "cp865", - "csibm865": "cp865", - "cp866": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " - }, - "ibm866": "cp866", - "csibm866": "cp866", - "cp869": { - "type": "_sbcs", - "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " - }, - "ibm869": "cp869", - "csibm869": "cp869", - "cp922": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" - }, - "ibm922": "cp922", - "csibm922": "cp922", - "cp1046": { - "type": "_sbcs", - "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" - }, - "ibm1046": "cp1046", - "csibm1046": "cp1046", - "cp1124": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" - }, - "ibm1124": "cp1124", - "csibm1124": "cp1124", - "cp1125": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " - }, - "ibm1125": "cp1125", - "csibm1125": "cp1125", - "cp1129": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1129": "cp1129", - "csibm1129": "cp1129", - "cp1133": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" - }, - "ibm1133": "cp1133", - "csibm1133": "cp1133", - "cp1161": { - "type": "_sbcs", - "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " - }, - "ibm1161": "cp1161", - "csibm1161": "cp1161", - "cp1162": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "ibm1162": "cp1162", - "csibm1162": "cp1162", - "cp1163": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1163": "cp1163", - "csibm1163": "cp1163", - "maccroatian": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" - }, - "maccyrillic": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "macgreek": { - "type": "_sbcs", - "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" - }, - "maciceland": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macroman": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macromania": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macthai": { - "type": "_sbcs", - "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" - }, - "macturkish": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macukraine": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "koi8r": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8u": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8ru": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8t": { - "type": "_sbcs", - "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "armscii8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" - }, - "rk1048": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "tcvn": { - "type": "_sbcs", - "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" - }, - "georgianacademy": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "georgianps": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "pt154": { - "type": "_sbcs", - "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "viscii": { - "type": "_sbcs", - "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" - }, - "iso646cn": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "iso646jp": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "hproman8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" - }, - "macintosh": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "ascii": { - "type": "_sbcs", - "chars": "��������������������������������������������������������������������������������������������������������������������������������" - }, - "tis620": { - "type": "_sbcs", - "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - } -} \ No newline at end of file diff --git a/node_modules/iconv-lite/encodings/sbcs-data.js b/node_modules/iconv-lite/encodings/sbcs-data.js deleted file mode 100644 index d8f8e17..0000000 --- a/node_modules/iconv-lite/encodings/sbcs-data.js +++ /dev/null @@ -1,178 +0,0 @@ -"use strict" - -// Manually added data to be used by sbcs codec in addition to generated one. - -module.exports = { - // Not supported by iconv, not sure why. - 10029: "maccenteuro", - maccenteuro: { - type: "_sbcs", - chars: "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" - }, - - 808: "cp808", - ibm808: "cp808", - cp808: { - type: "_sbcs", - chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " - }, - - mik: { - type: "_sbcs", - chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - - cp720: { - type: "_sbcs", - chars: "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" - }, - - // Aliases of generated encodings. - ascii8bit: "ascii", - usascii: "ascii", - ansix34: "ascii", - ansix341968: "ascii", - ansix341986: "ascii", - csascii: "ascii", - cp367: "ascii", - ibm367: "ascii", - isoir6: "ascii", - iso646us: "ascii", - iso646irv: "ascii", - us: "ascii", - - latin1: "iso88591", - latin2: "iso88592", - latin3: "iso88593", - latin4: "iso88594", - latin5: "iso88599", - latin6: "iso885910", - latin7: "iso885913", - latin8: "iso885914", - latin9: "iso885915", - latin10: "iso885916", - - csisolatin1: "iso88591", - csisolatin2: "iso88592", - csisolatin3: "iso88593", - csisolatin4: "iso88594", - csisolatincyrillic: "iso88595", - csisolatinarabic: "iso88596", - csisolatingreek: "iso88597", - csisolatinhebrew: "iso88598", - csisolatin5: "iso88599", - csisolatin6: "iso885910", - - l1: "iso88591", - l2: "iso88592", - l3: "iso88593", - l4: "iso88594", - l5: "iso88599", - l6: "iso885910", - l7: "iso885913", - l8: "iso885914", - l9: "iso885915", - l10: "iso885916", - - isoir14: "iso646jp", - isoir57: "iso646cn", - isoir100: "iso88591", - isoir101: "iso88592", - isoir109: "iso88593", - isoir110: "iso88594", - isoir144: "iso88595", - isoir127: "iso88596", - isoir126: "iso88597", - isoir138: "iso88598", - isoir148: "iso88599", - isoir157: "iso885910", - isoir166: "tis620", - isoir179: "iso885913", - isoir199: "iso885914", - isoir203: "iso885915", - isoir226: "iso885916", - - cp819: "iso88591", - ibm819: "iso88591", - - cyrillic: "iso88595", - - arabic: "iso88596", - arabic8: "iso88596", - ecma114: "iso88596", - asmo708: "iso88596", - - greek: "iso88597", - greek8: "iso88597", - ecma118: "iso88597", - elot928: "iso88597", - - hebrew: "iso88598", - hebrew8: "iso88598", - - turkish: "iso88599", - turkish8: "iso88599", - - thai: "iso885911", - thai8: "iso885911", - - celtic: "iso885914", - celtic8: "iso885914", - isoceltic: "iso885914", - - tis6200: "tis620", - tis62025291: "tis620", - tis62025330: "tis620", - - 10000: "macroman", - 10006: "macgreek", - 10007: "maccyrillic", - 10079: "maciceland", - 10081: "macturkish", - - cspc8codepage437: "cp437", - cspc775baltic: "cp775", - cspc850multilingual: "cp850", - cspcp852: "cp852", - cspc862latinhebrew: "cp862", - cpgr: "cp869", - - msee: "cp1250", - mscyrl: "cp1251", - msansi: "cp1252", - msgreek: "cp1253", - msturk: "cp1254", - mshebr: "cp1255", - msarab: "cp1256", - winbaltrim: "cp1257", - - cp20866: "koi8r", - 20866: "koi8r", - ibm878: "koi8r", - cskoi8r: "koi8r", - - cp21866: "koi8u", - 21866: "koi8u", - ibm1168: "koi8u", - - strk10482002: "rk1048", - - tcvn5712: "tcvn", - tcvn57121: "tcvn", - - gb198880: "iso646cn", - cn: "iso646cn", - - csiso14jisc6220ro: "iso646jp", - jisc62201969ro: "iso646jp", - jp: "iso646jp", - - cshproman8: "hproman8", - r8: "hproman8", - roman8: "hproman8", - xroman8: "hproman8", - ibm1051: "hproman8", - - mac: "macintosh", - csmacintosh: "macintosh" -} diff --git a/node_modules/iconv-lite/encodings/tables/big5-added.json b/node_modules/iconv-lite/encodings/tables/big5-added.json deleted file mode 100644 index 3c3d3c2..0000000 --- a/node_modules/iconv-lite/encodings/tables/big5-added.json +++ /dev/null @@ -1,122 +0,0 @@ -[ -["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], -["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], -["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], -["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], -["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], -["8940","𪎩𡅅"], -["8943","攊"], -["8946","丽滝鵎釟"], -["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], -["89a1","琑糼緍楆竉刧"], -["89ab","醌碸酞肼"], -["89b0","贋胶𠧧"], -["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], -["89c1","溚舾甙"], -["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], -["8a40","𧶄唥"], -["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], -["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], -["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], -["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], -["8aac","䠋𠆩㿺塳𢶍"], -["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], -["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], -["8ac9","𪘁𠸉𢫏𢳉"], -["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], -["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], -["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], -["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], -["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], -["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], -["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], -["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], -["8ca1","𣏹椙橃𣱣泿"], -["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], -["8cc9","顨杫䉶圽"], -["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], -["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], -["8d40","𠮟"], -["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], -["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], -["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], -["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], -["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], -["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], -["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], -["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], -["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], -["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], -["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], -["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], -["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], -["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], -["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], -["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], -["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], -["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], -["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], -["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], -["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], -["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], -["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], -["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], -["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], -["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], -["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], -["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], -["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], -["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], -["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], -["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], -["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], -["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], -["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], -["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], -["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], -["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], -["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], -["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], -["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], -["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], -["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], -["9fae","酙隁酜"], -["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], -["9fc1","𤤙盖鮝个𠳔莾衂"], -["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], -["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], -["9fe7","毺蠘罸"], -["9feb","嘠𪙊蹷齓"], -["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], -["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], -["a055","𡠻𦸅"], -["a058","詾𢔛"], -["a05b","惽癧髗鵄鍮鮏蟵"], -["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], -["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], -["a0a1","嵗𨯂迚𨸹"], -["a0a6","僙𡵆礆匲阸𠼻䁥"], -["a0ae","矾"], -["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], -["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], -["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], -["a3c0","␀",31,"␡"], -["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], -["c740","す",58,"ァアィイ"], -["c7a1","ゥ",81,"А",5,"ЁЖ",4], -["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], -["c8a1","龰冈龱𧘇"], -["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], -["c8f5","ʃɐɛɔɵœøŋʊɪ"], -["f9fe","■"], -["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], -["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], -["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], -["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], -["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], -["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], -["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], -["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], -["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], -["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] -] diff --git a/node_modules/iconv-lite/encodings/tables/cp936.json b/node_modules/iconv-lite/encodings/tables/cp936.json deleted file mode 100644 index 49ddb9a..0000000 --- a/node_modules/iconv-lite/encodings/tables/cp936.json +++ /dev/null @@ -1,264 +0,0 @@ -[ -["0","\u0000",127,"€"], -["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], -["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], -["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], -["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], -["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], -["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], -["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], -["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], -["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], -["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], -["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], -["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], -["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], -["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], -["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], -["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], -["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], -["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], -["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], -["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], -["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], -["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], -["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], -["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], -["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], -["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], -["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], -["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], -["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], -["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], -["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], -["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], -["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], -["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], -["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], -["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], -["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], -["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], -["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], -["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], -["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], -["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], -["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], -["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], -["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], -["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], -["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], -["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], -["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], -["9980","檧檨檪檭",114,"欥欦欨",6], -["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], -["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], -["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], -["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], -["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], -["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], -["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], -["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], -["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], -["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], -["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], -["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], -["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], -["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], -["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], -["a2a1","ⅰ",9], -["a2b1","⒈",19,"⑴",19,"①",9], -["a2e5","㈠",9], -["a2f1","Ⅰ",11], -["a3a1","!"#¥%",88," ̄"], -["a4a1","ぁ",82], -["a5a1","ァ",85], -["a6a1","Α",16,"Σ",6], -["a6c1","α",16,"σ",6], -["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], -["a6ee","︻︼︷︸︱"], -["a6f4","︳︴"], -["a7a1","А",5,"ЁЖ",25], -["a7d1","а",5,"ёж",25], -["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], -["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], -["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], -["a8bd","ńň"], -["a8c0","ɡ"], -["a8c5","ㄅ",36], -["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], -["a959","℡㈱"], -["a95c","‐"], -["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], -["a980","﹢",4,"﹨﹩﹪﹫"], -["a996","〇"], -["a9a4","─",75], -["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], -["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], -["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], -["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], -["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], -["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], -["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], -["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], -["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], -["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], -["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], -["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], -["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], -["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], -["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], -["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], -["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], -["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], -["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], -["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], -["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], -["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], -["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], -["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], -["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], -["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], -["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], -["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], -["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], -["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], -["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], -["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], -["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], -["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], -["bb40","籃",9,"籎",36,"籵",5,"籾",9], -["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], -["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], -["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], -["bd40","紷",54,"絯",7], -["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], -["be40","継",12,"綧",6,"綯",42], -["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], -["bf40","緻",62], -["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], -["c040","繞",35,"纃",23,"纜纝纞"], -["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], -["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], -["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], -["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], -["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], -["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], -["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], -["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], -["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], -["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], -["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], -["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], -["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], -["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], -["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], -["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], -["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], -["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], -["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], -["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], -["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], -["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], -["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], -["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], -["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], -["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], -["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], -["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], -["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], -["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], -["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], -["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], -["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], -["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], -["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], -["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], -["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], -["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], -["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], -["d440","訞",31,"訿",8,"詉",21], -["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], -["d540","誁",7,"誋",7,"誔",46], -["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], -["d640","諤",34,"謈",27], -["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], -["d740","譆",31,"譧",4,"譭",25], -["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], -["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], -["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], -["d940","貮",62], -["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], -["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], -["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], -["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], -["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], -["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], -["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], -["dd40","軥",62], -["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], -["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], -["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], -["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], -["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], -["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], -["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], -["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], -["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], -["e240","釦",62], -["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], -["e340","鉆",45,"鉵",16], -["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], -["e440","銨",5,"銯",24,"鋉",31], -["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], -["e540","錊",51,"錿",10], -["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], -["e640","鍬",34,"鎐",27], -["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], -["e740","鏎",7,"鏗",54], -["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], -["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], -["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], -["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], -["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], -["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], -["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], -["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], -["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], -["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], -["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], -["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], -["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], -["ee40","頏",62], -["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], -["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], -["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], -["f040","餈",4,"餎餏餑",28,"餯",26], -["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], -["f140","馌馎馚",10,"馦馧馩",47], -["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], -["f240","駺",62], -["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], -["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], -["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], -["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], -["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], -["f540","魼",62], -["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], -["f640","鯜",62], -["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], -["f740","鰼",62], -["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], -["f840","鳣",62], -["f880","鴢",32], -["f940","鵃",62], -["f980","鶂",32], -["fa40","鶣",62], -["fa80","鷢",32], -["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], -["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], -["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], -["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], -["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], -["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], -["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] -] diff --git a/node_modules/iconv-lite/encodings/tables/cp949.json b/node_modules/iconv-lite/encodings/tables/cp949.json deleted file mode 100644 index 2022a00..0000000 --- a/node_modules/iconv-lite/encodings/tables/cp949.json +++ /dev/null @@ -1,273 +0,0 @@ -[ -["0","\u0000",127], -["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], -["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], -["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], -["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], -["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], -["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], -["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], -["8361","긝",18,"긲긳긵긶긹긻긼"], -["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], -["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], -["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], -["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], -["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], -["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], -["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], -["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], -["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], -["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], -["8741","놞",9,"놩",15], -["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], -["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], -["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], -["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], -["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], -["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], -["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], -["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], -["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], -["8a61","둧",4,"둭",18,"뒁뒂"], -["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], -["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], -["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], -["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], -["8c41","똀",15,"똒똓똕똖똗똙",4], -["8c61","똞",6,"똦",5,"똭",6,"똵",5], -["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], -["8d41","뛃",16,"뛕",8], -["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], -["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], -["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], -["8e61","럂",4,"럈럊",19], -["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], -["8f41","뢅",7,"뢎",17], -["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], -["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], -["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], -["9061","륾",5,"릆릈릋릌릏",15], -["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], -["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], -["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], -["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], -["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], -["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], -["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], -["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], -["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], -["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], -["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], -["9461","봞",5,"봥",6,"봭",12], -["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], -["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], -["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], -["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], -["9641","뺸",23,"뻒뻓"], -["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], -["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], -["9741","뾃",16,"뾕",8], -["9761","뾞",17,"뾱",7], -["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], -["9841","쁀",16,"쁒",5,"쁙쁚쁛"], -["9861","쁝쁞쁟쁡",6,"쁪",15], -["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], -["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], -["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], -["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], -["9a41","숤숥숦숧숪숬숮숰숳숵",16], -["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], -["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], -["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], -["9b61","쌳",17,"썆",7], -["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], -["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], -["9c61","쏿",8,"쐉",6,"쐑",9], -["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], -["9d41","쒪",13,"쒹쒺쒻쒽",8], -["9d61","쓆",25], -["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], -["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], -["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], -["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], -["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], -["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], -["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], -["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], -["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], -["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], -["a141","좥좦좧좩",18,"좾좿죀죁"], -["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], -["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], -["a241","줐줒",5,"줙",18], -["a261","줭",6,"줵",18], -["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], -["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], -["a361","즑",6,"즚즜즞",16], -["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], -["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], -["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], -["a481","쨦쨧쨨쨪",28,"ㄱ",93], -["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], -["a561","쩫",17,"쩾",5,"쪅쪆"], -["a581","쪇",16,"쪙",14,"ⅰ",9], -["a5b0","Ⅰ",9], -["a5c1","Α",16,"Σ",6], -["a5e1","α",16,"σ",6], -["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], -["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], -["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], -["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], -["a761","쬪",22,"쭂쭃쭄"], -["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], -["a841","쭭",10,"쭺",14], -["a861","쮉",18,"쮝",6], -["a881","쮤",19,"쮹",11,"ÆÐªĦ"], -["a8a6","IJ"], -["a8a8","ĿŁØŒºÞŦŊ"], -["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], -["a941","쯅",14,"쯕",10], -["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], -["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], -["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], -["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], -["aa81","챳챴챶",29,"ぁ",82], -["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], -["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], -["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], -["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], -["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], -["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], -["acd1","а",5,"ёж",25], -["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], -["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], -["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], -["ae41","췆",5,"췍췎췏췑",16], -["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], -["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], -["af41","츬츭츮츯츲츴츶",19], -["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], -["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], -["b041","캚",5,"캢캦",5,"캮",12], -["b061","캻",5,"컂",19], -["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], -["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], -["b161","켥",6,"켮켲",5,"켹",11], -["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], -["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], -["b261","쾎",18,"쾢",5,"쾩"], -["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], -["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], -["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], -["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], -["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], -["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], -["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], -["b541","킕",14,"킦킧킩킪킫킭",5], -["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], -["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], -["b641","턅",7,"턎",17], -["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], -["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], -["b741","텮",13,"텽",6,"톅톆톇톉톊"], -["b761","톋",20,"톢톣톥톦톧"], -["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], -["b841","퇐",7,"퇙",17], -["b861","퇫",8,"퇵퇶퇷퇹",13], -["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], -["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], -["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], -["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], -["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], -["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], -["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], -["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], -["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], -["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], -["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], -["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], -["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], -["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], -["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], -["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], -["be41","퐸",7,"푁푂푃푅",14], -["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], -["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], -["bf41","풞",10,"풪",14], -["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], -["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], -["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], -["c061","픞",25], -["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], -["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], -["c161","햌햍햎햏햑",19,"햦햧"], -["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], -["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], -["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], -["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], -["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], -["c361","홢",4,"홨홪",5,"홲홳홵",11], -["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], -["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], -["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], -["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], -["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], -["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], -["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], -["c641","힍힎힏힑",6,"힚힜힞",5], -["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], -["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], -["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], -["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], -["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], -["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], -["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], -["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], -["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], -["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], -["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], -["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], -["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], -["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], -["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], -["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], -["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], -["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], -["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], -["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], -["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], -["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], -["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], -["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], -["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], -["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], -["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], -["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], -["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], -["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], -["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], -["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], -["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], -["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], -["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], -["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], -["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], -["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], -["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], -["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], -["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], -["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], -["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], -["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], -["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], -["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], -["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], -["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], -["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], -["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], -["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], -["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], -["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], -["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], -["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] -] diff --git a/node_modules/iconv-lite/encodings/tables/cp950.json b/node_modules/iconv-lite/encodings/tables/cp950.json deleted file mode 100644 index d8bc871..0000000 --- a/node_modules/iconv-lite/encodings/tables/cp950.json +++ /dev/null @@ -1,177 +0,0 @@ -[ -["0","\u0000",127], -["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], -["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], -["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], -["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], -["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], -["a3a1","ㄐ",25,"˙ˉˊˇˋ"], -["a3e1","€"], -["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], -["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], -["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], -["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], -["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], -["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], -["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], -["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], -["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], -["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], -["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], -["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], -["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], -["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], -["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], -["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], -["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], -["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], -["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], -["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], -["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], -["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], -["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], -["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], -["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], -["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], -["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], -["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], -["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], -["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], -["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], -["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], -["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], -["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], -["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], -["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], -["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], -["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], -["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], -["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], -["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], -["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], -["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], -["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], -["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], -["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], -["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], -["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], -["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], -["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], -["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], -["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], -["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], -["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], -["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], -["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], -["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], -["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], -["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], -["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], -["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], -["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], -["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], -["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], -["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], -["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], -["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], -["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], -["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], -["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], -["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], -["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], -["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], -["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], -["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], -["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], -["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], -["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], -["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], -["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], -["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], -["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], -["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], -["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], -["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], -["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], -["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], -["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], -["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], -["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], -["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], -["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], -["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], -["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], -["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], -["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], -["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], -["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], -["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], -["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], -["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], -["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], -["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], -["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], -["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], -["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], -["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], -["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], -["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], -["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], -["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], -["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], -["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], -["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], -["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], -["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], -["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], -["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], -["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], -["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], -["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], -["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], -["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], -["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], -["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], -["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], -["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], -["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], -["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], -["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], -["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], -["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], -["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], -["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], -["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], -["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], -["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], -["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], -["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], -["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], -["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], -["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], -["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], -["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], -["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], -["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], -["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], -["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], -["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], -["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], -["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], -["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], -["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], -["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], -["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], -["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], -["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], -["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], -["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], -["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], -["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], -["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], -["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], -["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], -["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], -["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], -["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] -] diff --git a/node_modules/iconv-lite/encodings/tables/eucjp.json b/node_modules/iconv-lite/encodings/tables/eucjp.json deleted file mode 100644 index 4fa61ca..0000000 --- a/node_modules/iconv-lite/encodings/tables/eucjp.json +++ /dev/null @@ -1,182 +0,0 @@ -[ -["0","\u0000",127], -["8ea1","。",62], -["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], -["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], -["a2ba","∈∋⊆⊇⊂⊃∪∩"], -["a2ca","∧∨¬⇒⇔∀∃"], -["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], -["a2f2","ʼn♯♭♪†‡¶"], -["a2fe","◯"], -["a3b0","0",9], -["a3c1","A",25], -["a3e1","a",25], -["a4a1","ぁ",82], -["a5a1","ァ",85], -["a6a1","Α",16,"Σ",6], -["a6c1","α",16,"σ",6], -["a7a1","А",5,"ЁЖ",25], -["a7d1","а",5,"ёж",25], -["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], -["ada1","①",19,"Ⅰ",9], -["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], -["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], -["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], -["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], -["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], -["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], -["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], -["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], -["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], -["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], -["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], -["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], -["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], -["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], -["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], -["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], -["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], -["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], -["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], -["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], -["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], -["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], -["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], -["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], -["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], -["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], -["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], -["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], -["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], -["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], -["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], -["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], -["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], -["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], -["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], -["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], -["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], -["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], -["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], -["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], -["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], -["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], -["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], -["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], -["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], -["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], -["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], -["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], -["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], -["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], -["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], -["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], -["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], -["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], -["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], -["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], -["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], -["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], -["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], -["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], -["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], -["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], -["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], -["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], -["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], -["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], -["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], -["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], -["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], -["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], -["f4a1","堯槇遙瑤凜熙"], -["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], -["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], -["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], -["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], -["fcf1","ⅰ",9,"¬¦'""], -["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], -["8fa2c2","¡¦¿"], -["8fa2eb","ºª©®™¤№"], -["8fa6e1","ΆΈΉΊΪ"], -["8fa6e7","Ό"], -["8fa6e9","ΎΫ"], -["8fa6ec","Ώ"], -["8fa6f1","άέήίϊΐόςύϋΰώ"], -["8fa7c2","Ђ",10,"ЎЏ"], -["8fa7f2","ђ",10,"ўџ"], -["8fa9a1","ÆĐ"], -["8fa9a4","Ħ"], -["8fa9a6","IJ"], -["8fa9a8","ŁĿ"], -["8fa9ab","ŊØŒ"], -["8fa9af","ŦÞ"], -["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], -["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], -["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], -["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], -["8fabbd","ġĥíìïîǐ"], -["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], -["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], -["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], -["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], -["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], -["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], -["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], -["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], -["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], -["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], -["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], -["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], -["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], -["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], -["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], -["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], -["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], -["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], -["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], -["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], -["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], -["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], -["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], -["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], -["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], -["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], -["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], -["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], -["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], -["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], -["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], -["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], -["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], -["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], -["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], -["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], -["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], -["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], -["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], -["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], -["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], -["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], -["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], -["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], -["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], -["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], -["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], -["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], -["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], -["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], -["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], -["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], -["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], -["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], -["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], -["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], -["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], -["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], -["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], -["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], -["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], -["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], -["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] -] diff --git a/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json deleted file mode 100644 index 85c6934..0000000 --- a/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +++ /dev/null @@ -1 +0,0 @@ -{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]} \ No newline at end of file diff --git a/node_modules/iconv-lite/encodings/tables/gbk-added.json b/node_modules/iconv-lite/encodings/tables/gbk-added.json deleted file mode 100644 index b742e36..0000000 --- a/node_modules/iconv-lite/encodings/tables/gbk-added.json +++ /dev/null @@ -1,56 +0,0 @@ -[ -["a140","",62], -["a180","",32], -["a240","",62], -["a280","",32], -["a2ab","",5], -["a2e3","€"], -["a2ef",""], -["a2fd",""], -["a340","",62], -["a380","",31," "], -["a440","",62], -["a480","",32], -["a4f4","",10], -["a540","",62], -["a580","",32], -["a5f7","",7], -["a640","",62], -["a680","",32], -["a6b9","",7], -["a6d9","",6], -["a6ec",""], -["a6f3",""], -["a6f6","",8], -["a740","",62], -["a780","",32], -["a7c2","",14], -["a7f2","",12], -["a896","",10], -["a8bc","ḿ"], -["a8bf","ǹ"], -["a8c1",""], -["a8ea","",20], -["a958",""], -["a95b",""], -["a95d",""], -["a989","〾⿰",11], -["a997","",12], -["a9f0","",14], -["aaa1","",93], -["aba1","",93], -["aca1","",93], -["ada1","",93], -["aea1","",93], -["afa1","",93], -["d7fa","",4], -["f8a1","",93], -["f9a1","",93], -["faa1","",93], -["fba1","",93], -["fca1","",93], -["fda1","",93], -["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], -["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], -["8135f437",""] -] diff --git a/node_modules/iconv-lite/encodings/tables/shiftjis.json b/node_modules/iconv-lite/encodings/tables/shiftjis.json deleted file mode 100644 index 5a3a43c..0000000 --- a/node_modules/iconv-lite/encodings/tables/shiftjis.json +++ /dev/null @@ -1,125 +0,0 @@ -[ -["0","\u0000",128], -["a1","。",62], -["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], -["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], -["81b8","∈∋⊆⊇⊂⊃∪∩"], -["81c8","∧∨¬⇒⇔∀∃"], -["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], -["81f0","ʼn♯♭♪†‡¶"], -["81fc","◯"], -["824f","0",9], -["8260","A",25], -["8281","a",25], -["829f","ぁ",82], -["8340","ァ",62], -["8380","ム",22], -["839f","Α",16,"Σ",6], -["83bf","α",16,"σ",6], -["8440","А",5,"ЁЖ",25], -["8470","а",5,"ёж",7], -["8480","о",17], -["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], -["8740","①",19,"Ⅰ",9], -["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], -["877e","㍻"], -["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], -["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], -["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], -["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], -["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], -["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], -["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], -["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], -["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], -["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], -["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], -["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], -["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], -["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], -["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], -["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], -["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], -["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], -["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], -["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], -["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], -["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], -["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], -["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], -["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], -["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], -["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], -["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], -["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], -["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], -["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], -["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], -["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], -["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], -["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], -["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], -["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], -["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], -["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], -["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], -["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], -["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], -["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], -["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], -["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], -["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], -["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], -["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], -["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], -["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], -["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], -["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], -["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], -["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], -["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], -["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], -["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], -["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], -["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], -["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], -["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], -["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], -["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], -["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], -["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], -["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], -["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], -["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], -["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], -["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], -["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], -["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], -["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], -["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], -["eeef","ⅰ",9,"¬¦'""], -["f040","",62], -["f080","",124], -["f140","",62], -["f180","",124], -["f240","",62], -["f280","",124], -["f340","",62], -["f380","",124], -["f440","",62], -["f480","",124], -["f540","",62], -["f580","",124], -["f640","",62], -["f680","",124], -["f740","",62], -["f780","",124], -["f840","",62], -["f880","",124], -["f940",""], -["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], -["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], -["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], -["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], -["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] -] diff --git a/node_modules/iconv-lite/encodings/utf16.js b/node_modules/iconv-lite/encodings/utf16.js deleted file mode 100644 index ae60d98..0000000 --- a/node_modules/iconv-lite/encodings/utf16.js +++ /dev/null @@ -1,187 +0,0 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer - -// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js - -// == UTF16-BE codec. ========================================================== - -exports.utf16be = Utf16BECodec -function Utf16BECodec () { -} - -Utf16BECodec.prototype.encoder = Utf16BEEncoder -Utf16BECodec.prototype.decoder = Utf16BEDecoder -Utf16BECodec.prototype.bomAware = true - -// -- Encoding - -function Utf16BEEncoder () { -} - -Utf16BEEncoder.prototype.write = function (str) { - var buf = Buffer.from(str, "ucs2") - for (var i = 0; i < buf.length; i += 2) { - var tmp = buf[i]; buf[i] = buf[i + 1]; buf[i + 1] = tmp - } - return buf -} - -Utf16BEEncoder.prototype.end = function () { -} - -// -- Decoding - -function Utf16BEDecoder () { - this.overflowByte = -1 -} - -Utf16BEDecoder.prototype.write = function (buf) { - if (buf.length == 0) { return "" } - - var buf2 = Buffer.alloc(buf.length + 1) - var i = 0; var j = 0 - - if (this.overflowByte !== -1) { - buf2[0] = buf[0] - buf2[1] = this.overflowByte - i = 1; j = 2 - } - - for (; i < buf.length - 1; i += 2, j += 2) { - buf2[j] = buf[i + 1] - buf2[j + 1] = buf[i] - } - - this.overflowByte = (i == buf.length - 1) ? buf[buf.length - 1] : -1 - - return buf2.slice(0, j).toString("ucs2") -} - -Utf16BEDecoder.prototype.end = function () { - this.overflowByte = -1 -} - -// == UTF-16 codec ============================================================= -// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. -// Defaults to UTF-16LE, as it's prevalent and default in Node. -// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le -// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); - -// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). - -exports.utf16 = Utf16Codec -function Utf16Codec (codecOptions, iconv) { - this.iconv = iconv -} - -Utf16Codec.prototype.encoder = Utf16Encoder -Utf16Codec.prototype.decoder = Utf16Decoder - -// -- Encoding (pass-through) - -function Utf16Encoder (options, codec) { - options = options || {} - if (options.addBOM === undefined) { options.addBOM = true } - this.encoder = codec.iconv.getEncoder("utf-16le", options) -} - -Utf16Encoder.prototype.write = function (str) { - return this.encoder.write(str) -} - -Utf16Encoder.prototype.end = function () { - return this.encoder.end() -} - -// -- Decoding - -function Utf16Decoder (options, codec) { - this.decoder = null - this.initialBufs = [] - this.initialBufsLen = 0 - - this.options = options || {} - this.iconv = codec.iconv -} - -Utf16Decoder.prototype.write = function (buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf) - this.initialBufsLen += buf.length - - if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) - { return "" } - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) - this.decoder = this.iconv.getDecoder(encoding, this.options) - - var resStr = "" - for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } - - this.initialBufs.length = this.initialBufsLen = 0 - return resStr - } - - return this.decoder.write(buf) -} - -Utf16Decoder.prototype.end = function () { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) - this.decoder = this.iconv.getDecoder(encoding, this.options) - - var resStr = "" - for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } - - var trail = this.decoder.end() - if (trail) { resStr += trail } - - this.initialBufs.length = this.initialBufsLen = 0 - return resStr - } - return this.decoder.end() -} - -function detectEncoding (bufs, defaultEncoding) { - var b = [] - var charsProcessed = 0 - // Number of ASCII chars when decoded as LE or BE. - var asciiCharsLE = 0 - var asciiCharsBE = 0 - - outerLoop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i] - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]) - if (b.length === 2) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE) return "utf-16le" - if (b[0] === 0xFE && b[1] === 0xFF) return "utf-16be" - } - - if (b[0] === 0 && b[1] !== 0) asciiCharsBE++ - if (b[0] !== 0 && b[1] === 0) asciiCharsLE++ - - b.length = 0 - charsProcessed++ - - if (charsProcessed >= 100) { - break outerLoop - } - } - } - } - - // Make decisions. - // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. - // So, we count ASCII as if it was LE or BE, and decide from that. - if (asciiCharsBE > asciiCharsLE) return "utf-16be" - if (asciiCharsBE < asciiCharsLE) return "utf-16le" - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || "utf-16le" -} diff --git a/node_modules/iconv-lite/encodings/utf32.js b/node_modules/iconv-lite/encodings/utf32.js deleted file mode 100644 index 7231789..0000000 --- a/node_modules/iconv-lite/encodings/utf32.js +++ /dev/null @@ -1,307 +0,0 @@ -"use strict" - -var Buffer = require("safer-buffer").Buffer - -// == UTF32-LE/BE codec. ========================================================== - -exports._utf32 = Utf32Codec - -function Utf32Codec (codecOptions, iconv) { - this.iconv = iconv - this.bomAware = true - this.isLE = codecOptions.isLE -} - -exports.utf32le = { type: "_utf32", isLE: true } -exports.utf32be = { type: "_utf32", isLE: false } - -// Aliases -exports.ucs4le = "utf32le" -exports.ucs4be = "utf32be" - -Utf32Codec.prototype.encoder = Utf32Encoder -Utf32Codec.prototype.decoder = Utf32Decoder - -// -- Encoding - -function Utf32Encoder (options, codec) { - this.isLE = codec.isLE - this.highSurrogate = 0 -} - -Utf32Encoder.prototype.write = function (str) { - var src = Buffer.from(str, "ucs2") - var dst = Buffer.alloc(src.length * 2) - var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE - var offset = 0 - - for (var i = 0; i < src.length; i += 2) { - var code = src.readUInt16LE(i) - var isHighSurrogate = (code >= 0xD800 && code < 0xDC00) - var isLowSurrogate = (code >= 0xDC00 && code < 0xE000) - - if (this.highSurrogate) { - if (isHighSurrogate || !isLowSurrogate) { - // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low - // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character - // (technically wrong, but expected by some applications, like Windows file names). - write32.call(dst, this.highSurrogate, offset) - offset += 4 - } else { - // Create 32-bit value from high and low surrogates; - var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000 - - write32.call(dst, codepoint, offset) - offset += 4 - this.highSurrogate = 0 - - continue - } - } - - if (isHighSurrogate) { this.highSurrogate = code } else { - // Even if the current character is a low surrogate, with no previous high surrogate, we'll - // encode it as a semi-invalid stand-alone character for the same reasons expressed above for - // unpaired high surrogates. - write32.call(dst, code, offset) - offset += 4 - this.highSurrogate = 0 - } - } - - if (offset < dst.length) { dst = dst.slice(0, offset) } - - return dst -} - -Utf32Encoder.prototype.end = function () { - // Treat any leftover high surrogate as a semi-valid independent character. - if (!this.highSurrogate) { return } - - var buf = Buffer.alloc(4) - - if (this.isLE) { buf.writeUInt32LE(this.highSurrogate, 0) } else { buf.writeUInt32BE(this.highSurrogate, 0) } - - this.highSurrogate = 0 - - return buf -} - -// -- Decoding - -function Utf32Decoder (options, codec) { - this.isLE = codec.isLE - this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0) - this.overflow = [] -} - -Utf32Decoder.prototype.write = function (src) { - if (src.length === 0) { return "" } - - var i = 0 - var codepoint = 0 - var dst = Buffer.alloc(src.length + 4) - var offset = 0 - var isLE = this.isLE - var overflow = this.overflow - var badChar = this.badChar - - if (overflow.length > 0) { - for (; i < src.length && overflow.length < 4; i++) { overflow.push(src[i]) } - - if (overflow.length === 4) { - // NOTE: codepoint is a signed int32 and can be negative. - // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). - if (isLE) { - codepoint = overflow[i] | (overflow[i + 1] << 8) | (overflow[i + 2] << 16) | (overflow[i + 3] << 24) - } else { - codepoint = overflow[i + 3] | (overflow[i + 2] << 8) | (overflow[i + 1] << 16) | (overflow[i] << 24) - } - overflow.length = 0 - - offset = _writeCodepoint(dst, offset, codepoint, badChar) - } - } - - // Main loop. Should be as optimized as possible. - for (; i < src.length - 3; i += 4) { - // NOTE: codepoint is a signed int32 and can be negative. - if (isLE) { - codepoint = src[i] | (src[i + 1] << 8) | (src[i + 2] << 16) | (src[i + 3] << 24) - } else { - codepoint = src[i + 3] | (src[i + 2] << 8) | (src[i + 1] << 16) | (src[i] << 24) - } - offset = _writeCodepoint(dst, offset, codepoint, badChar) - } - - // Keep overflowing bytes. - for (; i < src.length; i++) { - overflow.push(src[i]) - } - - return dst.slice(0, offset).toString("ucs2") -} - -function _writeCodepoint (dst, offset, codepoint, badChar) { - // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. - if (codepoint < 0 || codepoint > 0x10FFFF) { - // Not a valid Unicode codepoint - codepoint = badChar - } - - // Ephemeral Planes: Write high surrogate. - if (codepoint >= 0x10000) { - codepoint -= 0x10000 - - var high = 0xD800 | (codepoint >> 10) - dst[offset++] = high & 0xff - dst[offset++] = high >> 8 - - // Low surrogate is written below. - var codepoint = 0xDC00 | (codepoint & 0x3FF) - } - - // Write BMP char or low surrogate. - dst[offset++] = codepoint & 0xff - dst[offset++] = codepoint >> 8 - - return offset -}; - -Utf32Decoder.prototype.end = function () { - this.overflow.length = 0 -} - -// == UTF-32 Auto codec ============================================================= -// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. -// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 -// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); - -// Encoder prepends BOM (which can be overridden with (addBOM: false}). - -exports.utf32 = Utf32AutoCodec -exports.ucs4 = "utf32" - -function Utf32AutoCodec (options, iconv) { - this.iconv = iconv -} - -Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder -Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder - -// -- Encoding - -function Utf32AutoEncoder (options, codec) { - options = options || {} - - if (options.addBOM === undefined) { - options.addBOM = true - } - - this.encoder = codec.iconv.getEncoder(options.defaultEncoding || "utf-32le", options) -} - -Utf32AutoEncoder.prototype.write = function (str) { - return this.encoder.write(str) -} - -Utf32AutoEncoder.prototype.end = function () { - return this.encoder.end() -} - -// -- Decoding - -function Utf32AutoDecoder (options, codec) { - this.decoder = null - this.initialBufs = [] - this.initialBufsLen = 0 - this.options = options || {} - this.iconv = codec.iconv -} - -Utf32AutoDecoder.prototype.write = function (buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf) - this.initialBufsLen += buf.length - - if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) - { return "" } - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) - this.decoder = this.iconv.getDecoder(encoding, this.options) - - var resStr = "" - for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } - - this.initialBufs.length = this.initialBufsLen = 0 - return resStr - } - - return this.decoder.write(buf) -} - -Utf32AutoDecoder.prototype.end = function () { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) - this.decoder = this.iconv.getDecoder(encoding, this.options) - - var resStr = "" - for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } - - var trail = this.decoder.end() - if (trail) { resStr += trail } - - this.initialBufs.length = this.initialBufsLen = 0 - return resStr - } - - return this.decoder.end() -} - -function detectEncoding (bufs, defaultEncoding) { - var b = [] - var charsProcessed = 0 - var invalidLE = 0; var invalidBE = 0 // Number of invalid chars when decoded as LE or BE. - var bmpCharsLE = 0; var bmpCharsBE = 0 // Number of BMP chars when decoded as LE or BE. - - outerLoop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i] - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]) - if (b.length === 4) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { - return "utf-32le" - } - if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { - return "utf-32be" - } - } - - if (b[0] !== 0 || b[1] > 0x10) invalidBE++ - if (b[3] !== 0 || b[2] > 0x10) invalidLE++ - - if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++ - if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++ - - b.length = 0 - charsProcessed++ - - if (charsProcessed >= 100) { - break outerLoop - } - } - } - } - - // Make decisions. - if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return "utf-32be" - if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return "utf-32le" - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || "utf-32le" -} diff --git a/node_modules/iconv-lite/encodings/utf7.js b/node_modules/iconv-lite/encodings/utf7.js deleted file mode 100644 index fe72a9d..0000000 --- a/node_modules/iconv-lite/encodings/utf7.js +++ /dev/null @@ -1,283 +0,0 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer - -// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 -// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 - -exports.utf7 = Utf7Codec -exports.unicode11utf7 = "utf7" // Alias UNICODE-1-1-UTF-7 -function Utf7Codec (codecOptions, iconv) { - this.iconv = iconv -}; - -Utf7Codec.prototype.encoder = Utf7Encoder -Utf7Codec.prototype.decoder = Utf7Decoder -Utf7Codec.prototype.bomAware = true - -// -- Encoding - -// Why scape ()?./? -// eslint-disable-next-line no-useless-escape -var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g - -function Utf7Encoder (options, codec) { - this.iconv = codec.iconv -} - -Utf7Encoder.prototype.write = function (str) { - // Naive implementation. - // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". - return Buffer.from(str.replace(nonDirectChars, function (chunk) { - return "+" + (chunk === "+" - ? "" - : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + - "-" - }.bind(this))) -} - -Utf7Encoder.prototype.end = function () { -} - -// -- Decoding - -function Utf7Decoder (options, codec) { - this.iconv = codec.iconv - this.inBase64 = false - this.base64Accum = "" -} - -// Why scape /? -// eslint-disable-next-line no-useless-escape -var base64Regex = /[A-Za-z0-9\/+]/ -var base64Chars = [] -for (var i = 0; i < 256; i++) { base64Chars[i] = base64Regex.test(String.fromCharCode(i)) } - -var plusChar = "+".charCodeAt(0) -var minusChar = "-".charCodeAt(0) -var andChar = "&".charCodeAt(0) - -Utf7Decoder.prototype.write = function (buf) { - var res = ""; var lastI = 0 - var inBase64 = this.inBase64 - var base64Accum = this.base64Accum - - // The decoder is more involved as we must handle chunks in stream. - - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '+' - if (buf[i] == plusChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. - lastI = i + 1 - inBase64 = true - } - } else { // We decode base64. - if (!base64Chars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) { // "+-" -> "+" - res += "+" - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii") - res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") - } - - if (buf[i] != minusChar) // Minus is absorbed after base64. - { i-- } - - lastI = i + 1 - inBase64 = false - base64Accum = "" - } - } - } - - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii") - - var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded) - - res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") - } - - this.inBase64 = inBase64 - this.base64Accum = base64Accum - - return res -} - -Utf7Decoder.prototype.end = function () { - var res = "" - if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } - - this.inBase64 = false - this.base64Accum = "" - return res -} - -// UTF-7-IMAP codec. -// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) -// Differences: -// * Base64 part is started by "&" instead of "+" -// * Direct characters are 0x20-0x7E, except "&" (0x26) -// * In Base64, "," is used instead of "/" -// * Base64 must not be used to represent direct characters. -// * No implicit shift back from Base64 (should always end with '-') -// * String must end in non-shifted position. -// * "-&" while in base64 is not allowed. - -exports.utf7imap = Utf7IMAPCodec -function Utf7IMAPCodec (codecOptions, iconv) { - this.iconv = iconv -}; - -Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder -Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder -Utf7IMAPCodec.prototype.bomAware = true - -// -- Encoding - -function Utf7IMAPEncoder (options, codec) { - this.iconv = codec.iconv - this.inBase64 = false - this.base64Accum = Buffer.alloc(6) - this.base64AccumIdx = 0 -} - -Utf7IMAPEncoder.prototype.write = function (str) { - var inBase64 = this.inBase64 - var base64Accum = this.base64Accum - var base64AccumIdx = this.base64AccumIdx - var buf = Buffer.alloc(str.length * 5 + 10); var bufIdx = 0 - - for (var i = 0; i < str.length; i++) { - var uChar = str.charCodeAt(i) - if (uChar >= 0x20 && uChar <= 0x7E) { // Direct character or '&'. - if (inBase64) { - if (base64AccumIdx > 0) { - bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) - base64AccumIdx = 0 - } - - buf[bufIdx++] = minusChar // Write '-', then go to direct mode. - inBase64 = false - } - - if (!inBase64) { - buf[bufIdx++] = uChar // Write direct character - - if (uChar === andChar) // Ampersand -> '&-' - { buf[bufIdx++] = minusChar } - } - } else { // Non-direct character - if (!inBase64) { - buf[bufIdx++] = andChar // Write '&', then go to base64 mode. - inBase64 = true - } - if (inBase64) { - base64Accum[base64AccumIdx++] = uChar >> 8 - base64Accum[base64AccumIdx++] = uChar & 0xFF - - if (base64AccumIdx == base64Accum.length) { - bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx) - base64AccumIdx = 0 - } - } - } - } - - this.inBase64 = inBase64 - this.base64AccumIdx = base64AccumIdx - - return buf.slice(0, bufIdx) -} - -Utf7IMAPEncoder.prototype.end = function () { - var buf = Buffer.alloc(10); var bufIdx = 0 - if (this.inBase64) { - if (this.base64AccumIdx > 0) { - bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) - this.base64AccumIdx = 0 - } - - buf[bufIdx++] = minusChar // Write '-', then go to direct mode. - this.inBase64 = false - } - - return buf.slice(0, bufIdx) -} - -// -- Decoding - -function Utf7IMAPDecoder (options, codec) { - this.iconv = codec.iconv - this.inBase64 = false - this.base64Accum = "" -} - -var base64IMAPChars = base64Chars.slice() -base64IMAPChars[",".charCodeAt(0)] = true - -Utf7IMAPDecoder.prototype.write = function (buf) { - var res = ""; var lastI = 0 - var inBase64 = this.inBase64 - var base64Accum = this.base64Accum - - // The decoder is more involved as we must handle chunks in stream. - // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). - - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '&' - if (buf[i] == andChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. - lastI = i + 1 - inBase64 = true - } - } else { // We decode base64. - if (!base64IMAPChars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" - res += "&" - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, "/") - res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") - } - - if (buf[i] != minusChar) // Minus may be absorbed after base64. - { i-- } - - lastI = i + 1 - inBase64 = false - base64Accum = "" - } - } - } - - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, "/") - - var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded) - - res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") - } - - this.inBase64 = inBase64 - this.base64Accum = base64Accum - - return res -} - -Utf7IMAPDecoder.prototype.end = function () { - var res = "" - if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } - - this.inBase64 = false - this.base64Accum = "" - return res -} diff --git a/node_modules/iconv-lite/lib/bom-handling.js b/node_modules/iconv-lite/lib/bom-handling.js deleted file mode 100644 index a86a6b5..0000000 --- a/node_modules/iconv-lite/lib/bom-handling.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict" - -var BOMChar = "\uFEFF" - -exports.PrependBOM = PrependBOMWrapper -function PrependBOMWrapper (encoder, options) { - this.encoder = encoder - this.addBOM = true -} - -PrependBOMWrapper.prototype.write = function (str) { - if (this.addBOM) { - str = BOMChar + str - this.addBOM = false - } - - return this.encoder.write(str) -} - -PrependBOMWrapper.prototype.end = function () { - return this.encoder.end() -} - -// ------------------------------------------------------------------------------ - -exports.StripBOM = StripBOMWrapper -function StripBOMWrapper (decoder, options) { - this.decoder = decoder - this.pass = false - this.options = options || {} -} - -StripBOMWrapper.prototype.write = function (buf) { - var res = this.decoder.write(buf) - if (this.pass || !res) { return res } - - if (res[0] === BOMChar) { - res = res.slice(1) - if (typeof this.options.stripBOM === "function") { this.options.stripBOM() } - } - - this.pass = true - return res -} - -StripBOMWrapper.prototype.end = function () { - return this.decoder.end() -} diff --git a/node_modules/iconv-lite/lib/helpers/merge-exports.js b/node_modules/iconv-lite/lib/helpers/merge-exports.js deleted file mode 100644 index e79e041..0000000 --- a/node_modules/iconv-lite/lib/helpers/merge-exports.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict" - -var hasOwn = typeof Object.hasOwn === "undefined" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn - -function mergeModules (target, module) { - for (var key in module) { - if (hasOwn(module, key)) { - target[key] = module[key] - } - } -} - -module.exports = mergeModules diff --git a/node_modules/iconv-lite/lib/index.d.ts b/node_modules/iconv-lite/lib/index.d.ts deleted file mode 100644 index b11d99e..0000000 --- a/node_modules/iconv-lite/lib/index.d.ts +++ /dev/null @@ -1,129 +0,0 @@ -/* --------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - * REQUIREMENT: This definition is dependent on the @types/node definition. - * Install with `npm install @types/node --save-dev` - *-------------------------------------------------------------------------------------------- */ - -/* --------------------------------------------------------------------------------------------- - * This file provides detailed typings for the public API of iconv-lite - *-------------------------------------------------------------------------------------------- */ - -import type Stream = require("stream") -import type { Encoding } from "../types/encodings" - -declare namespace iconv { - export interface DecodeOptions { - /** - * Strip the Byte Order Mark (BOM) from the input, - * when decoding, if the codec is BOM-aware. @default true - */ - stripBOM?: boolean; - /** Override the default endianness for `UTF-16` and `UTF-32` decodings. */ - defaultEncoding?: "utf16be" | "utf32be"; - } - - export interface EncodeOptions { - /** - * Add a Byte Order Mark (BOM) to the output, when encoding, - * if the codec is BOM-aware. @default false - */ - addBOM?: boolean; - /** Override the default endianness for `UTF-32` encoding. */ - defaultEncoding?: "utf32be"; - } - - export interface EncoderStream { - write(str: string): Buffer; - end(): Buffer | undefined; - } - - export interface DecoderStream { - write(buf: Buffer): string; - end(): string | undefined; - } - - export interface Codec { - encoder: new (options?: EncodeOptions, codec?: Codec) => EncoderStream; - decoder: new (options?: DecodeOptions, codec?: Codec) => DecoderStream; - bomAware?: boolean; - [key: string]: any; - } - - /** Encodes a `string` into a `Buffer`, using the provided `encoding`. */ - export function encode (content: string, encoding: Encoding, options?: EncodeOptions): Buffer - - /** Decodes a `Buffer` into a `string`, using the provided `encoding`. */ - export function decode (buffer: Buffer | Uint8Array, encoding: Encoding, options?: DecodeOptions): string - - /** Checks if a given encoding is supported by `iconv-lite`. */ - export function encodingExists (encoding: string): encoding is Encoding - - /** Legacy alias for {@link iconv.encode}. */ - export const toEncoding: typeof iconv.encode - - /** Legacy alias for {@link iconv.decode}. */ - export const fromEncoding: typeof iconv.decode - - /** Creates a stream that decodes binary data from a given `encoding` into strings. */ - export function decodeStream (encoding: Encoding, options?: DecodeOptions): NodeJS.ReadWriteStream - - /** Creates a stream that encodes strings into binary data in a given `encoding`. */ - export function encodeStream (encoding: Encoding, options?: EncodeOptions): NodeJS.ReadWriteStream - - /** - * Explicitly enable Streaming API in browser environments by passing in: - * ```js - * require('stream') - * ``` - * @example iconv.enableStreamingAPI(require('stream')); - */ - export function enableStreamingAPI (stream_module: { Transform: typeof Stream.Transform }): void - - /** Creates and returns a low-level encoder stream. */ - export function getEncoder (encoding: Encoding, options?: EncodeOptions): EncoderStream - - /** Creates and returns a low-level decoder stream. */ - export function getDecoder (encoding: Encoding, options?: DecodeOptions): DecoderStream - - /** - * Returns a codec object for the given `encoding`. - * @throws If the `encoding` is not recognized. - */ - export function getCodec (encoding: Encoding): Codec - - /** Strips all non-alphanumeric characters and appended year from `encoding`. */ - export function _canonicalizeEncoding (encoding: Encoding): string - - /** A cache of all loaded encoding definitions. */ - export let encodings: Record< - Encoding, - | string - | { - type: string; - [key: string]: any; - } - > | null - - /** A cache of initialized codec objects. */ - export let _codecDataCache: Record - - /** The character used for untranslatable `Unicode` characters. @default "�" */ - export let defaultCharUnicode: string - - /** The character used for untranslatable `single-byte` characters. @default "?" */ - export let defaultCharSingleByte: string - - /** - * Skip deprecation warning when strings are used instead of Buffers during decoding. - * Note: {@link iconv.decode} converts the string to Buffer regardless. - */ - export let skipDecodeWarning: boolean - - /** @readonly Whether or not, Streaming API is enabled. */ - export const supportsStreams: boolean - - export type { iconv as Iconv, Encoding } -} - -export = iconv diff --git a/node_modules/iconv-lite/lib/index.js b/node_modules/iconv-lite/lib/index.js deleted file mode 100644 index bd5d6bc..0000000 --- a/node_modules/iconv-lite/lib/index.js +++ /dev/null @@ -1,182 +0,0 @@ -"use strict" - -var Buffer = require("safer-buffer").Buffer - -var bomHandling = require("./bom-handling") -var mergeModules = require("./helpers/merge-exports") - -// All codecs and aliases are kept here, keyed by encoding name/alias. -// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. -// Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true -module.exports.encodings = null - -// Characters emitted in case of error. -module.exports.defaultCharUnicode = "�" -module.exports.defaultCharSingleByte = "?" - -// Public API. -module.exports.encode = function encode (str, encoding, options) { - str = "" + (str || "") // Ensure string. - - var encoder = module.exports.getEncoder(encoding, options) - - var res = encoder.write(str) - var trail = encoder.end() - - return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res -} - -module.exports.decode = function decode (buf, encoding, options) { - if (typeof buf === "string") { - if (!module.exports.skipDecodeWarning) { - console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding") - module.exports.skipDecodeWarning = true - } - - buf = Buffer.from("" + (buf || ""), "binary") // Ensure buffer. - } - - var decoder = module.exports.getDecoder(encoding, options) - - var res = decoder.write(buf) - var trail = decoder.end() - - return trail ? (res + trail) : res -} - -module.exports.encodingExists = function encodingExists (enc) { - try { - module.exports.getCodec(enc) - return true - } catch (e) { - return false - } -} - -// Legacy aliases to convert functions -module.exports.toEncoding = module.exports.encode -module.exports.fromEncoding = module.exports.decode - -// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. -module.exports._codecDataCache = { __proto__: null } - -module.exports.getCodec = function getCodec (encoding) { - if (!module.exports.encodings) { - var raw = require("../encodings") - // TODO: In future versions when old nodejs support is removed can use object.assign - module.exports.encodings = { __proto__: null } // Initialize as empty object. - mergeModules(module.exports.encodings, raw) - } - - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - var enc = module.exports._canonicalizeEncoding(encoding) - - // Traverse iconv.encodings to find actual codec. - var codecOptions = {} - while (true) { - var codec = module.exports._codecDataCache[enc] - - if (codec) { return codec } - - var codecDef = module.exports.encodings[enc] - - switch (typeof codecDef) { - case "string": // Direct alias to other encoding. - enc = codecDef - break - - case "object": // Alias with options. Can be layered. - for (var key in codecDef) { codecOptions[key] = codecDef[key] } - - if (!codecOptions.encodingName) { codecOptions.encodingName = enc } - - enc = codecDef.type - break - - case "function": // Codec itself. - if (!codecOptions.encodingName) { codecOptions.encodingName = enc } - - // The codec function must load all tables and return object with .encoder and .decoder methods. - // It'll be called only once (for each different options object). - // - codec = new codecDef(codecOptions, module.exports) - - module.exports._codecDataCache[codecOptions.encodingName] = codec // Save it to be reused later. - return codec - - default: - throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')") - } - } -} - -module.exports._canonicalizeEncoding = function (encoding) { - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "") -} - -module.exports.getEncoder = function getEncoder (encoding, options) { - var codec = module.exports.getCodec(encoding) - var encoder = new codec.encoder(options, codec) - - if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options) } - - return encoder -} - -module.exports.getDecoder = function getDecoder (encoding, options) { - var codec = module.exports.getCodec(encoding) - var decoder = new codec.decoder(options, codec) - - if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options) } - - return decoder -} - -// Streaming API -// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add -// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. -// If you would like to enable it explicitly, please add the following code to your app: -// > iconv.enableStreamingAPI(require('stream')); -module.exports.enableStreamingAPI = function enableStreamingAPI (streamModule) { - if (module.exports.supportsStreams) { return } - - // Dependency-inject stream module to create IconvLite stream classes. - var streams = require("./streams")(streamModule) - - // Not public API yet, but expose the stream classes. - module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream - module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream - - // Streaming API. - module.exports.encodeStream = function encodeStream (encoding, options) { - return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options) - } - - module.exports.decodeStream = function decodeStream (encoding, options) { - return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options) - } - - module.exports.supportsStreams = true -} - -// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). -var streamModule -try { - streamModule = require("stream") -} catch (e) {} - -if (streamModule && streamModule.Transform) { - module.exports.enableStreamingAPI(streamModule) -} else { - // In rare cases where 'stream' module is not available by default, throw a helpful exception. - module.exports.encodeStream = module.exports.decodeStream = function () { - throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.") - } -} - -// Some environments, such as browsers, may not load JavaScript files as UTF-8 -// eslint-disable-next-line no-constant-condition -if ("Ā" !== "\u0100") { - console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.") -} diff --git a/node_modules/iconv-lite/lib/streams.js b/node_modules/iconv-lite/lib/streams.js deleted file mode 100644 index ebfed8e..0000000 --- a/node_modules/iconv-lite/lib/streams.js +++ /dev/null @@ -1,105 +0,0 @@ -"use strict" - -var Buffer = require("safer-buffer").Buffer - -// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), -// we opt to dependency-inject it instead of creating a hard dependency. -module.exports = function (streamModule) { - var Transform = streamModule.Transform - - // == Encoder stream ======================================================= - - function IconvLiteEncoderStream (conv, options) { - this.conv = conv - options = options || {} - options.decodeStrings = false // We accept only strings, so we don't need to decode them. - Transform.call(this, options) - } - - IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteEncoderStream } - }) - - IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) { - if (typeof chunk !== "string") { - return done(new Error("Iconv encoding stream needs strings as its input.")) - } - - try { - var res = this.conv.write(chunk) - if (res && res.length) this.push(res) - done() - } catch (e) { - done(e) - } - } - - IconvLiteEncoderStream.prototype._flush = function (done) { - try { - var res = this.conv.end() - if (res && res.length) this.push(res) - done() - } catch (e) { - done(e) - } - } - - IconvLiteEncoderStream.prototype.collect = function (cb) { - var chunks = [] - this.on("error", cb) - this.on("data", function (chunk) { chunks.push(chunk) }) - this.on("end", function () { - cb(null, Buffer.concat(chunks)) - }) - return this - } - - // == Decoder stream ======================================================= - - function IconvLiteDecoderStream (conv, options) { - this.conv = conv - options = options || {} - options.encoding = this.encoding = "utf8" // We output strings. - Transform.call(this, options) - } - - IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteDecoderStream } - }) - - IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) { - if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error("Iconv decoding stream needs buffers as its input.")) } - try { - var res = this.conv.write(chunk) - if (res && res.length) this.push(res, this.encoding) - done() - } catch (e) { - done(e) - } - } - - IconvLiteDecoderStream.prototype._flush = function (done) { - try { - var res = this.conv.end() - if (res && res.length) this.push(res, this.encoding) - done() - } catch (e) { - done(e) - } - } - - IconvLiteDecoderStream.prototype.collect = function (cb) { - var res = "" - this.on("error", cb) - this.on("data", function (chunk) { res += chunk }) - this.on("end", function () { - cb(null, res) - }) - return this - } - - return { - IconvLiteEncoderStream: IconvLiteEncoderStream, - IconvLiteDecoderStream: IconvLiteDecoderStream - } -} diff --git a/node_modules/iconv-lite/package.json b/node_modules/iconv-lite/package.json deleted file mode 100644 index 2a57357..0000000 --- a/node_modules/iconv-lite/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "iconv-lite", - "description": "Convert character encodings in pure javascript.", - "version": "0.7.2", - "license": "MIT", - "keywords": [ - "iconv", - "convert", - "charset", - "icu" - ], - "author": "Alexander Shtuchkin ", - "main": "./lib/index.js", - "typings": "./lib/index.d.ts", - "homepage": "https://github.com/pillarjs/iconv-lite", - "bugs": "https://github.com/pillarjs/iconv-lite/issues", - "files": [ - "lib/", - "encodings/", - "types/" - ], - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, - "repository": { - "type": "git", - "url": "https://github.com/pillarjs/iconv-lite.git" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "lint": "eslint", - "lint:fix": "eslint --fix", - "test": "mocha --reporter spec --check-leaks --grep .", - "test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test", - "test:cov": "nyc --exclude test --reporter=html --reporter=text npm test", - "test:performance": "node --allow-natives-syntax performance/index.js", - "test:tap": "mocha --reporter tap --check-leaks --grep .", - "test:typescript": "tsc && attw --pack", - "test:webpack": "npm pack && mv iconv-lite-*.tgz test/webpack/iconv-lite.tgz && cd test/webpack && npm install && npm run test && rm iconv-lite.tgz", - "typegen": "node generation/gen-typings.js" - }, - "browser": { - "stream": false - }, - "devDependencies": { - "@arethetypeswrong/cli": "^0.17.4", - "@stylistic/eslint-plugin": "^5.1.0", - "@stylistic/eslint-plugin-js": "^4.1.0", - "@types/node": "^24.0.12", - "async": "^3.2.0", - "bench-node": "^0.10.0", - "eslint": "^9.0.0", - "errto": "^0.2.1", - "expect-type": "^1.2.0", - "iconv": "^2.3.5", - "mocha": "^6.2.2", - "neostandard": "^0.12.0", - "nyc": "^14.1.1", - "request": "^2.88.2", - "semver": "^6.3.0", - "typescript": "~5.9.2", - "unorm": "^1.6.0" - }, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } -} diff --git a/node_modules/iconv-lite/types/encodings.d.ts b/node_modules/iconv-lite/types/encodings.d.ts deleted file mode 100644 index bedbe33..0000000 --- a/node_modules/iconv-lite/types/encodings.d.ts +++ /dev/null @@ -1,423 +0,0 @@ -/* - * --------------------------------------------------------------------------------------------- - * DO NOT EDIT THIS FILE MANUALLY. - * THIS FILE IS AUTOMATICALLY GENERATED. - * TO UPDATE, RUN `npm run typegen` AND COMMIT THE CHANGES. - * --------------------------------------------------------------------------------------------- - */ - -/** A union of all supported encoding strings in `iconv-lite`. */ -export type Encoding = - | "10000" - | "10006" - | "10007" - | "10029" - | "10079" - | "10081" - | "1046" - | "1124" - | "1125" - | "1129" - | "1133" - | "1161" - | "1162" - | "1163" - | "1250" - | "1251" - | "1252" - | "1253" - | "1254" - | "1255" - | "1256" - | "1257" - | "1258" - | "20866" - | "21866" - | "28591" - | "28592" - | "28593" - | "28594" - | "28595" - | "28596" - | "28597" - | "28598" - | "28599" - | "28600" - | "28601" - | "28603" - | "28604" - | "28605" - | "28606" - | "437" - | "737" - | "775" - | "808" - | "850" - | "852" - | "855" - | "856" - | "857" - | "858" - | "860" - | "861" - | "862" - | "863" - | "864" - | "865" - | "866" - | "869" - | "874" - | "922" - | "932" - | "936" - | "949" - | "950" - | "ansix34" - | "ansix341968" - | "ansix341986" - | "arabic" - | "arabic8" - | "armscii8" - | "ascii" - | "ascii8bit" - | "asmo708" - | "base64" - | "big5" - | "big5hkscs" - | "binary" - | "celtic" - | "celtic8" - | "cesu8" - | "chinese" - | "cn" - | "cnbig5" - | "cp1046" - | "cp1124" - | "cp1125" - | "cp1129" - | "cp1133" - | "cp1161" - | "cp1162" - | "cp1163" - | "cp1250" - | "cp1251" - | "cp1252" - | "cp1253" - | "cp1254" - | "cp1255" - | "cp1256" - | "cp1257" - | "cp1258" - | "cp20866" - | "cp21866" - | "cp28591" - | "cp28592" - | "cp28593" - | "cp28594" - | "cp28595" - | "cp28596" - | "cp28597" - | "cp28598" - | "cp28599" - | "cp28600" - | "cp28601" - | "cp28603" - | "cp28604" - | "cp28605" - | "cp28606" - | "cp367" - | "cp437" - | "cp720" - | "cp737" - | "cp775" - | "cp808" - | "cp819" - | "cp850" - | "cp852" - | "cp855" - | "cp856" - | "cp857" - | "cp858" - | "cp860" - | "cp861" - | "cp862" - | "cp863" - | "cp864" - | "cp865" - | "cp866" - | "cp869" - | "cp874" - | "cp922" - | "cp932" - | "cp936" - | "cp949" - | "cp950" - | "cpgr" - | "csascii" - | "csbig5" - | "cseuckr" - | "csgb2312" - | "cshproman8" - | "csibm1046" - | "csibm1124" - | "csibm1125" - | "csibm1129" - | "csibm1133" - | "csibm1161" - | "csibm1162" - | "csibm1163" - | "csibm437" - | "csibm737" - | "csibm775" - | "csibm850" - | "csibm852" - | "csibm855" - | "csibm856" - | "csibm857" - | "csibm858" - | "csibm860" - | "csibm861" - | "csibm862" - | "csibm863" - | "csibm864" - | "csibm865" - | "csibm866" - | "csibm869" - | "csibm922" - | "csiso14jisc6220ro" - | "csiso58gb231280" - | "csisolatin1" - | "csisolatin2" - | "csisolatin3" - | "csisolatin4" - | "csisolatin5" - | "csisolatin6" - | "csisolatinarabic" - | "csisolatincyrillic" - | "csisolatingreek" - | "csisolatinhebrew" - | "cskoi8r" - | "csksc56011987" - | "csmacintosh" - | "cspc775baltic" - | "cspc850multilingual" - | "cspc862latinhebrew" - | "cspc8codepage437" - | "cspcp852" - | "csshiftjis" - | "cyrillic" - | "ecma114" - | "ecma118" - | "elot928" - | "euccn" - | "eucjp" - | "euckr" - | "gb18030" - | "gb198880" - | "gb2312" - | "gb23121980" - | "gb231280" - | "gbk" - | "georgianacademy" - | "georgianps" - | "greek" - | "greek8" - | "hebrew" - | "hebrew8" - | "hex" - | "hproman8" - | "ibm1046" - | "ibm1051" - | "ibm1124" - | "ibm1125" - | "ibm1129" - | "ibm1133" - | "ibm1161" - | "ibm1162" - | "ibm1163" - | "ibm1168" - | "ibm367" - | "ibm437" - | "ibm737" - | "ibm775" - | "ibm808" - | "ibm819" - | "ibm850" - | "ibm852" - | "ibm855" - | "ibm856" - | "ibm857" - | "ibm858" - | "ibm860" - | "ibm861" - | "ibm862" - | "ibm863" - | "ibm864" - | "ibm865" - | "ibm866" - | "ibm869" - | "ibm878" - | "ibm922" - | "iso646cn" - | "iso646irv" - | "iso646jp" - | "iso646us" - | "iso88591" - | "iso885910" - | "iso885911" - | "iso885913" - | "iso885914" - | "iso885915" - | "iso885916" - | "iso88592" - | "iso88593" - | "iso88594" - | "iso88595" - | "iso88596" - | "iso88597" - | "iso88598" - | "iso88599" - | "isoceltic" - | "isoir100" - | "isoir101" - | "isoir109" - | "isoir110" - | "isoir126" - | "isoir127" - | "isoir138" - | "isoir14" - | "isoir144" - | "isoir148" - | "isoir149" - | "isoir157" - | "isoir166" - | "isoir179" - | "isoir199" - | "isoir203" - | "isoir226" - | "isoir57" - | "isoir58" - | "isoir6" - | "jisc62201969ro" - | "jp" - | "koi8r" - | "koi8ru" - | "koi8t" - | "koi8u" - | "korean" - | "ksc5601" - | "ksc56011987" - | "ksc56011989" - | "l1" - | "l10" - | "l2" - | "l3" - | "l4" - | "l5" - | "l6" - | "l7" - | "l8" - | "l9" - | "latin1" - | "latin10" - | "latin2" - | "latin3" - | "latin4" - | "latin5" - | "latin6" - | "latin7" - | "latin8" - | "latin9" - | "mac" - | "maccenteuro" - | "maccroatian" - | "maccyrillic" - | "macgreek" - | "maciceland" - | "macintosh" - | "macroman" - | "macromania" - | "macthai" - | "macturkish" - | "macukraine" - | "mik" - | "ms31j" - | "ms932" - | "ms936" - | "ms949" - | "ms950" - | "msansi" - | "msarab" - | "mscyrl" - | "msee" - | "msgreek" - | "mshebr" - | "mskanji" - | "msturk" - | "pt154" - | "r8" - | "rk1048" - | "roman8" - | "shiftjis" - | "sjis" - | "strk10482002" - | "tcvn" - | "tcvn5712" - | "tcvn57121" - | "thai" - | "thai8" - | "tis620" - | "tis6200" - | "tis62025291" - | "tis62025330" - | "turkish" - | "turkish8" - | "ucs2" - | "ucs4" - | "ucs4be" - | "ucs4le" - | "unicode11utf7" - | "unicode11utf8" - | "us" - | "usascii" - | "utf16" - | "utf16be" - | "utf16le" - | "utf32" - | "utf32be" - | "utf32le" - | "utf7" - | "utf7imap" - | "utf8" - | "viscii" - | "win1250" - | "win1251" - | "win1252" - | "win1253" - | "win1254" - | "win1255" - | "win1256" - | "win1257" - | "win1258" - | "win874" - | "winbaltrim" - | "windows1250" - | "windows1251" - | "windows1252" - | "windows1253" - | "windows1254" - | "windows1255" - | "windows1256" - | "windows1257" - | "windows1258" - | "windows31j" - | "windows874" - | "windows932" - | "windows936" - | "windows949" - | "windows950" - | "xgbk" - | "xroman8" - | "xsjis" - | "xxbig5" - | (string & {}) diff --git a/node_modules/inherits/LICENSE b/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013..0000000 --- a/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - diff --git a/node_modules/inherits/README.md b/node_modules/inherits/README.md deleted file mode 100644 index b1c5665..0000000 --- a/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js deleted file mode 100644 index f71f2d9..0000000 --- a/node_modules/inherits/inherits.js +++ /dev/null @@ -1,9 +0,0 @@ -try { - var util = require('util'); - /* istanbul ignore next */ - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - /* istanbul ignore next */ - module.exports = require('./inherits_browser.js'); -} diff --git a/node_modules/inherits/inherits_browser.js b/node_modules/inherits/inherits_browser.js deleted file mode 100644 index 86bbb3d..0000000 --- a/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,27 +0,0 @@ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }) - } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } - } -} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json deleted file mode 100644 index 37b4366..0000000 --- a/node_modules/inherits/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "inherits", - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.4", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented", - "inherits", - "browser", - "browserify" - ], - "main": "./inherits.js", - "browser": "./inherits_browser.js", - "repository": "git://github.com/isaacs/inherits", - "license": "ISC", - "scripts": { - "test": "tap" - }, - "devDependencies": { - "tap": "^14.2.4" - }, - "files": [ - "inherits.js", - "inherits_browser.js" - ] -} diff --git a/node_modules/ip-address/LICENSE b/node_modules/ip-address/LICENSE deleted file mode 100644 index ec79adb..0000000 --- a/node_modules/ip-address/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2011 by Beau Gunderson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/ip-address/README.md b/node_modules/ip-address/README.md deleted file mode 100644 index 93ccb41..0000000 --- a/node_modules/ip-address/README.md +++ /dev/null @@ -1,105 +0,0 @@ -[![CircleCI](https://dl.circleci.com/status-badge/img/circleci/9fJmTZfn8d8p7GtVt688PY/JjriGjhcxBD6zYKygMZaet/tree/master.svg?style=svg&circle-token=7baede7efd3db5f1f25fb439e97d5f695ff76318)](https://dl.circleci.com/status-badge/redirect/circleci/9fJmTZfn8d8p7GtVt688PY/JjriGjhcxBD6zYKygMZaet/tree/master) -[![codecov]](https://codecov.io/github/beaugunderson/ip-address?branch=master) -[![downloads]](https://www.npmjs.com/package/ip-address) -[![npm]](https://www.npmjs.com/package/ip-address) -[![snyk]](https://snyk.io/test/github/beaugunderson/ip-address) - -[codecov]: https://codecov.io/github/beaugunderson/ip-address/coverage.svg?branch=master -[downloads]: https://img.shields.io/npm/dm/ip-address.svg -[npm]: https://img.shields.io/npm/v/ip-address.svg -[snyk]: https://snyk.io/test/github/beaugunderson/ip-address/badge.svg - -## ip-address - -`ip-address` is a library for validating and manipulating IPv4 and IPv6 -addresses in JavaScript. - -### Upgrading from 9.x to 10.x - -The dependency on `jsbn` was removed thanks to -[michal-kocarek](https://github.com/michal-kocarek). Thanks Michal! For -clarity, all methods with BigInteger in the name were renamed to BigInt. - -#### Breaking changes - -- `#fromBigInteger()` → `#fromBigInt()`; now returns a native BigInt -- `#bigInteger()` → `#bigInt()`; now returns a native BigInt - -### Documentation - -Documentation is available at [ip-address.js.org](http://ip-address.js.org/). - -### Examples - -```js -var Address6 = require('ip-address').Address6; - -var address = new Address6('2001:0:ce49:7601:e866:efff:62c3:fffe'); - -var teredo = address.inspectTeredo(); - -teredo.client4; // '157.60.0.1' -``` - -### Features - -- Usable via CommonJS or ESM -- Parsing of all IPv6 notations -- Parsing of IPv6 addresses and ports from URLs with `Address6.fromURL(url)` -- Validity checking -- Decoding of the [Teredo - information](http://en.wikipedia.org/wiki/Teredo_tunneling#IPv6_addressing) - in an address -- Whether one address is a valid subnet of another -- What special properties a given address has (multicast prefix, unique - local address prefix, etc.) -- Number of subnets of a certain size in a given address -- Display methods - - Hex, binary, and decimal - - Canonical form - - Correct form - - IPv4-compatible (i.e. `::ffff:192.168.0.1`) -- Works in [node](http://nodejs.org/) and the browser (with browserify) -- ~1,600 test cases - -### Used by - -- [anon](https://github.com/edsu/anon) which powers - [@congressedits](https://twitter.com/congressedits), among - [many others](https://github.com/edsu/anon#community) -- [base85](https://github.com/noseglid/base85): base85 encoding/decoding -- [contrail-web-core](https://github.com/Juniper/contrail-web-core): part of - Contrail, a network virtualization solution made by Juniper Networks -- [dhcpjs](https://github.com/apaprocki/node-dhcpjs): a DHCP client and server -- [epochtalk](https://github.com/epochtalk/epochtalk): next generation forum - software -- [geoip-web](https://github.com/tfrce/node-geoip-web): a server for - quickly geolocating IP addresses -- [hexabus](https://github.com/mysmartgrid/hexabus): an IPv6-based home - automation bus -- [hubot-deploy](https://github.com/atmos/hubot-deploy): GitHub Flow via hubot -- [heroku-portscanner](https://github.com/robison/heroku-portscanner): nmap - hosted on Heroku -- [ipfs-swarm](https://github.com/diasdavid/node-ipfs-swarm): a swarm - implementation based on IPFS -- [javascript-x-server](https://github.com/GothAck/javascript-x-server): an X - server written in JavaScript -- [libnmap](https://github.com/jas-/node-libnmap): a node API for nmap -- [mail-io](https://github.com/mofux/mail-io): a lightweight SMTP server -- [maxmind-db-reader](https://github.com/PaddeK/node-maxmind-db): a library for - reading MaxMind database files -- [proxy-protocol-v2](https://github.com/ably/proxy-protocol-v2): a proxy - protocol encoder/decoder built by [Ably](https://www.ably.io/) -- [Samsara](https://github.com/mariusGundersen/Samsara): a Docker web interface -- [sis-api](https://github.com/sis-cmdb/sis-api): a configuration management - database API -- [socks5-client](https://github.com/mattcg/socks5-client): a SOCKS v5 client -- [socksified](https://github.com/vially/node-socksified): a SOCKS v5 client -- [socksv5](https://github.com/mscdex/socksv5): a SOCKS v5 server/client -- [ssdapi](https://github.com/rsolomou/ssdapi): an API created by the - University of Portsmouth -- [SwitchyOmega](https://github.com/FelisCatus/SwitchyOmega): a [Chrome - extension](https://chrome.google.com/webstore/detail/padekgcemlokbadohgkifijomclgjgif) - for switching between multiple proxies with ~311k users! -- [swiz](https://github.com/racker/node-swiz): a serialization framework built - and used by [Rackspace](http://www.rackspace.com/) diff --git a/node_modules/ip-address/dist/address-error.d.ts b/node_modules/ip-address/dist/address-error.d.ts deleted file mode 100644 index 59b2165..0000000 --- a/node_modules/ip-address/dist/address-error.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare class AddressError extends Error { - parseMessage?: string; - constructor(message: string, parseMessage?: string); -} -//# sourceMappingURL=address-error.d.ts.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/address-error.d.ts.map b/node_modules/ip-address/dist/address-error.d.ts.map deleted file mode 100644 index 0ef7fa6..0000000 --- a/node_modules/ip-address/dist/address-error.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address-error.d.ts","sourceRoot":"","sources":["../src/address-error.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;gBAEV,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM;CAOnD"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/address-error.js b/node_modules/ip-address/dist/address-error.js deleted file mode 100644 index c178ae4..0000000 --- a/node_modules/ip-address/dist/address-error.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AddressError = void 0; -class AddressError extends Error { - constructor(message, parseMessage) { - super(message); - this.name = 'AddressError'; - this.parseMessage = parseMessage; - } -} -exports.AddressError = AddressError; -//# sourceMappingURL=address-error.js.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/address-error.js.map b/node_modules/ip-address/dist/address-error.js.map deleted file mode 100644 index 5d71d13..0000000 --- a/node_modules/ip-address/dist/address-error.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address-error.js","sourceRoot":"","sources":["../src/address-error.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IAGrC,YAAY,OAAe,EAAE,YAAqB;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAE3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAVD,oCAUC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/common.d.ts b/node_modules/ip-address/dist/common.d.ts deleted file mode 100644 index a4250d8..0000000 --- a/node_modules/ip-address/dist/common.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Address4 } from './ipv4'; -import { Address6 } from './ipv6'; -export interface ReverseFormOptions { - omitSuffix?: boolean; -} -export declare function isInSubnet(this: Address4 | Address6, address: Address4 | Address6): boolean; -export declare function isCorrect(defaultBits: number): (this: Address4 | Address6) => boolean; -export declare function numberToPaddedHex(number: number): string; -export declare function stringToPaddedHex(numberString: string): string; -/** - * @param binaryValue Binary representation of a value (e.g. `10`) - * @param position Byte position, where 0 is the least significant bit - */ -export declare function testBit(binaryValue: string, position: number): boolean; -//# sourceMappingURL=common.d.ts.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/common.d.ts.map b/node_modules/ip-address/dist/common.d.ts.map deleted file mode 100644 index d13705a..0000000 --- a/node_modules/ip-address/dist/common.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,QAAQ,WAUjF;AAED,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,UACpB,QAAQ,GAAG,QAAQ,aAW3C;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,UAE/C;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,UAErD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAStE"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/common.js b/node_modules/ip-address/dist/common.js deleted file mode 100644 index 273a01e..0000000 --- a/node_modules/ip-address/dist/common.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isInSubnet = isInSubnet; -exports.isCorrect = isCorrect; -exports.numberToPaddedHex = numberToPaddedHex; -exports.stringToPaddedHex = stringToPaddedHex; -exports.testBit = testBit; -function isInSubnet(address) { - if (this.subnetMask < address.subnetMask) { - return false; - } - if (this.mask(address.subnetMask) === address.mask()) { - return true; - } - return false; -} -function isCorrect(defaultBits) { - return function () { - if (this.addressMinusSuffix !== this.correctForm()) { - return false; - } - if (this.subnetMask === defaultBits && !this.parsedSubnet) { - return true; - } - return this.parsedSubnet === String(this.subnetMask); - }; -} -function numberToPaddedHex(number) { - return number.toString(16).padStart(2, '0'); -} -function stringToPaddedHex(numberString) { - return numberToPaddedHex(parseInt(numberString, 10)); -} -/** - * @param binaryValue Binary representation of a value (e.g. `10`) - * @param position Byte position, where 0 is the least significant bit - */ -function testBit(binaryValue, position) { - const { length } = binaryValue; - if (position > length) { - return false; - } - const positionInString = length - position; - return binaryValue.substring(positionInString, positionInString + 1) === '1'; -} -//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/common.js.map b/node_modules/ip-address/dist/common.js.map deleted file mode 100644 index 036ce66..0000000 --- a/node_modules/ip-address/dist/common.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAOA,gCAUC;AAED,8BAYC;AAED,8CAEC;AAED,8CAEC;AAMD,0BASC;AA/CD,SAAgB,UAAU,CAA4B,OAA4B;IAChF,IAAI,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,SAAS,CAAC,WAAmB;IAC3C,OAAO;QACL,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAAc;IAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,iBAAiB,CAAC,YAAoB;IACpD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,WAAmB,EAAE,QAAgB;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE/B,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,OAAO,WAAW,CAAC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AAC/E,CAAC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/ip-address.d.ts b/node_modules/ip-address/dist/ip-address.d.ts deleted file mode 100644 index 14f8fe0..0000000 --- a/node_modules/ip-address/dist/ip-address.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { Address4 } from './ipv4'; -export { Address6 } from './ipv6'; -export { AddressError } from './address-error'; -import * as helpers from './v6/helpers'; -export declare const v6: { - helpers: typeof helpers; -}; -//# sourceMappingURL=ip-address.d.ts.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/ip-address.d.ts.map b/node_modules/ip-address/dist/ip-address.d.ts.map deleted file mode 100644 index 7bcb98a..0000000 --- a/node_modules/ip-address/dist/ip-address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ip-address.d.ts","sourceRoot":"","sources":["../src/ip-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,eAAO,MAAM,EAAE;;CAAc,CAAC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/ip-address.js b/node_modules/ip-address/dist/ip-address.js deleted file mode 100644 index 84f3487..0000000 --- a/node_modules/ip-address/dist/ip-address.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.v6 = exports.AddressError = exports.Address6 = exports.Address4 = void 0; -var ipv4_1 = require("./ipv4"); -Object.defineProperty(exports, "Address4", { enumerable: true, get: function () { return ipv4_1.Address4; } }); -var ipv6_1 = require("./ipv6"); -Object.defineProperty(exports, "Address6", { enumerable: true, get: function () { return ipv6_1.Address6; } }); -var address_error_1 = require("./address-error"); -Object.defineProperty(exports, "AddressError", { enumerable: true, get: function () { return address_error_1.AddressError; } }); -const helpers = __importStar(require("./v6/helpers")); -exports.v6 = { helpers }; -//# sourceMappingURL=ip-address.js.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/ip-address.js.map b/node_modules/ip-address/dist/ip-address.js.map deleted file mode 100644 index cb89ed3..0000000 --- a/node_modules/ip-address/dist/ip-address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ip-address.js","sourceRoot":"","sources":["../src/ip-address.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAErB,sDAAwC;AAE3B,QAAA,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/ipv4.d.ts b/node_modules/ip-address/dist/ipv4.d.ts deleted file mode 100644 index 9a0d9ad..0000000 --- a/node_modules/ip-address/dist/ipv4.d.ts +++ /dev/null @@ -1,193 +0,0 @@ -import * as common from './common'; -/** - * Represents an IPv4 address - * @class Address4 - * @param {string} address - An IPv4 address string - */ -export declare class Address4 { - address: string; - addressMinusSuffix?: string; - groups: number; - parsedAddress: string[]; - parsedSubnet: string; - subnet: string; - subnetMask: number; - v4: boolean; - constructor(address: string); - static isValid(address: string): boolean; - parse(address: string): string[]; - /** - * Returns the correct form of an address - * @memberof Address4 - * @instance - * @returns {String} - */ - correctForm(): string; - /** - * Returns true if the address is correct, false otherwise - * @memberof Address4 - * @instance - * @returns {Boolean} - */ - isCorrect: (this: Address4 | import("./ipv6").Address6) => boolean; - /** - * Converts a hex string to an IPv4 address object - * @memberof Address4 - * @static - * @param {string} hex - a hex string to convert - * @returns {Address4} - */ - static fromHex(hex: string): Address4; - /** - * Converts an integer into a IPv4 address object - * @memberof Address4 - * @static - * @param {integer} integer - a number to convert - * @returns {Address4} - */ - static fromInteger(integer: number): Address4; - /** - * Return an address from in-addr.arpa form - * @memberof Address4 - * @static - * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address - * @returns {Adress4} - * @example - * var address = Address4.fromArpa(42.2.0.192.in-addr.arpa.) - * address.correctForm(); // '192.0.2.42' - */ - static fromArpa(arpaFormAddress: string): Address4; - /** - * Converts an IPv4 address object to a hex string - * @memberof Address4 - * @instance - * @returns {String} - */ - toHex(): string; - /** - * Converts an IPv4 address object to an array of bytes - * @memberof Address4 - * @instance - * @returns {Array} - */ - toArray(): number[]; - /** - * Converts an IPv4 address object to an IPv6 address group - * @memberof Address4 - * @instance - * @returns {String} - */ - toGroup6(): string; - /** - * Returns the address as a `bigint` - * @memberof Address4 - * @instance - * @returns {bigint} - */ - bigInt(): bigint; - /** - * Helper function getting start address. - * @memberof Address4 - * @instance - * @returns {bigint} - */ - _startAddress(): bigint; - /** - * The first address in the range given by this address' subnet. - * Often referred to as the Network Address. - * @memberof Address4 - * @instance - * @returns {Address4} - */ - startAddress(): Address4; - /** - * The first host address in the range given by this address's subnet ie - * the first address after the Network Address - * @memberof Address4 - * @instance - * @returns {Address4} - */ - startAddressExclusive(): Address4; - /** - * Helper function getting end address. - * @memberof Address4 - * @instance - * @returns {bigint} - */ - _endAddress(): bigint; - /** - * The last address in the range given by this address' subnet - * Often referred to as the Broadcast - * @memberof Address4 - * @instance - * @returns {Address4} - */ - endAddress(): Address4; - /** - * The last host address in the range given by this address's subnet ie - * the last address prior to the Broadcast Address - * @memberof Address4 - * @instance - * @returns {Address4} - */ - endAddressExclusive(): Address4; - /** - * Converts a BigInt to a v4 address object - * @memberof Address4 - * @static - * @param {bigint} bigInt - a BigInt to convert - * @returns {Address4} - */ - static fromBigInt(bigInt: bigint): Address4; - /** - * Returns the first n bits of the address, defaulting to the - * subnet mask - * @memberof Address4 - * @instance - * @returns {String} - */ - mask(mask?: number): string; - /** - * Returns the bits in the given range as a base-2 string - * @memberof Address4 - * @instance - * @returns {string} - */ - getBitsBase2(start: number, end: number): string; - /** - * Return the reversed ip6.arpa form of the address - * @memberof Address4 - * @param {Object} options - * @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix - * @instance - * @returns {String} - */ - reverseForm(options?: common.ReverseFormOptions): string; - /** - * Returns true if the given address is in the subnet of the current address - * @memberof Address4 - * @instance - * @returns {boolean} - */ - isInSubnet: typeof common.isInSubnet; - /** - * Returns true if the given address is a multicast address - * @memberof Address4 - * @instance - * @returns {boolean} - */ - isMulticast(): boolean; - /** - * Returns a zero-padded base-2 string representation of the address - * @memberof Address4 - * @instance - * @returns {string} - */ - binaryZeroPad(): string; - /** - * Groups an IPv4 address for inclusion at the end of an IPv6 address - * @returns {String} - */ - groupForV6(): string; -} -//# sourceMappingURL=ipv4.d.ts.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/ipv4.d.ts.map b/node_modules/ip-address/dist/ipv4.d.ts.map deleted file mode 100644 index 680ffb5..0000000 --- a/node_modules/ip-address/dist/ipv4.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ipv4.d.ts","sourceRoot":"","sources":["../src/ipv4.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAInC;;;;GAIG;AACH,qBAAa,QAAQ;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAoB;IAClC,aAAa,EAAE,MAAM,EAAE,CAAM;IAC7B,YAAY,EAAE,MAAM,CAAM;IAC1B,MAAM,EAAE,MAAM,CAAS;IACvB,UAAU,EAAE,MAAM,CAAM;IACxB,EAAE,EAAE,OAAO,CAAQ;gBAEP,OAAO,EAAE,MAAM;IAsB3B,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAcxC,KAAK,CAAC,OAAO,EAAE,MAAM;IAUrB;;;;;OAKG;IACH,WAAW,IAAI,MAAM;IAIrB;;;;;OAKG;IACH,SAAS,0DAAoC;IAE7C;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ;IAcrC;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ;IAI7C;;;;;;;;;OASG;IACH,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ;IASlD;;;;;OAKG;IACH,KAAK,IAAI,MAAM;IAIf;;;;;OAKG;IACH,OAAO,IAAI,MAAM,EAAE;IAInB;;;;;OAKG;IACH,QAAQ,IAAI,MAAM;IAelB;;;;;OAKG;IACH,MAAM,IAAI,MAAM;IAIhB;;;;;OAKG;IACH,aAAa,IAAI,MAAM;IAIvB;;;;;;OAMG;IACH,YAAY,IAAI,QAAQ;IAIxB;;;;;;OAMG;IACH,qBAAqB,IAAI,QAAQ;IAKjC;;;;;OAKG;IACH,WAAW,IAAI,MAAM;IAIrB;;;;;;OAMG;IACH,UAAU,IAAI,QAAQ;IAItB;;;;;;OAMG;IACH,mBAAmB,IAAI,QAAQ;IAK/B;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;IAI3C;;;;;;OAMG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ3B;;;;;OAKG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAIhD;;;;;;;OAOG;IACH,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,kBAAkB,GAAG,MAAM;IAcxD;;;;;OAKG;IACH,UAAU,2BAAqB;IAE/B;;;;;OAKG;IACH,WAAW,IAAI,OAAO;IAItB;;;;;OAKG;IACH,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACH,UAAU,IAAI,MAAM;CAYrB"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/ipv4.js b/node_modules/ip-address/dist/ipv4.js deleted file mode 100644 index f1b6006..0000000 --- a/node_modules/ip-address/dist/ipv4.js +++ /dev/null @@ -1,327 +0,0 @@ -"use strict"; -/* eslint-disable no-param-reassign */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Address4 = void 0; -const common = __importStar(require("./common")); -const constants = __importStar(require("./v4/constants")); -const address_error_1 = require("./address-error"); -/** - * Represents an IPv4 address - * @class Address4 - * @param {string} address - An IPv4 address string - */ -class Address4 { - constructor(address) { - this.groups = constants.GROUPS; - this.parsedAddress = []; - this.parsedSubnet = ''; - this.subnet = '/32'; - this.subnetMask = 32; - this.v4 = true; - /** - * Returns true if the address is correct, false otherwise - * @memberof Address4 - * @instance - * @returns {Boolean} - */ - this.isCorrect = common.isCorrect(constants.BITS); - /** - * Returns true if the given address is in the subnet of the current address - * @memberof Address4 - * @instance - * @returns {boolean} - */ - this.isInSubnet = common.isInSubnet; - this.address = address; - const subnet = constants.RE_SUBNET_STRING.exec(address); - if (subnet) { - this.parsedSubnet = subnet[0].replace('/', ''); - this.subnetMask = parseInt(this.parsedSubnet, 10); - this.subnet = `/${this.subnetMask}`; - if (this.subnetMask < 0 || this.subnetMask > constants.BITS) { - throw new address_error_1.AddressError('Invalid subnet mask.'); - } - address = address.replace(constants.RE_SUBNET_STRING, ''); - } - this.addressMinusSuffix = address; - this.parsedAddress = this.parse(address); - } - static isValid(address) { - try { - // eslint-disable-next-line no-new - new Address4(address); - return true; - } - catch (e) { - return false; - } - } - /* - * Parses a v4 address - */ - parse(address) { - const groups = address.split('.'); - if (!address.match(constants.RE_ADDRESS)) { - throw new address_error_1.AddressError('Invalid IPv4 address.'); - } - return groups; - } - /** - * Returns the correct form of an address - * @memberof Address4 - * @instance - * @returns {String} - */ - correctForm() { - return this.parsedAddress.map((part) => parseInt(part, 10)).join('.'); - } - /** - * Converts a hex string to an IPv4 address object - * @memberof Address4 - * @static - * @param {string} hex - a hex string to convert - * @returns {Address4} - */ - static fromHex(hex) { - const padded = hex.replace(/:/g, '').padStart(8, '0'); - const groups = []; - let i; - for (i = 0; i < 8; i += 2) { - const h = padded.slice(i, i + 2); - groups.push(parseInt(h, 16)); - } - return new Address4(groups.join('.')); - } - /** - * Converts an integer into a IPv4 address object - * @memberof Address4 - * @static - * @param {integer} integer - a number to convert - * @returns {Address4} - */ - static fromInteger(integer) { - return Address4.fromHex(integer.toString(16)); - } - /** - * Return an address from in-addr.arpa form - * @memberof Address4 - * @static - * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address - * @returns {Adress4} - * @example - * var address = Address4.fromArpa(42.2.0.192.in-addr.arpa.) - * address.correctForm(); // '192.0.2.42' - */ - static fromArpa(arpaFormAddress) { - // remove ending ".in-addr.arpa." or just "." - const leader = arpaFormAddress.replace(/(\.in-addr\.arpa)?\.$/, ''); - const address = leader.split('.').reverse().join('.'); - return new Address4(address); - } - /** - * Converts an IPv4 address object to a hex string - * @memberof Address4 - * @instance - * @returns {String} - */ - toHex() { - return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(':'); - } - /** - * Converts an IPv4 address object to an array of bytes - * @memberof Address4 - * @instance - * @returns {Array} - */ - toArray() { - return this.parsedAddress.map((part) => parseInt(part, 10)); - } - /** - * Converts an IPv4 address object to an IPv6 address group - * @memberof Address4 - * @instance - * @returns {String} - */ - toGroup6() { - const output = []; - let i; - for (i = 0; i < constants.GROUPS; i += 2) { - output.push(`${common.stringToPaddedHex(this.parsedAddress[i])}${common.stringToPaddedHex(this.parsedAddress[i + 1])}`); - } - return output.join(':'); - } - /** - * Returns the address as a `bigint` - * @memberof Address4 - * @instance - * @returns {bigint} - */ - bigInt() { - return BigInt(`0x${this.parsedAddress.map((n) => common.stringToPaddedHex(n)).join('')}`); - } - /** - * Helper function getting start address. - * @memberof Address4 - * @instance - * @returns {bigint} - */ - _startAddress() { - return BigInt(`0b${this.mask() + '0'.repeat(constants.BITS - this.subnetMask)}`); - } - /** - * The first address in the range given by this address' subnet. - * Often referred to as the Network Address. - * @memberof Address4 - * @instance - * @returns {Address4} - */ - startAddress() { - return Address4.fromBigInt(this._startAddress()); - } - /** - * The first host address in the range given by this address's subnet ie - * the first address after the Network Address - * @memberof Address4 - * @instance - * @returns {Address4} - */ - startAddressExclusive() { - const adjust = BigInt('1'); - return Address4.fromBigInt(this._startAddress() + adjust); - } - /** - * Helper function getting end address. - * @memberof Address4 - * @instance - * @returns {bigint} - */ - _endAddress() { - return BigInt(`0b${this.mask() + '1'.repeat(constants.BITS - this.subnetMask)}`); - } - /** - * The last address in the range given by this address' subnet - * Often referred to as the Broadcast - * @memberof Address4 - * @instance - * @returns {Address4} - */ - endAddress() { - return Address4.fromBigInt(this._endAddress()); - } - /** - * The last host address in the range given by this address's subnet ie - * the last address prior to the Broadcast Address - * @memberof Address4 - * @instance - * @returns {Address4} - */ - endAddressExclusive() { - const adjust = BigInt('1'); - return Address4.fromBigInt(this._endAddress() - adjust); - } - /** - * Converts a BigInt to a v4 address object - * @memberof Address4 - * @static - * @param {bigint} bigInt - a BigInt to convert - * @returns {Address4} - */ - static fromBigInt(bigInt) { - return Address4.fromHex(bigInt.toString(16)); - } - /** - * Returns the first n bits of the address, defaulting to the - * subnet mask - * @memberof Address4 - * @instance - * @returns {String} - */ - mask(mask) { - if (mask === undefined) { - mask = this.subnetMask; - } - return this.getBitsBase2(0, mask); - } - /** - * Returns the bits in the given range as a base-2 string - * @memberof Address4 - * @instance - * @returns {string} - */ - getBitsBase2(start, end) { - return this.binaryZeroPad().slice(start, end); - } - /** - * Return the reversed ip6.arpa form of the address - * @memberof Address4 - * @param {Object} options - * @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix - * @instance - * @returns {String} - */ - reverseForm(options) { - if (!options) { - options = {}; - } - const reversed = this.correctForm().split('.').reverse().join('.'); - if (options.omitSuffix) { - return reversed; - } - return `${reversed}.in-addr.arpa.`; - } - /** - * Returns true if the given address is a multicast address - * @memberof Address4 - * @instance - * @returns {boolean} - */ - isMulticast() { - return this.isInSubnet(new Address4('224.0.0.0/4')); - } - /** - * Returns a zero-padded base-2 string representation of the address - * @memberof Address4 - * @instance - * @returns {string} - */ - binaryZeroPad() { - return this.bigInt().toString(2).padStart(constants.BITS, '0'); - } - /** - * Groups an IPv4 address for inclusion at the end of an IPv6 address - * @returns {String} - */ - groupForV6() { - const segments = this.parsedAddress; - return this.address.replace(constants.RE_ADDRESS, `${segments - .slice(0, 2) - .join('.')}.${segments - .slice(2, 4) - .join('.')}`); - } -} -exports.Address4 = Address4; -//# sourceMappingURL=ipv4.js.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/ipv4.js.map b/node_modules/ip-address/dist/ipv4.js.map deleted file mode 100644 index bb1ea2f..0000000 --- a/node_modules/ip-address/dist/ipv4.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ipv4.js","sourceRoot":"","sources":["../src/ipv4.ts"],"names":[],"mappings":";AAAA,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,iDAAmC;AACnC,0DAA4C;AAC5C,mDAA+C;AAE/C;;;;GAIG;AACH,MAAa,QAAQ;IAUnB,YAAY,OAAe;QAP3B,WAAM,GAAW,SAAS,CAAC,MAAM,CAAC;QAClC,kBAAa,GAAa,EAAE,CAAC;QAC7B,iBAAY,GAAW,EAAE,CAAC;QAC1B,WAAM,GAAW,KAAK,CAAC;QACvB,eAAU,GAAW,EAAE,CAAC;QACxB,OAAE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CAAC,CAAC;aACX,IAAI,CAAC,GAAG,CAAC,sDAAsD,QAAQ;aACvE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;aACX,IAAI,CAAC,GAAG,CAAC,SAAS,CACtB,CAAC;IACJ,CAAC;CACF;AAxVD,4BAwVC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/ipv6.d.ts b/node_modules/ip-address/dist/ipv6.d.ts deleted file mode 100644 index 2a7c7e0..0000000 --- a/node_modules/ip-address/dist/ipv6.d.ts +++ /dev/null @@ -1,428 +0,0 @@ -import * as common from './common'; -import { Address4 } from './ipv4'; -interface SixToFourProperties { - prefix: string; - gateway: string; -} -interface TeredoProperties { - prefix: string; - server4: string; - client4: string; - flags: string; - coneNat: boolean; - microsoft: { - reserved: boolean; - universalLocal: boolean; - groupIndividual: boolean; - nonce: string; - }; - udpPort: string; -} -/** - * Represents an IPv6 address - * @class Address6 - * @param {string} address - An IPv6 address string - * @param {number} [groups=8] - How many octets to parse - * @example - * var address = new Address6('2001::/32'); - */ -export declare class Address6 { - address4?: Address4; - address: string; - addressMinusSuffix: string; - elidedGroups?: number; - elisionBegin?: number; - elisionEnd?: number; - groups: number; - parsedAddress4?: string; - parsedAddress: string[]; - parsedSubnet: string; - subnet: string; - subnetMask: number; - v4: boolean; - zone: string; - constructor(address: string, optionalGroups?: number); - static isValid(address: string): boolean; - /** - * Convert a BigInt to a v6 address object - * @memberof Address6 - * @static - * @param {bigint} bigInt - a BigInt to convert - * @returns {Address6} - * @example - * var bigInt = BigInt('1000000000000'); - * var address = Address6.fromBigInt(bigInt); - * address.correctForm(); // '::e8:d4a5:1000' - */ - static fromBigInt(bigInt: bigint): Address6; - /** - * Convert a URL (with optional port number) to an address object - * @memberof Address6 - * @static - * @param {string} url - a URL with optional port number - * @example - * var addressAndPort = Address6.fromURL('http://[ffff::]:8080/foo/'); - * addressAndPort.address.correctForm(); // 'ffff::' - * addressAndPort.port; // 8080 - */ - static fromURL(url: string): { - error: string; - address: null; - port: null; - } | { - address: Address6; - port: number | null; - error?: undefined; - }; - /** - * Create an IPv6-mapped address given an IPv4 address - * @memberof Address6 - * @static - * @param {string} address - An IPv4 address string - * @returns {Address6} - * @example - * var address = Address6.fromAddress4('192.168.0.1'); - * address.correctForm(); // '::ffff:c0a8:1' - * address.to4in6(); // '::ffff:192.168.0.1' - */ - static fromAddress4(address: string): Address6; - /** - * Return an address from ip6.arpa form - * @memberof Address6 - * @static - * @param {string} arpaFormAddress - an 'ip6.arpa' form address - * @returns {Adress6} - * @example - * var address = Address6.fromArpa(e.f.f.f.3.c.2.6.f.f.f.e.6.6.8.e.1.0.6.7.9.4.e.c.0.0.0.0.1.0.0.2.ip6.arpa.) - * address.correctForm(); // '2001:0:ce49:7601:e866:efff:62c3:fffe' - */ - static fromArpa(arpaFormAddress: string): Address6; - /** - * Return the Microsoft UNC transcription of the address - * @memberof Address6 - * @instance - * @returns {String} the Microsoft UNC transcription of the address - */ - microsoftTranscription(): string; - /** - * Return the first n bits of the address, defaulting to the subnet mask - * @memberof Address6 - * @instance - * @param {number} [mask=subnet] - the number of bits to mask - * @returns {String} the first n bits of the address as a string - */ - mask(mask?: number): string; - /** - * Return the number of possible subnets of a given size in the address - * @memberof Address6 - * @instance - * @param {number} [subnetSize=128] - the subnet size - * @returns {String} - */ - possibleSubnets(subnetSize?: number): string; - /** - * Helper function getting start address. - * @memberof Address6 - * @instance - * @returns {bigint} - */ - _startAddress(): bigint; - /** - * The first address in the range given by this address' subnet - * Often referred to as the Network Address. - * @memberof Address6 - * @instance - * @returns {Address6} - */ - startAddress(): Address6; - /** - * The first host address in the range given by this address's subnet ie - * the first address after the Network Address - * @memberof Address6 - * @instance - * @returns {Address6} - */ - startAddressExclusive(): Address6; - /** - * Helper function getting end address. - * @memberof Address6 - * @instance - * @returns {bigint} - */ - _endAddress(): bigint; - /** - * The last address in the range given by this address' subnet - * Often referred to as the Broadcast - * @memberof Address6 - * @instance - * @returns {Address6} - */ - endAddress(): Address6; - /** - * The last host address in the range given by this address's subnet ie - * the last address prior to the Broadcast Address - * @memberof Address6 - * @instance - * @returns {Address6} - */ - endAddressExclusive(): Address6; - /** - * Return the scope of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - getScope(): string; - /** - * Return the type of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - getType(): string; - /** - * Return the bits in the given range as a BigInt - * @memberof Address6 - * @instance - * @returns {bigint} - */ - getBits(start: number, end: number): bigint; - /** - * Return the bits in the given range as a base-2 string - * @memberof Address6 - * @instance - * @returns {String} - */ - getBitsBase2(start: number, end: number): string; - /** - * Return the bits in the given range as a base-16 string - * @memberof Address6 - * @instance - * @returns {String} - */ - getBitsBase16(start: number, end: number): string; - /** - * Return the bits that are set past the subnet mask length - * @memberof Address6 - * @instance - * @returns {String} - */ - getBitsPastSubnet(): string; - /** - * Return the reversed ip6.arpa form of the address - * @memberof Address6 - * @param {Object} options - * @param {boolean} options.omitSuffix - omit the "ip6.arpa" suffix - * @instance - * @returns {String} - */ - reverseForm(options?: common.ReverseFormOptions): string; - /** - * Return the correct form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - correctForm(): string; - /** - * Return a zero-padded base-2 string representation of the address - * @memberof Address6 - * @instance - * @returns {String} - * @example - * var address = new Address6('2001:4860:4001:803::1011'); - * address.binaryZeroPad(); - * // '0010000000000001010010000110000001000000000000010000100000000011 - * // 0000000000000000000000000000000000000000000000000001000000010001' - */ - binaryZeroPad(): string; - parse4in6(address: string): string; - parse(address: string): string[]; - /** - * Return the canonical form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - canonicalForm(): string; - /** - * Return the decimal form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - decimal(): string; - /** - * Return the address as a BigInt - * @memberof Address6 - * @instance - * @returns {bigint} - */ - bigInt(): bigint; - /** - * Return the last two groups of this address as an IPv4 address string - * @memberof Address6 - * @instance - * @returns {Address4} - * @example - * var address = new Address6('2001:4860:4001::1825:bf11'); - * address.to4().correctForm(); // '24.37.191.17' - */ - to4(): Address4; - /** - * Return the v4-in-v6 form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - to4in6(): string; - /** - * Return an object containing the Teredo properties of the address - * @memberof Address6 - * @instance - * @returns {Object} - */ - inspectTeredo(): TeredoProperties; - /** - * Return an object containing the 6to4 properties of the address - * @memberof Address6 - * @instance - * @returns {Object} - */ - inspect6to4(): SixToFourProperties; - /** - * Return a v6 6to4 address from a v6 v4inv6 address - * @memberof Address6 - * @instance - * @returns {Address6} - */ - to6to4(): Address6 | null; - /** - * Return a byte array - * @memberof Address6 - * @instance - * @returns {Array} - */ - toByteArray(): number[]; - /** - * Return an unsigned byte array - * @memberof Address6 - * @instance - * @returns {Array} - */ - toUnsignedByteArray(): number[]; - /** - * Convert a byte array to an Address6 object - * @memberof Address6 - * @static - * @returns {Address6} - */ - static fromByteArray(bytes: Array): Address6; - /** - * Convert an unsigned byte array to an Address6 object - * @memberof Address6 - * @static - * @returns {Address6} - */ - static fromUnsignedByteArray(bytes: Array): Address6; - /** - * Returns true if the given address is in the subnet of the current address - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isInSubnet: typeof common.isInSubnet; - /** - * Returns true if the address is correct, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isCorrect: (this: Address4 | Address6) => boolean; - /** - * Returns true if the address is in the canonical form, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isCanonical(): boolean; - /** - * Returns true if the address is a link local address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isLinkLocal(): boolean; - /** - * Returns true if the address is a multicast address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isMulticast(): boolean; - /** - * Returns true if the address is a v4-in-v6 address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - is4(): boolean; - /** - * Returns true if the address is a Teredo address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isTeredo(): boolean; - /** - * Returns true if the address is a 6to4 address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - is6to4(): boolean; - /** - * Returns true if the address is a loopback address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isLoopback(): boolean; - /** - * @returns {String} the address in link form with a default port of 80 - */ - href(optionalPort?: number | string): string; - /** - * @returns {String} a link suitable for conveying the address via a URL hash - */ - link(options?: { - className?: string; - prefix?: string; - v4?: boolean; - }): string; - /** - * Groups an address - * @returns {String} - */ - group(): string; - /** - * Generate a regular expression string that can be used to find or validate - * all variations of this address - * @memberof Address6 - * @instance - * @param {boolean} substringSearch - * @returns {string} - */ - regularExpressionString(this: Address6, substringSearch?: boolean): string; - /** - * Generate a regular expression that can be used to find or validate all - * variations of this address. - * @memberof Address6 - * @instance - * @param {boolean} substringSearch - * @returns {RegExp} - */ - regularExpression(this: Address6, substringSearch?: boolean): RegExp; -} -export {}; -//# sourceMappingURL=ipv6.d.ts.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/ipv6.d.ts.map b/node_modules/ip-address/dist/ipv6.d.ts.map deleted file mode 100644 index 37ead6a..0000000 --- a/node_modules/ip-address/dist/ipv6.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ipv6.d.ts","sourceRoot":"","sources":["../src/ipv6.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAInC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AA4DlC,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE;QACT,QAAQ,EAAE,OAAO,CAAC;QAClB,cAAc,EAAE,OAAO,CAAC;QACxB,eA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b/node_modules/ip-address/dist/ipv6.js deleted file mode 100644 index 5f88ab6..0000000 --- a/node_modules/ip-address/dist/ipv6.js +++ /dev/null @@ -1,1003 +0,0 @@ -"use strict"; -/* eslint-disable prefer-destructuring */ -/* eslint-disable no-param-reassign */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Address6 = void 0; -const common = __importStar(require("./common")); -const constants4 = __importStar(require("./v4/constants")); -const constants6 = __importStar(require("./v6/constants")); -const helpers = __importStar(require("./v6/helpers")); -const ipv4_1 = require("./ipv4"); -const regular_expressions_1 = require("./v6/regular-expressions"); -const address_error_1 = require("./address-error"); -const common_1 = require("./common"); -function assert(condition) { - if (!condition) { - throw new Error('Assertion failed.'); - } -} -function addCommas(number) { - const r = /(\d+)(\d{3})/; - while (r.test(number)) { - number = number.replace(r, '$1,$2'); - } - return number; -} -function spanLeadingZeroes4(n) { - n = n.replace(/^(0{1,})([1-9]+)$/, '$1$2'); - n = n.replace(/^(0{1,})(0)$/, '$1$2'); - return n; -} -/* - * A helper function to compact an array - */ -function compact(address, slice) { - const s1 = []; - const s2 = []; - let i; - for (i = 0; i < address.length; i++) { - if (i < slice[0]) { - s1.push(address[i]); - } - else if (i > slice[1]) { - s2.push(address[i]); - } - } - return s1.concat(['compact']).concat(s2); -} -function paddedHex(octet) { - return parseInt(octet, 16).toString(16).padStart(4, '0'); -} -function unsignByte(b) { - // eslint-disable-next-line no-bitwise - return b & 0xff; -} -/** - * Represents an IPv6 address - * @class Address6 - * @param {string} address - An IPv6 address string - * @param {number} [groups=8] - How many octets to parse - * @example - * var address = new Address6('2001::/32'); - */ -class Address6 { - constructor(address, optionalGroups) { - this.addressMinusSuffix = ''; - this.parsedSubnet = ''; - this.subnet = '/128'; - this.subnetMask = 128; - this.v4 = false; - this.zone = ''; - // #region Attributes - /** - * Returns true if the given address is in the subnet of the current address - * @memberof Address6 - * @instance - * @returns {boolean} - */ - this.isInSubnet = common.isInSubnet; - /** - * Returns true if the address is correct, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - this.isCorrect = common.isCorrect(constants6.BITS); - if (optionalGroups === undefined) { - this.groups = constants6.GROUPS; - } - else { - this.groups = optionalGroups; - } - this.address = address; - const subnet = constants6.RE_SUBNET_STRING.exec(address); - if (subnet) { - this.parsedSubnet = subnet[0].replace('/', ''); - this.subnetMask = parseInt(this.parsedSubnet, 10); - this.subnet = `/${this.subnetMask}`; - if (Number.isNaN(this.subnetMask) || - this.subnetMask < 0 || - this.subnetMask > constants6.BITS) { - throw new address_error_1.AddressError('Invalid subnet mask.'); - } - address = address.replace(constants6.RE_SUBNET_STRING, ''); - } - else if (/\//.test(address)) { - throw new address_error_1.AddressError('Invalid subnet mask.'); - } - const zone = constants6.RE_ZONE_STRING.exec(address); - if (zone) { - this.zone = zone[0]; - address = address.replace(constants6.RE_ZONE_STRING, ''); - } - this.addressMinusSuffix = address; - this.parsedAddress = this.parse(this.addressMinusSuffix); - } - static isValid(address) { - try { - // eslint-disable-next-line no-new - new Address6(address); - return true; - } - catch (e) { - return false; - } - } - /** - * Convert a BigInt to a v6 address object - * @memberof Address6 - * @static - * @param {bigint} bigInt - a BigInt to convert - * @returns {Address6} - * @example - * var bigInt = BigInt('1000000000000'); - * var address = Address6.fromBigInt(bigInt); - * address.correctForm(); // '::e8:d4a5:1000' - */ - static fromBigInt(bigInt) { - const hex = bigInt.toString(16).padStart(32, '0'); - const groups = []; - let i; - for (i = 0; i < constants6.GROUPS; i++) { - groups.push(hex.slice(i * 4, (i + 1) * 4)); - } - return new Address6(groups.join(':')); - } - /** - * Convert a URL (with optional port number) to an address object - * @memberof Address6 - * @static - * @param {string} url - a URL with optional port number - * @example - * var addressAndPort = Address6.fromURL('http://[ffff::]:8080/foo/'); - * addressAndPort.address.correctForm(); // 'ffff::' - * addressAndPort.port; // 8080 - */ - static fromURL(url) { - let host; - let port = null; - let result; - // If we have brackets parse them and find a port - if (url.indexOf('[') !== -1 && url.indexOf(']:') !== -1) { - result = constants6.RE_URL_WITH_PORT.exec(url); - if (result === null) { - return { - error: 'failed to parse address with port', - address: null, - port: null, - }; - } - host = result[1]; - port = result[2]; - // If there's a URL extract the address - } - else if (url.indexOf('/') !== -1) { - // Remove the protocol prefix - url = url.replace(/^[a-z0-9]+:\/\//, ''); - // Parse the address - result = constants6.RE_URL.exec(url); - if (result === null) { - return { - error: 'failed to parse address from URL', - address: null, - port: null, - }; - } - host = result[1]; - // Otherwise just assign the URL to the host and let the library parse it - } - else { - host = url; - } - // If there's a port convert it to an integer - if (port) { - port = parseInt(port, 10); - // squelch out of range ports - if (port < 0 || port > 65536) { - port = null; - } - } - else { - // Standardize `undefined` to `null` - port = null; - } - return { - address: new Address6(host), - port, - }; - } - /** - * Create an IPv6-mapped address given an IPv4 address - * @memberof Address6 - * @static - * @param {string} address - An IPv4 address string - * @returns {Address6} - * @example - * var address = Address6.fromAddress4('192.168.0.1'); - * address.correctForm(); // '::ffff:c0a8:1' - * address.to4in6(); // '::ffff:192.168.0.1' - */ - static fromAddress4(address) { - const address4 = new ipv4_1.Address4(address); - const mask6 = constants6.BITS - (constants4.BITS - address4.subnetMask); - return new Address6(`::ffff:${address4.correctForm()}/${mask6}`); - } - /** - * Return an address from ip6.arpa form - * @memberof Address6 - * @static - * @param {string} arpaFormAddress - an 'ip6.arpa' form address - * @returns {Adress6} - * @example - * var address = Address6.fromArpa(e.f.f.f.3.c.2.6.f.f.f.e.6.6.8.e.1.0.6.7.9.4.e.c.0.0.0.0.1.0.0.2.ip6.arpa.) - * address.correctForm(); // '2001:0:ce49:7601:e866:efff:62c3:fffe' - */ - static fromArpa(arpaFormAddress) { - // remove ending ".ip6.arpa." or just "." - let address = arpaFormAddress.replace(/(\.ip6\.arpa)?\.$/, ''); - const semicolonAmount = 7; - // correct ip6.arpa form with ending removed will be 63 characters - if (address.length !== 63) { - throw new address_error_1.AddressError("Invalid 'ip6.arpa' form."); - } - const parts = address.split('.').reverse(); - for (let i = semicolonAmount; i > 0; i--) { - const insertIndex = i * 4; - parts.splice(insertIndex, 0, ':'); - } - address = parts.join(''); - return new Address6(address); - } - /** - * Return the Microsoft UNC transcription of the address - * @memberof Address6 - * @instance - * @returns {String} the Microsoft UNC transcription of the address - */ - microsoftTranscription() { - return `${this.correctForm().replace(/:/g, '-')}.ipv6-literal.net`; - } - /** - * Return the first n bits of the address, defaulting to the subnet mask - * @memberof Address6 - * @instance - * @param {number} [mask=subnet] - the number of bits to mask - * @returns {String} the first n bits of the address as a string - */ - mask(mask = this.subnetMask) { - return this.getBitsBase2(0, mask); - } - /** - * Return the number of possible subnets of a given size in the address - * @memberof Address6 - * @instance - * @param {number} [subnetSize=128] - the subnet size - * @returns {String} - */ - // TODO: probably useful to have a numeric version of this too - possibleSubnets(subnetSize = 128) { - const availableBits = constants6.BITS - this.subnetMask; - const subnetBits = Math.abs(subnetSize - constants6.BITS); - const subnetPowers = availableBits - subnetBits; - if (subnetPowers < 0) { - return '0'; - } - return addCommas((BigInt('2') ** BigInt(subnetPowers)).toString(10)); - } - /** - * Helper function getting start address. - * @memberof Address6 - * @instance - * @returns {bigint} - */ - _startAddress() { - return BigInt(`0b${this.mask() + '0'.repeat(constants6.BITS - this.subnetMask)}`); - } - /** - * The first address in the range given by this address' subnet - * Often referred to as the Network Address. - * @memberof Address6 - * @instance - * @returns {Address6} - */ - startAddress() { - return Address6.fromBigInt(this._startAddress()); - } - /** - * The first host address in the range given by this address's subnet ie - * the first address after the Network Address - * @memberof Address6 - * @instance - * @returns {Address6} - */ - startAddressExclusive() { - const adjust = BigInt('1'); - return Address6.fromBigInt(this._startAddress() + adjust); - } - /** - * Helper function getting end address. - * @memberof Address6 - * @instance - * @returns {bigint} - */ - _endAddress() { - return BigInt(`0b${this.mask() + '1'.repeat(constants6.BITS - this.subnetMask)}`); - } - /** - * The last address in the range given by this address' subnet - * Often referred to as the Broadcast - * @memberof Address6 - * @instance - * @returns {Address6} - */ - endAddress() { - return Address6.fromBigInt(this._endAddress()); - } - /** - * The last host address in the range given by this address's subnet ie - * the last address prior to the Broadcast Address - * @memberof Address6 - * @instance - * @returns {Address6} - */ - endAddressExclusive() { - const adjust = BigInt('1'); - return Address6.fromBigInt(this._endAddress() - adjust); - } - /** - * Return the scope of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - getScope() { - let scope = constants6.SCOPES[parseInt(this.getBits(12, 16).toString(10), 10)]; - if (this.getType() === 'Global unicast' && scope !== 'Link local') { - scope = 'Global'; - } - return scope || 'Unknown'; - } - /** - * Return the type of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - getType() { - for (const subnet of Object.keys(constants6.TYPES)) { - if (this.isInSubnet(new Address6(subnet))) { - return constants6.TYPES[subnet]; - } - } - return 'Global unicast'; - } - /** - * Return the bits in the given range as a BigInt - * @memberof Address6 - * @instance - * @returns {bigint} - */ - getBits(start, end) { - return BigInt(`0b${this.getBitsBase2(start, end)}`); - } - /** - * Return the bits in the given range as a base-2 string - * @memberof Address6 - * @instance - * @returns {String} - */ - getBitsBase2(start, end) { - return this.binaryZeroPad().slice(start, end); - } - /** - * Return the bits in the given range as a base-16 string - * @memberof Address6 - * @instance - * @returns {String} - */ - getBitsBase16(start, end) { - const length = end - start; - if (length % 4 !== 0) { - throw new Error('Length of bits to retrieve must be divisible by four'); - } - return this.getBits(start, end) - .toString(16) - .padStart(length / 4, '0'); - } - /** - * Return the bits that are set past the subnet mask length - * @memberof Address6 - * @instance - * @returns {String} - */ - getBitsPastSubnet() { - return this.getBitsBase2(this.subnetMask, constants6.BITS); - } - /** - * Return the reversed ip6.arpa form of the address - * @memberof Address6 - * @param {Object} options - * @param {boolean} options.omitSuffix - omit the "ip6.arpa" suffix - * @instance - * @returns {String} - */ - reverseForm(options) { - if (!options) { - options = {}; - } - const characters = Math.floor(this.subnetMask / 4); - const reversed = this.canonicalForm() - .replace(/:/g, '') - .split('') - .slice(0, characters) - .reverse() - .join('.'); - if (characters > 0) { - if (options.omitSuffix) { - return reversed; - } - return `${reversed}.ip6.arpa.`; - } - if (options.omitSuffix) { - return ''; - } - return 'ip6.arpa.'; - } - /** - * Return the correct form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - correctForm() { - let i; - let groups = []; - let zeroCounter = 0; - const zeroes = []; - for (i = 0; i < this.parsedAddress.length; i++) { - const value = parseInt(this.parsedAddress[i], 16); - if (value === 0) { - zeroCounter++; - } - if (value !== 0 && zeroCounter > 0) { - if (zeroCounter > 1) { - zeroes.push([i - zeroCounter, i - 1]); - } - zeroCounter = 0; - } - } - // Do we end with a string of zeroes? - if (zeroCounter > 1) { - zeroes.push([this.parsedAddress.length - zeroCounter, this.parsedAddress.length - 1]); - } - const zeroLengths = zeroes.map((n) => n[1] - n[0] + 1); - if (zeroes.length > 0) { - const index = zeroLengths.indexOf(Math.max(...zeroLengths)); - groups = compact(this.parsedAddress, zeroes[index]); - } - else { - groups = this.parsedAddress; - } - for (i = 0; i < groups.length; i++) { - if (groups[i] !== 'compact') { - groups[i] = parseInt(groups[i], 16).toString(16); - } - } - let correct = groups.join(':'); - correct = correct.replace(/^compact$/, '::'); - correct = correct.replace(/(^compact)|(compact$)/, ':'); - correct = correct.replace(/compact/, ''); - return correct; - } - /** - * Return a zero-padded base-2 string representation of the address - * @memberof Address6 - * @instance - * @returns {String} - * @example - * var address = new Address6('2001:4860:4001:803::1011'); - * address.binaryZeroPad(); - * // '0010000000000001010010000110000001000000000000010000100000000011 - * // 0000000000000000000000000000000000000000000000000001000000010001' - */ - binaryZeroPad() { - return this.bigInt().toString(2).padStart(constants6.BITS, '0'); - } - // TODO: Improve the semantics of this helper function - parse4in6(address) { - const groups = address.split(':'); - const lastGroup = groups.slice(-1)[0]; - const address4 = lastGroup.match(constants4.RE_ADDRESS); - if (address4) { - this.parsedAddress4 = address4[0]; - this.address4 = new ipv4_1.Address4(this.parsedAddress4); - for (let i = 0; i < this.address4.groups; i++) { - if (/^0[0-9]+/.test(this.address4.parsedAddress[i])) { - throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", address.replace(constants4.RE_ADDRESS, this.address4.parsedAddress.map(spanLeadingZeroes4).join('.'))); - } - } - this.v4 = true; - groups[groups.length - 1] = this.address4.toGroup6(); - address = groups.join(':'); - } - return address; - } - // TODO: Make private? - parse(address) { - address = this.parse4in6(address); - const badCharacters = address.match(constants6.RE_BAD_CHARACTERS); - if (badCharacters) { - throw new address_error_1.AddressError(`Bad character${badCharacters.length > 1 ? 's' : ''} detected in address: ${badCharacters.join('')}`, address.replace(constants6.RE_BAD_CHARACTERS, '$1')); - } - const badAddress = address.match(constants6.RE_BAD_ADDRESS); - if (badAddress) { - throw new address_error_1.AddressError(`Address failed regex: ${badAddress.join('')}`, address.replace(constants6.RE_BAD_ADDRESS, '$1')); - } - let groups = []; - const halves = address.split('::'); - if (halves.length === 2) { - let first = halves[0].split(':'); - let last = halves[1].split(':'); - if (first.length === 1 && first[0] === '') { - first = []; - } - if (last.length === 1 && last[0] === '') { - last = []; - } - const remaining = this.groups - (first.length + last.length); - if (!remaining) { - throw new address_error_1.AddressError('Error parsing groups'); - } - this.elidedGroups = remaining; - this.elisionBegin = first.length; - this.elisionEnd = first.length + this.elidedGroups; - groups = groups.concat(first); - for (let i = 0; i < remaining; i++) { - groups.push('0'); - } - groups = groups.concat(last); - } - else if (halves.length === 1) { - groups = address.split(':'); - this.elidedGroups = 0; - } - else { - throw new address_error_1.AddressError('Too many :: groups found'); - } - groups = groups.map((group) => parseInt(group, 16).toString(16)); - if (groups.length !== this.groups) { - throw new address_error_1.AddressError('Incorrect number of groups found'); - } - return groups; - } - /** - * Return the canonical form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - canonicalForm() { - return this.parsedAddress.map(paddedHex).join(':'); - } - /** - * Return the decimal form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - decimal() { - return this.parsedAddress.map((n) => parseInt(n, 16).toString(10).padStart(5, '0')).join(':'); - } - /** - * Return the address as a BigInt - * @memberof Address6 - * @instance - * @returns {bigint} - */ - bigInt() { - return BigInt(`0x${this.parsedAddress.map(paddedHex).join('')}`); - } - /** - * Return the last two groups of this address as an IPv4 address string - * @memberof Address6 - * @instance - * @returns {Address4} - * @example - * var address = new Address6('2001:4860:4001::1825:bf11'); - * address.to4().correctForm(); // '24.37.191.17' - */ - to4() { - const binary = this.binaryZeroPad().split(''); - return ipv4_1.Address4.fromHex(BigInt(`0b${binary.slice(96, 128).join('')}`).toString(16)); - } - /** - * Return the v4-in-v6 form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - to4in6() { - const address4 = this.to4(); - const address6 = new Address6(this.parsedAddress.slice(0, 6).join(':'), 6); - const correct = address6.correctForm(); - let infix = ''; - if (!/:$/.test(correct)) { - infix = ':'; - } - return correct + infix + address4.address; - } - /** - * Return an object containing the Teredo properties of the address - * @memberof Address6 - * @instance - * @returns {Object} - */ - inspectTeredo() { - /* - - Bits 0 to 31 are set to the Teredo prefix (normally 2001:0000::/32). - - Bits 32 to 63 embed the primary IPv4 address of the Teredo server that - is used. - - Bits 64 to 79 can be used to define some flags. Currently only the - higher order bit is used; it is set to 1 if the Teredo client is - located behind a cone NAT, 0 otherwise. For Microsoft's Windows Vista - and Windows Server 2008 implementations, more bits are used. In those - implementations, the format for these 16 bits is "CRAAAAUG AAAAAAAA", - where "C" remains the "Cone" flag. The "R" bit is reserved for future - use. The "U" bit is for the Universal/Local flag (set to 0). The "G" bit - is Individual/Group flag (set to 0). The A bits are set to a 12-bit - randomly generated number chosen by the Teredo client to introduce - additional protection for the Teredo node against IPv6-based scanning - attacks. - - Bits 80 to 95 contains the obfuscated UDP port number. This is the - port number that is mapped by the NAT to the Teredo client with all - bits inverted. - - Bits 96 to 127 contains the obfuscated IPv4 address. This is the - public IPv4 address of the NAT with all bits inverted. - */ - const prefix = this.getBitsBase16(0, 32); - const bitsForUdpPort = this.getBits(80, 96); - // eslint-disable-next-line no-bitwise - const udpPort = (bitsForUdpPort ^ BigInt('0xffff')).toString(); - const server4 = ipv4_1.Address4.fromHex(this.getBitsBase16(32, 64)); - const bitsForClient4 = this.getBits(96, 128); - // eslint-disable-next-line no-bitwise - const client4 = ipv4_1.Address4.fromHex((bitsForClient4 ^ BigInt('0xffffffff')).toString(16)); - const flagsBase2 = this.getBitsBase2(64, 80); - const coneNat = (0, common_1.testBit)(flagsBase2, 15); - const reserved = (0, common_1.testBit)(flagsBase2, 14); - const groupIndividual = (0, common_1.testBit)(flagsBase2, 8); - const universalLocal = (0, common_1.testBit)(flagsBase2, 9); - const nonce = BigInt(`0b${flagsBase2.slice(2, 6) + flagsBase2.slice(8, 16)}`).toString(10); - return { - prefix: `${prefix.slice(0, 4)}:${prefix.slice(4, 8)}`, - server4: server4.address, - client4: client4.address, - flags: flagsBase2, - coneNat, - microsoft: { - reserved, - universalLocal, - groupIndividual, - nonce, - }, - udpPort, - }; - } - /** - * Return an object containing the 6to4 properties of the address - * @memberof Address6 - * @instance - * @returns {Object} - */ - inspect6to4() { - /* - - Bits 0 to 15 are set to the 6to4 prefix (2002::/16). - - Bits 16 to 48 embed the IPv4 address of the 6to4 gateway that is used. - */ - const prefix = this.getBitsBase16(0, 16); - const gateway = ipv4_1.Address4.fromHex(this.getBitsBase16(16, 48)); - return { - prefix: prefix.slice(0, 4), - gateway: gateway.address, - }; - } - /** - * Return a v6 6to4 address from a v6 v4inv6 address - * @memberof Address6 - * @instance - * @returns {Address6} - */ - to6to4() { - if (!this.is4()) { - return null; - } - const addr6to4 = [ - '2002', - this.getBitsBase16(96, 112), - this.getBitsBase16(112, 128), - '', - '/16', - ].join(':'); - return new Address6(addr6to4); - } - /** - * Return a byte array - * @memberof Address6 - * @instance - * @returns {Array} - */ - toByteArray() { - const valueWithoutPadding = this.bigInt().toString(16); - const leadingPad = '0'.repeat(valueWithoutPadding.length % 2); - const value = `${leadingPad}${valueWithoutPadding}`; - const bytes = []; - for (let i = 0, length = value.length; i < length; i += 2) { - bytes.push(parseInt(value.substring(i, i + 2), 16)); - } - return bytes; - } - /** - * Return an unsigned byte array - * @memberof Address6 - * @instance - * @returns {Array} - */ - toUnsignedByteArray() { - return this.toByteArray().map(unsignByte); - } - /** - * Convert a byte array to an Address6 object - * @memberof Address6 - * @static - * @returns {Address6} - */ - static fromByteArray(bytes) { - return this.fromUnsignedByteArray(bytes.map(unsignByte)); - } - /** - * Convert an unsigned byte array to an Address6 object - * @memberof Address6 - * @static - * @returns {Address6} - */ - static fromUnsignedByteArray(bytes) { - const BYTE_MAX = BigInt('256'); - let result = BigInt('0'); - let multiplier = BigInt('1'); - for (let i = bytes.length - 1; i >= 0; i--) { - result += multiplier * BigInt(bytes[i].toString(10)); - multiplier *= BYTE_MAX; - } - return Address6.fromBigInt(result); - } - /** - * Returns true if the address is in the canonical form, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isCanonical() { - return this.addressMinusSuffix === this.canonicalForm(); - } - /** - * Returns true if the address is a link local address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isLinkLocal() { - // Zeroes are required, i.e. we can't check isInSubnet with 'fe80::/10' - if (this.getBitsBase2(0, 64) === - '1111111010000000000000000000000000000000000000000000000000000000') { - return true; - } - return false; - } - /** - * Returns true if the address is a multicast address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isMulticast() { - return this.getType() === 'Multicast'; - } - /** - * Returns true if the address is a v4-in-v6 address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - is4() { - return this.v4; - } - /** - * Returns true if the address is a Teredo address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isTeredo() { - return this.isInSubnet(new Address6('2001::/32')); - } - /** - * Returns true if the address is a 6to4 address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - is6to4() { - return this.isInSubnet(new Address6('2002::/16')); - } - /** - * Returns true if the address is a loopback address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isLoopback() { - return this.getType() === 'Loopback'; - } - // #endregion - // #region HTML - /** - * @returns {String} the address in link form with a default port of 80 - */ - href(optionalPort) { - if (optionalPort === undefined) { - optionalPort = ''; - } - else { - optionalPort = `:${optionalPort}`; - } - return `http://[${this.correctForm()}]${optionalPort}/`; - } - /** - * @returns {String} a link suitable for conveying the address via a URL hash - */ - link(options) { - if (!options) { - options = {}; - } - if (options.className === undefined) { - options.className = ''; - } - if (options.prefix === undefined) { - options.prefix = '/#address='; - } - if (options.v4 === undefined) { - options.v4 = false; - } - let formFunction = this.correctForm; - if (options.v4) { - formFunction = this.to4in6; - } - const form = formFunction.call(this); - if (options.className) { - return `${form}`; - } - return `${form}`; - } - /** - * Groups an address - * @returns {String} - */ - group() { - if (this.elidedGroups === 0) { - // The simple case - return helpers.simpleGroup(this.address).join(':'); - } - assert(typeof this.elidedGroups === 'number'); - assert(typeof this.elisionBegin === 'number'); - // The elided case - const output = []; - const [left, right] = this.address.split('::'); - if (left.length) { - output.push(...helpers.simpleGroup(left)); - } - else { - output.push(''); - } - const classes = ['hover-group']; - for (let i = this.elisionBegin; i < this.elisionBegin + this.elidedGroups; i++) { - classes.push(`group-${i}`); - } - output.push(``); - if (right.length) { - output.push(...helpers.simpleGroup(right, this.elisionEnd)); - } - else { - output.push(''); - } - if (this.is4()) { - assert(this.address4 instanceof ipv4_1.Address4); - output.pop(); - output.push(this.address4.groupForV6()); - } - return output.join(':'); - } - // #endregion - // #region Regular expressions - /** - * Generate a regular expression string that can be used to find or validate - * all variations of this address - * @memberof Address6 - * @instance - * @param {boolean} substringSearch - * @returns {string} - */ - regularExpressionString(substringSearch = false) { - let output = []; - // TODO: revisit why this is necessary - const address6 = new Address6(this.correctForm()); - if (address6.elidedGroups === 0) { - // The simple case - output.push((0, regular_expressions_1.simpleRegularExpression)(address6.parsedAddress)); - } - else if (address6.elidedGroups === constants6.GROUPS) { - // A completely elided address - output.push((0, regular_expressions_1.possibleElisions)(constants6.GROUPS)); - } - else { - // A partially elided address - const halves = address6.address.split('::'); - if (halves[0].length) { - output.push((0, regular_expressions_1.simpleRegularExpression)(halves[0].split(':'))); - } - assert(typeof address6.elidedGroups === 'number'); - output.push((0, regular_expressions_1.possibleElisions)(address6.elidedGroups, halves[0].length !== 0, halves[1].length !== 0)); - if (halves[1].length) { - output.push((0, regular_expressions_1.simpleRegularExpression)(halves[1].split(':'))); - } - output = [output.join(':')]; - } - if (!substringSearch) { - output = [ - '(?=^|', - regular_expressions_1.ADDRESS_BOUNDARY, - '|[^\\w\\:])(', - ...output, - ')(?=[^\\w\\:]|', - regular_expressions_1.ADDRESS_BOUNDARY, - '|$)', - ]; - } - return output.join(''); - } - /** - * Generate a regular expression that can be used to find or validate all - * variations of this address. - * @memberof Address6 - * @instance - * @param {boolean} substringSearch - * @returns {RegExp} - */ - regularExpression(substringSearch = false) { - return new RegExp(this.regularExpressionString(substringSearch), 'i'); - } -} -exports.Address6 = Address6; -//# sourceMappingURL=ipv6.js.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/ipv6.js.map b/node_modules/ip-address/dist/ipv6.js.map deleted file mode 100644 index 05d59a0..0000000 --- a/node_modules/ip-address/dist/ipv6.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ipv6.js","sourceRoot":"","sources":["../src/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AG,CAAC,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,GAAG;gBACP,OAAO;gBACP,sCAAgB;gBAChB,cAAc;gBACd,GAAG,MAAM;gBACT,gBAAgB;gBAChB,sCAAgB;gBAChB,KAAK;aACN,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED;;;;;;;OAOG;IACH,iBAAiB,CAAiB,kBAA2B,KAAK;QAChE,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC,CAAC;IACxE,CAAC;CAEF;AA5lCD,4BA4lCC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/v4/constants.d.ts b/node_modules/ip-address/dist/v4/constants.d.ts deleted file mode 100644 index 4e85d4a..0000000 --- a/node_modules/ip-address/dist/v4/constants.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const BITS = 32; -export declare const GROUPS = 4; -export declare const RE_ADDRESS: RegExp; -export declare const RE_SUBNET_STRING: RegExp; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/v4/constants.d.ts.map b/node_modules/ip-address/dist/v4/constants.d.ts.map deleted file mode 100644 index ea60ced..0000000 --- a/node_modules/ip-address/dist/v4/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/v4/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,KAAK,CAAC;AACvB,eAAO,MAAM,MAAM,IAAI,CAAC;AAExB,eAAO,MAAM,UAAU,QAC8I,CAAC;AAEtK,eAAO,MAAM,gBAAgB,QAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/v4/constants.js b/node_modules/ip-address/dist/v4/constants.js deleted file mode 100644 index 6fa2518..0000000 --- a/node_modules/ip-address/dist/v4/constants.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.RE_SUBNET_STRING = exports.RE_ADDRESS = exports.GROUPS = exports.BITS = void 0; -exports.BITS = 32; -exports.GROUPS = 4; -exports.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g; -exports.RE_SUBNET_STRING = /\/\d{1,2}$/; -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/v4/constants.js.map b/node_modules/ip-address/dist/v4/constants.js.map deleted file mode 100644 index 0a96f86..0000000 --- a/node_modules/ip-address/dist/v4/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/v4/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,EAAE,CAAC;AACV,QAAA,MAAM,GAAG,CAAC,CAAC;AAEX,QAAA,UAAU,GACrB,mKAAmK,CAAC;AAEzJ,QAAA,gBAAgB,GAAG,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/constants.d.ts b/node_modules/ip-address/dist/v6/constants.d.ts deleted file mode 100644 index 1302375..0000000 --- a/node_modules/ip-address/dist/v6/constants.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -export declare const BITS = 128; -export declare const GROUPS = 8; -/** - * Represents IPv6 address scopes - * @memberof Address6 - * @static - */ -export declare const SCOPES: { - [key: number]: string | undefined; -}; -/** - * Represents IPv6 address types - * @memberof Address6 - * @static - */ -export declare const TYPES: { - [key: string]: string | undefined; -}; -/** - * A regular expression that matches bad characters in an IPv6 address - * @memberof Address6 - * @static - */ -export declare const RE_BAD_CHARACTERS: RegExp; -/** - * A regular expression that matches an incorrect IPv6 address - * @memberof Address6 - * @static - */ -export declare const RE_BAD_ADDRESS: RegExp; -/** - * A regular expression that matches an IPv6 subnet - * @memberof Address6 - * @static - */ -export declare const RE_SUBNET_STRING: RegExp; -/** - * A regular expression that matches an IPv6 zone - * @memberof Address6 - * @static - */ -export declare const RE_ZONE_STRING: RegExp; -export declare const RE_URL: RegExp; -export declare const RE_URL_WITH_PORT: RegExp; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/constants.d.ts.map b/node_modules/ip-address/dist/v6/constants.d.ts.map deleted file mode 100644 index 0f4f412..0000000 --- a/node_modules/ip-address/dist/v6/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/v6/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,MAAM,CAAC;AACxB,eAAO,MAAM,MAAM,IAAI,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAS9C,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAuB7C,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAqB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAA6C,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAqB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAAS,CAAC;AAErC,eAAO,MAAM,MAAM,QAAgC,CAAC;AACpD,eAAO,MAAM,gBAAgB,QAAkC,CAAC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/constants.js b/node_modules/ip-address/dist/v6/constants.js deleted file mode 100644 index 0abc423..0000000 --- a/node_modules/ip-address/dist/v6/constants.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.RE_URL_WITH_PORT = exports.RE_URL = exports.RE_ZONE_STRING = exports.RE_SUBNET_STRING = exports.RE_BAD_ADDRESS = exports.RE_BAD_CHARACTERS = exports.TYPES = exports.SCOPES = exports.GROUPS = exports.BITS = void 0; -exports.BITS = 128; -exports.GROUPS = 8; -/** - * Represents IPv6 address scopes - * @memberof Address6 - * @static - */ -exports.SCOPES = { - 0: 'Reserved', - 1: 'Interface local', - 2: 'Link local', - 4: 'Admin local', - 5: 'Site local', - 8: 'Organization local', - 14: 'Global', - 15: 'Reserved', -}; -/** - * Represents IPv6 address types - * @memberof Address6 - * @static - */ -exports.TYPES = { - 'ff01::1/128': 'Multicast (All nodes on this interface)', - 'ff01::2/128': 'Multicast (All routers on this interface)', - 'ff02::1/128': 'Multicast (All nodes on this link)', - 'ff02::2/128': 'Multicast (All routers on this link)', - 'ff05::2/128': 'Multicast (All routers in this site)', - 'ff02::5/128': 'Multicast (OSPFv3 AllSPF routers)', - 'ff02::6/128': 'Multicast (OSPFv3 AllDR routers)', - 'ff02::9/128': 'Multicast (RIP routers)', - 'ff02::a/128': 'Multicast (EIGRP routers)', - 'ff02::d/128': 'Multicast (PIM routers)', - 'ff02::16/128': 'Multicast (MLDv2 reports)', - 'ff01::fb/128': 'Multicast (mDNSv6)', - 'ff02::fb/128': 'Multicast (mDNSv6)', - 'ff05::fb/128': 'Multicast (mDNSv6)', - 'ff02::1:2/128': 'Multicast (All DHCP servers and relay agents on this link)', - 'ff05::1:2/128': 'Multicast (All DHCP servers and relay agents in this site)', - 'ff02::1:3/128': 'Multicast (All DHCP servers on this link)', - 'ff05::1:3/128': 'Multicast (All DHCP servers in this site)', - '::/128': 'Unspecified', - '::1/128': 'Loopback', - 'ff00::/8': 'Multicast', - 'fe80::/10': 'Link-local unicast', -}; -/** - * A regular expression that matches bad characters in an IPv6 address - * @memberof Address6 - * @static - */ -exports.RE_BAD_CHARACTERS = /([^0-9a-f:/%])/gi; -/** - * A regular expression that matches an incorrect IPv6 address - * @memberof Address6 - * @static - */ -exports.RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi; -/** - * A regular expression that matches an IPv6 subnet - * @memberof Address6 - * @static - */ -exports.RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/; -/** - * A regular expression that matches an IPv6 zone - * @memberof Address6 - * @static - */ -exports.RE_ZONE_STRING = /%.*$/; -exports.RE_URL = /^\[{0,1}([0-9a-f:]+)\]{0,1}/; -exports.RE_URL_WITH_PORT = /\[([0-9a-f:]+)\]:([0-9]{1,5})/; -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/constants.js.map b/node_modules/ip-address/dist/v6/constants.js.map deleted file mode 100644 index 1d313e0..0000000 --- a/node_modules/ip-address/dist/v6/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/v6/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,GAAG,CAAC;AACX,QAAA,MAAM,GAAG,CAAC,CAAC;AAExB;;;;GAIG;AACU,QAAA,MAAM,GAA0C;IAC3D,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,iBAAiB;IACpB,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,oBAAoB;IACvB,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,UAAU;CACN,CAAC;AAEX;;;;GAIG;AACU,QAAA,KAAK,GAA0C;IAC1D,aAAa,EAAE,yCAAyC;IACxD,aAAa,EAAE,2CAA2C;IAC1D,aAAa,EAAE,oCAAoC;IACnD,aAAa,EAAE,sCAAsC;IACrD,aAAa,EAAE,sCAAsC;IACrD,aAAa,EAAE,mCAAmC;IAClD,aAAa,EAAE,kCAAkC;IACjD,aAAa,EAAE,yBAAyB;IACxC,aAAa,EAAE,2BAA2B;IAC1C,aAAa,EAAE,yBAAyB;IACxC,cAAc,EAAE,2BAA2B;IAC3C,cAAc,EAAE,oBAAoB;IACpC,cAAc,EAAE,oBAAoB;IACpC,cAAc,EAAE,oBAAoB;IACpC,eAAe,EAAE,4DAA4D;IAC7E,eAAe,EAAE,4DAA4D;IAC7E,eAAe,EAAE,2CAA2C;IAC5D,eAAe,EAAE,2CAA2C;IAC5D,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,UAAU;IACrB,UAAU,EAAE,WAAW;IACvB,WAAW,EAAE,oBAAoB;CACzB,CAAC;AAEX;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,kBAAkB,CAAC;AAEpD;;;;GAIG;AACU,QAAA,cAAc,GAAG,0CAA0C,CAAC;AAEzE;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AAEnD;;;;GAIG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC;AAExB,QAAA,MAAM,GAAG,6BAA6B,CAAC;AACvC,QAAA,gBAAgB,GAAG,+BAA+B,CAAC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/helpers.d.ts b/node_modules/ip-address/dist/v6/helpers.d.ts deleted file mode 100644 index e72f031..0000000 --- a/node_modules/ip-address/dist/v6/helpers.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @returns {String} the string with all zeroes contained in a - */ -export declare function spanAllZeroes(s: string): string; -/** - * @returns {String} the string with each character contained in a - */ -export declare function spanAll(s: string, offset?: number): string; -/** - * @returns {String} the string with leading zeroes contained in a - */ -export declare function spanLeadingZeroes(address: string): string; -/** - * Groups an address - * @returns {String} a grouped address - */ -export declare function simpleGroup(addressString: string, offset?: number): string[]; -//# sourceMappingURL=helpers.d.ts.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/helpers.d.ts.map b/node_modules/ip-address/dist/v6/helpers.d.ts.map deleted file mode 100644 index 823f26e..0000000 --- a/node_modules/ip-address/dist/v6/helpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/v6/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,GAAG,MAAM,CAQ7D;AAMD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,GAAG,MAAM,EAAE,CAU/E"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/helpers.js b/node_modules/ip-address/dist/v6/helpers.js deleted file mode 100644 index fafca0c..0000000 --- a/node_modules/ip-address/dist/v6/helpers.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.spanAllZeroes = spanAllZeroes; -exports.spanAll = spanAll; -exports.spanLeadingZeroes = spanLeadingZeroes; -exports.simpleGroup = simpleGroup; -/** - * @returns {String} the string with all zeroes contained in a - */ -function spanAllZeroes(s) { - return s.replace(/(0+)/g, '$1'); -} -/** - * @returns {String} the string with each character contained in a - */ -function spanAll(s, offset = 0) { - const letters = s.split(''); - return letters - .map((n, i) => `${spanAllZeroes(n)}`) - .join(''); -} -function spanLeadingZeroesSimple(group) { - return group.replace(/^(0+)/, '$1'); -} -/** - * @returns {String} the string with leading zeroes contained in a - */ -function spanLeadingZeroes(address) { - const groups = address.split(':'); - return groups.map((g) => spanLeadingZeroesSimple(g)).join(':'); -} -/** - * Groups an address - * @returns {String} a grouped address - */ -function simpleGroup(addressString, offset = 0) { - const groups = addressString.split(':'); - return groups.map((g, i) => { - if (/group-v4/.test(g)) { - return g; - } - return `${spanLeadingZeroesSimple(g)}`; - }); -} -//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/helpers.js.map b/node_modules/ip-address/dist/v6/helpers.js.map deleted file mode 100644 index c895455..0000000 --- a/node_modules/ip-address/dist/v6/helpers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/v6/helpers.ts"],"names":[],"mappings":";;AAGA,sCAEC;AAKD,0BAQC;AASD,8CAIC;AAMD,kCAUC;AA/CD;;GAEG;AACH,SAAgB,aAAa,CAAC,CAAS;IACrC,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,SAAgB,OAAO,CAAC,CAAS,EAAE,SAAiB,CAAC;IACnD,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAE5B,OAAO,OAAO;SACX,GAAG,CACF,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,4BAA4B,CAAC,aAAa,CAAC,GAAG,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC,SAAS,CAC7F;SACA,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAa;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;AAChE,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjE,CAAC;AAED;;;GAGG;AACH,SAAgB,WAAW,CAAC,aAAqB,EAAE,SAAiB,CAAC;IACnE,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAExC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACzB,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,CAAC;QACX,CAAC;QAED,OAAO,kCAAkC,CAAC,GAAG,MAAM,KAAK,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9F,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/regular-expressions.d.ts b/node_modules/ip-address/dist/v6/regular-expressions.d.ts deleted file mode 100644 index 181b91e..0000000 --- a/node_modules/ip-address/dist/v6/regular-expressions.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare function groupPossibilities(possibilities: string[]): string; -export declare function padGroup(group: string): string; -export declare const ADDRESS_BOUNDARY = "[^A-Fa-f0-9:]"; -export declare function simpleRegularExpression(groups: string[]): string; -export declare function possibleElisions(elidedGroups: number, moreLeft?: boolean, moreRight?: boolean): string; -//# sourceMappingURL=regular-expressions.d.ts.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/regular-expressions.d.ts.map b/node_modules/ip-address/dist/v6/regular-expressions.d.ts.map deleted file mode 100644 index 20a93f7..0000000 --- a/node_modules/ip-address/dist/v6/regular-expressions.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regular-expressions.d.ts","sourceRoot":"","sources":["../../src/v6/regular-expressions.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,CAElE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM9C;AAED,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,UA+BvD;AAED,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,OAAO,EAClB,SAAS,CAAC,EAAE,OAAO,GAClB,MAAM,CAwCR"} \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/regular-expressions.js b/node_modules/ip-address/dist/v6/regular-expressions.js deleted file mode 100644 index a2c5145..0000000 --- a/node_modules/ip-address/dist/v6/regular-expressions.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ADDRESS_BOUNDARY = void 0; -exports.groupPossibilities = groupPossibilities; -exports.padGroup = padGroup; -exports.simpleRegularExpression = simpleRegularExpression; -exports.possibleElisions = possibleElisions; -const v6 = __importStar(require("./constants")); -function groupPossibilities(possibilities) { - return `(${possibilities.join('|')})`; -} -function padGroup(group) { - if (group.length < 4) { - return `0{0,${4 - group.length}}${group}`; - } - return group; -} -exports.ADDRESS_BOUNDARY = '[^A-Fa-f0-9:]'; -function simpleRegularExpression(groups) { - const zeroIndexes = []; - groups.forEach((group, i) => { - const groupInteger = parseInt(group, 16); - if (groupInteger === 0) { - zeroIndexes.push(i); - } - }); - // You can technically elide a single 0, this creates the regular expressions - // to match that eventuality - const possibilities = zeroIndexes.map((zeroIndex) => groups - .map((group, i) => { - if (i === zeroIndex) { - const elision = i === 0 || i === v6.GROUPS - 1 ? ':' : ''; - return groupPossibilities([padGroup(group), elision]); - } - return padGroup(group); - }) - .join(':')); - // The simplest case - possibilities.push(groups.map(padGroup).join(':')); - return groupPossibilities(possibilities); -} -function possibleElisions(elidedGroups, moreLeft, moreRight) { - const left = moreLeft ? '' : ':'; - const right = moreRight ? '' : ':'; - const possibilities = []; - // 1. elision of everything (::) - if (!moreLeft && !moreRight) { - possibilities.push('::'); - } - // 2. complete elision of the middle - if (moreLeft && moreRight) { - possibilities.push(''); - } - if ((moreRight && !moreLeft) || (!moreRight && moreLeft)) { - // 3. complete elision of one side - possibilities.push(':'); - } - // 4. elision from the left side - possibilities.push(`${left}(:0{1,4}){1,${elidedGroups - 1}}`); - // 5. elision from the right side - possibilities.push(`(0{1,4}:){1,${elidedGroups - 1}}${right}`); - // 6. no elision - possibilities.push(`(0{1,4}:){${elidedGroups - 1}}0{1,4}`); - // 7. elision (including sloppy elision) from the middle - for (let groups = 1; groups < elidedGroups - 1; groups++) { - for (let position = 1; position < elidedGroups - groups; position++) { - possibilities.push(`(0{1,4}:){${position}}:(0{1,4}:){${elidedGroups - position - groups - 1}}0{1,4}`); - } - } - return groupPossibilities(possibilities); -} -//# sourceMappingURL=regular-expressions.js.map \ No newline at end of file diff --git a/node_modules/ip-address/dist/v6/regular-expressions.js.map b/node_modules/ip-address/dist/v6/regular-expressions.js.map deleted file mode 100644 index 190fd4a..0000000 --- a/node_modules/ip-address/dist/v6/regular-expressions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regular-expressions.js","sourceRoot":"","sources":["../../src/v6/regular-expressions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,gDAEC;AAED,4BAMC;AAID,0DA+BC;AAED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AK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;QACzD,KAAK,IAAI,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC;YACpE,aAAa,CAAC,IAAI,CAChB,aAAa,QAAQ,eAAe,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,CAAC,SAAS,CAClF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAC3C,CAAC"} \ No newline at end of file diff --git a/node_modules/ip-address/package.json b/node_modules/ip-address/package.json deleted file mode 100644 index 87795e0..0000000 --- a/node_modules/ip-address/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "ip-address", - "description": "A library for parsing IPv4 and IPv6 IP addresses in node and the browser.", - "keywords": [ - "ipv6", - "ipv4", - "browser", - "validation" - ], - "version": "10.0.1", - "author": "Beau Gunderson (https://beaugunderson.com/)", - "license": "MIT", - "main": "dist/ip-address.js", - "types": "dist/ip-address.d.ts", - "scripts": { - "docs": "documentation build --github --output docs --format html ./ip-address.js", - "build": "rm -rf dist; mkdir dist; tsc", - "prepack": "npm run build", - "release": "release-it", - "test-ci": "nyc mocha", - "test": "mocha", - "watch": "mocha --watch" - }, - "nyc": { - "extension": [ - ".ts" - ], - "exclude": [ - "**/*.d.ts", - ".eslintrc.js", - "coverage/", - "dist/", - "test/", - "tmp/" - ], - "reporter": [ - "html", - "lcov", - "text" - ], - "all": true - }, - "engines": { - "node": ">= 12" - }, - "files": [ - "src", - "dist" - ], - "repository": { - "type": "git", - "url": "git://github.com/beaugunderson/ip-address.git" - }, - "devDependencies": { - "@types/chai": "^5.0.0", - "@types/mocha": "^10.0.8", - "@typescript-eslint/eslint-plugin": "^8.8.0", - "@typescript-eslint/parser": "^8.8.0", - "chai": "^5.1.1", - "documentation": "^14.0.3", - "eslint": "^8.50.0", - "eslint_d": "^14.0.4", - "eslint-config-airbnb": "^19.0.4", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-filenames": "^1.3.2", - "eslint-plugin-import": "^2.30.0", - "eslint-plugin-jsx-a11y": "^6.10.0", - "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-sort-imports-es6-autofix": "^0.6.0", - "mocha": "^10.7.3", - "nyc": "^17.1.0", - "prettier": "^3.3.3", - "release-it": "^17.6.0", - "source-map-support": "^0.5.21", - "tsx": "^4.19.1", - "typescript": "<5.6.0" - } -} diff --git a/node_modules/ip-address/src/address-error.ts b/node_modules/ip-address/src/address-error.ts deleted file mode 100644 index 032d4cd..0000000 --- a/node_modules/ip-address/src/address-error.ts +++ /dev/null @@ -1,11 +0,0 @@ -export class AddressError extends Error { - parseMessage?: string; - - constructor(message: string, parseMessage?: string) { - super(message); - - this.name = 'AddressError'; - - this.parseMessage = parseMessage; - } -} diff --git a/node_modules/ip-address/src/common.ts b/node_modules/ip-address/src/common.ts deleted file mode 100644 index 1123fa3..0000000 --- a/node_modules/ip-address/src/common.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { Address4 } from './ipv4'; -import { Address6 } from './ipv6'; - -export interface ReverseFormOptions { - omitSuffix?: boolean; -} - -export function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) { - if (this.subnetMask < address.subnetMask) { - return false; - } - - if (this.mask(address.subnetMask) === address.mask()) { - return true; - } - - return false; -} - -export function isCorrect(defaultBits: number) { - return function (this: Address4 | Address6) { - if (this.addressMinusSuffix !== this.correctForm()) { - return false; - } - - if (this.subnetMask === defaultBits && !this.parsedSubnet) { - return true; - } - - return this.parsedSubnet === String(this.subnetMask); - }; -} - -export function numberToPaddedHex(number: number) { - return number.toString(16).padStart(2, '0'); -} - -export function stringToPaddedHex(numberString: string) { - return numberToPaddedHex(parseInt(numberString, 10)); -} - -/** - * @param binaryValue Binary representation of a value (e.g. `10`) - * @param position Byte position, where 0 is the least significant bit - */ -export function testBit(binaryValue: string, position: number): boolean { - const { length } = binaryValue; - - if (position > length) { - return false; - } - - const positionInString = length - position; - return binaryValue.substring(positionInString, positionInString + 1) === '1'; -} diff --git a/node_modules/ip-address/src/ip-address.ts b/node_modules/ip-address/src/ip-address.ts deleted file mode 100644 index b4e1502..0000000 --- a/node_modules/ip-address/src/ip-address.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { Address4 } from './ipv4'; -export { Address6 } from './ipv6'; -export { AddressError } from './address-error'; - -import * as helpers from './v6/helpers'; - -export const v6 = { helpers }; diff --git a/node_modules/ip-address/src/ipv4.ts b/node_modules/ip-address/src/ipv4.ts deleted file mode 100644 index 00c2da8..0000000 --- a/node_modules/ip-address/src/ipv4.ts +++ /dev/null @@ -1,356 +0,0 @@ -/* eslint-disable no-param-reassign */ - -import * as common from './common'; -import * as constants from './v4/constants'; -import { AddressError } from './address-error'; - -/** - * Represents an IPv4 address - * @class Address4 - * @param {string} address - An IPv4 address string - */ -export class Address4 { - address: string; - addressMinusSuffix?: string; - groups: number = constants.GROUPS; - parsedAddress: string[] = []; - parsedSubnet: string = ''; - subnet: string = '/32'; - subnetMask: number = 32; - v4: boolean = true; - - constructor(address: string) { - this.address = address; - - const subnet = constants.RE_SUBNET_STRING.exec(address); - - if (subnet) { - this.parsedSubnet = subnet[0].replace('/', ''); - this.subnetMask = parseInt(this.parsedSubnet, 10); - this.subnet = `/${this.subnetMask}`; - - if (this.subnetMask < 0 || this.subnetMask > constants.BITS) { - throw new AddressError('Invalid subnet mask.'); - } - - address = address.replace(constants.RE_SUBNET_STRING, ''); - } - - this.addressMinusSuffix = address; - - this.parsedAddress = this.parse(address); - } - - static isValid(address: string): boolean { - try { - // eslint-disable-next-line no-new - new Address4(address); - - return true; - } catch (e) { - return false; - } - } - - /* - * Parses a v4 address - */ - parse(address: string) { - const groups = address.split('.'); - - if (!address.match(constants.RE_ADDRESS)) { - throw new AddressError('Invalid IPv4 address.'); - } - - return groups; - } - - /** - * Returns the correct form of an address - * @memberof Address4 - * @instance - * @returns {String} - */ - correctForm(): string { - return this.parsedAddress.map((part) => parseInt(part, 10)).join('.'); - } - - /** - * Returns true if the address is correct, false otherwise - * @memberof Address4 - * @instance - * @returns {Boolean} - */ - isCorrect = common.isCorrect(constants.BITS); - - /** - * Converts a hex string to an IPv4 address object - * @memberof Address4 - * @static - * @param {string} hex - a hex string to convert - * @returns {Address4} - */ - static fromHex(hex: string): Address4 { - const padded = hex.replace(/:/g, '').padStart(8, '0'); - const groups = []; - let i; - - for (i = 0; i < 8; i += 2) { - const h = padded.slice(i, i + 2); - - groups.push(parseInt(h, 16)); - } - - return new Address4(groups.join('.')); - } - - /** - * Converts an integer into a IPv4 address object - * @memberof Address4 - * @static - * @param {integer} integer - a number to convert - * @returns {Address4} - */ - static fromInteger(integer: number): Address4 { - return Address4.fromHex(integer.toString(16)); - } - - /** - * Return an address from in-addr.arpa form - * @memberof Address4 - * @static - * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address - * @returns {Adress4} - * @example - * var address = Address4.fromArpa(42.2.0.192.in-addr.arpa.) - * address.correctForm(); // '192.0.2.42' - */ - static fromArpa(arpaFormAddress: string): Address4 { - // remove ending ".in-addr.arpa." or just "." - const leader = arpaFormAddress.replace(/(\.in-addr\.arpa)?\.$/, ''); - - const address = leader.split('.').reverse().join('.'); - - return new Address4(address); - } - - /** - * Converts an IPv4 address object to a hex string - * @memberof Address4 - * @instance - * @returns {String} - */ - toHex(): string { - return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(':'); - } - - /** - * Converts an IPv4 address object to an array of bytes - * @memberof Address4 - * @instance - * @returns {Array} - */ - toArray(): number[] { - return this.parsedAddress.map((part) => parseInt(part, 10)); - } - - /** - * Converts an IPv4 address object to an IPv6 address group - * @memberof Address4 - * @instance - * @returns {String} - */ - toGroup6(): string { - const output = []; - let i; - - for (i = 0; i < constants.GROUPS; i += 2) { - output.push( - `${common.stringToPaddedHex(this.parsedAddress[i])}${common.stringToPaddedHex( - this.parsedAddress[i + 1], - )}`, - ); - } - - return output.join(':'); - } - - /** - * Returns the address as a `bigint` - * @memberof Address4 - * @instance - * @returns {bigint} - */ - bigInt(): bigint { - return BigInt(`0x${this.parsedAddress.map((n) => common.stringToPaddedHex(n)).join('')}`); - } - - /** - * Helper function getting start address. - * @memberof Address4 - * @instance - * @returns {bigint} - */ - _startAddress(): bigint { - return BigInt(`0b${this.mask() + '0'.repeat(constants.BITS - this.subnetMask)}`); - } - - /** - * The first address in the range given by this address' subnet. - * Often referred to as the Network Address. - * @memberof Address4 - * @instance - * @returns {Address4} - */ - startAddress(): Address4 { - return Address4.fromBigInt(this._startAddress()); - } - - /** - * The first host address in the range given by this address's subnet ie - * the first address after the Network Address - * @memberof Address4 - * @instance - * @returns {Address4} - */ - startAddressExclusive(): Address4 { - const adjust = BigInt('1'); - return Address4.fromBigInt(this._startAddress() + adjust); - } - - /** - * Helper function getting end address. - * @memberof Address4 - * @instance - * @returns {bigint} - */ - _endAddress(): bigint { - return BigInt(`0b${this.mask() + '1'.repeat(constants.BITS - this.subnetMask)}`); - } - - /** - * The last address in the range given by this address' subnet - * Often referred to as the Broadcast - * @memberof Address4 - * @instance - * @returns {Address4} - */ - endAddress(): Address4 { - return Address4.fromBigInt(this._endAddress()); - } - - /** - * The last host address in the range given by this address's subnet ie - * the last address prior to the Broadcast Address - * @memberof Address4 - * @instance - * @returns {Address4} - */ - endAddressExclusive(): Address4 { - const adjust = BigInt('1'); - return Address4.fromBigInt(this._endAddress() - adjust); - } - - /** - * Converts a BigInt to a v4 address object - * @memberof Address4 - * @static - * @param {bigint} bigInt - a BigInt to convert - * @returns {Address4} - */ - static fromBigInt(bigInt: bigint): Address4 { - return Address4.fromHex(bigInt.toString(16)); - } - - /** - * Returns the first n bits of the address, defaulting to the - * subnet mask - * @memberof Address4 - * @instance - * @returns {String} - */ - mask(mask?: number): string { - if (mask === undefined) { - mask = this.subnetMask; - } - - return this.getBitsBase2(0, mask); - } - - /** - * Returns the bits in the given range as a base-2 string - * @memberof Address4 - * @instance - * @returns {string} - */ - getBitsBase2(start: number, end: number): string { - return this.binaryZeroPad().slice(start, end); - } - - /** - * Return the reversed ip6.arpa form of the address - * @memberof Address4 - * @param {Object} options - * @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix - * @instance - * @returns {String} - */ - reverseForm(options?: common.ReverseFormOptions): string { - if (!options) { - options = {}; - } - - const reversed = this.correctForm().split('.').reverse().join('.'); - - if (options.omitSuffix) { - return reversed; - } - - return `${reversed}.in-addr.arpa.`; - } - - /** - * Returns true if the given address is in the subnet of the current address - * @memberof Address4 - * @instance - * @returns {boolean} - */ - isInSubnet = common.isInSubnet; - - /** - * Returns true if the given address is a multicast address - * @memberof Address4 - * @instance - * @returns {boolean} - */ - isMulticast(): boolean { - return this.isInSubnet(new Address4('224.0.0.0/4')); - } - - /** - * Returns a zero-padded base-2 string representation of the address - * @memberof Address4 - * @instance - * @returns {string} - */ - binaryZeroPad(): string { - return this.bigInt().toString(2).padStart(constants.BITS, '0'); - } - - /** - * Groups an IPv4 address for inclusion at the end of an IPv6 address - * @returns {String} - */ - groupForV6(): string { - const segments = this.parsedAddress; - - return this.address.replace( - constants.RE_ADDRESS, - `${segments - .slice(0, 2) - .join('.')}.${segments - .slice(2, 4) - .join('.')}`, - ); - } -} diff --git a/node_modules/ip-address/src/ipv6.ts b/node_modules/ip-address/src/ipv6.ts deleted file mode 100644 index 60348e9..0000000 --- a/node_modules/ip-address/src/ipv6.ts +++ /dev/null @@ -1,1212 +0,0 @@ -/* eslint-disable prefer-destructuring */ -/* eslint-disable no-param-reassign */ - -import * as common from './common'; -import * as constants4 from './v4/constants'; -import * as constants6 from './v6/constants'; -import * as helpers from './v6/helpers'; -import { Address4 } from './ipv4'; -import { - ADDRESS_BOUNDARY, - possibleElisions, - simpleRegularExpression, -} from './v6/regular-expressions'; -import { AddressError } from './address-error'; -import { testBit } from './common'; - -function assert(condition: any): asserts condition { - if (!condition) { - throw new Error('Assertion failed.'); - } -} - -function addCommas(number: string): string { - const r = /(\d+)(\d{3})/; - - while (r.test(number)) { - number = number.replace(r, '$1,$2'); - } - - return number; -} - -function spanLeadingZeroes4(n: string): string { - n = n.replace(/^(0{1,})([1-9]+)$/, '$1$2'); - n = n.replace(/^(0{1,})(0)$/, '$1$2'); - - return n; -} - -/* - * A helper function to compact an array - */ -function compact(address: string[], slice: number[]) { - const s1 = []; - const s2 = []; - let i; - - for (i = 0; i < address.length; i++) { - if (i < slice[0]) { - s1.push(address[i]); - } else if (i > slice[1]) { - s2.push(address[i]); - } - } - - return s1.concat(['compact']).concat(s2); -} - -function paddedHex(octet: string): string { - return parseInt(octet, 16).toString(16).padStart(4, '0'); -} - -function unsignByte(b: number) { - // eslint-disable-next-line no-bitwise - return b & 0xff; -} - -interface SixToFourProperties { - prefix: string; - gateway: string; -} - -interface TeredoProperties { - prefix: string; - server4: string; - client4: string; - flags: string; - coneNat: boolean; - microsoft: { - reserved: boolean; - universalLocal: boolean; - groupIndividual: boolean; - nonce: string; - }; - udpPort: string; -} - -/** - * Represents an IPv6 address - * @class Address6 - * @param {string} address - An IPv6 address string - * @param {number} [groups=8] - How many octets to parse - * @example - * var address = new Address6('2001::/32'); - */ -export class Address6 { - address4?: Address4; - address: string; - addressMinusSuffix: string = ''; - elidedGroups?: number; - elisionBegin?: number; - elisionEnd?: number; - groups: number; - parsedAddress4?: string; - parsedAddress: string[]; - parsedSubnet: string = ''; - subnet: string = '/128'; - subnetMask: number = 128; - v4: boolean = false; - zone: string = ''; - - constructor(address: string, optionalGroups?: number) { - if (optionalGroups === undefined) { - this.groups = constants6.GROUPS; - } else { - this.groups = optionalGroups; - } - - this.address = address; - - const subnet = constants6.RE_SUBNET_STRING.exec(address); - - if (subnet) { - this.parsedSubnet = subnet[0].replace('/', ''); - this.subnetMask = parseInt(this.parsedSubnet, 10); - this.subnet = `/${this.subnetMask}`; - - if ( - Number.isNaN(this.subnetMask) || - this.subnetMask < 0 || - this.subnetMask > constants6.BITS - ) { - throw new AddressError('Invalid subnet mask.'); - } - - address = address.replace(constants6.RE_SUBNET_STRING, ''); - } else if (/\//.test(address)) { - throw new AddressError('Invalid subnet mask.'); - } - - const zone = constants6.RE_ZONE_STRING.exec(address); - - if (zone) { - this.zone = zone[0]; - - address = address.replace(constants6.RE_ZONE_STRING, ''); - } - - this.addressMinusSuffix = address; - - this.parsedAddress = this.parse(this.addressMinusSuffix); - } - - static isValid(address: string): boolean { - try { - // eslint-disable-next-line no-new - new Address6(address); - - return true; - } catch (e) { - return false; - } - } - - /** - * Convert a BigInt to a v6 address object - * @memberof Address6 - * @static - * @param {bigint} bigInt - a BigInt to convert - * @returns {Address6} - * @example - * var bigInt = BigInt('1000000000000'); - * var address = Address6.fromBigInt(bigInt); - * address.correctForm(); // '::e8:d4a5:1000' - */ - static fromBigInt(bigInt: bigint): Address6 { - const hex = bigInt.toString(16).padStart(32, '0'); - const groups = []; - let i; - - for (i = 0; i < constants6.GROUPS; i++) { - groups.push(hex.slice(i * 4, (i + 1) * 4)); - } - - return new Address6(groups.join(':')); - } - - /** - * Convert a URL (with optional port number) to an address object - * @memberof Address6 - * @static - * @param {string} url - a URL with optional port number - * @example - * var addressAndPort = Address6.fromURL('http://[ffff::]:8080/foo/'); - * addressAndPort.address.correctForm(); // 'ffff::' - * addressAndPort.port; // 8080 - */ - static fromURL(url: string) { - let host: string; - let port: string | number | null = null; - let result: string[] | null; - - // If we have brackets parse them and find a port - if (url.indexOf('[') !== -1 && url.indexOf(']:') !== -1) { - result = constants6.RE_URL_WITH_PORT.exec(url); - - if (result === null) { - return { - error: 'failed to parse address with port', - address: null, - port: null, - }; - } - - host = result[1]; - port = result[2]; - // If there's a URL extract the address - } else if (url.indexOf('/') !== -1) { - // Remove the protocol prefix - url = url.replace(/^[a-z0-9]+:\/\//, ''); - - // Parse the address - result = constants6.RE_URL.exec(url); - - if (result === null) { - return { - error: 'failed to parse address from URL', - address: null, - port: null, - }; - } - - host = result[1]; - // Otherwise just assign the URL to the host and let the library parse it - } else { - host = url; - } - - // If there's a port convert it to an integer - if (port) { - port = parseInt(port, 10); - - // squelch out of range ports - if (port < 0 || port > 65536) { - port = null; - } - } else { - // Standardize `undefined` to `null` - port = null; - } - - return { - address: new Address6(host), - port, - }; - } - - /** - * Create an IPv6-mapped address given an IPv4 address - * @memberof Address6 - * @static - * @param {string} address - An IPv4 address string - * @returns {Address6} - * @example - * var address = Address6.fromAddress4('192.168.0.1'); - * address.correctForm(); // '::ffff:c0a8:1' - * address.to4in6(); // '::ffff:192.168.0.1' - */ - static fromAddress4(address: string): Address6 { - const address4 = new Address4(address); - - const mask6 = constants6.BITS - (constants4.BITS - address4.subnetMask); - - return new Address6(`::ffff:${address4.correctForm()}/${mask6}`); - } - - /** - * Return an address from ip6.arpa form - * @memberof Address6 - * @static - * @param {string} arpaFormAddress - an 'ip6.arpa' form address - * @returns {Adress6} - * @example - * var address = Address6.fromArpa(e.f.f.f.3.c.2.6.f.f.f.e.6.6.8.e.1.0.6.7.9.4.e.c.0.0.0.0.1.0.0.2.ip6.arpa.) - * address.correctForm(); // '2001:0:ce49:7601:e866:efff:62c3:fffe' - */ - static fromArpa(arpaFormAddress: string): Address6 { - // remove ending ".ip6.arpa." or just "." - let address = arpaFormAddress.replace(/(\.ip6\.arpa)?\.$/, ''); - const semicolonAmount = 7; - - // correct ip6.arpa form with ending removed will be 63 characters - if (address.length !== 63) { - throw new AddressError("Invalid 'ip6.arpa' form."); - } - - const parts = address.split('.').reverse(); - - for (let i = semicolonAmount; i > 0; i--) { - const insertIndex = i * 4; - parts.splice(insertIndex, 0, ':'); - } - - address = parts.join(''); - - return new Address6(address); - } - - /** - * Return the Microsoft UNC transcription of the address - * @memberof Address6 - * @instance - * @returns {String} the Microsoft UNC transcription of the address - */ - microsoftTranscription(): string { - return `${this.correctForm().replace(/:/g, '-')}.ipv6-literal.net`; - } - - /** - * Return the first n bits of the address, defaulting to the subnet mask - * @memberof Address6 - * @instance - * @param {number} [mask=subnet] - the number of bits to mask - * @returns {String} the first n bits of the address as a string - */ - mask(mask: number = this.subnetMask): string { - return this.getBitsBase2(0, mask); - } - - /** - * Return the number of possible subnets of a given size in the address - * @memberof Address6 - * @instance - * @param {number} [subnetSize=128] - the subnet size - * @returns {String} - */ - // TODO: probably useful to have a numeric version of this too - possibleSubnets(subnetSize: number = 128): string { - const availableBits = constants6.BITS - this.subnetMask; - const subnetBits = Math.abs(subnetSize - constants6.BITS); - const subnetPowers = availableBits - subnetBits; - - if (subnetPowers < 0) { - return '0'; - } - - return addCommas((BigInt('2') ** BigInt(subnetPowers)).toString(10)); - } - - /** - * Helper function getting start address. - * @memberof Address6 - * @instance - * @returns {bigint} - */ - _startAddress(): bigint { - return BigInt(`0b${this.mask() + '0'.repeat(constants6.BITS - this.subnetMask)}`); - } - - /** - * The first address in the range given by this address' subnet - * Often referred to as the Network Address. - * @memberof Address6 - * @instance - * @returns {Address6} - */ - startAddress(): Address6 { - return Address6.fromBigInt(this._startAddress()); - } - - /** - * The first host address in the range given by this address's subnet ie - * the first address after the Network Address - * @memberof Address6 - * @instance - * @returns {Address6} - */ - startAddressExclusive(): Address6 { - const adjust = BigInt('1'); - return Address6.fromBigInt(this._startAddress() + adjust); - } - - /** - * Helper function getting end address. - * @memberof Address6 - * @instance - * @returns {bigint} - */ - _endAddress(): bigint { - return BigInt(`0b${this.mask() + '1'.repeat(constants6.BITS - this.subnetMask)}`); - } - - /** - * The last address in the range given by this address' subnet - * Often referred to as the Broadcast - * @memberof Address6 - * @instance - * @returns {Address6} - */ - endAddress(): Address6 { - return Address6.fromBigInt(this._endAddress()); - } - - /** - * The last host address in the range given by this address's subnet ie - * the last address prior to the Broadcast Address - * @memberof Address6 - * @instance - * @returns {Address6} - */ - endAddressExclusive(): Address6 { - const adjust = BigInt('1'); - return Address6.fromBigInt(this._endAddress() - adjust); - } - - /** - * Return the scope of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - getScope(): string { - let scope = constants6.SCOPES[parseInt(this.getBits(12, 16).toString(10), 10)]; - - if (this.getType() === 'Global unicast' && scope !== 'Link local') { - scope = 'Global'; - } - - return scope || 'Unknown'; - } - - /** - * Return the type of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - getType(): string { - for (const subnet of Object.keys(constants6.TYPES)) { - if (this.isInSubnet(new Address6(subnet))) { - return constants6.TYPES[subnet] as string; - } - } - - return 'Global unicast'; - } - - /** - * Return the bits in the given range as a BigInt - * @memberof Address6 - * @instance - * @returns {bigint} - */ - getBits(start: number, end: number): bigint { - return BigInt(`0b${this.getBitsBase2(start, end)}`); - } - - /** - * Return the bits in the given range as a base-2 string - * @memberof Address6 - * @instance - * @returns {String} - */ - getBitsBase2(start: number, end: number): string { - return this.binaryZeroPad().slice(start, end); - } - - /** - * Return the bits in the given range as a base-16 string - * @memberof Address6 - * @instance - * @returns {String} - */ - getBitsBase16(start: number, end: number): string { - const length = end - start; - - if (length % 4 !== 0) { - throw new Error('Length of bits to retrieve must be divisible by four'); - } - - return this.getBits(start, end) - .toString(16) - .padStart(length / 4, '0'); - } - - /** - * Return the bits that are set past the subnet mask length - * @memberof Address6 - * @instance - * @returns {String} - */ - getBitsPastSubnet(): string { - return this.getBitsBase2(this.subnetMask, constants6.BITS); - } - - /** - * Return the reversed ip6.arpa form of the address - * @memberof Address6 - * @param {Object} options - * @param {boolean} options.omitSuffix - omit the "ip6.arpa" suffix - * @instance - * @returns {String} - */ - reverseForm(options?: common.ReverseFormOptions): string { - if (!options) { - options = {}; - } - - const characters = Math.floor(this.subnetMask / 4); - - const reversed = this.canonicalForm() - .replace(/:/g, '') - .split('') - .slice(0, characters) - .reverse() - .join('.'); - - if (characters > 0) { - if (options.omitSuffix) { - return reversed; - } - - return `${reversed}.ip6.arpa.`; - } - - if (options.omitSuffix) { - return ''; - } - - return 'ip6.arpa.'; - } - - /** - * Return the correct form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - correctForm(): string { - let i; - let groups = []; - - let zeroCounter = 0; - const zeroes = []; - - for (i = 0; i < this.parsedAddress.length; i++) { - const value = parseInt(this.parsedAddress[i], 16); - - if (value === 0) { - zeroCounter++; - } - - if (value !== 0 && zeroCounter > 0) { - if (zeroCounter > 1) { - zeroes.push([i - zeroCounter, i - 1]); - } - - zeroCounter = 0; - } - } - - // Do we end with a string of zeroes? - if (zeroCounter > 1) { - zeroes.push([this.parsedAddress.length - zeroCounter, this.parsedAddress.length - 1]); - } - - const zeroLengths = zeroes.map((n) => n[1] - n[0] + 1); - - if (zeroes.length > 0) { - const index = zeroLengths.indexOf(Math.max(...zeroLengths) as number); - - groups = compact(this.parsedAddress, zeroes[index]); - } else { - groups = this.parsedAddress; - } - - for (i = 0; i < groups.length; i++) { - if (groups[i] !== 'compact') { - groups[i] = parseInt(groups[i], 16).toString(16); - } - } - - let correct = groups.join(':'); - - correct = correct.replace(/^compact$/, '::'); - correct = correct.replace(/(^compact)|(compact$)/, ':'); - correct = correct.replace(/compact/, ''); - - return correct; - } - - /** - * Return a zero-padded base-2 string representation of the address - * @memberof Address6 - * @instance - * @returns {String} - * @example - * var address = new Address6('2001:4860:4001:803::1011'); - * address.binaryZeroPad(); - * // '0010000000000001010010000110000001000000000000010000100000000011 - * // 0000000000000000000000000000000000000000000000000001000000010001' - */ - binaryZeroPad(): string { - return this.bigInt().toString(2).padStart(constants6.BITS, '0'); - } - - // TODO: Improve the semantics of this helper function - parse4in6(address: string): string { - const groups = address.split(':'); - const lastGroup = groups.slice(-1)[0]; - - const address4 = lastGroup.match(constants4.RE_ADDRESS); - - if (address4) { - this.parsedAddress4 = address4[0]; - this.address4 = new Address4(this.parsedAddress4); - - for (let i = 0; i < this.address4.groups; i++) { - if (/^0[0-9]+/.test(this.address4.parsedAddress[i])) { - throw new AddressError( - "IPv4 addresses can't have leading zeroes.", - address.replace( - constants4.RE_ADDRESS, - this.address4.parsedAddress.map(spanLeadingZeroes4).join('.'), - ), - ); - } - } - - this.v4 = true; - - groups[groups.length - 1] = this.address4.toGroup6(); - - address = groups.join(':'); - } - - return address; - } - - // TODO: Make private? - parse(address: string): string[] { - address = this.parse4in6(address); - - const badCharacters = address.match(constants6.RE_BAD_CHARACTERS); - - if (badCharacters) { - throw new AddressError( - `Bad character${ - badCharacters.length > 1 ? 's' : '' - } detected in address: ${badCharacters.join('')}`, - address.replace(constants6.RE_BAD_CHARACTERS, '$1'), - ); - } - - const badAddress = address.match(constants6.RE_BAD_ADDRESS); - - if (badAddress) { - throw new AddressError( - `Address failed regex: ${badAddress.join('')}`, - address.replace(constants6.RE_BAD_ADDRESS, '$1'), - ); - } - - let groups: string[] = []; - - const halves = address.split('::'); - - if (halves.length === 2) { - let first = halves[0].split(':'); - let last = halves[1].split(':'); - - if (first.length === 1 && first[0] === '') { - first = []; - } - - if (last.length === 1 && last[0] === '') { - last = []; - } - - const remaining = this.groups - (first.length + last.length); - - if (!remaining) { - throw new AddressError('Error parsing groups'); - } - - this.elidedGroups = remaining; - - this.elisionBegin = first.length; - this.elisionEnd = first.length + this.elidedGroups; - - groups = groups.concat(first); - - for (let i = 0; i < remaining; i++) { - groups.push('0'); - } - - groups = groups.concat(last); - } else if (halves.length === 1) { - groups = address.split(':'); - - this.elidedGroups = 0; - } else { - throw new AddressError('Too many :: groups found'); - } - - groups = groups.map((group: string) => parseInt(group, 16).toString(16)); - - if (groups.length !== this.groups) { - throw new AddressError('Incorrect number of groups found'); - } - - return groups; - } - - /** - * Return the canonical form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - canonicalForm(): string { - return this.parsedAddress.map(paddedHex).join(':'); - } - - /** - * Return the decimal form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - decimal(): string { - return this.parsedAddress.map((n) => parseInt(n, 16).toString(10).padStart(5, '0')).join(':'); - } - - /** - * Return the address as a BigInt - * @memberof Address6 - * @instance - * @returns {bigint} - */ - bigInt(): bigint { - return BigInt(`0x${this.parsedAddress.map(paddedHex).join('')}`); - } - - /** - * Return the last two groups of this address as an IPv4 address string - * @memberof Address6 - * @instance - * @returns {Address4} - * @example - * var address = new Address6('2001:4860:4001::1825:bf11'); - * address.to4().correctForm(); // '24.37.191.17' - */ - to4(): Address4 { - const binary = this.binaryZeroPad().split(''); - - return Address4.fromHex(BigInt(`0b${binary.slice(96, 128).join('')}`).toString(16)); - } - - /** - * Return the v4-in-v6 form of the address - * @memberof Address6 - * @instance - * @returns {String} - */ - to4in6(): string { - const address4 = this.to4(); - const address6 = new Address6(this.parsedAddress.slice(0, 6).join(':'), 6); - - const correct = address6.correctForm(); - - let infix = ''; - - if (!/:$/.test(correct)) { - infix = ':'; - } - - return correct + infix + address4.address; - } - - /** - * Return an object containing the Teredo properties of the address - * @memberof Address6 - * @instance - * @returns {Object} - */ - inspectTeredo(): TeredoProperties { - /* - - Bits 0 to 31 are set to the Teredo prefix (normally 2001:0000::/32). - - Bits 32 to 63 embed the primary IPv4 address of the Teredo server that - is used. - - Bits 64 to 79 can be used to define some flags. Currently only the - higher order bit is used; it is set to 1 if the Teredo client is - located behind a cone NAT, 0 otherwise. For Microsoft's Windows Vista - and Windows Server 2008 implementations, more bits are used. In those - implementations, the format for these 16 bits is "CRAAAAUG AAAAAAAA", - where "C" remains the "Cone" flag. The "R" bit is reserved for future - use. The "U" bit is for the Universal/Local flag (set to 0). The "G" bit - is Individual/Group flag (set to 0). The A bits are set to a 12-bit - randomly generated number chosen by the Teredo client to introduce - additional protection for the Teredo node against IPv6-based scanning - attacks. - - Bits 80 to 95 contains the obfuscated UDP port number. This is the - port number that is mapped by the NAT to the Teredo client with all - bits inverted. - - Bits 96 to 127 contains the obfuscated IPv4 address. This is the - public IPv4 address of the NAT with all bits inverted. - */ - const prefix = this.getBitsBase16(0, 32); - - const bitsForUdpPort: bigint = this.getBits(80, 96); - // eslint-disable-next-line no-bitwise - const udpPort = (bitsForUdpPort ^ BigInt('0xffff')).toString(); - - const server4 = Address4.fromHex(this.getBitsBase16(32, 64)); - - const bitsForClient4 = this.getBits(96, 128); - // eslint-disable-next-line no-bitwise - const client4 = Address4.fromHex((bitsForClient4 ^ BigInt('0xffffffff')).toString(16)); - - const flagsBase2 = this.getBitsBase2(64, 80); - - const coneNat = testBit(flagsBase2, 15); - const reserved = testBit(flagsBase2, 14); - const groupIndividual = testBit(flagsBase2, 8); - const universalLocal = testBit(flagsBase2, 9); - const nonce = BigInt(`0b${flagsBase2.slice(2, 6) + flagsBase2.slice(8, 16)}`).toString(10); - - return { - prefix: `${prefix.slice(0, 4)}:${prefix.slice(4, 8)}`, - server4: server4.address, - client4: client4.address, - flags: flagsBase2, - coneNat, - microsoft: { - reserved, - universalLocal, - groupIndividual, - nonce, - }, - udpPort, - }; - } - - /** - * Return an object containing the 6to4 properties of the address - * @memberof Address6 - * @instance - * @returns {Object} - */ - inspect6to4(): SixToFourProperties { - /* - - Bits 0 to 15 are set to the 6to4 prefix (2002::/16). - - Bits 16 to 48 embed the IPv4 address of the 6to4 gateway that is used. - */ - - const prefix = this.getBitsBase16(0, 16); - - const gateway = Address4.fromHex(this.getBitsBase16(16, 48)); - - return { - prefix: prefix.slice(0, 4), - gateway: gateway.address, - }; - } - - /** - * Return a v6 6to4 address from a v6 v4inv6 address - * @memberof Address6 - * @instance - * @returns {Address6} - */ - to6to4(): Address6 | null { - if (!this.is4()) { - return null; - } - - const addr6to4 = [ - '2002', - this.getBitsBase16(96, 112), - this.getBitsBase16(112, 128), - '', - '/16', - ].join(':'); - - return new Address6(addr6to4); - } - - /** - * Return a byte array - * @memberof Address6 - * @instance - * @returns {Array} - */ - toByteArray(): number[] { - const valueWithoutPadding = this.bigInt().toString(16); - const leadingPad = '0'.repeat(valueWithoutPadding.length % 2); - - const value = `${leadingPad}${valueWithoutPadding}`; - - const bytes = []; - for (let i = 0, length = value.length; i < length; i += 2) { - bytes.push(parseInt(value.substring(i, i + 2), 16)); - } - - return bytes; - } - - /** - * Return an unsigned byte array - * @memberof Address6 - * @instance - * @returns {Array} - */ - toUnsignedByteArray(): number[] { - return this.toByteArray().map(unsignByte); - } - - /** - * Convert a byte array to an Address6 object - * @memberof Address6 - * @static - * @returns {Address6} - */ - static fromByteArray(bytes: Array): Address6 { - return this.fromUnsignedByteArray(bytes.map(unsignByte)); - } - - /** - * Convert an unsigned byte array to an Address6 object - * @memberof Address6 - * @static - * @returns {Address6} - */ - static fromUnsignedByteArray(bytes: Array): Address6 { - const BYTE_MAX = BigInt('256'); - let result = BigInt('0'); - let multiplier = BigInt('1'); - - for (let i = bytes.length - 1; i >= 0; i--) { - result += multiplier * BigInt(bytes[i].toString(10)); - - multiplier *= BYTE_MAX; - } - - return Address6.fromBigInt(result); - } - - // #region Attributes - /** - * Returns true if the given address is in the subnet of the current address - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isInSubnet = common.isInSubnet; - - /** - * Returns true if the address is correct, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isCorrect = common.isCorrect(constants6.BITS); - - /** - * Returns true if the address is in the canonical form, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isCanonical(): boolean { - return this.addressMinusSuffix === this.canonicalForm(); - } - - /** - * Returns true if the address is a link local address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isLinkLocal(): boolean { - // Zeroes are required, i.e. we can't check isInSubnet with 'fe80::/10' - if ( - this.getBitsBase2(0, 64) === - '1111111010000000000000000000000000000000000000000000000000000000' - ) { - return true; - } - - return false; - } - - /** - * Returns true if the address is a multicast address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isMulticast(): boolean { - return this.getType() === 'Multicast'; - } - - /** - * Returns true if the address is a v4-in-v6 address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - is4(): boolean { - return this.v4; - } - - /** - * Returns true if the address is a Teredo address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isTeredo(): boolean { - return this.isInSubnet(new Address6('2001::/32')); - } - - /** - * Returns true if the address is a 6to4 address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - is6to4(): boolean { - return this.isInSubnet(new Address6('2002::/16')); - } - - /** - * Returns true if the address is a loopback address, false otherwise - * @memberof Address6 - * @instance - * @returns {boolean} - */ - isLoopback(): boolean { - return this.getType() === 'Loopback'; - } - // #endregion - - // #region HTML - /** - * @returns {String} the address in link form with a default port of 80 - */ - href(optionalPort?: number | string): string { - if (optionalPort === undefined) { - optionalPort = ''; - } else { - optionalPort = `:${optionalPort}`; - } - - return `http://[${this.correctForm()}]${optionalPort}/`; - } - - /** - * @returns {String} a link suitable for conveying the address via a URL hash - */ - link(options?: { className?: string; prefix?: string; v4?: boolean }): string { - if (!options) { - options = {}; - } - - if (options.className === undefined) { - options.className = ''; - } - - if (options.prefix === undefined) { - options.prefix = '/#address='; - } - - if (options.v4 === undefined) { - options.v4 = false; - } - - let formFunction = this.correctForm; - - if (options.v4) { - formFunction = this.to4in6; - } - - const form = formFunction.call(this); - - if (options.className) { - return `${form}`; - } - - return `${form}`; - } - - /** - * Groups an address - * @returns {String} - */ - group(): string { - if (this.elidedGroups === 0) { - // The simple case - return helpers.simpleGroup(this.address).join(':'); - } - - assert(typeof this.elidedGroups === 'number'); - assert(typeof this.elisionBegin === 'number'); - - // The elided case - const output = []; - - const [left, right] = this.address.split('::'); - - if (left.length) { - output.push(...helpers.simpleGroup(left)); - } else { - output.push(''); - } - - const classes = ['hover-group']; - - for (let i = this.elisionBegin; i < this.elisionBegin + this.elidedGroups; i++) { - classes.push(`group-${i}`); - } - - output.push(``); - - if (right.length) { - output.push(...helpers.simpleGroup(right, this.elisionEnd)); - } else { - output.push(''); - } - - if (this.is4()) { - assert(this.address4 instanceof Address4); - - output.pop(); - output.push(this.address4.groupForV6()); - } - - return output.join(':'); - } - // #endregion - - // #region Regular expressions - /** - * Generate a regular expression string that can be used to find or validate - * all variations of this address - * @memberof Address6 - * @instance - * @param {boolean} substringSearch - * @returns {string} - */ - regularExpressionString(this: Address6, substringSearch: boolean = false): string { - let output: string[] = []; - - // TODO: revisit why this is necessary - const address6 = new Address6(this.correctForm()); - - if (address6.elidedGroups === 0) { - // The simple case - output.push(simpleRegularExpression(address6.parsedAddress)); - } else if (address6.elidedGroups === constants6.GROUPS) { - // A completely elided address - output.push(possibleElisions(constants6.GROUPS)); - } else { - // A partially elided address - const halves = address6.address.split('::'); - - if (halves[0].length) { - output.push(simpleRegularExpression(halves[0].split(':'))); - } - - assert(typeof address6.elidedGroups === 'number'); - - output.push( - possibleElisions(address6.elidedGroups, halves[0].length !== 0, halves[1].length !== 0), - ); - - if (halves[1].length) { - output.push(simpleRegularExpression(halves[1].split(':'))); - } - - output = [output.join(':')]; - } - - if (!substringSearch) { - output = [ - '(?=^|', - ADDRESS_BOUNDARY, - '|[^\\w\\:])(', - ...output, - ')(?=[^\\w\\:]|', - ADDRESS_BOUNDARY, - '|$)', - ]; - } - - return output.join(''); - } - - /** - * Generate a regular expression that can be used to find or validate all - * variations of this address. - * @memberof Address6 - * @instance - * @param {boolean} substringSearch - * @returns {RegExp} - */ - regularExpression(this: Address6, substringSearch: boolean = false): RegExp { - return new RegExp(this.regularExpressionString(substringSearch), 'i'); - } - // #endregion -} diff --git a/node_modules/ip-address/src/v4/constants.ts b/node_modules/ip-address/src/v4/constants.ts deleted file mode 100644 index 73c32f1..0000000 --- a/node_modules/ip-address/src/v4/constants.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const BITS = 32; -export const GROUPS = 4; - -export const RE_ADDRESS = - /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g; - -export const RE_SUBNET_STRING = /\/\d{1,2}$/; diff --git a/node_modules/ip-address/src/v6/constants.ts b/node_modules/ip-address/src/v6/constants.ts deleted file mode 100644 index e23bfa5..0000000 --- a/node_modules/ip-address/src/v6/constants.ts +++ /dev/null @@ -1,79 +0,0 @@ -export const BITS = 128; -export const GROUPS = 8; - -/** - * Represents IPv6 address scopes - * @memberof Address6 - * @static - */ -export const SCOPES: { [key: number]: string | undefined } = { - 0: 'Reserved', - 1: 'Interface local', - 2: 'Link local', - 4: 'Admin local', - 5: 'Site local', - 8: 'Organization local', - 14: 'Global', - 15: 'Reserved', -} as const; - -/** - * Represents IPv6 address types - * @memberof Address6 - * @static - */ -export const TYPES: { [key: string]: string | undefined } = { - 'ff01::1/128': 'Multicast (All nodes on this interface)', - 'ff01::2/128': 'Multicast (All routers on this interface)', - 'ff02::1/128': 'Multicast (All nodes on this link)', - 'ff02::2/128': 'Multicast (All routers on this link)', - 'ff05::2/128': 'Multicast (All routers in this site)', - 'ff02::5/128': 'Multicast (OSPFv3 AllSPF routers)', - 'ff02::6/128': 'Multicast (OSPFv3 AllDR routers)', - 'ff02::9/128': 'Multicast (RIP routers)', - 'ff02::a/128': 'Multicast (EIGRP routers)', - 'ff02::d/128': 'Multicast (PIM routers)', - 'ff02::16/128': 'Multicast (MLDv2 reports)', - 'ff01::fb/128': 'Multicast (mDNSv6)', - 'ff02::fb/128': 'Multicast (mDNSv6)', - 'ff05::fb/128': 'Multicast (mDNSv6)', - 'ff02::1:2/128': 'Multicast (All DHCP servers and relay agents on this link)', - 'ff05::1:2/128': 'Multicast (All DHCP servers and relay agents in this site)', - 'ff02::1:3/128': 'Multicast (All DHCP servers on this link)', - 'ff05::1:3/128': 'Multicast (All DHCP servers in this site)', - '::/128': 'Unspecified', - '::1/128': 'Loopback', - 'ff00::/8': 'Multicast', - 'fe80::/10': 'Link-local unicast', -} as const; - -/** - * A regular expression that matches bad characters in an IPv6 address - * @memberof Address6 - * @static - */ -export const RE_BAD_CHARACTERS = /([^0-9a-f:/%])/gi; - -/** - * A regular expression that matches an incorrect IPv6 address - * @memberof Address6 - * @static - */ -export const RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi; - -/** - * A regular expression that matches an IPv6 subnet - * @memberof Address6 - * @static - */ -export const RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/; - -/** - * A regular expression that matches an IPv6 zone - * @memberof Address6 - * @static - */ -export const RE_ZONE_STRING = /%.*$/; - -export const RE_URL = /^\[{0,1}([0-9a-f:]+)\]{0,1}/; -export const RE_URL_WITH_PORT = /\[([0-9a-f:]+)\]:([0-9]{1,5})/; diff --git a/node_modules/ip-address/src/v6/helpers.ts b/node_modules/ip-address/src/v6/helpers.ts deleted file mode 100644 index e40074c..0000000 --- a/node_modules/ip-address/src/v6/helpers.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @returns {String} the string with all zeroes contained in a - */ -export function spanAllZeroes(s: string): string { - return s.replace(/(0+)/g, '$1'); -} - -/** - * @returns {String} the string with each character contained in a - */ -export function spanAll(s: string, offset: number = 0): string { - const letters = s.split(''); - - return letters - .map( - (n, i) => `${spanAllZeroes(n)}`, - ) - .join(''); -} - -function spanLeadingZeroesSimple(group: string): string { - return group.replace(/^(0+)/, '$1'); -} - -/** - * @returns {String} the string with leading zeroes contained in a - */ -export function spanLeadingZeroes(address: string): string { - const groups = address.split(':'); - - return groups.map((g) => spanLeadingZeroesSimple(g)).join(':'); -} - -/** - * Groups an address - * @returns {String} a grouped address - */ -export function simpleGroup(addressString: string, offset: number = 0): string[] { - const groups = addressString.split(':'); - - return groups.map((g, i) => { - if (/group-v4/.test(g)) { - return g; - } - - return `${spanLeadingZeroesSimple(g)}`; - }); -} diff --git a/node_modules/ip-address/src/v6/regular-expressions.ts b/node_modules/ip-address/src/v6/regular-expressions.ts deleted file mode 100644 index a511b84..0000000 --- a/node_modules/ip-address/src/v6/regular-expressions.ts +++ /dev/null @@ -1,94 +0,0 @@ -import * as v6 from './constants'; - -export function groupPossibilities(possibilities: string[]): string { - return `(${possibilities.join('|')})`; -} - -export function padGroup(group: string): string { - if (group.length < 4) { - return `0{0,${4 - group.length}}${group}`; - } - - return group; -} - -export const ADDRESS_BOUNDARY = '[^A-Fa-f0-9:]'; - -export function simpleRegularExpression(groups: string[]) { - const zeroIndexes: number[] = []; - - groups.forEach((group, i) => { - const groupInteger = parseInt(group, 16); - - if (groupInteger === 0) { - zeroIndexes.push(i); - } - }); - - // You can technically elide a single 0, this creates the regular expressions - // to match that eventuality - const possibilities = zeroIndexes.map((zeroIndex) => - groups - .map((group, i) => { - if (i === zeroIndex) { - const elision = i === 0 || i === v6.GROUPS - 1 ? ':' : ''; - - return groupPossibilities([padGroup(group), elision]); - } - - return padGroup(group); - }) - .join(':'), - ); - - // The simplest case - possibilities.push(groups.map(padGroup).join(':')); - - return groupPossibilities(possibilities); -} - -export function possibleElisions( - elidedGroups: number, - moreLeft?: boolean, - moreRight?: boolean, -): string { - const left = moreLeft ? '' : ':'; - const right = moreRight ? '' : ':'; - - const possibilities = []; - - // 1. elision of everything (::) - if (!moreLeft && !moreRight) { - possibilities.push('::'); - } - - // 2. complete elision of the middle - if (moreLeft && moreRight) { - possibilities.push(''); - } - - if ((moreRight && !moreLeft) || (!moreRight && moreLeft)) { - // 3. complete elision of one side - possibilities.push(':'); - } - - // 4. elision from the left side - possibilities.push(`${left}(:0{1,4}){1,${elidedGroups - 1}}`); - - // 5. elision from the right side - possibilities.push(`(0{1,4}:){1,${elidedGroups - 1}}${right}`); - - // 6. no elision - possibilities.push(`(0{1,4}:){${elidedGroups - 1}}0{1,4}`); - - // 7. elision (including sloppy elision) from the middle - for (let groups = 1; groups < elidedGroups - 1; groups++) { - for (let position = 1; position < elidedGroups - groups; position++) { - possibilities.push( - `(0{1,4}:){${position}}:(0{1,4}:){${elidedGroups - position - groups - 1}}0{1,4}`, - ); - } - } - - return groupPossibilities(possibilities); -} diff --git a/node_modules/ipaddr.js/LICENSE b/node_modules/ipaddr.js/LICENSE deleted file mode 100644 index f6b37b5..0000000 --- a/node_modules/ipaddr.js/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2011-2017 whitequark - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/ipaddr.js/README.md b/node_modules/ipaddr.js/README.md deleted file mode 100644 index f57725b..0000000 --- a/node_modules/ipaddr.js/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# ipaddr.js — an IPv6 and IPv4 address manipulation library [![Build Status](https://travis-ci.org/whitequark/ipaddr.js.svg)](https://travis-ci.org/whitequark/ipaddr.js) - -ipaddr.js is a small (1.9K minified and gzipped) library for manipulating -IP addresses in JavaScript environments. It runs on both CommonJS runtimes -(e.g. [nodejs]) and in a web browser. - -ipaddr.js allows you to verify and parse string representation of an IP -address, match it against a CIDR range or range list, determine if it falls -into some reserved ranges (examples include loopback and private ranges), -and convert between IPv4 and IPv4-mapped IPv6 addresses. - -[nodejs]: http://nodejs.org - -## Installation - -`npm install ipaddr.js` - -or - -`bower install ipaddr.js` - -## API - -ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS, -it is exported from the module: - -```js -var ipaddr = require('ipaddr.js'); -``` - -The API consists of several global methods and two classes: ipaddr.IPv6 and ipaddr.IPv4. - -### Global methods - -There are three global methods defined: `ipaddr.isValid`, `ipaddr.parse` and -`ipaddr.process`. All of them receive a string as a single parameter. - -The `ipaddr.isValid` method returns `true` if the address is a valid IPv4 or -IPv6 address, and `false` otherwise. It does not throw any exceptions. - -The `ipaddr.parse` method returns an object representing the IP address, -or throws an `Error` if the passed string is not a valid representation of an -IP address. - -The `ipaddr.process` method works just like the `ipaddr.parse` one, but it -automatically converts IPv4-mapped IPv6 addresses to their IPv4 counterparts -before returning. It is useful when you have a Node.js instance listening -on an IPv6 socket, and the `net.ivp6.bindv6only` sysctl parameter (or its -equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4 -connections on your IPv6-only socket, but the remote address will be mangled. -Use `ipaddr.process` method to automatically demangle it. - -### Object representation - -Parsing methods return an object which descends from `ipaddr.IPv6` or -`ipaddr.IPv4`. These objects share some properties, but most of them differ. - -#### Shared properties - -One can determine the type of address by calling `addr.kind()`. It will return -either `"ipv6"` or `"ipv4"`. - -An address can be converted back to its string representation with `addr.toString()`. -Note that this method: - * does not return the original string used to create the object (in fact, there is - no way of getting that string) - * returns a compact representation (when it is applicable) - -A `match(range, bits)` method can be used to check if the address falls into a -certain CIDR range. -Note that an address can be (obviously) matched only against an address of the same type. - -For example: - -```js -var addr = ipaddr.parse("2001:db8:1234::1"); -var range = ipaddr.parse("2001:db8::"); - -addr.match(range, 32); // => true -``` - -Alternatively, `match` can also be called as `match([range, bits])`. In this way, -it can be used together with the `parseCIDR(string)` method, which parses an IP -address together with a CIDR range. - -For example: - -```js -var addr = ipaddr.parse("2001:db8:1234::1"); - -addr.match(ipaddr.parseCIDR("2001:db8::/32")); // => true -``` - -A `range()` method returns one of predefined names for several special ranges defined -by IP protocols. The exact names (and their respective CIDR ranges) can be looked up -in the source: [IPv6 ranges] and [IPv4 ranges]. Some common ones include `"unicast"` -(the default one) and `"reserved"`. - -You can match against your own range list by using -`ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with a mix of IPv6 or IPv4 addresses, and accepts a name-to-subnet map as the range list. For example: - -```js -var rangeList = { - documentationOnly: [ ipaddr.parse('2001:db8::'), 32 ], - tunnelProviders: [ - [ ipaddr.parse('2001:470::'), 32 ], // he.net - [ ipaddr.parse('2001:5c0::'), 32 ] // freenet6 - ] -}; -ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "tunnelProviders" -``` - -The addresses can be converted to their byte representation with `toByteArray()`. -(Actually, JavaScript mostly does not know about byte buffers. They are emulated with -arrays of numbers, each in range of 0..255.) - -```js -var bytes = ipaddr.parse('2a00:1450:8007::68').toByteArray(); // ipv6.google.com -bytes // => [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, , 0x00, 0x68 ] -``` - -The `ipaddr.IPv4` and `ipaddr.IPv6` objects have some methods defined, too. All of them -have the same interface for both protocols, and are similar to global methods. - -`ipaddr.IPvX.isValid(string)` can be used to check if the string is a valid address -for particular protocol, and `ipaddr.IPvX.parse(string)` is the error-throwing parser. - -`ipaddr.IPvX.isValid(string)` uses the same format for parsing as the POSIX `inet_ntoa` function, which accepts unusual formats like `0xc0.168.1.1` or `0x10000000`. The function `ipaddr.IPv4.isValidFourPartDecimal(string)` validates the IPv4 address and also ensures that it is written in four-part decimal format. - -[IPv6 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L186 -[IPv4 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L71 - -#### IPv6 properties - -Sometimes you will want to convert IPv6 not to a compact string representation (with -the `::` substitution); the `toNormalizedString()` method will return an address where -all zeroes are explicit. - -For example: - -```js -var addr = ipaddr.parse("2001:0db8::0001"); -addr.toString(); // => "2001:db8::1" -addr.toNormalizedString(); // => "2001:db8:0:0:0:0:0:1" -``` - -The `isIPv4MappedAddress()` method will return `true` if this address is an IPv4-mapped -one, and `toIPv4Address()` will return an IPv4 object address. - -To access the underlying binary representation of the address, use `addr.parts`. - -```js -var addr = ipaddr.parse("2001:db8:10::1234:DEAD"); -addr.parts // => [0x2001, 0xdb8, 0x10, 0, 0, 0, 0x1234, 0xdead] -``` - -A IPv6 zone index can be accessed via `addr.zoneId`: - -```js -var addr = ipaddr.parse("2001:db8::%eth0"); -addr.zoneId // => 'eth0' -``` - -#### IPv4 properties - -`toIPv4MappedAddress()` will return a corresponding IPv4-mapped IPv6 address. - -To access the underlying representation of the address, use `addr.octets`. - -```js -var addr = ipaddr.parse("192.168.1.1"); -addr.octets // => [192, 168, 1, 1] -``` - -`prefixLengthFromSubnetMask()` will return a CIDR prefix length for a valid IPv4 netmask or -null if the netmask is not valid. - -```js -ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask() == 28 -ipaddr.IPv4.parse('255.192.164.0').prefixLengthFromSubnetMask() == null -``` - -`subnetMaskFromPrefixLength()` will return an IPv4 netmask for a valid CIDR prefix length. - -```js -ipaddr.IPv4.subnetMaskFromPrefixLength(24) == "255.255.255.0" -ipaddr.IPv4.subnetMaskFromPrefixLength(29) == "255.255.255.248" -``` - -`broadcastAddressFromCIDR()` will return the broadcast address for a given IPv4 interface and netmask in CIDR notation. -```js -ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/24") == "172.0.0.255" -``` -`networkAddressFromCIDR()` will return the network address for a given IPv4 interface and netmask in CIDR notation. -```js -ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/24") == "172.0.0.0" -``` - -#### Conversion - -IPv4 and IPv6 can be converted bidirectionally to and from network byte order (MSB) byte arrays. - -The `fromByteArray()` method will take an array and create an appropriate IPv4 or IPv6 object -if the input satisfies the requirements. For IPv4 it has to be an array of four 8-bit values, -while for IPv6 it has to be an array of sixteen 8-bit values. - -For example: -```js -var addr = ipaddr.fromByteArray([0x7f, 0, 0, 1]); -addr.toString(); // => "127.0.0.1" -``` - -or - -```js -var addr = ipaddr.fromByteArray([0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) -addr.toString(); // => "2001:db8::1" -``` - -Both objects also offer a `toByteArray()` method, which returns an array in network byte order (MSB). - -For example: -```js -var addr = ipaddr.parse("127.0.0.1"); -addr.toByteArray(); // => [0x7f, 0, 0, 1] -``` - -or - -```js -var addr = ipaddr.parse("2001:db8::1"); -addr.toByteArray(); // => [0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] -``` diff --git a/node_modules/ipaddr.js/ipaddr.min.js b/node_modules/ipaddr.js/ipaddr.min.js deleted file mode 100644 index b54a7cc..0000000 --- a/node_modules/ipaddr.js/ipaddr.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var r,t,n,e,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,n,e){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;e>0;){if((o=n-e)<0&&(o=0),r[i]>>o!=t[i]>>o)return!1;e-=n,i+=1}return!0},t.subnetMatch=function(r,t,n){var e,i,o,a,s;null==n&&(n="unicast");for(o in t)for(!(a=t[o])[0]||a[0]instanceof Array||(a=[a]),e=0,i=a.length;e=0;t=n+=-1){if(!((e=this.octets[t])in a))return null;if(o=a[e],i&&0!==o)return null;8!==o&&(i=!0),r+=o}return 32-r},r}(),n="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},t.IPv4.parser=function(r){var t,n,i,o,a;if(n=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(e.fourOctet))return function(){var r,e,o,a;for(a=[],r=0,e=(o=t.slice(1,6)).length;r4294967295||a<0)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;r<=24;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r,t){var n,e,i,o,a,s;if(16===r.length)for(this.parts=[],n=e=0;e<=14;n=e+=2)this.parts.push(r[n]<<8|r[n+1]);else{if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=r}for(i=0,o=(s=this.parts).length;it&&(r=n.index,t=n[0].length);return t<0?i:i.substring(0,r)+"::"+i.substring(r+t)},r.prototype.toByteArray=function(){var r,t,n,e,i;for(r=[],t=0,n=(i=this.parts).length;t>8),r.push(255&e);return r},r.prototype.toNormalizedString=function(){var r,t,n;return r=function(){var r,n,e,i;for(i=[],r=0,n=(e=this.parts).length;r>8,255&r,n>>8,255&n])},r.prototype.prefixLengthFromSubnetMask=function(){var r,t,n,e,i,o,a;for(a={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r=0,i=!1,t=n=7;n>=0;t=n+=-1){if(!((e=this.parts[t])in a))return null;if(o=a[e],i&&0!==o)return null;16!==o&&(i=!0),r+=o}return 128-r},r}(),i="(?:[0-9a-f]+::?)+",o={zoneIndex:new RegExp("%[0-9a-z]{1,}","i"),native:new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?(%[0-9a-z]{1,})?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+n+"\\."+n+"\\."+n+"\\."+n+"(%[0-9a-z]{1,})?$","i")},r=function(r,t){var n,e,i,a,s,p;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for((p=(r.match(o.zoneIndex)||[])[0])&&(p=p.substring(1),r=r.replace(/%.+$/,"")),n=0,e=-1;(e=r.indexOf(":",e+1))>=0;)n++;if("::"===r.substr(0,2)&&n--,"::"===r.substr(-2,2)&&n--,n>t)return null;for(s=t-n,a=":";s--;)a+="0:";return":"===(r=r.replace("::",a))[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),t=function(){var t,n,e,o;for(o=[],t=0,n=(e=r.split(":")).length;t=0&&t<=32)return e=[this.parse(n[1]),t],Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e;throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},t.IPv4.subnetMaskFromPrefixLength=function(r){var t,n,e;if((r=parseInt(r))<0||r>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(e=[0,0,0,0],n=0,t=Math.floor(r/8);n=0&&t<=128)return e=[this.parse(n[1]),t],Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){try{return t.IPv6.parseCIDR(r)}catch(n){n;try{return t.IPv4.parseCIDR(r)}catch(r){throw r,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.fromByteArray=function(r){var n;if(4===(n=r.length))return new t.IPv4(r);if(16===n)return new t.IPv6(r);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},t.process=function(r){var t;return t=this.parse(r),"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this); \ No newline at end of file diff --git a/node_modules/ipaddr.js/lib/ipaddr.js b/node_modules/ipaddr.js/lib/ipaddr.js deleted file mode 100644 index 18bd93b..0000000 --- a/node_modules/ipaddr.js/lib/ipaddr.js +++ /dev/null @@ -1,673 +0,0 @@ -(function() { - var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex; - - ipaddr = {}; - - root = this; - - if ((typeof module !== "undefined" && module !== null) && module.exports) { - module.exports = ipaddr; - } else { - root['ipaddr'] = ipaddr; - } - - matchCIDR = function(first, second, partSize, cidrBits) { - var part, shift; - if (first.length !== second.length) { - throw new Error("ipaddr: cannot match CIDR for objects with different lengths"); - } - part = 0; - while (cidrBits > 0) { - shift = partSize - cidrBits; - if (shift < 0) { - shift = 0; - } - if (first[part] >> shift !== second[part] >> shift) { - return false; - } - cidrBits -= partSize; - part += 1; - } - return true; - }; - - ipaddr.subnetMatch = function(address, rangeList, defaultName) { - var k, len, rangeName, rangeSubnets, subnet; - if (defaultName == null) { - defaultName = 'unicast'; - } - for (rangeName in rangeList) { - rangeSubnets = rangeList[rangeName]; - if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) { - rangeSubnets = [rangeSubnets]; - } - for (k = 0, len = rangeSubnets.length; k < len; k++) { - subnet = rangeSubnets[k]; - if (address.kind() === subnet[0].kind()) { - if (address.match.apply(address, subnet)) { - return rangeName; - } - } - } - } - return defaultName; - }; - - ipaddr.IPv4 = (function() { - function IPv4(octets) { - var k, len, octet; - if (octets.length !== 4) { - throw new Error("ipaddr: ipv4 octet count should be 4"); - } - for (k = 0, len = octets.length; k < len; k++) { - octet = octets[k]; - if (!((0 <= octet && octet <= 255))) { - throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); - } - } - this.octets = octets; - } - - IPv4.prototype.kind = function() { - return 'ipv4'; - }; - - IPv4.prototype.toString = function() { - return this.octets.join("."); - }; - - IPv4.prototype.toNormalizedString = function() { - return this.toString(); - }; - - IPv4.prototype.toByteArray = function() { - return this.octets.slice(0); - }; - - IPv4.prototype.match = function(other, cidrRange) { - var ref; - if (cidrRange === void 0) { - ref = other, other = ref[0], cidrRange = ref[1]; - } - if (other.kind() !== 'ipv4') { - throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one"); - } - return matchCIDR(this.octets, other.octets, 8, cidrRange); - }; - - IPv4.prototype.SpecialRanges = { - unspecified: [[new IPv4([0, 0, 0, 0]), 8]], - broadcast: [[new IPv4([255, 255, 255, 255]), 32]], - multicast: [[new IPv4([224, 0, 0, 0]), 4]], - linkLocal: [[new IPv4([169, 254, 0, 0]), 16]], - loopback: [[new IPv4([127, 0, 0, 0]), 8]], - carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]], - "private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]], - reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]] - }; - - IPv4.prototype.range = function() { - return ipaddr.subnetMatch(this, this.SpecialRanges); - }; - - IPv4.prototype.toIPv4MappedAddress = function() { - return ipaddr.IPv6.parse("::ffff:" + (this.toString())); - }; - - IPv4.prototype.prefixLengthFromSubnetMask = function() { - var cidr, i, k, octet, stop, zeros, zerotable; - zerotable = { - 0: 8, - 128: 7, - 192: 6, - 224: 5, - 240: 4, - 248: 3, - 252: 2, - 254: 1, - 255: 0 - }; - cidr = 0; - stop = false; - for (i = k = 3; k >= 0; i = k += -1) { - octet = this.octets[i]; - if (octet in zerotable) { - zeros = zerotable[octet]; - if (stop && zeros !== 0) { - return null; - } - if (zeros !== 8) { - stop = true; - } - cidr += zeros; - } else { - return null; - } - } - return 32 - cidr; - }; - - return IPv4; - - })(); - - ipv4Part = "(0?\\d+|0x[a-f0-9]+)"; - - ipv4Regexes = { - fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", 'i'), - longValue: new RegExp("^" + ipv4Part + "$", 'i') - }; - - ipaddr.IPv4.parser = function(string) { - var match, parseIntAuto, part, shift, value; - parseIntAuto = function(string) { - if (string[0] === "0" && string[1] !== "x") { - return parseInt(string, 8); - } else { - return parseInt(string); - } - }; - if (match = string.match(ipv4Regexes.fourOctet)) { - return (function() { - var k, len, ref, results; - ref = match.slice(1, 6); - results = []; - for (k = 0, len = ref.length; k < len; k++) { - part = ref[k]; - results.push(parseIntAuto(part)); - } - return results; - })(); - } else if (match = string.match(ipv4Regexes.longValue)) { - value = parseIntAuto(match[1]); - if (value > 0xffffffff || value < 0) { - throw new Error("ipaddr: address outside defined range"); - } - return ((function() { - var k, results; - results = []; - for (shift = k = 0; k <= 24; shift = k += 8) { - results.push((value >> shift) & 0xff); - } - return results; - })()).reverse(); - } else { - return null; - } - }; - - ipaddr.IPv6 = (function() { - function IPv6(parts, zoneId) { - var i, k, l, len, part, ref; - if (parts.length === 16) { - this.parts = []; - for (i = k = 0; k <= 14; i = k += 2) { - this.parts.push((parts[i] << 8) | parts[i + 1]); - } - } else if (parts.length === 8) { - this.parts = parts; - } else { - throw new Error("ipaddr: ipv6 part count should be 8 or 16"); - } - ref = this.parts; - for (l = 0, len = ref.length; l < len; l++) { - part = ref[l]; - if (!((0 <= part && part <= 0xffff))) { - throw new Error("ipaddr: ipv6 part should fit in 16 bits"); - } - } - if (zoneId) { - this.zoneId = zoneId; - } - } - - IPv6.prototype.kind = function() { - return 'ipv6'; - }; - - IPv6.prototype.toString = function() { - return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::'); - }; - - IPv6.prototype.toRFC5952String = function() { - var bestMatchIndex, bestMatchLength, match, regex, string; - regex = /((^|:)(0(:|$)){2,})/g; - string = this.toNormalizedString(); - bestMatchIndex = 0; - bestMatchLength = -1; - while ((match = regex.exec(string))) { - if (match[0].length > bestMatchLength) { - bestMatchIndex = match.index; - bestMatchLength = match[0].length; - } - } - if (bestMatchLength < 0) { - return string; - } - return string.substring(0, bestMatchIndex) + '::' + string.substring(bestMatchIndex + bestMatchLength); - }; - - IPv6.prototype.toByteArray = function() { - var bytes, k, len, part, ref; - bytes = []; - ref = this.parts; - for (k = 0, len = ref.length; k < len; k++) { - part = ref[k]; - bytes.push(part >> 8); - bytes.push(part & 0xff); - } - return bytes; - }; - - IPv6.prototype.toNormalizedString = function() { - var addr, part, suffix; - addr = ((function() { - var k, len, ref, results; - ref = this.parts; - results = []; - for (k = 0, len = ref.length; k < len; k++) { - part = ref[k]; - results.push(part.toString(16)); - } - return results; - }).call(this)).join(":"); - suffix = ''; - if (this.zoneId) { - suffix = '%' + this.zoneId; - } - return addr + suffix; - }; - - IPv6.prototype.toFixedLengthString = function() { - var addr, part, suffix; - addr = ((function() { - var k, len, ref, results; - ref = this.parts; - results = []; - for (k = 0, len = ref.length; k < len; k++) { - part = ref[k]; - results.push(part.toString(16).padStart(4, '0')); - } - return results; - }).call(this)).join(":"); - suffix = ''; - if (this.zoneId) { - suffix = '%' + this.zoneId; - } - return addr + suffix; - }; - - IPv6.prototype.match = function(other, cidrRange) { - var ref; - if (cidrRange === void 0) { - ref = other, other = ref[0], cidrRange = ref[1]; - } - if (other.kind() !== 'ipv6') { - throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one"); - } - return matchCIDR(this.parts, other.parts, 16, cidrRange); - }; - - IPv6.prototype.SpecialRanges = { - unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128], - linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10], - multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8], - loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128], - uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7], - ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96], - rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96], - rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96], - '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16], - teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32], - reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]] - }; - - IPv6.prototype.range = function() { - return ipaddr.subnetMatch(this, this.SpecialRanges); - }; - - IPv6.prototype.isIPv4MappedAddress = function() { - return this.range() === 'ipv4Mapped'; - }; - - IPv6.prototype.toIPv4Address = function() { - var high, low, ref; - if (!this.isIPv4MappedAddress()) { - throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4"); - } - ref = this.parts.slice(-2), high = ref[0], low = ref[1]; - return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]); - }; - - IPv6.prototype.prefixLengthFromSubnetMask = function() { - var cidr, i, k, part, stop, zeros, zerotable; - zerotable = { - 0: 16, - 32768: 15, - 49152: 14, - 57344: 13, - 61440: 12, - 63488: 11, - 64512: 10, - 65024: 9, - 65280: 8, - 65408: 7, - 65472: 6, - 65504: 5, - 65520: 4, - 65528: 3, - 65532: 2, - 65534: 1, - 65535: 0 - }; - cidr = 0; - stop = false; - for (i = k = 7; k >= 0; i = k += -1) { - part = this.parts[i]; - if (part in zerotable) { - zeros = zerotable[part]; - if (stop && zeros !== 0) { - return null; - } - if (zeros !== 16) { - stop = true; - } - cidr += zeros; - } else { - return null; - } - } - return 128 - cidr; - }; - - return IPv6; - - })(); - - ipv6Part = "(?:[0-9a-f]+::?)+"; - - zoneIndex = "%[0-9a-z]{1,}"; - - ipv6Regexes = { - zoneIndex: new RegExp(zoneIndex, 'i'), - "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?(" + zoneIndex + ")?$", 'i'), - transitional: new RegExp(("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)") + (ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part) + ("(" + zoneIndex + ")?$"), 'i') - }; - - expandIPv6 = function(string, parts) { - var colonCount, lastColon, part, replacement, replacementCount, zoneId; - if (string.indexOf('::') !== string.lastIndexOf('::')) { - return null; - } - zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0]; - if (zoneId) { - zoneId = zoneId.substring(1); - string = string.replace(/%.+$/, ''); - } - colonCount = 0; - lastColon = -1; - while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) { - colonCount++; - } - if (string.substr(0, 2) === '::') { - colonCount--; - } - if (string.substr(-2, 2) === '::') { - colonCount--; - } - if (colonCount > parts) { - return null; - } - replacementCount = parts - colonCount; - replacement = ':'; - while (replacementCount--) { - replacement += '0:'; - } - string = string.replace('::', replacement); - if (string[0] === ':') { - string = string.slice(1); - } - if (string[string.length - 1] === ':') { - string = string.slice(0, -1); - } - parts = (function() { - var k, len, ref, results; - ref = string.split(":"); - results = []; - for (k = 0, len = ref.length; k < len; k++) { - part = ref[k]; - results.push(parseInt(part, 16)); - } - return results; - })(); - return { - parts: parts, - zoneId: zoneId - }; - }; - - ipaddr.IPv6.parser = function(string) { - var addr, k, len, match, octet, octets, zoneId; - if (ipv6Regexes['native'].test(string)) { - return expandIPv6(string, 8); - } else if (match = string.match(ipv6Regexes['transitional'])) { - zoneId = match[6] || ''; - addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6); - if (addr.parts) { - octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])]; - for (k = 0, len = octets.length; k < len; k++) { - octet = octets[k]; - if (!((0 <= octet && octet <= 255))) { - return null; - } - } - addr.parts.push(octets[0] << 8 | octets[1]); - addr.parts.push(octets[2] << 8 | octets[3]); - return { - parts: addr.parts, - zoneId: addr.zoneId - }; - } - } - return null; - }; - - ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) { - return this.parser(string) !== null; - }; - - ipaddr.IPv4.isValid = function(string) { - var e; - try { - new this(this.parser(string)); - return true; - } catch (error1) { - e = error1; - return false; - } - }; - - ipaddr.IPv4.isValidFourPartDecimal = function(string) { - if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) { - return true; - } else { - return false; - } - }; - - ipaddr.IPv6.isValid = function(string) { - var addr, e; - if (typeof string === "string" && string.indexOf(":") === -1) { - return false; - } - try { - addr = this.parser(string); - new this(addr.parts, addr.zoneId); - return true; - } catch (error1) { - e = error1; - return false; - } - }; - - ipaddr.IPv4.parse = function(string) { - var parts; - parts = this.parser(string); - if (parts === null) { - throw new Error("ipaddr: string is not formatted like ip address"); - } - return new this(parts); - }; - - ipaddr.IPv6.parse = function(string) { - var addr; - addr = this.parser(string); - if (addr.parts === null) { - throw new Error("ipaddr: string is not formatted like ip address"); - } - return new this(addr.parts, addr.zoneId); - }; - - ipaddr.IPv4.parseCIDR = function(string) { - var maskLength, match, parsed; - if (match = string.match(/^(.+)\/(\d+)$/)) { - maskLength = parseInt(match[2]); - if (maskLength >= 0 && maskLength <= 32) { - parsed = [this.parse(match[1]), maskLength]; - Object.defineProperty(parsed, 'toString', { - value: function() { - return this.join('/'); - } - }); - return parsed; - } - } - throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range"); - }; - - ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) { - var filledOctetCount, j, octets; - prefix = parseInt(prefix); - if (prefix < 0 || prefix > 32) { - throw new Error('ipaddr: invalid IPv4 prefix length'); - } - octets = [0, 0, 0, 0]; - j = 0; - filledOctetCount = Math.floor(prefix / 8); - while (j < filledOctetCount) { - octets[j] = 255; - j++; - } - if (filledOctetCount < 4) { - octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8); - } - return new this(octets); - }; - - ipaddr.IPv4.broadcastAddressFromCIDR = function(string) { - var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; - try { - cidr = this.parseCIDR(string); - ipInterfaceOctets = cidr[0].toByteArray(); - subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); - octets = []; - i = 0; - while (i < 4) { - octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255); - i++; - } - return new this(octets); - } catch (error1) { - error = error1; - throw new Error('ipaddr: the address does not have IPv4 CIDR format'); - } - }; - - ipaddr.IPv4.networkAddressFromCIDR = function(string) { - var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; - try { - cidr = this.parseCIDR(string); - ipInterfaceOctets = cidr[0].toByteArray(); - subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); - octets = []; - i = 0; - while (i < 4) { - octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10)); - i++; - } - return new this(octets); - } catch (error1) { - error = error1; - throw new Error('ipaddr: the address does not have IPv4 CIDR format'); - } - }; - - ipaddr.IPv6.parseCIDR = function(string) { - var maskLength, match, parsed; - if (match = string.match(/^(.+)\/(\d+)$/)) { - maskLength = parseInt(match[2]); - if (maskLength >= 0 && maskLength <= 128) { - parsed = [this.parse(match[1]), maskLength]; - Object.defineProperty(parsed, 'toString', { - value: function() { - return this.join('/'); - } - }); - return parsed; - } - } - throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range"); - }; - - ipaddr.isValid = function(string) { - return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string); - }; - - ipaddr.parse = function(string) { - if (ipaddr.IPv6.isValid(string)) { - return ipaddr.IPv6.parse(string); - } else if (ipaddr.IPv4.isValid(string)) { - return ipaddr.IPv4.parse(string); - } else { - throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format"); - } - }; - - ipaddr.parseCIDR = function(string) { - var e; - try { - return ipaddr.IPv6.parseCIDR(string); - } catch (error1) { - e = error1; - try { - return ipaddr.IPv4.parseCIDR(string); - } catch (error1) { - e = error1; - throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format"); - } - } - }; - - ipaddr.fromByteArray = function(bytes) { - var length; - length = bytes.length; - if (length === 4) { - return new ipaddr.IPv4(bytes); - } else if (length === 16) { - return new ipaddr.IPv6(bytes); - } else { - throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); - } - }; - - ipaddr.process = function(string) { - var addr; - addr = this.parse(string); - if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) { - return addr.toIPv4Address(); - } else { - return addr; - } - }; - -}).call(this); diff --git a/node_modules/ipaddr.js/lib/ipaddr.js.d.ts b/node_modules/ipaddr.js/lib/ipaddr.js.d.ts deleted file mode 100644 index 52174b6..0000000 --- a/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -declare module "ipaddr.js" { - type IPv4Range = 'unicast' | 'unspecified' | 'broadcast' | 'multicast' | 'linkLocal' | 'loopback' | 'carrierGradeNat' | 'private' | 'reserved'; - type IPv6Range = 'unicast' | 'unspecified' | 'linkLocal' | 'multicast' | 'loopback' | 'uniqueLocal' | 'ipv4Mapped' | 'rfc6145' | 'rfc6052' | '6to4' | 'teredo' | 'reserved'; - - interface RangeList { - [name: string]: [T, number] | [T, number][]; - } - - // Common methods/properties for IPv4 and IPv6 classes. - class IP { - prefixLengthFromSubnetMask(): number | null; - toByteArray(): number[]; - toNormalizedString(): string; - toString(): string; - } - - namespace Address { - export function isValid(addr: string): boolean; - export function fromByteArray(bytes: number[]): IPv4 | IPv6; - export function parse(addr: string): IPv4 | IPv6; - export function parseCIDR(mask: string): [IPv4 | IPv6, number]; - export function process(addr: string): IPv4 | IPv6; - export function subnetMatch(addr: IPv4, rangeList: RangeList, defaultName?: string): string; - export function subnetMatch(addr: IPv6, rangeList: RangeList, defaultName?: string): string; - - export class IPv4 extends IP { - static broadcastAddressFromCIDR(addr: string): IPv4; - static isIPv4(addr: string): boolean; - static isValidFourPartDecimal(addr: string): boolean; - static isValid(addr: string): boolean; - static networkAddressFromCIDR(addr: string): IPv4; - static parse(addr: string): IPv4; - static parseCIDR(addr: string): [IPv4, number]; - static subnetMaskFromPrefixLength(prefix: number): IPv4; - constructor(octets: number[]); - octets: number[] - - kind(): 'ipv4'; - match(addr: IPv4, bits: number): boolean; - match(mask: [IPv4, number]): boolean; - range(): IPv4Range; - subnetMatch(rangeList: RangeList, defaultName?: string): string; - toIPv4MappedAddress(): IPv6; - } - - export class IPv6 extends IP { - static broadcastAddressFromCIDR(addr: string): IPv6; - static isIPv6(addr: string): boolean; - static isValid(addr: string): boolean; - static parse(addr: string): IPv6; - static parseCIDR(addr: string): [IPv6, number]; - static subnetMaskFromPrefixLength(prefix: number): IPv6; - constructor(parts: number[]); - parts: number[] - zoneId?: string - - isIPv4MappedAddress(): boolean; - kind(): 'ipv6'; - match(addr: IPv6, bits: number): boolean; - match(mask: [IPv6, number]): boolean; - range(): IPv6Range; - subnetMatch(rangeList: RangeList, defaultName?: string): string; - toIPv4Address(): IPv4; - } - } - - export = Address; -} diff --git a/node_modules/ipaddr.js/package.json b/node_modules/ipaddr.js/package.json deleted file mode 100644 index f4d3547..0000000 --- a/node_modules/ipaddr.js/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "ipaddr.js", - "description": "A library for manipulating IPv4 and IPv6 addresses in JavaScript.", - "version": "1.9.1", - "author": "whitequark ", - "directories": { - "lib": "./lib" - }, - "dependencies": {}, - "devDependencies": { - "coffee-script": "~1.12.6", - "nodeunit": "^0.11.3", - "uglify-js": "~3.0.19" - }, - "scripts": { - "test": "cake build test" - }, - "files": [ - "lib/", - "LICENSE", - "ipaddr.min.js" - ], - "keywords": [ - "ip", - "ipv4", - "ipv6" - ], - "repository": "git://github.com/whitequark/ipaddr.js", - "main": "./lib/ipaddr.js", - "engines": { - "node": ">= 0.10" - }, - "license": "MIT", - "types": "./lib/ipaddr.js.d.ts" -} diff --git a/node_modules/is-promise/LICENSE b/node_modules/is-promise/LICENSE deleted file mode 100644 index 27cc9f3..0000000 --- a/node_modules/is-promise/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Forbes Lindesay - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/is-promise/index.d.ts b/node_modules/is-promise/index.d.ts deleted file mode 100644 index 2107b42..0000000 --- a/node_modules/is-promise/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function isPromise(obj: PromiseLike | S): obj is PromiseLike; -export default isPromise; diff --git a/node_modules/is-promise/index.js b/node_modules/is-promise/index.js deleted file mode 100644 index 1bed087..0000000 --- a/node_modules/is-promise/index.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = isPromise; -module.exports.default = isPromise; - -function isPromise(obj) { - return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; -} diff --git a/node_modules/is-promise/index.mjs b/node_modules/is-promise/index.mjs deleted file mode 100644 index bf9e99b..0000000 --- a/node_modules/is-promise/index.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export default function isPromise(obj) { - return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; -} diff --git a/node_modules/is-promise/package.json b/node_modules/is-promise/package.json deleted file mode 100644 index 2a3c540..0000000 --- a/node_modules/is-promise/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "is-promise", - "version": "4.0.0", - "description": "Test whether an object looks like a promises-a+ promise", - "main": "./index.js", - "scripts": { - "test": "node test" - }, - "files": [ - "index.js", - "index.mjs", - "index.d.ts" - ], - "exports": { - ".": [ - { - "import": "./index.mjs", - "require": "./index.js", - "default": "./index.js" - }, - "./index.js" - ] - }, - "repository": { - "type": "git", - "url": "https://github.com/then/is-promise.git" - }, - "author": "ForbesLindesay", - "license": "MIT" -} diff --git a/node_modules/is-promise/readme.md b/node_modules/is-promise/readme.md deleted file mode 100644 index d53d34b..0000000 --- a/node_modules/is-promise/readme.md +++ /dev/null @@ -1,33 +0,0 @@ - - -# is-promise - - Test whether an object looks like a promises-a+ promise - - [![Build Status](https://img.shields.io/travis/then/is-promise/master.svg)](https://travis-ci.org/then/is-promise) - [![Dependency Status](https://img.shields.io/david/then/is-promise.svg)](https://david-dm.org/then/is-promise) - [![NPM version](https://img.shields.io/npm/v/is-promise.svg)](https://www.npmjs.org/package/is-promise) - - - -## Installation - - $ npm install is-promise - -You can also use it client side via npm. - -## API - -```typescript -import isPromise from 'is-promise'; - -isPromise(Promise.resolve());//=>true -isPromise({then:function () {...}});//=>true -isPromise(null);//=>false -isPromise({});//=>false -isPromise({then: true})//=>false -``` - -## License - - MIT diff --git a/node_modules/isexe/.npmignore b/node_modules/isexe/.npmignore deleted file mode 100644 index c1cb757..0000000 --- a/node_modules/isexe/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.nyc_output/ -coverage/ diff --git a/node_modules/isexe/LICENSE b/node_modules/isexe/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/isexe/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/isexe/README.md b/node_modules/isexe/README.md deleted file mode 100644 index 35769e8..0000000 --- a/node_modules/isexe/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# isexe - -Minimal module to check if a file is executable, and a normal file. - -Uses `fs.stat` and tests against the `PATHEXT` environment variable on -Windows. - -## USAGE - -```javascript -var isexe = require('isexe') -isexe('some-file-name', function (err, isExe) { - if (err) { - console.error('probably file does not exist or something', err) - } else if (isExe) { - console.error('this thing can be run') - } else { - console.error('cannot be run') - } -}) - -// same thing but synchronous, throws errors -var isExe = isexe.sync('some-file-name') - -// treat errors as just "not executable" -isexe('maybe-missing-file', { ignoreErrors: true }, callback) -var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) -``` - -## API - -### `isexe(path, [options], [callback])` - -Check if the path is executable. If no callback provided, and a -global `Promise` object is available, then a Promise will be returned. - -Will raise whatever errors may be raised by `fs.stat`, unless -`options.ignoreErrors` is set to true. - -### `isexe.sync(path, [options])` - -Same as `isexe` but returns the value and throws any errors raised. - -### Options - -* `ignoreErrors` Treat all errors as "no, this is not executable", but - don't raise them. -* `uid` Number to use as the user id -* `gid` Number to use as the group id -* `pathExt` List of path extensions to use instead of `PATHEXT` - environment variable on Windows. diff --git a/node_modules/isexe/index.js b/node_modules/isexe/index.js deleted file mode 100644 index 553fb32..0000000 --- a/node_modules/isexe/index.js +++ /dev/null @@ -1,57 +0,0 @@ -var fs = require('fs') -var core -if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = require('./windows.js') -} else { - core = require('./mode.js') -} - -module.exports = isexe -isexe.sync = sync - -function isexe (path, options, cb) { - if (typeof options === 'function') { - cb = options - options = {} - } - - if (!cb) { - if (typeof Promise !== 'function') { - throw new TypeError('callback not provided') - } - - return new Promise(function (resolve, reject) { - isexe(path, options || {}, function (er, is) { - if (er) { - reject(er) - } else { - resolve(is) - } - }) - }) - } - - core(path, options || {}, function (er, is) { - // ignore EACCES because that just means we aren't allowed to run it - if (er) { - if (er.code === 'EACCES' || options && options.ignoreErrors) { - er = null - is = false - } - } - cb(er, is) - }) -} - -function sync (path, options) { - // my kingdom for a filtered catch - try { - return core.sync(path, options || {}) - } catch (er) { - if (options && options.ignoreErrors || er.code === 'EACCES') { - return false - } else { - throw er - } - } -} diff --git a/node_modules/isexe/mode.js b/node_modules/isexe/mode.js deleted file mode 100644 index 1995ea4..0000000 --- a/node_modules/isexe/mode.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = isexe -isexe.sync = sync - -var fs = require('fs') - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), options) -} - -function checkStat (stat, options) { - return stat.isFile() && checkMode(stat, options) -} - -function checkMode (stat, options) { - var mod = stat.mode - var uid = stat.uid - var gid = stat.gid - - var myUid = options.uid !== undefined ? - options.uid : process.getuid && process.getuid() - var myGid = options.gid !== undefined ? - options.gid : process.getgid && process.getgid() - - var u = parseInt('100', 8) - var g = parseInt('010', 8) - var o = parseInt('001', 8) - var ug = u | g - - var ret = (mod & o) || - (mod & g) && gid === myGid || - (mod & u) && uid === myUid || - (mod & ug) && myUid === 0 - - return ret -} diff --git a/node_modules/isexe/package.json b/node_modules/isexe/package.json deleted file mode 100644 index e452689..0000000 --- a/node_modules/isexe/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "isexe", - "version": "2.0.0", - "description": "Minimal module to check if a file is executable.", - "main": "index.js", - "directories": { - "test": "test" - }, - "devDependencies": { - "mkdirp": "^0.5.1", - "rimraf": "^2.5.0", - "tap": "^10.3.0" - }, - "scripts": { - "test": "tap test/*.js --100", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/isexe.git" - }, - "keywords": [], - "bugs": { - "url": "https://github.com/isaacs/isexe/issues" - }, - "homepage": "https://github.com/isaacs/isexe#readme" -} diff --git a/node_modules/isexe/test/basic.js b/node_modules/isexe/test/basic.js deleted file mode 100644 index d926df6..0000000 --- a/node_modules/isexe/test/basic.js +++ /dev/null @@ -1,221 +0,0 @@ -var t = require('tap') -var fs = require('fs') -var path = require('path') -var fixture = path.resolve(__dirname, 'fixtures') -var meow = fixture + '/meow.cat' -var mine = fixture + '/mine.cat' -var ours = fixture + '/ours.cat' -var fail = fixture + '/fail.false' -var noent = fixture + '/enoent.exe' -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var isWindows = process.platform === 'win32' -var hasAccess = typeof fs.access === 'function' -var winSkip = isWindows && 'windows' -var accessSkip = !hasAccess && 'no fs.access function' -var hasPromise = typeof Promise === 'function' -var promiseSkip = !hasPromise && 'no global Promise' - -function reset () { - delete require.cache[require.resolve('../')] - return require('../') -} - -t.test('setup fixtures', function (t) { - rimraf.sync(fixture) - mkdirp.sync(fixture) - fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n') - fs.chmodSync(meow, parseInt('0755', 8)) - fs.writeFileSync(fail, '#!/usr/bin/env false\n') - fs.chmodSync(fail, parseInt('0644', 8)) - fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n') - fs.chmodSync(mine, parseInt('0744', 8)) - fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n') - fs.chmodSync(ours, parseInt('0754', 8)) - t.end() -}) - -t.test('promise', { skip: promiseSkip }, function (t) { - var isexe = reset() - t.test('meow async', function (t) { - isexe(meow).then(function (is) { - t.ok(is) - t.end() - }) - }) - t.test('fail async', function (t) { - isexe(fail).then(function (is) { - t.notOk(is) - t.end() - }) - }) - t.test('noent async', function (t) { - isexe(noent).catch(function (er) { - t.ok(er) - t.end() - }) - }) - t.test('noent ignore async', function (t) { - isexe(noent, { ignoreErrors: true }).then(function (is) { - t.notOk(is) - t.end() - }) - }) - t.end() -}) - -t.test('no promise', function (t) { - global.Promise = null - var isexe = reset() - t.throws('try to meow a promise', function () { - isexe(meow) - }) - t.end() -}) - -t.test('access', { skip: accessSkip || winSkip }, function (t) { - runTest(t) -}) - -t.test('mode', { skip: winSkip }, function (t) { - delete fs.access - delete fs.accessSync - var isexe = reset() - t.ok(isexe.sync(ours, { uid: 0, gid: 0 })) - t.ok(isexe.sync(mine, { uid: 0, gid: 0 })) - runTest(t) -}) - -t.test('windows', function (t) { - global.TESTING_WINDOWS = true - var pathExt = '.EXE;.CAT;.CMD;.COM' - t.test('pathExt option', function (t) { - runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' }) - }) - t.test('pathExt env', function (t) { - process.env.PATHEXT = pathExt - runTest(t) - }) - t.test('no pathExt', function (t) { - // with a pathExt of '', any filename is fine. - // so the "fail" one would still pass. - runTest(t, { pathExt: '', skipFail: true }) - }) - t.test('pathext with empty entry', function (t) { - // with a pathExt of '', any filename is fine. - // so the "fail" one would still pass. - runTest(t, { pathExt: ';' + pathExt, skipFail: true }) - }) - t.end() -}) - -t.test('cleanup', function (t) { - rimraf.sync(fixture) - t.end() -}) - -function runTest (t, options) { - var isexe = reset() - - var optionsIgnore = Object.create(options || {}) - optionsIgnore.ignoreErrors = true - - if (!options || !options.skipFail) { - t.notOk(isexe.sync(fail, options)) - } - t.notOk(isexe.sync(noent, optionsIgnore)) - if (!options) { - t.ok(isexe.sync(meow)) - } else { - t.ok(isexe.sync(meow, options)) - } - - t.ok(isexe.sync(mine, options)) - t.ok(isexe.sync(ours, options)) - t.throws(function () { - isexe.sync(noent, options) - }) - - t.test('meow async', function (t) { - if (!options) { - isexe(meow, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - } else { - isexe(meow, options, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - } - }) - - t.test('mine async', function (t) { - isexe(mine, options, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - }) - - t.test('ours async', function (t) { - isexe(ours, options, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - }) - - if (!options || !options.skipFail) { - t.test('fail async', function (t) { - isexe(fail, options, function (er, is) { - if (er) { - throw er - } - t.notOk(is) - t.end() - }) - }) - } - - t.test('noent async', function (t) { - isexe(noent, options, function (er, is) { - t.ok(er) - t.notOk(is) - t.end() - }) - }) - - t.test('noent ignore async', function (t) { - isexe(noent, optionsIgnore, function (er, is) { - if (er) { - throw er - } - t.notOk(is) - t.end() - }) - }) - - t.test('directory is not executable', function (t) { - isexe(__dirname, options, function (er, is) { - if (er) { - throw er - } - t.notOk(is) - t.end() - }) - }) - - t.end() -} diff --git a/node_modules/isexe/windows.js b/node_modules/isexe/windows.js deleted file mode 100644 index 3499673..0000000 --- a/node_modules/isexe/windows.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = isexe -isexe.sync = sync - -var fs = require('fs') - -function checkPathExt (path, options) { - var pathext = options.pathExt !== undefined ? - options.pathExt : process.env.PATHEXT - - if (!pathext) { - return true - } - - pathext = pathext.split(';') - if (pathext.indexOf('') !== -1) { - return true - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase() - if (p && path.substr(-p.length).toLowerCase() === p) { - return true - } - } - return false -} - -function checkStat (stat, path, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false - } - return checkPathExt(path, options) -} - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, path, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), path, options) -} diff --git a/node_modules/jose/LICENSE.md b/node_modules/jose/LICENSE.md deleted file mode 100644 index d0ec038..0000000 --- a/node_modules/jose/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Filip Skokan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/jose/README.md b/node_modules/jose/README.md deleted file mode 100644 index 6ab1f3e..0000000 --- a/node_modules/jose/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# jose - -`jose` is a JavaScript module for JSON Object Signing and Encryption, providing support for JSON Web Tokens (JWT), JSON Web Signature (JWS), JSON Web Encryption (JWE), JSON Web Key (JWK), JSON Web Key Set (JWKS), and more. The module is designed to work across various Web-interoperable runtimes including Node.js, browsers, Cloudflare Workers, Deno, Bun, and others. - -## Sponsor - - - - - Auth0 by Okta - - -If you want to quickly add JWT authentication to JavaScript apps, feel free to check out Auth0's JavaScript SDK and free plan. [Create an Auth0 account; it's free!][sponsor-auth0]

- -## [💗 Help the project](https://github.com/sponsors/panva) - -Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva). - -## Dependencies: 0 - -`jose` has no dependencies and it exports tree-shakeable ESM[^cjs]. - -## Documentation - -`jose` is distributed via [npmjs.com](https://www.npmjs.com/package/jose), [jsr.io](https://jsr.io/@panva/jose), [jsdelivr.com](https://www.jsdelivr.com/package/npm/jose), and [github.com](https://github.com/panva/jose). - -**`example`** ESM import[^cjs] - -```js -import * as jose from 'jose' -``` - -### JSON Web Tokens (JWT) - -The `jose` module supports JSON Web Tokens (JWT) and provides functionality for signing and verifying tokens, as well as their JWT Claims Set validation. - -- [JWT Claims Set Validation & Signature Verification](docs/jwt/verify/functions/jwtVerify.md) using the `jwtVerify` function - - [Using a remote JSON Web Key Set (JWKS)](docs/jwks/remote/functions/createRemoteJWKSet.md) - - [Using a local JSON Web Key Set (JWKS)](docs/jwks/local/functions/createLocalJWKSet.md) -- [Signing](docs/jwt/sign/classes/SignJWT.md) using the `SignJWT` class -- Utility functions - - [Decoding Token's Protected Header](docs/util/decode_protected_header/functions/decodeProtectedHeader.md) - - [Decoding JWT Claims Set](docs/util/decode_jwt/functions/decodeJwt.md) prior to its validation - -### Encrypted JSON Web Tokens - -The `jose` module supports encrypted JSON Web Tokens and provides functionality for encrypting and decrypting tokens, as well as their JWT Claims Set validation. - -- [Decryption & JWT Claims Set Validation](docs/jwt/decrypt/functions/jwtDecrypt.md) using the `jwtDecrypt` function -- [Encryption](docs/jwt/encrypt/classes/EncryptJWT.md) using the `EncryptJWT` class -- Utility functions - - [Decoding Token's Protected Header](docs/util/decode_protected_header/functions/decodeProtectedHeader.md) - -### Key Utilities - -The `jose` module supports importing, exporting, and generating keys and secrets in various formats, including PEM formats like SPKI, X.509 certificate, and PKCS #8, as well as JSON Web Key (JWK). - -- Key Import Functions - - [JWK Import](docs/key/import/functions/importJWK.md) - - [Public Key Import (SPKI)](docs/key/import/functions/importSPKI.md) - - [Public Key Import (X.509 Certificate)](docs/key/import/functions/importX509.md) - - [Private Key Import (PKCS #8)](docs/key/import/functions/importPKCS8.md) -- Key and Secret Generation Functions - - [Asymmetric Key Pair Generation](docs/key/generate_key_pair/functions/generateKeyPair.md) - - [Symmetric Secret Generation](docs/key/generate_secret/functions/generateSecret.md) -- Key Export Functions - - [JWK Export](docs/key/export/functions/exportJWK.md) - - [Private Key Export](docs/key/export/functions/exportPKCS8.md) - - [Public Key Export](docs/key/export/functions/exportSPKI.md) - -### JSON Web Signature (JWS) - -The `jose` module supports signing and verification of JWS messages with arbitrary payloads in Compact, Flattened JSON, and General JSON serialization syntaxes. - -- Signing - [Compact](docs/jws/compact/sign/classes/CompactSign.md), [Flattened JSON](docs/jws/flattened/sign/classes/FlattenedSign.md), [General JSON](docs/jws/general/sign/classes/GeneralSign.md) -- Verification - [Compact](docs/jws/compact/verify/functions/compactVerify.md), [Flattened JSON](docs/jws/flattened/verify/functions/flattenedVerify.md), [General JSON](docs/jws/general/verify/functions/generalVerify.md) - - [Using a remote JSON Web Key Set (JWKS)](docs/jwks/remote/functions/createRemoteJWKSet.md) - - [Using a local JSON Web Key Set (JWKS)](docs/jwks/local/functions/createLocalJWKSet.md) -- Utility functions - - [Decoding Token's Protected Header](docs/util/decode_protected_header/functions/decodeProtectedHeader.md) - -### JSON Web Encryption (JWE) - -The `jose` module supports encryption and decryption of JWE messages with arbitrary plaintext in Compact, Flattened JSON, and General JSON serialization syntaxes. - -- Encryption - [Compact](docs/jwe/compact/encrypt/classes/CompactEncrypt.md), [Flattened JSON](docs/jwe/flattened/encrypt/classes/FlattenedEncrypt.md), [General JSON](docs/jwe/general/encrypt/classes/GeneralEncrypt.md) -- Decryption - [Compact](docs/jwe/compact/decrypt/functions/compactDecrypt.md), [Flattened JSON](docs/jwe/flattened/decrypt/functions/flattenedDecrypt.md), [General JSON](docs/jwe/general/decrypt/functions/generalDecrypt.md) -- Utility functions - - [Decoding Token's Protected Header](docs/util/decode_protected_header/functions/decodeProtectedHeader.md) - -### Other - -The following are additional features and utilities provided by the `jose` module: - -- [Calculating JWK Thumbprint](docs/jwk/thumbprint/functions/calculateJwkThumbprint.md) -- [Calculating JWK Thumbprint URI](docs/jwk/thumbprint/functions/calculateJwkThumbprintUri.md) -- [Verification using a JWK Embedded in a JWS Header](docs/jwk/embedded/functions/EmbeddedJWK.md) -- [Unsecured JWT](docs/jwt/unsecured/classes/UnsecuredJWT.md) -- [JOSE Errors](docs/util/errors/README.md) - -## Supported Runtimes - -The `jose` module is compatible with JavaScript runtimes that support the utilized Web API globals and standard built-in objects or are Node.js. - -The following runtimes are supported _(this is not an exhaustive list)_: - -- [Bun](https://github.com/panva/jose/issues/471) -- [Browsers](https://github.com/panva/jose/issues/263) -- [Cloudflare Workers](https://github.com/panva/jose/issues/265) -- [Deno](https://github.com/panva/jose/issues/266) -- [Electron](https://github.com/panva/jose/issues/264) -- [Node.js](https://github.com/panva/jose/issues/262) - -Please note that certain algorithms may not be available depending on the runtime used. You can find a list of available algorithms for each runtime in the specific issue links provided above. - -## Supported Versions - -| Version | Security Fixes 🔑 | Other Bug Fixes 🐞 | New Features ⭐ | Runtime and Module type | -| ----------------------------------------------- | ----------------- | ------------------ | --------------- | ------------------------------- | -| [v6.x](https://github.com/panva/jose/tree/v6.x) | [Security Policy] | ✅ | ✅ | Universal[^universal] ESM[^cjs] | -| [v5.x](https://github.com/panva/jose/tree/v5.x) | [Security Policy] | ❌ | ❌ | Universal[^universal] CJS + ESM | -| [v4.x](https://github.com/panva/jose/tree/v4.x) | [Security Policy] | ❌ | ❌ | Universal[^universal] CJS + ESM | -| [v2.x](https://github.com/panva/jose/tree/v2.x) | [Security Policy] | ❌ | ❌ | Node.js CJS | - -## Specifications - -
-Details - -- JSON Web Signature (JWS) - [RFC7515](https://www.rfc-editor.org/rfc/rfc7515) -- JSON Web Encryption (JWE) - [RFC7516](https://www.rfc-editor.org/rfc/rfc7516) -- JSON Web Key (JWK) - [RFC7517](https://www.rfc-editor.org/rfc/rfc7517) -- JSON Web Algorithms (JWA) - [RFC7518](https://www.rfc-editor.org/rfc/rfc7518) -- JSON Web Token (JWT) - [RFC7519](https://www.rfc-editor.org/rfc/rfc7519) -- JSON Web Key Thumbprint - [RFC7638](https://www.rfc-editor.org/rfc/rfc7638) -- JSON Web Key Thumbprint URI - [RFC9278](https://www.rfc-editor.org/rfc/rfc9278) -- JWS Unencoded Payload Option - [RFC7797](https://www.rfc-editor.org/rfc/rfc7797) -- CFRG Elliptic Curve ECDH and Signatures - [RFC8037](https://www.rfc-editor.org/rfc/rfc8037) -- Fully-Specified Algorithms for JOSE - [RFC9864](https://www.rfc-editor.org/rfc/rfc9864.html) -- ML-DSA for JOSE - [draft-ietf-cose-dilithium-10](https://www.ietf.org/archive/id/draft-ietf-cose-dilithium-10.html) - -The algorithm implementations in `jose` have been tested using test vectors from their respective specifications as well as [RFC7520](https://www.rfc-editor.org/rfc/rfc7520). - -
- -[sponsor-auth0]: https://a0.to/signup/panva -[WebCryptoAPI]: https://w3c.github.io/webcrypto/ -[Fetch API]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API -[Security Policy]: https://github.com/panva/jose/security/policy - -[^cjs]: CJS style `let jose = require('jose')` is possible in Node.js versions where the `require(esm)` feature is enabled by default (^20.19.0 || ^22.12.0 || >= 23.0.0). - -[^universal]: Assumes runtime support of [WebCryptoAPI][] and [Fetch API][] diff --git a/node_modules/jose/dist/types/index.d.ts b/node_modules/jose/dist/types/index.d.ts deleted file mode 100644 index cb360d8..0000000 --- a/node_modules/jose/dist/types/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -export { compactDecrypt } from './jwe/compact/decrypt.js'; -export type { CompactDecryptGetKey } from './jwe/compact/decrypt.js'; -export { flattenedDecrypt } from './jwe/flattened/decrypt.js'; -export type { FlattenedDecryptGetKey } from './jwe/flattened/decrypt.js'; -export { generalDecrypt } from './jwe/general/decrypt.js'; -export type { GeneralDecryptGetKey } from './jwe/general/decrypt.js'; -export { GeneralEncrypt } from './jwe/general/encrypt.js'; -export type { Recipient } from './jwe/general/encrypt.js'; -export { compactVerify } from './jws/compact/verify.js'; -export type { CompactVerifyGetKey } from './jws/compact/verify.js'; -export { flattenedVerify } from './jws/flattened/verify.js'; -export type { FlattenedVerifyGetKey } from './jws/flattened/verify.js'; -export { generalVerify } from './jws/general/verify.js'; -export type { GeneralVerifyGetKey } from './jws/general/verify.js'; -export { jwtVerify } from './jwt/verify.js'; -export type { JWTVerifyOptions, JWTVerifyGetKey } from './jwt/verify.js'; -export { jwtDecrypt } from './jwt/decrypt.js'; -export type { JWTDecryptOptions, JWTDecryptGetKey } from './jwt/decrypt.js'; -export { CompactEncrypt } from './jwe/compact/encrypt.js'; -export { FlattenedEncrypt } from './jwe/flattened/encrypt.js'; -export { CompactSign } from './jws/compact/sign.js'; -export { FlattenedSign } from './jws/flattened/sign.js'; -export { GeneralSign } from './jws/general/sign.js'; -export type { Signature } from './jws/general/sign.js'; -export { SignJWT } from './jwt/sign.js'; -export { EncryptJWT } from './jwt/encrypt.js'; -export { calculateJwkThumbprint, calculateJwkThumbprintUri } from './jwk/thumbprint.js'; -export { EmbeddedJWK } from './jwk/embedded.js'; -export { createLocalJWKSet } from './jwks/local.js'; -export { createRemoteJWKSet, jwksCache, customFetch } from './jwks/remote.js'; -export type { RemoteJWKSetOptions, JWKSCacheInput, ExportedJWKSCache, FetchImplementation, } from './jwks/remote.js'; -export { UnsecuredJWT } from './jwt/unsecured.js'; -export type { UnsecuredResult } from './jwt/unsecured.js'; -export { exportPKCS8, exportSPKI, exportJWK } from './key/export.js'; -export { importSPKI, importPKCS8, importX509, importJWK } from './key/import.js'; -export type { KeyImportOptions } from './key/import.js'; -export { decodeProtectedHeader } from './util/decode_protected_header.js'; -export { decodeJwt } from './util/decode_jwt.js'; -export type { ProtectedHeaderParameters } from './util/decode_protected_header.js'; -import * as errors from './util/errors.js'; -export { errors }; -export { generateKeyPair } from './key/generate_key_pair.js'; -export type { GenerateKeyPairResult, GenerateKeyPairOptions } from './key/generate_key_pair.js'; -export { generateSecret } from './key/generate_secret.js'; -export type { GenerateSecretOptions } from './key/generate_secret.js'; -import * as base64url from './util/base64url.js'; -export { base64url }; -export type { CompactDecryptResult, CompactJWEHeaderParameters, CompactJWSHeaderParameters, CompactVerifyResult, CritOption, CryptoKey, DecryptOptions, EncryptOptions, FlattenedDecryptResult, FlattenedJWE, FlattenedJWS, FlattenedJWSInput, FlattenedVerifyResult, GeneralDecryptResult, GeneralJWE, GeneralJWS, GeneralJWSInput, GeneralVerifyResult, GetKeyFunction, JoseHeaderParameters, JSONWebKeySet, JWEHeaderParameters, JWEKeyManagementHeaderParameters, JWK_EC_Private, JWK_EC_Public, JWK_oct, JWK_OKP_Private, JWK_OKP_Public, JWK_RSA_Private, JWK_RSA_Public, JWK, JWKParameters, JWSHeaderParameters, JWTClaimVerificationOptions, JWTDecryptResult, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject, ProduceJWT, ResolvedKey, SignOptions, VerifyOptions, } from './types.d.ts'; -/** - * In prior releases this indicated whether a Node.js-specific build was loaded, this is now fixed - * to `"WebCryptoAPI"` - * - * @deprecated - */ -export declare const cryptoRuntime = "WebCryptoAPI"; diff --git a/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts b/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts deleted file mode 100644 index fd32376..0000000 --- a/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Decrypting JSON Web Encryption (JWE) in Compact Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * Interface for Compact JWE Decryption dynamic key resolution. No token components have been - * verified at the time of this function call. - */ -export interface CompactDecryptGetKey extends types.GetKeyFunction { -} -/** - * Decrypts a Compact JWE. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwe/compact/decrypt'`. - * - * @param jwe Compact JWE. - * @param key Private Key or Secret to decrypt the JWE with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Decryption options. - */ -export declare function compactDecrypt(jwe: string | Uint8Array, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.DecryptOptions): Promise; -/** - * @param jwe Compact JWE. - * @param getKey Function resolving Private Key or Secret to decrypt the JWE with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Decryption options. - */ -export declare function compactDecrypt(jwe: string | Uint8Array, getKey: CompactDecryptGetKey, options?: types.DecryptOptions): Promise; diff --git a/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts b/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts deleted file mode 100644 index 3bdcc4b..0000000 --- a/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Encrypting JSON Web Encryption (JWE) in Compact Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * The CompactEncrypt class is used to build and encrypt Compact JWE strings. - * - * This class is exported (as a named export) from the main `'jose'` module entry point as well as - * from its subpath export `'jose/jwe/compact/encrypt'`. - * - */ -export declare class CompactEncrypt { - #private; - /** - * {@link CompactEncrypt} constructor - * - * @param plaintext Binary representation of the plaintext to encrypt. - */ - constructor(plaintext: Uint8Array); - /** - * Sets a content encryption key to use, by default a random suitable one is generated for the JWE - * enc" (Encryption Algorithm) Header Parameter. - * - * @deprecated You should not use this method. It is only really intended for test and vector - * validation purposes. - * - * @param cek JWE Content Encryption Key. - */ - setContentEncryptionKey(cek: Uint8Array): this; - /** - * Sets the JWE Initialization Vector to use for content encryption, by default a random suitable - * one is generated for the JWE enc" (Encryption Algorithm) Header Parameter. - * - * @deprecated You should not use this method. It is only really intended for test and vector - * validation purposes. - * - * @param iv JWE Initialization Vector. - */ - setInitializationVector(iv: Uint8Array): this; - /** - * Sets the JWE Protected Header on the CompactEncrypt object. - * - * @param protectedHeader JWE Protected Header object. - */ - setProtectedHeader(protectedHeader: types.CompactJWEHeaderParameters): this; - /** - * Sets the JWE Key Management parameters to be used when encrypting. - * - * (ECDH-ES) Use of this method is needed for ECDH based algorithms to set the "apu" (Agreement - * PartyUInfo) or "apv" (Agreement PartyVInfo) parameters. - * - * @param parameters JWE Key Management parameters. - */ - setKeyManagementParameters(parameters: types.JWEKeyManagementHeaderParameters): this; - /** - * Encrypts and resolves the value of the Compact JWE string. - * - * @param key Public Key or Secret to encrypt the JWE with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Encryption options. - */ - encrypt(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.EncryptOptions): Promise; -} diff --git a/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts b/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts deleted file mode 100644 index 19a24bf..0000000 --- a/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Decrypting JSON Web Encryption (JWE) in Flattened JSON Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * Interface for Flattened JWE Decryption dynamic key resolution. No token components have been - * verified at the time of this function call. - */ -export interface FlattenedDecryptGetKey extends types.GetKeyFunction { -} -/** - * Decrypts a Flattened JWE. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwe/flattened/decrypt'`. - * - * @param jwe Flattened JWE. - * @param key Private Key or Secret to decrypt the JWE with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Decryption options. - */ -export declare function flattenedDecrypt(jwe: types.FlattenedJWE, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.DecryptOptions): Promise; -/** - * @param jwe Flattened JWE. - * @param getKey Function resolving Private Key or Secret to decrypt the JWE with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Decryption options. - */ -export declare function flattenedDecrypt(jwe: types.FlattenedJWE, getKey: FlattenedDecryptGetKey, options?: types.DecryptOptions): Promise; diff --git a/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts b/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts deleted file mode 100644 index fa348be..0000000 --- a/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Encrypting JSON Web Encryption (JWE) in Flattened JSON Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * The FlattenedEncrypt class is used to build and encrypt Flattened JWE objects. - * - * This class is exported (as a named export) from the main `'jose'` module entry point as well as - * from its subpath export `'jose/jwe/flattened/encrypt'`. - * - */ -export declare class FlattenedEncrypt { - #private; - /** - * {@link FlattenedEncrypt} constructor - * - * @param plaintext Binary representation of the plaintext to encrypt. - */ - constructor(plaintext: Uint8Array); - /** - * Sets the JWE Key Management parameters to be used when encrypting. - * - * (ECDH-ES) Use of this method is needed for ECDH based algorithms to set the "apu" (Agreement - * PartyUInfo) or "apv" (Agreement PartyVInfo) parameters. - * - * @param parameters JWE Key Management parameters. - */ - setKeyManagementParameters(parameters: types.JWEKeyManagementHeaderParameters): this; - /** - * Sets the JWE Protected Header on the FlattenedEncrypt object. - * - * @param protectedHeader JWE Protected Header. - */ - setProtectedHeader(protectedHeader: types.JWEHeaderParameters): this; - /** - * Sets the JWE Shared Unprotected Header on the FlattenedEncrypt object. - * - * @param sharedUnprotectedHeader JWE Shared Unprotected Header. - */ - setSharedUnprotectedHeader(sharedUnprotectedHeader: types.JWEHeaderParameters): this; - /** - * Sets the JWE Per-Recipient Unprotected Header on the FlattenedEncrypt object. - * - * @param unprotectedHeader JWE Per-Recipient Unprotected Header. - */ - setUnprotectedHeader(unprotectedHeader: types.JWEHeaderParameters): this; - /** - * Sets the Additional Authenticated Data on the FlattenedEncrypt object. - * - * @param aad Additional Authenticated Data. - */ - setAdditionalAuthenticatedData(aad: Uint8Array): this; - /** - * Sets a content encryption key to use, by default a random suitable one is generated for the JWE - * enc" (Encryption Algorithm) Header Parameter. - * - * @deprecated You should not use this method. It is only really intended for test and vector - * validation purposes. - * - * @param cek JWE Content Encryption Key. - */ - setContentEncryptionKey(cek: Uint8Array): this; - /** - * Sets the JWE Initialization Vector to use for content encryption, by default a random suitable - * one is generated for the JWE enc" (Encryption Algorithm) Header Parameter. - * - * @deprecated You should not use this method. It is only really intended for test and vector - * validation purposes. - * - * @param iv JWE Initialization Vector. - */ - setInitializationVector(iv: Uint8Array): this; - /** - * Encrypts and resolves the value of the Flattened JWE object. - * - * @param key Public Key or Secret to encrypt the JWE with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Encryption options. - */ - encrypt(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.EncryptOptions): Promise; -} diff --git a/node_modules/jose/dist/types/jwe/general/decrypt.d.ts b/node_modules/jose/dist/types/jwe/general/decrypt.d.ts deleted file mode 100644 index ccb87c9..0000000 --- a/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Decrypting JSON Web Encryption (JWE) in General JSON Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * Interface for General JWE Decryption dynamic key resolution. No token components have been - * verified at the time of this function call. - */ -export interface GeneralDecryptGetKey extends types.GetKeyFunction { -} -/** - * Decrypts a General JWE. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwe/general/decrypt'`. - * - * @param jwe General JWE. - * @param key Private Key or Secret to decrypt the JWE with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Decryption options. - */ -export declare function generalDecrypt(jwe: types.GeneralJWE, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.DecryptOptions): Promise; -/** - * @param jwe General JWE. - * @param getKey Function resolving Private Key or Secret to decrypt the JWE with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Decryption options. - */ -export declare function generalDecrypt(jwe: types.GeneralJWE, getKey: GeneralDecryptGetKey, options?: types.DecryptOptions): Promise; diff --git a/node_modules/jose/dist/types/jwe/general/encrypt.d.ts b/node_modules/jose/dist/types/jwe/general/encrypt.d.ts deleted file mode 100644 index 7a2e1d3..0000000 --- a/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Encrypting JSON Web Encryption (JWE) in General JSON Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** Used to build General JWE object's individual recipients. */ -export interface Recipient { - /** - * Sets the JWE Per-Recipient Unprotected Header on the Recipient object. - * - * @param unprotectedHeader JWE Per-Recipient Unprotected Header. - */ - setUnprotectedHeader(unprotectedHeader: types.JWEHeaderParameters): Recipient; - /** - * Sets the JWE Key Management parameters to be used when encrypting. - * - * (ECDH-ES) Use of this method is needed for ECDH based algorithms to set the "apu" (Agreement - * PartyUInfo) or "apv" (Agreement PartyVInfo) parameters. - * - * @param parameters JWE Key Management parameters. - */ - setKeyManagementParameters(parameters: types.JWEKeyManagementHeaderParameters): Recipient; - /** A shorthand for calling addRecipient() on the enclosing {@link GeneralEncrypt} instance */ - addRecipient(...args: Parameters): Recipient; - /** A shorthand for calling encrypt() on the enclosing {@link GeneralEncrypt} instance */ - encrypt(...args: Parameters): Promise; - /** Returns the enclosing {@link GeneralEncrypt} instance */ - done(): GeneralEncrypt; -} -/** - * The GeneralEncrypt class is used to build and encrypt General JWE objects. - * - * This class is exported (as a named export) from the main `'jose'` module entry point as well as - * from its subpath export `'jose/jwe/general/encrypt'`. - * - */ -export declare class GeneralEncrypt { - #private; - /** - * {@link GeneralEncrypt} constructor - * - * @param plaintext Binary representation of the plaintext to encrypt. - */ - constructor(plaintext: Uint8Array); - /** - * Adds an additional recipient for the General JWE object. - * - * @param key Public Key or Secret to encrypt the Content Encryption Key for the recipient with. - * See {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Encryption options. - */ - addRecipient(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.CritOption): Recipient; - /** - * Sets the JWE Protected Header on the GeneralEncrypt object. - * - * @param protectedHeader JWE Protected Header object. - */ - setProtectedHeader(protectedHeader: types.JWEHeaderParameters): this; - /** - * Sets the JWE Shared Unprotected Header on the GeneralEncrypt object. - * - * @param sharedUnprotectedHeader JWE Shared Unprotected Header object. - */ - setSharedUnprotectedHeader(sharedUnprotectedHeader: types.JWEHeaderParameters): this; - /** - * Sets the Additional Authenticated Data on the GeneralEncrypt object. - * - * @param aad Additional Authenticated Data. - */ - setAdditionalAuthenticatedData(aad: Uint8Array): this; - /** Encrypts and resolves the value of the General JWE object. */ - encrypt(): Promise; -} diff --git a/node_modules/jose/dist/types/jwk/embedded.d.ts b/node_modules/jose/dist/types/jwk/embedded.d.ts deleted file mode 100644 index 6911038..0000000 --- a/node_modules/jose/dist/types/jwk/embedded.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Verification using a JWK Embedded in a JWS Header - * - * @module - */ -import type * as types from '../types.d.ts'; -/** - * EmbeddedJWK is an implementation of a GetKeyFunction intended to be used with the JWS/JWT verify - * operations whenever you need to opt-in to verify signatures with a public key embedded in the - * token's "jwk" (JSON Web Key) Header Parameter. It is recommended to combine this with the verify - * function's `algorithms` option to define accepted JWS "alg" (Algorithm) Header Parameter values. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwk/embedded'`. - * - */ -export declare function EmbeddedJWK(protectedHeader?: types.JWSHeaderParameters, token?: types.FlattenedJWSInput): Promise; diff --git a/node_modules/jose/dist/types/jwk/thumbprint.d.ts b/node_modules/jose/dist/types/jwk/thumbprint.d.ts deleted file mode 100644 index 1d8450d..0000000 --- a/node_modules/jose/dist/types/jwk/thumbprint.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * JSON Web Key Thumbprint and JSON Web Key Thumbprint URI - * - * @module - */ -import type * as types from '../types.d.ts'; -/** - * Calculates a base64url-encoded JSON Web Key (JWK) Thumbprint - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwk/thumbprint'`. - * - * @param key Key to calculate the thumbprint for. - * @param digestAlgorithm Digest Algorithm to use for calculating the thumbprint. Default is - * "sha256". - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7638 RFC7638} - */ -export declare function calculateJwkThumbprint(key: types.JWK | types.CryptoKey | types.KeyObject, digestAlgorithm?: 'sha256' | 'sha384' | 'sha512'): Promise; -/** - * Calculates a JSON Web Key (JWK) Thumbprint URI - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwk/thumbprint'`. - * - * @param key Key to calculate the thumbprint for. - * @param digestAlgorithm Digest Algorithm to use for calculating the thumbprint. Default is - * "sha256". - * - * @see {@link https://www.rfc-editor.org/rfc/rfc9278 RFC9278} - */ -export declare function calculateJwkThumbprintUri(key: types.CryptoKey | types.KeyObject | types.JWK, digestAlgorithm?: 'sha256' | 'sha384' | 'sha512'): Promise; diff --git a/node_modules/jose/dist/types/jwks/local.d.ts b/node_modules/jose/dist/types/jwks/local.d.ts deleted file mode 100644 index fd9d31c..0000000 --- a/node_modules/jose/dist/types/jwks/local.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Verification using a JSON Web Key Set (JWKS) available locally - * - * @module - */ -import type * as types from '../types.d.ts'; -/** - * Returns a function that resolves a JWS JOSE Header to a public key object from a locally stored, - * or otherwise available, JSON Web Key Set. - * - * It uses the "alg" (JWS Algorithm) Header Parameter to determine the right JWK "kty" (Key Type), - * then proceeds to match the JWK "kid" (Key ID) with one found in the JWS Header Parameters (if - * there is one) while also respecting the JWK "use" (Public Key Use) and JWK "key_ops" (Key - * Operations) Parameters (if they are present on the JWK). - * - * Only a single public key must match the selection process. As shown in the example below when - * multiple keys get matched it is possible to opt-in to iterate over the matched keys and attempt - * verification in an iterative manner. - * - * > [!NOTE]\ - * > The function's purpose is to resolve public keys used for verifying signatures and will not work - * > for public encryption keys. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwks/local'`. - * - * @param jwks JSON Web Key Set formatted object. - */ -export declare function createLocalJWKSet(jwks: types.JSONWebKeySet): (protectedHeader?: types.JWSHeaderParameters, token?: types.FlattenedJWSInput) => Promise; diff --git a/node_modules/jose/dist/types/jwks/remote.d.ts b/node_modules/jose/dist/types/jwks/remote.d.ts deleted file mode 100644 index dae489d..0000000 --- a/node_modules/jose/dist/types/jwks/remote.d.ts +++ /dev/null @@ -1,237 +0,0 @@ -/** - * Verification using a JSON Web Key Set (JWKS) available on an HTTP(S) URL - * - * @module - */ -import type * as types from '../types.d.ts'; -/** - * When passed to {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} this allows the resolver - * to make use of advanced fetch configurations, HTTP Proxies, retry on network errors, etc. - * - * > [!NOTE]\ - * > Known caveat: Expect Type-related issues when passing the inputs through to fetch-like modules, - * > they hardly ever get their typings inline with actual fetch, you should `@ts-expect-error` them. - * - * import ky from 'ky' - * - * let logRequest!: (request: Request) => void - * let logResponse!: (request: Request, response: Response) => void - * let logRetry!: (request: Request, error: Error, retryCount: number) => void - * - * const JWKS = jose.createRemoteJWKSet(url, { - * [jose.customFetch]: (...args) => - * ky(args[0], { - * ...args[1], - * hooks: { - * beforeRequest: [ - * (request) => { - * logRequest(request) - * }, - * ], - * beforeRetry: [ - * ({ request, error, retryCount }) => { - * logRetry(request, error, retryCount) - * }, - * ], - * afterResponse: [ - * (request, _, response) => { - * logResponse(request, response) - * }, - * ], - * }, - * }), - * }) - * ``` - * - * import * as undici from 'undici' - * - * // see https://undici.nodejs.org/#/docs/api/EnvHttpProxyAgent - * let envHttpProxyAgent = new undici.EnvHttpProxyAgent() - * - * // @ts-ignore - * const JWKS = jose.createRemoteJWKSet(url, { - * [jose.customFetch]: (...args) => { - * // @ts-ignore - * return undici.fetch(args[0], { ...args[1], dispatcher: envHttpProxyAgent }) // prettier-ignore - * }, - * }) - * ``` - * - * import * as undici from 'undici' - * - * // see https://undici.nodejs.org/#/docs/api/RetryAgent - * let retryAgent = new undici.RetryAgent(new undici.Agent(), { - * statusCodes: [], - * errorCodes: [ - * 'ECONNRESET', - * 'ECONNREFUSED', - * 'ENOTFOUND', - * 'ENETDOWN', - * 'ENETUNREACH', - * 'EHOSTDOWN', - * 'UND_ERR_SOCKET', - * ], - * }) - * - * // @ts-ignore - * const JWKS = jose.createRemoteJWKSet(url, { - * [jose.customFetch]: (...args) => { - * // @ts-ignore - * return undici.fetch(args[0], { ...args[1], dispatcher: retryAgent }) // prettier-ignore - * }, - * }) - * ``` - * - * import * as undici from 'undici' - * - * // see https://undici.nodejs.org/#/docs/api/MockAgent - * let mockAgent = new undici.MockAgent() - * mockAgent.disableNetConnect() - * - * // @ts-ignore - * const JWKS = jose.createRemoteJWKSet(url, { - * [jose.customFetch]: (...args) => { - * // @ts-ignore - * return undici.fetch(args[0], { ...args[1], dispatcher: mockAgent }) // prettier-ignore - * }, - * }) - * ``` - */ -export declare const customFetch: unique symbol; -/** See {@link customFetch}. */ -export type FetchImplementation = ( -/** URL the request is being made sent to {@link !fetch} as the `resource` argument */ -url: string, -/** Options otherwise sent to {@link !fetch} as the `options` argument */ -options: { - /** HTTP Headers */ - headers: Headers; - /** The {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods request method} */ - method: 'GET'; - /** See {@link !Request.redirect} */ - redirect: 'manual'; - signal: AbortSignal; -}) => Promise; -/** - * > [!WARNING]\ - * > This option has security implications that must be understood, assessed for applicability, and - * > accepted before use. It is critical that the JSON Web Key Set cache only be writable by your own - * > code. - * - * This option is intended for cloud computing runtimes that cannot keep an in memory cache between - * their code's invocations. Use in runtimes where an in memory cache between requests is available - * is not desirable. - * - * When passed to {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} this allows the passed in - * object to: - * - * - Serve as an initial value for the JSON Web Key Set that the module would otherwise need to - * trigger an HTTP request for - * - Have the JSON Web Key Set the function optionally ended up triggering an HTTP request for - * assigned to it as properties - * - * The intended use pattern is: - * - * - Before verifying with {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} you pull the - * previously cached object from a low-latency key-value store offered by the cloud computing - * runtime it is executed on; - * - Default to an empty object `{}` instead when there's no previously cached value; - * - Pass it in as {@link RemoteJWKSetOptions[jwksCache]}; - * - Afterwards, update the key-value storage if the {@link ExportedJWKSCache.uat `uat`} property of - * the object has changed. - * - * // Prerequisites - * let url!: URL - * let jwt!: string - * let getPreviouslyCachedJWKS!: () => Promise - * let storeNewJWKScache!: (cache: jose.ExportedJWKSCache) => Promise - * - * // Load JSON Web Key Set cache - * const jwksCache: jose.JWKSCacheInput = (await getPreviouslyCachedJWKS()) || {} - * const { uat } = jwksCache - * - * const JWKS = jose.createRemoteJWKSet(url, { - * [jose.jwksCache]: jwksCache, - * }) - * - * // Use JSON Web Key Set cache - * await jose.jwtVerify(jwt, JWKS) - * - * if (uat !== jwksCache.uat) { - * // Update JSON Web Key Set cache - * await storeNewJWKScache(jwksCache) - * } - * ``` - */ -export declare const jwksCache: unique symbol; -/** Options for the remote JSON Web Key Set. */ -export interface RemoteJWKSetOptions { - /** - * Timeout (in milliseconds) for the HTTP request. When reached the request will be aborted and - * the verification will fail. Default is 5000 (5 seconds). - */ - timeoutDuration?: number; - /** - * Duration (in milliseconds) for which no more HTTP requests will be triggered after a previous - * successful fetch. Default is 30000 (30 seconds). - */ - cooldownDuration?: number; - /** - * Maximum time (in milliseconds) between successful HTTP requests. Default is 600000 (10 - * minutes). - */ - cacheMaxAge?: number | typeof Infinity; - /** Headers to be sent with the HTTP request. */ - headers?: Record; - /** See {@link jwksCache}. */ - [jwksCache]?: JWKSCacheInput; - /** See {@link customFetch}. */ - [customFetch]?: FetchImplementation; -} -/** See {@link jwksCache}. */ -export interface ExportedJWKSCache { - /** Current cached JSON Web Key Set */ - jwks: types.JSONWebKeySet; - /** Last updated at timestamp (seconds since epoch) */ - uat: number; -} -/** See {@link jwksCache}. */ -export type JWKSCacheInput = ExportedJWKSCache | Record; -/** - * Returns a function that resolves a JWS JOSE Header to a public key object downloaded from a - * remote endpoint returning a JSON Web Key Set, that is, for example, an OAuth 2.0 or OIDC - * jwks_uri. The JSON Web Key Set is fetched when no key matches the selection process but only as - * frequently as the `cooldownDuration` option allows to prevent abuse. - * - * It uses the "alg" (JWS Algorithm) Header Parameter to determine the right JWK "kty" (Key Type), - * then proceeds to match the JWK "kid" (Key ID) with one found in the JWS Header Parameters (if - * there is one) while also respecting the JWK "use" (Public Key Use) and JWK "key_ops" (Key - * Operations) Parameters (if they are present on the JWK). - * - * Only a single public key must match the selection process. As shown in the example below when - * multiple keys get matched it is possible to opt-in to iterate over the matched keys and attempt - * verification in an iterative manner. - * - * > [!NOTE]\ - * > The function's purpose is to resolve public keys used for verifying signatures and will not work - * > for public encryption keys. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwks/remote'`. - * - * @param url URL to fetch the JSON Web Key Set from. - * @param options Options for the remote JSON Web Key Set. - */ -export declare function createRemoteJWKSet(url: URL, options?: RemoteJWKSetOptions): { - (protectedHeader?: types.JWSHeaderParameters, token?: types.FlattenedJWSInput): Promise; - /** @ignore */ - coolingDown: boolean; - /** @ignore */ - fresh: boolean; - /** @ignore */ - reloading: boolean; - /** @ignore */ - reload: () => Promise; - /** @ignore */ - jwks: () => types.JSONWebKeySet | undefined; -}; diff --git a/node_modules/jose/dist/types/jws/compact/sign.d.ts b/node_modules/jose/dist/types/jws/compact/sign.d.ts deleted file mode 100644 index dc72958..0000000 --- a/node_modules/jose/dist/types/jws/compact/sign.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Signing JSON Web Signature (JWS) in Compact Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * The CompactSign class is used to build and sign Compact JWS strings. - * - * This class is exported (as a named export) from the main `'jose'` module entry point as well as - * from its subpath export `'jose/jws/compact/sign'`. - * - */ -export declare class CompactSign { - #private; - /** - * {@link CompactSign} constructor - * - * @param payload Binary representation of the payload to sign. - */ - constructor(payload: Uint8Array); - /** - * Sets the JWS Protected Header on the CompactSign object. - * - * @param protectedHeader JWS Protected Header. - */ - setProtectedHeader(protectedHeader: types.CompactJWSHeaderParameters): this; - /** - * Signs and resolves the value of the Compact JWS string. - * - * @param key Private Key or Secret to sign the JWS with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWS Sign options. - */ - sign(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.SignOptions): Promise; -} diff --git a/node_modules/jose/dist/types/jws/compact/verify.d.ts b/node_modules/jose/dist/types/jws/compact/verify.d.ts deleted file mode 100644 index 1a7ea32..0000000 --- a/node_modules/jose/dist/types/jws/compact/verify.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Verifying JSON Web Signature (JWS) in Compact Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * Interface for Compact JWS Verification dynamic key resolution. No token components have been - * verified at the time of this function call. - * - * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set. - */ -export interface CompactVerifyGetKey extends types.GenericGetKeyFunction { -} -/** - * Verifies the signature and format of and afterwards decodes the Compact JWS. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jws/compact/verify'`. - * - * @param jws Compact JWS. - * @param key Key to verify the JWS with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWS Verify options. - */ -export declare function compactVerify(jws: string | Uint8Array, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.VerifyOptions): Promise; -/** - * @param jws Compact JWS. - * @param getKey Function resolving a key to verify the JWS with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWS Verify options. - */ -export declare function compactVerify(jws: string | Uint8Array, getKey: CompactVerifyGetKey, options?: types.VerifyOptions): Promise; diff --git a/node_modules/jose/dist/types/jws/flattened/sign.d.ts b/node_modules/jose/dist/types/jws/flattened/sign.d.ts deleted file mode 100644 index d8c11e8..0000000 --- a/node_modules/jose/dist/types/jws/flattened/sign.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Signing JSON Web Signature (JWS) in Flattened JSON Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * The FlattenedSign class is used to build and sign Flattened JWS objects. - * - * This class is exported (as a named export) from the main `'jose'` module entry point as well as - * from its subpath export `'jose/jws/flattened/sign'`. - * - */ -export declare class FlattenedSign { - #private; - /** - * {@link FlattenedSign} constructor - * - * @param payload Binary representation of the payload to sign. - */ - constructor(payload: Uint8Array); - /** - * Sets the JWS Protected Header on the FlattenedSign object. - * - * @param protectedHeader JWS Protected Header. - */ - setProtectedHeader(protectedHeader: types.JWSHeaderParameters): this; - /** - * Sets the JWS Unprotected Header on the FlattenedSign object. - * - * @param unprotectedHeader JWS Unprotected Header. - */ - setUnprotectedHeader(unprotectedHeader: types.JWSHeaderParameters): this; - /** - * Signs and resolves the value of the Flattened JWS object. - * - * @param key Private Key or Secret to sign the JWS with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWS Sign options. - */ - sign(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.SignOptions): Promise; -} diff --git a/node_modules/jose/dist/types/jws/flattened/verify.d.ts b/node_modules/jose/dist/types/jws/flattened/verify.d.ts deleted file mode 100644 index e5e6a38..0000000 --- a/node_modules/jose/dist/types/jws/flattened/verify.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Verifying JSON Web Signature (JWS) in Flattened JSON Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * Interface for Flattened JWS Verification dynamic key resolution. No token components have been - * verified at the time of this function call. - * - * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set. - */ -export interface FlattenedVerifyGetKey extends types.GenericGetKeyFunction { -} -/** - * Verifies the signature and format of and afterwards decodes the Flattened JWS. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jws/flattened/verify'`. - * - * @param jws Flattened JWS. - * @param key Key to verify the JWS with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWS Verify options. - */ -export declare function flattenedVerify(jws: types.FlattenedJWSInput, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.VerifyOptions): Promise; -/** - * @param jws Flattened JWS. - * @param getKey Function resolving a key to verify the JWS with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWS Verify options. - */ -export declare function flattenedVerify(jws: types.FlattenedJWSInput, getKey: FlattenedVerifyGetKey, options?: types.VerifyOptions): Promise; diff --git a/node_modules/jose/dist/types/jws/general/sign.d.ts b/node_modules/jose/dist/types/jws/general/sign.d.ts deleted file mode 100644 index 122fe2b..0000000 --- a/node_modules/jose/dist/types/jws/general/sign.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Signing JSON Web Signature (JWS) in General JSON Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** Used to build General JWS object's individual signatures. */ -export interface Signature { - /** - * Sets the JWS Protected Header on the Signature object. - * - * @param protectedHeader JWS Protected Header. - */ - setProtectedHeader(protectedHeader: types.JWSHeaderParameters): Signature; - /** - * Sets the JWS Unprotected Header on the Signature object. - * - * @param unprotectedHeader JWS Unprotected Header. - */ - setUnprotectedHeader(unprotectedHeader: types.JWSHeaderParameters): Signature; - /** A shorthand for calling addSignature() on the enclosing {@link GeneralSign} instance */ - addSignature(...args: Parameters): Signature; - /** A shorthand for calling encrypt() on the enclosing {@link GeneralSign} instance */ - sign(...args: Parameters): Promise; - /** Returns the enclosing {@link GeneralSign} instance */ - done(): GeneralSign; -} -/** - * The GeneralSign class is used to build and sign General JWS objects. - * - * This class is exported (as a named export) from the main `'jose'` module entry point as well as - * from its subpath export `'jose/jws/general/sign'`. - * - */ -export declare class GeneralSign { - #private; - /** - * {@link GeneralSign} constructor - * - * @param payload Binary representation of the payload to sign. - */ - constructor(payload: Uint8Array); - /** - * Adds an additional signature for the General JWS object. - * - * @param key Private Key or Secret to sign the individual JWS signature with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWS Sign options. - */ - addSignature(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.SignOptions): Signature; - /** Signs and resolves the value of the General JWS object. */ - sign(): Promise; -} diff --git a/node_modules/jose/dist/types/jws/general/verify.d.ts b/node_modules/jose/dist/types/jws/general/verify.d.ts deleted file mode 100644 index ed81143..0000000 --- a/node_modules/jose/dist/types/jws/general/verify.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Verifying JSON Web Signature (JWS) in General JSON Serialization - * - * @module - */ -import type * as types from '../../types.d.ts'; -/** - * Interface for General JWS Verification dynamic key resolution. No token components have been - * verified at the time of this function call. - * - * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set. - */ -export interface GeneralVerifyGetKey extends types.GenericGetKeyFunction { -} -/** - * Verifies the signature and format of and afterwards decodes the General JWS. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jws/general/verify'`. - * - * @param jws General JWS. - * @param key Key to verify the JWS with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWS Verify options. - */ -export declare function generalVerify(jws: types.GeneralJWSInput, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.VerifyOptions): Promise; -/** - * @param jws General JWS. - * @param getKey Function resolving a key to verify the JWS with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWS Verify options. - */ -export declare function generalVerify(jws: types.GeneralJWSInput, getKey: GeneralVerifyGetKey, options?: types.VerifyOptions): Promise; diff --git a/node_modules/jose/dist/types/jwt/decrypt.d.ts b/node_modules/jose/dist/types/jwt/decrypt.d.ts deleted file mode 100644 index 8a27aad..0000000 --- a/node_modules/jose/dist/types/jwt/decrypt.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * JSON Web Token (JWT) Decryption (JWT is in JWE format) - * - * @module - */ -import type * as types from '../types.d.ts'; -/** Combination of JWE Decryption options and JWT Claims Set verification options. */ -export interface JWTDecryptOptions extends types.DecryptOptions, types.JWTClaimVerificationOptions { -} -/** - * Interface for JWT Decryption dynamic key resolution. No token components have been verified at - * the time of this function call. - */ -export interface JWTDecryptGetKey extends types.GetKeyFunction { -} -/** - * Verifies the JWT format (to be a JWE Compact format), decrypts the ciphertext, validates the JWT - * Claims Set. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwt/decrypt'`. - * - * @param jwt JSON Web Token value (encoded as JWE). - * @param key Private Key or Secret to decrypt and verify the JWT with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWT Decryption and JWT Claims Set validation options. - */ -export declare function jwtDecrypt(jwt: string | Uint8Array, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: JWTDecryptOptions): Promise>; -/** - * @param jwt JSON Web Token value (encoded as JWE). - * @param getKey Function resolving Private Key or Secret to decrypt and verify the JWT with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWT Decryption and JWT Claims Set validation options. - */ -export declare function jwtDecrypt(jwt: string | Uint8Array, getKey: JWTDecryptGetKey, options?: JWTDecryptOptions): Promise & types.ResolvedKey>; diff --git a/node_modules/jose/dist/types/jwt/encrypt.d.ts b/node_modules/jose/dist/types/jwt/encrypt.d.ts deleted file mode 100644 index ea62e0e..0000000 --- a/node_modules/jose/dist/types/jwt/encrypt.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * JSON Web Token (JWT) Encryption (JWT is in JWE format) - * - * @module - */ -import type * as types from '../types.d.ts'; -/** - * The EncryptJWT class is used to build and encrypt Compact JWE formatted JSON Web Tokens. - * - * This class is exported (as a named export) from the main `'jose'` module entry point as well as - * from its subpath export `'jose/jwt/encrypt'`. - * - */ -export declare class EncryptJWT implements types.ProduceJWT { - #private; - /** - * {@link EncryptJWT} constructor - * - * @param payload The JWT Claims Set object. Defaults to an empty object. - */ - constructor(payload?: types.JWTPayload); - setIssuer(issuer: string): this; - setSubject(subject: string): this; - setAudience(audience: string | string[]): this; - setJti(jwtId: string): this; - setNotBefore(input: number | string | Date): this; - setExpirationTime(input: number | string | Date): this; - setIssuedAt(input?: number | string | Date): this; - /** - * Sets the JWE Protected Header on the EncryptJWT object. - * - * @param protectedHeader JWE Protected Header. Must contain an "alg" (JWE Algorithm) and "enc" - * (JWE Encryption Algorithm) properties. - */ - setProtectedHeader(protectedHeader: types.CompactJWEHeaderParameters): this; - /** - * Sets the JWE Key Management parameters to be used when encrypting. - * - * (ECDH-ES) Use of this method is needed for ECDH based algorithms to set the "apu" (Agreement - * PartyUInfo) or "apv" (Agreement PartyVInfo) parameters. - * - * @param parameters JWE Key Management parameters. - */ - setKeyManagementParameters(parameters: types.JWEKeyManagementHeaderParameters): this; - /** - * Sets a content encryption key to use, by default a random suitable one is generated for the JWE - * enc" (Encryption Algorithm) Header Parameter. - * - * @deprecated You should not use this method. It is only really intended for test and vector - * validation purposes. - * - * @param cek JWE Content Encryption Key. - */ - setContentEncryptionKey(cek: Uint8Array): this; - /** - * Sets the JWE Initialization Vector to use for content encryption, by default a random suitable - * one is generated for the JWE enc" (Encryption Algorithm) Header Parameter. - * - * @deprecated You should not use this method. It is only really intended for test and vector - * validation purposes. - * - * @param iv JWE Initialization Vector. - */ - setInitializationVector(iv: Uint8Array): this; - /** - * Replicates the "iss" (Issuer) Claim as a JWE Protected Header Parameter. - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-5.3 RFC7519#section-5.3} - */ - replicateIssuerAsHeader(): this; - /** - * Replicates the "sub" (Subject) Claim as a JWE Protected Header Parameter. - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-5.3 RFC7519#section-5.3} - */ - replicateSubjectAsHeader(): this; - /** - * Replicates the "aud" (Audience) Claim as a JWE Protected Header Parameter. - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-5.3 RFC7519#section-5.3} - */ - replicateAudienceAsHeader(): this; - /** - * Encrypts and returns the JWT. - * - * @param key Public Key or Secret to encrypt the JWT with. See - * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}. - * @param options JWE Encryption options. - */ - encrypt(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.EncryptOptions): Promise; -} diff --git a/node_modules/jose/dist/types/jwt/sign.d.ts b/node_modules/jose/dist/types/jwt/sign.d.ts deleted file mode 100644 index 6e68a21..0000000 --- a/node_modules/jose/dist/types/jwt/sign.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * JSON Web Token (JWT) Signing (JWT is in JWS format) - * - * @module - */ -import type * as types from '../types.d.ts'; -/** - * The SignJWT class is used to build and sign Compact JWS formatted JSON Web Tokens. - * - * This class is exported (as a named export) from the main `'jose'` module entry point as well as - * from its subpath export `'jose/jwt/sign'`. - * - */ -export declare class SignJWT implements types.ProduceJWT { - #private; - /** - * {@link SignJWT} constructor - * - * @param payload The JWT Claims Set object. Defaults to an empty object. - */ - constructor(payload?: types.JWTPayload); - setIssuer(issuer: string): this; - setSubject(subject: string): this; - setAudience(audience: string | string[]): this; - setJti(jwtId: string): this; - setNotBefore(input: number | string | Date): this; - setExpirationTime(input: number | string | Date): this; - setIssuedAt(input?: number | string | Date): this; - /** - * Sets the JWS Protected Header on the SignJWT object. - * - * @param protectedHeader JWS Protected Header. Must contain an "alg" (JWS Algorithm) property. - */ - setProtectedHeader(protectedHeader: types.JWTHeaderParameters): this; - /** - * Signs and returns the JWT. - * - * @param key Private Key or Secret to sign the JWT with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWT Sign options. - */ - sign(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.SignOptions): Promise; -} diff --git a/node_modules/jose/dist/types/jwt/unsecured.d.ts b/node_modules/jose/dist/types/jwt/unsecured.d.ts deleted file mode 100644 index 8dd69e3..0000000 --- a/node_modules/jose/dist/types/jwt/unsecured.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Unsecured (unsigned & unencrypted) JSON Web Tokens (JWT) - * - * @module - */ -import type * as types from '../types.d.ts'; -/** Result of decoding an Unsecured JWT. */ -export interface UnsecuredResult { - payload: PayloadType & types.JWTPayload; - header: types.JWSHeaderParameters; -} -/** - * The UnsecuredJWT class is a utility for dealing with `{ "alg": "none" }` Unsecured JWTs. - * - * This class is exported (as a named export) from the main `'jose'` module entry point as well as - * from its subpath export `'jose/jwt/unsecured'`. - * - */ -export declare class UnsecuredJWT implements types.ProduceJWT { - #private; - /** - * {@link UnsecuredJWT} constructor - * - * @param payload The JWT Claims Set object. Defaults to an empty object. - */ - constructor(payload?: types.JWTPayload); - /** Encodes the Unsecured JWT. */ - encode(): string; - setIssuer(issuer: string): this; - setSubject(subject: string): this; - setAudience(audience: string | string[]): this; - setJti(jwtId: string): this; - setNotBefore(input: number | string | Date): this; - setExpirationTime(input: number | string | Date): this; - setIssuedAt(input?: number | string | Date): this; - /** - * Decodes an unsecured JWT. - * - * @param jwt Unsecured JWT to decode the payload of. - * @param options JWT Claims Set validation options. - */ - static decode(jwt: string, options?: types.JWTClaimVerificationOptions): UnsecuredResult; -} diff --git a/node_modules/jose/dist/types/jwt/verify.d.ts b/node_modules/jose/dist/types/jwt/verify.d.ts deleted file mode 100644 index 285b567..0000000 --- a/node_modules/jose/dist/types/jwt/verify.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * JSON Web Token (JWT) Verification (JWT is in JWS format) - * - * @module - */ -import type * as types from '../types.d.ts'; -/** Combination of JWS Verification options and JWT Claims Set verification options. */ -export interface JWTVerifyOptions extends types.VerifyOptions, types.JWTClaimVerificationOptions { -} -/** - * Interface for JWT Verification dynamic key resolution. No token components have been verified at - * the time of this function call. - * - * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set. - */ -export interface JWTVerifyGetKey extends types.GenericGetKeyFunction { -} -/** - * Verifies the JWT format (to be a JWS Compact format), verifies the JWS signature, validates the - * JWT Claims Set. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwt/verify'`. - * - * @param jwt JSON Web Token value (encoded as JWS). - * @param key Key to verify the JWT with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWT Decryption and JWT Claims Set validation options. - */ -export declare function jwtVerify(jwt: string | Uint8Array, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: JWTVerifyOptions): Promise>; -/** - * @param jwt JSON Web Token value (encoded as JWS). - * @param getKey Function resolving a key to verify the JWT with. See - * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}. - * @param options JWT Decryption and JWT Claims Set validation options. - */ -export declare function jwtVerify(jwt: string | Uint8Array, getKey: JWTVerifyGetKey, options?: JWTVerifyOptions): Promise & types.ResolvedKey>; diff --git a/node_modules/jose/dist/types/key/export.d.ts b/node_modules/jose/dist/types/key/export.d.ts deleted file mode 100644 index 9ca16cc..0000000 --- a/node_modules/jose/dist/types/key/export.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Cryptographic key export functions - * - * @module - */ -import type * as types from '../types.d.ts'; -/** - * Exports a public {@link !CryptoKey} or {@link !KeyObject} to a PEM-encoded SPKI string format. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/key/export'`. - * - * @param key Key to export to a PEM-encoded SPKI string format. - */ -export declare function exportSPKI(key: types.CryptoKey | types.KeyObject): Promise; -/** - * Exports a private {@link !CryptoKey} or {@link !KeyObject} to a PEM-encoded PKCS8 string format. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/key/export'`. - * - * @param key Key to export to a PEM-encoded PKCS8 string format. - */ -export declare function exportPKCS8(key: types.CryptoKey | types.KeyObject): Promise; -/** - * Exports a {@link !CryptoKey}, {@link !KeyObject}, or {@link !Uint8Array} to a JWK. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/key/export'`. - * - * @param key Key to export as JWK. - */ -export declare function exportJWK(key: types.CryptoKey | types.KeyObject | Uint8Array): Promise; diff --git a/node_modules/jose/dist/types/key/generate_key_pair.d.ts b/node_modules/jose/dist/types/key/generate_key_pair.d.ts deleted file mode 100644 index 81677f7..0000000 --- a/node_modules/jose/dist/types/key/generate_key_pair.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Asymmetric key generation - * - * @module - */ -import type * as types from '../types.d.ts'; -/** Asymmetric key pair generation function result. */ -export interface GenerateKeyPairResult { - /** The generated Private Key. */ - privateKey: types.CryptoKey; - /** Public Key corresponding to the generated Private Key. */ - publicKey: types.CryptoKey; -} -/** Asymmetric key pair generation function options. */ -export interface GenerateKeyPairOptions { - /** - * The EC "crv" (Curve) or OKP "crv" (Subtype of Key Pair) value to generate. The curve must be - * both supported on the runtime as well as applicable for the given JWA algorithm identifier. - */ - crv?: string; - /** - * A hint for RSA algorithms to generate an RSA key of a given `modulusLength` (Key size in bits). - * JOSE requires 2048 bits or larger. Default is 2048. - */ - modulusLength?: number; - /** - * The value to use as {@link !SubtleCrypto.generateKey} `extractable` argument. Default is false. - * - */ - extractable?: boolean; -} -/** - * Generates a private and a public key for a given JWA algorithm identifier. This can only generate - * asymmetric key pairs. For symmetric secrets use the `generateSecret` function. - * - * > [!NOTE]\ - * > The `privateKey` is generated with `extractable` set to `false` by default. See - * > {@link GenerateKeyPairOptions.extractable} to generate an extractable `privateKey`. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/generate/keypair'`. - * - * @param alg JWA Algorithm Identifier to be used with the generated key pair. See - * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}. - * @param options Additional options passed down to the key pair generation. - */ -export declare function generateKeyPair(alg: string, options?: GenerateKeyPairOptions): Promise; diff --git a/node_modules/jose/dist/types/key/generate_secret.d.ts b/node_modules/jose/dist/types/key/generate_secret.d.ts deleted file mode 100644 index 9c41dc5..0000000 --- a/node_modules/jose/dist/types/key/generate_secret.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Symmetric key generation - * - * @module - */ -import type * as types from '../types.d.ts'; -/** Secret generation function options. */ -export interface GenerateSecretOptions { - /** - * The value to use as {@link !SubtleCrypto.generateKey} `extractable` argument. Default is false. - * - * > [!NOTE]\ - * > Because A128CBC-HS256, A192CBC-HS384, and A256CBC-HS512 secrets cannot be represented as - * > {@link !CryptoKey} this option has no effect for them. - */ - extractable?: boolean; -} -/** - * Generates a symmetric secret key for a given JWA algorithm identifier. - * - * > [!NOTE]\ - * > The secret key is generated with `extractable` set to `false` by default. - * - * > [!NOTE]\ - * > Because A128CBC-HS256, A192CBC-HS384, and A256CBC-HS512 secrets cannot be represented as - * > {@link !CryptoKey} this method yields a {@link !Uint8Array} for them instead. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/generate/secret'`. - * - * @param alg JWA Algorithm Identifier to be used with the generated secret. See - * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}. - * @param options Additional options passed down to the secret generation. - */ -export declare function generateSecret(alg: string, options?: GenerateSecretOptions): Promise; diff --git a/node_modules/jose/dist/types/key/import.d.ts b/node_modules/jose/dist/types/key/import.d.ts deleted file mode 100644 index e0cbfe0..0000000 --- a/node_modules/jose/dist/types/key/import.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Cryptographic key import functions - * - * @module - */ -import type * as types from '../types.d.ts'; -/** Key Import Function options. */ -export interface KeyImportOptions { - /** - * The value to use as {@link !SubtleCrypto.importKey} `extractable` argument. Default is false for - * private keys, true otherwise. - */ - extractable?: boolean; -} -/** - * Imports a PEM-encoded SPKI string as a {@link !CryptoKey}. - * - * > [!NOTE]\ - * > The OID id-RSASSA-PSS (1.2.840.113549.1.1.10) is not supported in - * > {@link https://w3c.github.io/webcrypto/ Web Cryptography API}, use the OID rsaEncryption - * > (1.2.840.113549.1.1.1) instead for all RSA algorithms. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/key/import'`. - * - * @param spki PEM-encoded SPKI string - * @param alg JSON Web Algorithm identifier to be used with the imported key. See - * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}. - */ -export declare function importSPKI(spki: string, alg: string, options?: KeyImportOptions): Promise; -/** - * Imports the SPKI from an X.509 string certificate as a {@link !CryptoKey}. - * - * > [!NOTE]\ - * > The OID id-RSASSA-PSS (1.2.840.113549.1.1.10) is not supported in - * > {@link https://w3c.github.io/webcrypto/ Web Cryptography API}, use the OID rsaEncryption - * > (1.2.840.113549.1.1.1) instead for all RSA algorithms. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/key/import'`. - * - * @param x509 X.509 certificate string - * @param alg JSON Web Algorithm identifier to be used with the imported key. See - * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}. - */ -export declare function importX509(x509: string, alg: string, options?: KeyImportOptions): Promise; -/** - * Imports a PEM-encoded PKCS#8 string as a {@link !CryptoKey}. - * - * > [!NOTE]\ - * > The OID id-RSASSA-PSS (1.2.840.113549.1.1.10) is not supported in - * > {@link https://w3c.github.io/webcrypto/ Web Cryptography API}, use the OID rsaEncryption - * > (1.2.840.113549.1.1.1) instead for all RSA algorithms. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/key/import'`. - * - * @param pkcs8 PEM-encoded PKCS#8 string - * @param alg JSON Web Algorithm identifier to be used with the imported key. See - * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}. - */ -export declare function importPKCS8(pkcs8: string, alg: string, options?: KeyImportOptions): Promise; -/** - * Imports a JWK to a {@link !CryptoKey}. Either the JWK "alg" (Algorithm) Parameter, or the optional - * "alg" argument, must be present for asymmetric JSON Web Key imports. - * - * > [!NOTE]\ - * > The JSON Web Key parameters "use", "key_ops", and "ext" are also used in the {@link !CryptoKey} - * > import process. - * - * > [!NOTE]\ - * > Symmetric JSON Web Keys (i.e. `kty: "oct"`) yield back an {@link !Uint8Array} instead of a - * > {@link !CryptoKey}. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/key/import'`. - * - * @param jwk JSON Web Key. - * @param alg JSON Web Algorithm identifier to be used with the imported key. Default is the "alg" - * property on the JWK. See - * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}. - */ -export declare function importJWK(jwk: types.JWK, alg?: string, options?: KeyImportOptions): Promise; diff --git a/node_modules/jose/dist/types/types.d.ts b/node_modules/jose/dist/types/types.d.ts deleted file mode 100644 index 5e08fa1..0000000 --- a/node_modules/jose/dist/types/types.d.ts +++ /dev/null @@ -1,841 +0,0 @@ -/** Generic JSON Web Key Parameters. */ -export interface JWKParameters { - /** JWK "kty" (Key Type) Parameter */ - kty?: string - /** - * JWK "alg" (Algorithm) Parameter - * - * @see {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements} - */ - alg?: string - /** JWK "key_ops" (Key Operations) Parameter */ - key_ops?: string[] - /** JWK "ext" (Extractable) Parameter */ - ext?: boolean - /** JWK "use" (Public Key Use) Parameter */ - use?: string - /** JWK "x5c" (X.509 Certificate Chain) Parameter */ - x5c?: string[] - /** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter */ - x5t?: string - /** JWK "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter */ - 'x5t#S256'?: string - /** JWK "x5u" (X.509 URL) Parameter */ - x5u?: string - /** JWK "kid" (Key ID) Parameter */ - kid?: string -} - -/** Convenience interface for Public OKP JSON Web Keys */ -export interface JWK_OKP_Public extends JWKParameters { - /** OKP JWK "crv" (The Subtype of Key Pair) Parameter */ - crv: string - /** OKP JWK "x" (The public key) Parameter */ - x: string -} - -/** Convenience interface for Private OKP JSON Web Keys */ -export interface JWK_OKP_Private extends JWK_OKP_Public { - /** OKP JWK "d" (The Private Key) Parameter */ - d: string -} - -/** Convenience interface for Public AKP JSON Web Keys */ -export interface JWK_AKP_Public extends JWKParameters { - /** JWK "alg" (Algorithm) Parameter */ - alg: string - /** AKP JWK "pub" (The Public key) Parameter */ - pub: string -} - -/** Convenience interface for Private AKP JSON Web Keys */ -export interface JWK_AKP_Private extends JWK_AKP_Public { - /** AKP JWK "priv" (The Private Key) Parameter */ - priv: string -} - -/** Convenience interface for Public EC JSON Web Keys */ -export interface JWK_EC_Public extends JWKParameters { - /** EC JWK "crv" (Curve) Parameter */ - crv: string - /** EC JWK "x" (X Coordinate) Parameter */ - x: string - /** EC JWK "y" (Y Coordinate) Parameter */ - y: string -} - -/** Convenience interface for Private EC JSON Web Keys */ -export interface JWK_EC_Private extends JWK_EC_Public { - /** EC JWK "d" (ECC Private Key) Parameter */ - d: string -} - -/** Convenience interface for Public RSA JSON Web Keys */ -export interface JWK_RSA_Public extends JWKParameters { - /** RSA JWK "e" (Exponent) Parameter */ - e: string - /** RSA JWK "n" (Modulus) Parameter */ - n: string -} - -/** Convenience interface for Private RSA JSON Web Keys */ -export interface JWK_RSA_Private extends JWK_RSA_Public { - /** RSA JWK "d" (Private Exponent) Parameter */ - d: string - /** RSA JWK "dp" (First Factor CRT Exponent) Parameter */ - dp: string - /** RSA JWK "dq" (Second Factor CRT Exponent) Parameter */ - dq: string - /** RSA JWK "p" (First Prime Factor) Parameter */ - p: string - /** RSA JWK "q" (Second Prime Factor) Parameter */ - q: string - /** RSA JWK "qi" (First CRT Coefficient) Parameter */ - qi: string -} - -/** Convenience interface for oct JSON Web Keys */ -export interface JWK_oct extends JWKParameters { - /** Oct JWK "k" (Key Value) Parameter */ - k: string -} - -/** - * JSON Web Key ({@link https://www.rfc-editor.org/rfc/rfc7517 JWK}). "RSA", "EC", "OKP", "AKP", and - * "oct" key types are supported. - * - * @see {@link JWK_AKP_Public} - * @see {@link JWK_AKP_Private} - * @see {@link JWK_OKP_Public} - * @see {@link JWK_OKP_Private} - * @see {@link JWK_EC_Public} - * @see {@link JWK_EC_Private} - * @see {@link JWK_RSA_Public} - * @see {@link JWK_RSA_Private} - * @see {@link JWK_oct} - */ -export interface JWK extends JWKParameters { - /** - * - EC JWK "crv" (Curve) Parameter - * - OKP JWK "crv" (The Subtype of Key Pair) Parameter - */ - crv?: string - /** - * - Private RSA JWK "d" (Private Exponent) Parameter - * - Private EC JWK "d" (ECC Private Key) Parameter - * - Private OKP JWK "d" (The Private Key) Parameter - */ - d?: string - /** Private RSA JWK "dp" (First Factor CRT Exponent) Parameter */ - dp?: string - /** Private RSA JWK "dq" (Second Factor CRT Exponent) Parameter */ - dq?: string - /** RSA JWK "e" (Exponent) Parameter */ - e?: string - /** Oct JWK "k" (Key Value) Parameter */ - k?: string - /** RSA JWK "n" (Modulus) Parameter */ - n?: string - /** Private RSA JWK "p" (First Prime Factor) Parameter */ - p?: string - /** Private RSA JWK "q" (Second Prime Factor) Parameter */ - q?: string - /** Private RSA JWK "qi" (First CRT Coefficient) Parameter */ - qi?: string - /** - * - EC JWK "x" (X Coordinate) Parameter - * - OKP JWK "x" (The public key) Parameter - */ - x?: string - /** EC JWK "y" (Y Coordinate) Parameter */ - y?: string - /** AKP JWK "pub" (Public Key) Parameter */ - pub?: string - /** AKP JWK "priv" (Private key) Parameter */ - priv?: string -} - -/** - * @private - * - * @internal - */ -export interface GenericGetKeyFunction { - /** - * Dynamic key resolution function. No token components have been verified at the time of this - * function call. - * - * If a suitable key for the token cannot be matched, throw an error instead. - * - * @param protectedHeader JWE or JWS Protected Header. - * @param token The consumed JWE or JWS token. - */ - (protectedHeader: IProtectedHeader, token: IToken): Promise | ReturnKeyTypes -} - -/** - * Generic Interface for consuming operations dynamic key resolution. - * - * @param IProtectedHeader Type definition of the JWE or JWS Protected Header. - * @param IToken Type definition of the consumed JWE or JWS token. - */ -export interface GetKeyFunction extends GenericGetKeyFunction< - IProtectedHeader, - IToken, - CryptoKey | KeyObject | JWK | Uint8Array -> {} - -/** - * Flattened JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for - * detached signature validation. - */ -export interface FlattenedJWSInput { - /** - * The "header" member MUST be present and contain the value JWS Unprotected Header when the JWS - * Unprotected Header value is non- empty; otherwise, it MUST be absent. This value is represented - * as an unencoded JSON object, rather than as a string. These Header Parameter values are not - * integrity protected. - */ - header?: JWSHeaderParameters - - /** - * The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When RFC7797 - * "b64": false is used the value passed may also be a {@link !Uint8Array}. - */ - payload: string | Uint8Array - - /** - * The "protected" member MUST be present and contain the value BASE64URL(UTF8(JWS Protected - * Header)) when the JWS Protected Header value is non-empty; otherwise, it MUST be absent. These - * Header Parameter values are integrity protected. - */ - protected?: string - - /** The "signature" member MUST be present and contain the value BASE64URL(JWS Signature). */ - signature: string -} - -/** - * General JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for - * detached signature validation. - */ -export interface GeneralJWSInput { - /** - * The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When when - * JWS Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) "b64": false is - * used the value passed may also be a {@link !Uint8Array}. - */ - payload: string | Uint8Array - - /** - * The "signatures" member value MUST be an array of JSON objects. Each object represents a - * signature or MAC over the JWS Payload and the JWS Protected Header. - */ - signatures: Omit[] -} - -/** - * Flattened JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS - * Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used. - */ -export interface FlattenedJWS extends Partial { - payload: string - signature: string -} - -/** - * General JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS - * Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used. - */ -export interface GeneralJWS { - payload: string - signatures: Omit[] -} - -/** Header Parameters common to JWE and JWS */ -export interface JoseHeaderParameters { - /** "kid" (Key ID) Header Parameter */ - kid?: string - - /** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter */ - x5t?: string - - /** "x5c" (X.509 Certificate Chain) Header Parameter */ - x5c?: string[] - - /** "x5u" (X.509 URL) Header Parameter */ - x5u?: string - - /** "jku" (JWK Set URL) Header Parameter */ - jku?: string - - /** "jwk" (JSON Web Key) Header Parameter */ - jwk?: Pick - - /** "typ" (Type) Header Parameter */ - typ?: string - - /** "cty" (Content Type) Header Parameter */ - cty?: string -} - -/** Recognized JWS Header Parameters, any other Header Members may also be present. */ -export interface JWSHeaderParameters extends JoseHeaderParameters { - /** - * JWS "alg" (Algorithm) Header Parameter - * - * @see {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements} - */ - alg?: string - - /** - * This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing - * Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}. - */ - b64?: boolean - - /** JWS "crit" (Critical) Header Parameter */ - crit?: string[] - - /** Any other JWS Header member. */ - [propName: string]: unknown -} - -/** Recognized JWE Key Management-related Header Parameters. */ -export interface JWEKeyManagementHeaderParameters { - /** - * ECDH-ES "apu" (Agreement PartyUInfo). This will be used as a JOSE Header Parameter and will be - * used in ECDH's ConcatKDF. - */ - apu?: Uint8Array - - /** - * ECDH-ES "apv" (Agreement PartyVInfo). This will be used as a JOSE Header Parameter and will be - * used in ECDH's ConcatKDF. - */ - apv?: Uint8Array - /** - * @deprecated You should not use this parameter. It is only intended for testing and vector - * validation purposes. - */ - p2c?: number - /** - * @deprecated You should not use this parameter. It is only intended for testing and vector - * validation purposes. - */ - p2s?: Uint8Array - /** - * @deprecated You should not use this parameter. It is only intended for testing and vector - * validation purposes. - */ - iv?: Uint8Array - /** - * @deprecated You should not use this parameter. It is only intended for testing and vector - * validation purposes. - */ - epk?: CryptoKey | KeyObject -} - -/** Flattened JWE JSON Serialization Syntax token. */ -export interface FlattenedJWE { - /** - * The "aad" member MUST be present and contain the value BASE64URL(JWE AAD)) when the JWE AAD - * value is non-empty; otherwise, it MUST be absent. A JWE AAD value can be included to supply a - * base64url-encoded value to be integrity protected but not encrypted. - */ - aad?: string - - /** The "ciphertext" member MUST be present and contain the value BASE64URL(JWE Ciphertext). */ - ciphertext: string - - /** - * The "encrypted_key" member MUST be present and contain the value BASE64URL(JWE Encrypted Key) - * when the JWE Encrypted Key value is non-empty; otherwise, it MUST be absent. - */ - encrypted_key?: string - - /** - * The "header" member MUST be present and contain the value JWE Per- Recipient Unprotected Header - * when the JWE Per-Recipient Unprotected Header value is non-empty; otherwise, it MUST be absent. - * This value is represented as an unencoded JSON object, rather than as a string. These Header - * Parameter values are not integrity protected. - */ - header?: JWEHeaderParameters - - /** - * The "iv" member MUST be present and contain the value BASE64URL(JWE Initialization Vector) when - * the JWE Initialization Vector value is non-empty; otherwise, it MUST be absent. - */ - iv?: string - - /** - * The "protected" member MUST be present and contain the value BASE64URL(UTF8(JWE Protected - * Header)) when the JWE Protected Header value is non-empty; otherwise, it MUST be absent. These - * Header Parameter values are integrity protected. - */ - protected?: string - - /** - * The "tag" member MUST be present and contain the value BASE64URL(JWE Authentication Tag) when - * the JWE Authentication Tag value is non-empty; otherwise, it MUST be absent. - */ - tag?: string - - /** - * The "unprotected" member MUST be present and contain the value JWE Shared Unprotected Header - * when the JWE Shared Unprotected Header value is non-empty; otherwise, it MUST be absent. This - * value is represented as an unencoded JSON object, rather than as a string. These Header - * Parameter values are not integrity protected. - */ - unprotected?: JWEHeaderParameters -} - -/** General JWE JSON Serialization Syntax token. */ -export interface GeneralJWE extends Omit { - recipients: Pick[] -} - -/** Recognized JWE Header Parameters, any other Header members may also be present. */ -export interface JWEHeaderParameters extends JoseHeaderParameters { - /** - * JWE "alg" (Algorithm) Header Parameter - * - * @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements} - */ - alg?: string - - /** - * JWE "enc" (Encryption Algorithm) Header Parameter - * - * @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements} - */ - enc?: string - - /** JWE "crit" (Critical) Header Parameter */ - crit?: string[] - - /** - * JWE "zip" (Compression Algorithm) Header Parameter. This parameter is not supported anymore. - * - * @deprecated Compression of data SHOULD NOT be done before encryption, because such compressed - * data often reveals information about the plaintext. - * - * @see {@link https://www.rfc-editor.org/rfc/rfc8725#name-avoid-compression-of-encryp Avoid Compression of Encryption Inputs} - */ - zip?: string - - /** Any other JWE Header member. */ - [propName: string]: unknown -} - -/** Shared Interface with a "crit" property for all sign, verify, encrypt and decrypt operations. */ -export interface CritOption { - /** - * An object with keys representing recognized "crit" (Critical) Header Parameter names. The value - * for those is either `true` or `false`. `true` when the Header Parameter MUST be integrity - * protected, `false` when it's irrelevant. - * - * This makes the "Extension Header Parameter "..." is not recognized" error go away. - * - * Use this when a given JWS/JWT/JWE profile requires the use of proprietary non-registered "crit" - * (Critical) Header Parameters. This will only make sure the Header Parameter is syntactically - * correct when provided and that it is optionally integrity protected. It will not process the - * Header Parameter in any way or reject the operation if it is missing. You MUST still verify the - * Header Parameter was present and process it according to the profile's validation steps after - * the operation succeeds. - * - * The JWS extension Header Parameter `b64` is always recognized and processed properly. No other - * registered Header Parameters that need this kind of default built-in treatment are currently - * available. - */ - crit?: { - [propName: string]: boolean - } -} - -/** JWE Decryption options. */ -export interface DecryptOptions extends CritOption { - /** - * A list of accepted JWE "alg" (Algorithm) Header Parameter values. By default all "alg" - * (Algorithm) Header Parameter values applicable for the used key/secret are allowed except for - * all PBES2 Key Management Algorithms, these need to be explicitly allowed using this option. - */ - keyManagementAlgorithms?: string[] - - /** - * A list of accepted JWE "enc" (Encryption Algorithm) Header Parameter values. By default all - * "enc" (Encryption Algorithm) values applicable for the used key/secret are allowed. - */ - contentEncryptionAlgorithms?: string[] - - /** - * (PBES2 Key Management Algorithms only) Maximum allowed "p2c" (PBES2 Count) Header Parameter - * value. The PBKDF2 iteration count defines the algorithm's computational expense. By default - * this value is set to 10000. - */ - maxPBES2Count?: number -} - -/** JWE Encryption options. */ -export interface EncryptOptions extends CritOption {} - -/** JWT Claims Set verification options. */ -export interface JWTClaimVerificationOptions { - /** - * Expected JWT "aud" (Audience) Claim value(s). - * - * This option makes the JWT "aud" (Audience) Claim presence required. - */ - audience?: string | string[] - - /** - * Clock skew tolerance - * - * - In seconds when number (e.g. 5) - * - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours"). - * - * Used when validating the JWT "nbf" (Not Before) and "exp" (Expiration Time) claims, and when - * validating the "iat" (Issued At) claim if the {@link maxTokenAge `maxTokenAge` option} is set. - */ - clockTolerance?: string | number - - /** - * Expected JWT "iss" (Issuer) Claim value(s). - * - * This option makes the JWT "iss" (Issuer) Claim presence required. - */ - issuer?: string | string[] - - /** - * Maximum time elapsed (in seconds) from the JWT "iat" (Issued At) Claim value. - * - * - In seconds when number (e.g. 5) - * - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours"). - * - * This option makes the JWT "iat" (Issued At) Claim presence required. - */ - maxTokenAge?: string | number - - /** - * Expected JWT "sub" (Subject) Claim value. - * - * This option makes the JWT "sub" (Subject) Claim presence required. - */ - subject?: string - - /** - * Expected JWT "typ" (Type) Header Parameter value. - * - * This option makes the JWT "typ" (Type) Header Parameter presence required. - */ - typ?: string - - /** Date to use when comparing NumericDate claims, defaults to `new Date()`. */ - currentDate?: Date - - /** - * Array of required Claim Names that must be present in the JWT Claims Set. Default is that: if - * the {@link issuer `issuer` option} is set, then JWT "iss" (Issuer) Claim must be present; if the - * {@link audience `audience` option} is set, then JWT "aud" (Audience) Claim must be present; if - * the {@link subject `subject` option} is set, then JWT "sub" (Subject) Claim must be present; if - * the {@link maxTokenAge `maxTokenAge` option} is set, then JWT "iat" (Issued At) Claim must be - * present. - */ - requiredClaims?: string[] -} - -/** JWS Verification options. */ -export interface VerifyOptions extends CritOption { - /** - * A list of accepted JWS "alg" (Algorithm) Header Parameter values. By default all "alg" - * (Algorithm) values applicable for the used key/secret are allowed. - * - * > [!NOTE]\ - * > Unsecured JWTs (`{ "alg": "none" }`) are never accepted by this API. - */ - algorithms?: string[] -} - -/** JWS Signing options. */ -export interface SignOptions extends CritOption {} - -/** Recognized JWT Claims Set members, any other members may also be present. */ -export interface JWTPayload { - /** - * JWT Issuer - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1 RFC7519#section-4.1.1} - */ - iss?: string - - /** - * JWT Subject - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.2 RFC7519#section-4.1.2} - */ - sub?: string - - /** - * JWT Audience - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.3 RFC7519#section-4.1.3} - */ - aud?: string | string[] - - /** - * JWT ID - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.7 RFC7519#section-4.1.7} - */ - jti?: string - - /** - * JWT Not Before - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.5 RFC7519#section-4.1.5} - */ - nbf?: number - - /** - * JWT Expiration Time - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4 RFC7519#section-4.1.4} - */ - exp?: number - - /** - * JWT Issued At - * - * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 RFC7519#section-4.1.6} - */ - iat?: number - - /** Any other JWT Claim Set member. */ - [propName: string]: unknown -} - -/** Flattened JWE JSON Serialization Syntax decryption result */ -export interface FlattenedDecryptResult { - /** JWE AAD. */ - additionalAuthenticatedData?: Uint8Array - - /** Plaintext. */ - plaintext: Uint8Array - - /** JWE Protected Header. */ - protectedHeader?: JWEHeaderParameters - - /** JWE Shared Unprotected Header. */ - sharedUnprotectedHeader?: JWEHeaderParameters - - /** JWE Per-Recipient Unprotected Header. */ - unprotectedHeader?: JWEHeaderParameters -} - -/** General JWE JSON Serialization Syntax decryption result */ -export interface GeneralDecryptResult extends FlattenedDecryptResult {} - -/** Compact JWE decryption result */ -export interface CompactDecryptResult { - /** Plaintext. */ - plaintext: Uint8Array - - /** JWE Protected Header. */ - protectedHeader: CompactJWEHeaderParameters -} - -/** Flattened JWS JSON Serialization Syntax verification result */ -export interface FlattenedVerifyResult { - /** JWS Payload. */ - payload: Uint8Array - - /** JWS Protected Header. */ - protectedHeader?: JWSHeaderParameters - - /** JWS Unprotected Header. */ - unprotectedHeader?: JWSHeaderParameters -} - -/** General JWS JSON Serialization Syntax verification result */ -export interface GeneralVerifyResult extends FlattenedVerifyResult {} - -/** Compact JWS verification result */ -export interface CompactVerifyResult { - /** JWS Payload. */ - payload: Uint8Array - - /** JWS Protected Header. */ - protectedHeader: CompactJWSHeaderParameters -} - -/** Signed JSON Web Token (JWT) verification result */ -export interface JWTVerifyResult { - /** JWT Claims Set. */ - payload: PayloadType & JWTPayload - - /** JWS Protected Header. */ - protectedHeader: JWTHeaderParameters -} - -/** Encrypted JSON Web Token (JWT) decryption result */ -export interface JWTDecryptResult { - /** JWT Claims Set. */ - payload: PayloadType & JWTPayload - - /** JWE Protected Header. */ - protectedHeader: CompactJWEHeaderParameters -} - -/** When key resolver functions are used this becomes part of successful resolves */ -export interface ResolvedKey { - /** Key resolved from the key resolver function. */ - key: CryptoKey | Uint8Array -} - -/** Recognized Compact JWS Header Parameters, any other Header Members may also be present. */ -export interface CompactJWSHeaderParameters extends JWSHeaderParameters { - alg: string -} - -/** Recognized Signed JWT Header Parameters, any other Header Members may also be present. */ -export interface JWTHeaderParameters extends CompactJWSHeaderParameters { - b64?: true -} - -/** Recognized Compact JWE Header Parameters, any other Header Members may also be present. */ -export interface CompactJWEHeaderParameters extends JWEHeaderParameters { - alg: string - enc: string -} - -/** JSON Web Key Set */ -export interface JSONWebKeySet { - keys: JWK[] -} - -/** - * {@link !KeyObject} is a representation of a key/secret available in the Node.js runtime. You may - * use the Node.js runtime APIs {@link !createPublicKey}, {@link !createPrivateKey}, and - * {@link !createSecretKey} to obtain a {@link !KeyObject} from your existing key material. - */ -export interface KeyObject { - type: string -} - -/** - * {@link !CryptoKey} is a representation of a key/secret available in all supported runtimes. In - * addition to the {@link key/import Key Import Functions} you may use the - * {@link !SubtleCrypto.importKey} API to obtain a {@link !CryptoKey} from your existing key - * material. - */ -export type CryptoKey = Extract< - Awaited>, - { type: string } -> - -/** Generic interface for JWT producing classes. */ -export interface ProduceJWT { - /** - * Set the "iss" (Issuer) Claim. - * - * @param issuer "Issuer" Claim value to set on the JWT Claims Set. - */ - setIssuer(issuer: string): this - - /** - * Set the "sub" (Subject) Claim. - * - * @param subject "sub" (Subject) Claim value to set on the JWT Claims Set. - */ - setSubject(subject: string): this - - /** - * Set the "aud" (Audience) Claim. - * - * @param audience "aud" (Audience) Claim value to set on the JWT Claims Set. - */ - setAudience(audience: string | string[]): this - - /** - * Set the "jti" (JWT ID) Claim. - * - * @param jwtId "jti" (JWT ID) Claim value to set on the JWT Claims Set. - */ - setJti(jwtId: string): this - - /** - * Set the "nbf" (Not Before) Claim. - * - * - If a `number` is passed as an argument it is used as the claim directly. - * - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the - * claim. - * - If a `string` is passed as an argument it is resolved to a time span, and then added to the - * current unix timestamp and used as the claim. - * - * Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 - * day". - * - * Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", - * "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", - * "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an - * alias for a year. - * - * If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets - * subtracted from the current unix timestamp. A "from now" suffix can also be used for - * readability when adding to the current unix timestamp. - * - * @param input "nbf" (Not Before) Claim value to set on the JWT Claims Set. - */ - setNotBefore(input: number | string | Date): this - - /** - * Set the "exp" (Expiration Time) Claim. - * - * - If a `number` is passed as an argument it is used as the claim directly. - * - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the - * claim. - * - If a `string` is passed as an argument it is resolved to a time span, and then added to the - * current unix timestamp and used as the claim. - * - * Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 - * day". - * - * Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", - * "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", - * "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an - * alias for a year. - * - * If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets - * subtracted from the current unix timestamp. A "from now" suffix can also be used for - * readability when adding to the current unix timestamp. - * - * @param input "exp" (Expiration Time) Claim value to set on the JWT Claims Set. - */ - setExpirationTime(input: number | string | Date): this - - /** - * Set the "iat" (Issued At) Claim. - * - * - If no argument is used the current unix timestamp is used as the claim. - * - If a `number` is passed as an argument it is used as the claim directly. - * - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the - * claim. - * - If a `string` is passed as an argument it is resolved to a time span, and then added to the - * current unix timestamp and used as the claim. - * - * Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 - * day". - * - * Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", - * "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", - * "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an - * alias for a year. - * - * If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets - * subtracted from the current unix timestamp. A "from now" suffix can also be used for - * readability when adding to the current unix timestamp. - * - * @param input "iat" (Expiration Time) Claim value to set on the JWT Claims Set. - */ - setIssuedAt(input?: number | string | Date): this -} diff --git a/node_modules/jose/dist/types/util/base64url.d.ts b/node_modules/jose/dist/types/util/base64url.d.ts deleted file mode 100644 index 7ec0d31..0000000 --- a/node_modules/jose/dist/types/util/base64url.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Base64URL encoding and decoding utilities - * - * @module - */ -/** Decodes a Base64URL encoded input. */ -export declare function decode(input: Uint8Array | string): Uint8Array; -/** Encodes an input using Base64URL with no padding. */ -export declare function encode(input: Uint8Array | string): string; diff --git a/node_modules/jose/dist/types/util/decode_jwt.d.ts b/node_modules/jose/dist/types/util/decode_jwt.d.ts deleted file mode 100644 index 3fd77ab..0000000 --- a/node_modules/jose/dist/types/util/decode_jwt.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * JSON Web Token (JWT) Claims Set Decoding (no validation, no signature checking) - * - * @module - */ -import type * as types from '../types.d.ts'; -/** - * Decodes a signed JSON Web Token payload. This does not validate the JWT Claims Set types or - * values. This does not validate the JWS Signature. For a proper Signed JWT Claims Set validation - * and JWS signature verification use `jose.jwtVerify()`. For an encrypted JWT Claims Set validation - * and JWE decryption use `jose.jwtDecrypt()`. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/jwt/decode'`. - * - * @param jwt JWT token in compact JWS serialization. - */ -export declare function decodeJwt(jwt: string): PayloadType & types.JWTPayload; diff --git a/node_modules/jose/dist/types/util/decode_protected_header.d.ts b/node_modules/jose/dist/types/util/decode_protected_header.d.ts deleted file mode 100644 index bec6fc0..0000000 --- a/node_modules/jose/dist/types/util/decode_protected_header.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * JOSE Protected Header Decoding (JWE, JWS, all serialization syntaxes) - * - * @module - */ -import type * as types from '../types.d.ts'; -/** JWE and JWS Header Parameters */ -export type ProtectedHeaderParameters = types.JWSHeaderParameters & types.JWEHeaderParameters; -/** - * Decodes the Protected Header of a JWE/JWS/JWT token utilizing any JOSE serialization. - * - * This function is exported (as a named export) from the main `'jose'` module entry point as well - * as from its subpath export `'jose/decode/protected_header'`. - * - * @param token JWE/JWS/JWT token in any JOSE serialization. - */ -export declare function decodeProtectedHeader(token: string | object): ProtectedHeaderParameters; diff --git a/node_modules/jose/dist/types/util/errors.d.ts b/node_modules/jose/dist/types/util/errors.d.ts deleted file mode 100644 index bad54f8..0000000 --- a/node_modules/jose/dist/types/util/errors.d.ts +++ /dev/null @@ -1,213 +0,0 @@ -/** - * JOSE module errors and error codes - * - * @module - */ -import type * as types from '../types.d.ts'; -/** - * A generic Error that all other JOSE specific Error subclasses extend. - * - */ -export declare class JOSEError extends Error { - /** - * A unique error code for the particular error subclass. - * - * @ignore - */ - static code: string; - /** A unique error code for {@link JOSEError}. */ - code: string; - /** @ignore */ - constructor(message?: string, options?: { - cause?: unknown; - }); -} -/** - * An error subclass thrown when a JWT Claim Set member validation fails. - * - */ -export declare class JWTClaimValidationFailed extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWTClaimValidationFailed}. */ - code: string; - /** The Claim for which the validation failed. */ - claim: string; - /** Reason code for the validation failure. */ - reason: string; - /** - * The parsed JWT Claims Set (aka payload). Other JWT claims may or may not have been verified at - * this point. The JSON Web Signature (JWS) or a JSON Web Encryption (JWE) structures' integrity - * has however been verified. Claims Set verification happens after the JWS Signature or JWE - * Decryption processes. - */ - payload: types.JWTPayload; - /** @ignore */ - constructor(message: string, payload: types.JWTPayload, claim?: string, reason?: string); -} -/** - * An error subclass thrown when a JWT is expired. - * - */ -export declare class JWTExpired extends JOSEError implements JWTClaimValidationFailed { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWTExpired}. */ - code: string; - /** The Claim for which the validation failed. */ - claim: string; - /** Reason code for the validation failure. */ - reason: string; - /** - * The parsed JWT Claims Set (aka payload). Other JWT claims may or may not have been verified at - * this point. The JSON Web Signature (JWS) or a JSON Web Encryption (JWE) structures' integrity - * has however been verified. Claims Set verification happens after the JWS Signature or JWE - * Decryption processes. - */ - payload: types.JWTPayload; - /** @ignore */ - constructor(message: string, payload: types.JWTPayload, claim?: string, reason?: string); -} -/** - * An error subclass thrown when a JOSE Algorithm is not allowed per developer preference. - * - */ -export declare class JOSEAlgNotAllowed extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JOSEAlgNotAllowed}. */ - code: string; -} -/** - * An error subclass thrown when a particular feature or algorithm is not supported by this - * implementation or JOSE in general. - * - */ -export declare class JOSENotSupported extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JOSENotSupported}. */ - code: string; -} -/** - * An error subclass thrown when a JWE ciphertext decryption fails. - * - */ -export declare class JWEDecryptionFailed extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWEDecryptionFailed}. */ - code: string; - /** @ignore */ - constructor(message?: string, options?: { - cause?: unknown; - }); -} -/** - * An error subclass thrown when a JWE is invalid. - * - */ -export declare class JWEInvalid extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWEInvalid}. */ - code: string; -} -/** - * An error subclass thrown when a JWS is invalid. - * - */ -export declare class JWSInvalid extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWSInvalid}. */ - code: string; -} -/** - * An error subclass thrown when a JWT is invalid. - * - */ -export declare class JWTInvalid extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWTInvalid}. */ - code: string; -} -/** - * An error subclass thrown when a JWK is invalid. - * - */ -export declare class JWKInvalid extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWKInvalid}. */ - code: string; -} -/** - * An error subclass thrown when a JWKS is invalid. - * - */ -export declare class JWKSInvalid extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWKSInvalid}. */ - code: string; -} -/** - * An error subclass thrown when no keys match from a JWKS. - * - */ -export declare class JWKSNoMatchingKey extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWKSNoMatchingKey}. */ - code: string; - /** @ignore */ - constructor(message?: string, options?: { - cause?: unknown; - }); -} -/** - * An error subclass thrown when multiple keys match from a JWKS. - * - */ -export declare class JWKSMultipleMatchingKeys extends JOSEError { - /** @ignore */ - [Symbol.asyncIterator]: () => AsyncIterableIterator; - /** @ignore */ - static code: string; - /** A unique error code for {@link JWKSMultipleMatchingKeys}. */ - code: string; - /** @ignore */ - constructor(message?: string, options?: { - cause?: unknown; - }); -} -/** - * Timeout was reached when retrieving the JWKS response. - * - */ -export declare class JWKSTimeout extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWKSTimeout}. */ - code: string; - /** @ignore */ - constructor(message?: string, options?: { - cause?: unknown; - }); -} -/** - * An error subclass thrown when JWS signature verification fails. - * - */ -export declare class JWSSignatureVerificationFailed extends JOSEError { - /** @ignore */ - static code: string; - /** A unique error code for {@link JWSSignatureVerificationFailed}. */ - code: string; - /** @ignore */ - constructor(message?: string, options?: { - cause?: unknown; - }); -} diff --git a/node_modules/jose/dist/webapi/index.js b/node_modules/jose/dist/webapi/index.js deleted file mode 100644 index 939f09b..0000000 --- a/node_modules/jose/dist/webapi/index.js +++ /dev/null @@ -1,32 +0,0 @@ -export { compactDecrypt } from './jwe/compact/decrypt.js'; -export { flattenedDecrypt } from './jwe/flattened/decrypt.js'; -export { generalDecrypt } from './jwe/general/decrypt.js'; -export { GeneralEncrypt } from './jwe/general/encrypt.js'; -export { compactVerify } from './jws/compact/verify.js'; -export { flattenedVerify } from './jws/flattened/verify.js'; -export { generalVerify } from './jws/general/verify.js'; -export { jwtVerify } from './jwt/verify.js'; -export { jwtDecrypt } from './jwt/decrypt.js'; -export { CompactEncrypt } from './jwe/compact/encrypt.js'; -export { FlattenedEncrypt } from './jwe/flattened/encrypt.js'; -export { CompactSign } from './jws/compact/sign.js'; -export { FlattenedSign } from './jws/flattened/sign.js'; -export { GeneralSign } from './jws/general/sign.js'; -export { SignJWT } from './jwt/sign.js'; -export { EncryptJWT } from './jwt/encrypt.js'; -export { calculateJwkThumbprint, calculateJwkThumbprintUri } from './jwk/thumbprint.js'; -export { EmbeddedJWK } from './jwk/embedded.js'; -export { createLocalJWKSet } from './jwks/local.js'; -export { createRemoteJWKSet, jwksCache, customFetch } from './jwks/remote.js'; -export { UnsecuredJWT } from './jwt/unsecured.js'; -export { exportPKCS8, exportSPKI, exportJWK } from './key/export.js'; -export { importSPKI, importPKCS8, importX509, importJWK } from './key/import.js'; -export { decodeProtectedHeader } from './util/decode_protected_header.js'; -export { decodeJwt } from './util/decode_jwt.js'; -import * as errors from './util/errors.js'; -export { errors }; -export { generateKeyPair } from './key/generate_key_pair.js'; -export { generateSecret } from './key/generate_secret.js'; -import * as base64url from './util/base64url.js'; -export { base64url }; -export const cryptoRuntime = 'WebCryptoAPI'; diff --git a/node_modules/jose/dist/webapi/jwe/compact/decrypt.js b/node_modules/jose/dist/webapi/jwe/compact/decrypt.js deleted file mode 100644 index d74a67b..0000000 --- a/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +++ /dev/null @@ -1,27 +0,0 @@ -import { flattenedDecrypt } from '../flattened/decrypt.js'; -import { JWEInvalid } from '../../util/errors.js'; -import { decoder } from '../../lib/buffer_utils.js'; -export async function compactDecrypt(jwe, key, options) { - if (jwe instanceof Uint8Array) { - jwe = decoder.decode(jwe); - } - if (typeof jwe !== 'string') { - throw new JWEInvalid('Compact JWE must be a string or Uint8Array'); - } - const { 0: protectedHeader, 1: encryptedKey, 2: iv, 3: ciphertext, 4: tag, length, } = jwe.split('.'); - if (length !== 5) { - throw new JWEInvalid('Invalid Compact JWE'); - } - const decrypted = await flattenedDecrypt({ - ciphertext, - iv: iv || undefined, - protected: protectedHeader, - tag: tag || undefined, - encrypted_key: encryptedKey || undefined, - }, key, options); - const result = { plaintext: decrypted.plaintext, protectedHeader: decrypted.protectedHeader }; - if (typeof key === 'function') { - return { ...result, key: decrypted.key }; - } - return result; -} diff --git a/node_modules/jose/dist/webapi/jwe/compact/encrypt.js b/node_modules/jose/dist/webapi/jwe/compact/encrypt.js deleted file mode 100644 index 5492e2c..0000000 --- a/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +++ /dev/null @@ -1,27 +0,0 @@ -import { FlattenedEncrypt } from '../flattened/encrypt.js'; -export class CompactEncrypt { - #flattened; - constructor(plaintext) { - this.#flattened = new FlattenedEncrypt(plaintext); - } - setContentEncryptionKey(cek) { - this.#flattened.setContentEncryptionKey(cek); - return this; - } - setInitializationVector(iv) { - this.#flattened.setInitializationVector(iv); - return this; - } - setProtectedHeader(protectedHeader) { - this.#flattened.setProtectedHeader(protectedHeader); - return this; - } - setKeyManagementParameters(parameters) { - this.#flattened.setKeyManagementParameters(parameters); - return this; - } - async encrypt(key, options) { - const jwe = await this.#flattened.encrypt(key, options); - return [jwe.protected, jwe.encrypted_key, jwe.iv, jwe.ciphertext, jwe.tag].join('.'); - } -} diff --git a/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js b/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js deleted file mode 100644 index d7a846a..0000000 --- a/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +++ /dev/null @@ -1,165 +0,0 @@ -import { decode as b64u } from '../../util/base64url.js'; -import { decrypt } from '../../lib/decrypt.js'; -import { JOSEAlgNotAllowed, JOSENotSupported, JWEInvalid } from '../../util/errors.js'; -import { isDisjoint } from '../../lib/is_disjoint.js'; -import { isObject } from '../../lib/is_object.js'; -import { decryptKeyManagement } from '../../lib/decrypt_key_management.js'; -import { decoder, concat, encode } from '../../lib/buffer_utils.js'; -import { generateCek } from '../../lib/cek.js'; -import { validateCrit } from '../../lib/validate_crit.js'; -import { validateAlgorithms } from '../../lib/validate_algorithms.js'; -import { normalizeKey } from '../../lib/normalize_key.js'; -import { checkKeyType } from '../../lib/check_key_type.js'; -export async function flattenedDecrypt(jwe, key, options) { - if (!isObject(jwe)) { - throw new JWEInvalid('Flattened JWE must be an object'); - } - if (jwe.protected === undefined && jwe.header === undefined && jwe.unprotected === undefined) { - throw new JWEInvalid('JOSE Header missing'); - } - if (jwe.iv !== undefined && typeof jwe.iv !== 'string') { - throw new JWEInvalid('JWE Initialization Vector incorrect type'); - } - if (typeof jwe.ciphertext !== 'string') { - throw new JWEInvalid('JWE Ciphertext missing or incorrect type'); - } - if (jwe.tag !== undefined && typeof jwe.tag !== 'string') { - throw new JWEInvalid('JWE Authentication Tag incorrect type'); - } - if (jwe.protected !== undefined && typeof jwe.protected !== 'string') { - throw new JWEInvalid('JWE Protected Header incorrect type'); - } - if (jwe.encrypted_key !== undefined && typeof jwe.encrypted_key !== 'string') { - throw new JWEInvalid('JWE Encrypted Key incorrect type'); - } - if (jwe.aad !== undefined && typeof jwe.aad !== 'string') { - throw new JWEInvalid('JWE AAD incorrect type'); - } - if (jwe.header !== undefined && !isObject(jwe.header)) { - throw new JWEInvalid('JWE Shared Unprotected Header incorrect type'); - } - if (jwe.unprotected !== undefined && !isObject(jwe.unprotected)) { - throw new JWEInvalid('JWE Per-Recipient Unprotected Header incorrect type'); - } - let parsedProt; - if (jwe.protected) { - try { - const protectedHeader = b64u(jwe.protected); - parsedProt = JSON.parse(decoder.decode(protectedHeader)); - } - catch { - throw new JWEInvalid('JWE Protected Header is invalid'); - } - } - if (!isDisjoint(parsedProt, jwe.header, jwe.unprotected)) { - throw new JWEInvalid('JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint'); - } - const joseHeader = { - ...parsedProt, - ...jwe.header, - ...jwe.unprotected, - }; - validateCrit(JWEInvalid, new Map(), options?.crit, parsedProt, joseHeader); - if (joseHeader.zip !== undefined) { - throw new JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.'); - } - const { alg, enc } = joseHeader; - if (typeof alg !== 'string' || !alg) { - throw new JWEInvalid('missing JWE Algorithm (alg) in JWE Header'); - } - if (typeof enc !== 'string' || !enc) { - throw new JWEInvalid('missing JWE Encryption Algorithm (enc) in JWE Header'); - } - const keyManagementAlgorithms = options && validateAlgorithms('keyManagementAlgorithms', options.keyManagementAlgorithms); - const contentEncryptionAlgorithms = options && - validateAlgorithms('contentEncryptionAlgorithms', options.contentEncryptionAlgorithms); - if ((keyManagementAlgorithms && !keyManagementAlgorithms.has(alg)) || - (!keyManagementAlgorithms && alg.startsWith('PBES2'))) { - throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed'); - } - if (contentEncryptionAlgorithms && !contentEncryptionAlgorithms.has(enc)) { - throw new JOSEAlgNotAllowed('"enc" (Encryption Algorithm) Header Parameter value not allowed'); - } - let encryptedKey; - if (jwe.encrypted_key !== undefined) { - try { - encryptedKey = b64u(jwe.encrypted_key); - } - catch { - throw new JWEInvalid('Failed to base64url decode the encrypted_key'); - } - } - let resolvedKey = false; - if (typeof key === 'function') { - key = await key(parsedProt, jwe); - resolvedKey = true; - } - checkKeyType(alg === 'dir' ? enc : alg, key, 'decrypt'); - const k = await normalizeKey(key, alg); - let cek; - try { - cek = await decryptKeyManagement(alg, k, encryptedKey, joseHeader, options); - } - catch (err) { - if (err instanceof TypeError || err instanceof JWEInvalid || err instanceof JOSENotSupported) { - throw err; - } - cek = generateCek(enc); - } - let iv; - let tag; - if (jwe.iv !== undefined) { - try { - iv = b64u(jwe.iv); - } - catch { - throw new JWEInvalid('Failed to base64url decode the iv'); - } - } - if (jwe.tag !== undefined) { - try { - tag = b64u(jwe.tag); - } - catch { - throw new JWEInvalid('Failed to base64url decode the tag'); - } - } - const protectedHeader = jwe.protected !== undefined ? encode(jwe.protected) : new Uint8Array(); - let additionalData; - if (jwe.aad !== undefined) { - additionalData = concat(protectedHeader, encode('.'), encode(jwe.aad)); - } - else { - additionalData = protectedHeader; - } - let ciphertext; - try { - ciphertext = b64u(jwe.ciphertext); - } - catch { - throw new JWEInvalid('Failed to base64url decode the ciphertext'); - } - const plaintext = await decrypt(enc, cek, ciphertext, iv, tag, additionalData); - const result = { plaintext }; - if (jwe.protected !== undefined) { - result.protectedHeader = parsedProt; - } - if (jwe.aad !== undefined) { - try { - result.additionalAuthenticatedData = b64u(jwe.aad); - } - catch { - throw new JWEInvalid('Failed to base64url decode the aad'); - } - } - if (jwe.unprotected !== undefined) { - result.sharedUnprotectedHeader = jwe.unprotected; - } - if (jwe.header !== undefined) { - result.unprotectedHeader = jwe.header; - } - if (resolvedKey) { - return { ...result, key: k }; - } - return result; -} diff --git a/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js b/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js deleted file mode 100644 index aa2cd1c..0000000 --- a/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +++ /dev/null @@ -1,169 +0,0 @@ -import { encode as b64u } from '../../util/base64url.js'; -import { unprotected } from '../../lib/private_symbols.js'; -import { encrypt } from '../../lib/encrypt.js'; -import { encryptKeyManagement } from '../../lib/encrypt_key_management.js'; -import { JOSENotSupported, JWEInvalid } from '../../util/errors.js'; -import { isDisjoint } from '../../lib/is_disjoint.js'; -import { concat, encode } from '../../lib/buffer_utils.js'; -import { validateCrit } from '../../lib/validate_crit.js'; -import { normalizeKey } from '../../lib/normalize_key.js'; -import { checkKeyType } from '../../lib/check_key_type.js'; -export class FlattenedEncrypt { - #plaintext; - #protectedHeader; - #sharedUnprotectedHeader; - #unprotectedHeader; - #aad; - #cek; - #iv; - #keyManagementParameters; - constructor(plaintext) { - if (!(plaintext instanceof Uint8Array)) { - throw new TypeError('plaintext must be an instance of Uint8Array'); - } - this.#plaintext = plaintext; - } - setKeyManagementParameters(parameters) { - if (this.#keyManagementParameters) { - throw new TypeError('setKeyManagementParameters can only be called once'); - } - this.#keyManagementParameters = parameters; - return this; - } - setProtectedHeader(protectedHeader) { - if (this.#protectedHeader) { - throw new TypeError('setProtectedHeader can only be called once'); - } - this.#protectedHeader = protectedHeader; - return this; - } - setSharedUnprotectedHeader(sharedUnprotectedHeader) { - if (this.#sharedUnprotectedHeader) { - throw new TypeError('setSharedUnprotectedHeader can only be called once'); - } - this.#sharedUnprotectedHeader = sharedUnprotectedHeader; - return this; - } - setUnprotectedHeader(unprotectedHeader) { - if (this.#unprotectedHeader) { - throw new TypeError('setUnprotectedHeader can only be called once'); - } - this.#unprotectedHeader = unprotectedHeader; - return this; - } - setAdditionalAuthenticatedData(aad) { - this.#aad = aad; - return this; - } - setContentEncryptionKey(cek) { - if (this.#cek) { - throw new TypeError('setContentEncryptionKey can only be called once'); - } - this.#cek = cek; - return this; - } - setInitializationVector(iv) { - if (this.#iv) { - throw new TypeError('setInitializationVector can only be called once'); - } - this.#iv = iv; - return this; - } - async encrypt(key, options) { - if (!this.#protectedHeader && !this.#unprotectedHeader && !this.#sharedUnprotectedHeader) { - throw new JWEInvalid('either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()'); - } - if (!isDisjoint(this.#protectedHeader, this.#unprotectedHeader, this.#sharedUnprotectedHeader)) { - throw new JWEInvalid('JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint'); - } - const joseHeader = { - ...this.#protectedHeader, - ...this.#unprotectedHeader, - ...this.#sharedUnprotectedHeader, - }; - validateCrit(JWEInvalid, new Map(), options?.crit, this.#protectedHeader, joseHeader); - if (joseHeader.zip !== undefined) { - throw new JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.'); - } - const { alg, enc } = joseHeader; - if (typeof alg !== 'string' || !alg) { - throw new JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid'); - } - if (typeof enc !== 'string' || !enc) { - throw new JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid'); - } - let encryptedKey; - if (this.#cek && (alg === 'dir' || alg === 'ECDH-ES')) { - throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${alg}`); - } - checkKeyType(alg === 'dir' ? enc : alg, key, 'encrypt'); - let cek; - { - let parameters; - const k = await normalizeKey(key, alg); - ({ cek, encryptedKey, parameters } = await encryptKeyManagement(alg, enc, k, this.#cek, this.#keyManagementParameters)); - if (parameters) { - if (options && unprotected in options) { - if (!this.#unprotectedHeader) { - this.setUnprotectedHeader(parameters); - } - else { - this.#unprotectedHeader = { ...this.#unprotectedHeader, ...parameters }; - } - } - else if (!this.#protectedHeader) { - this.setProtectedHeader(parameters); - } - else { - this.#protectedHeader = { ...this.#protectedHeader, ...parameters }; - } - } - } - let additionalData; - let protectedHeaderS; - let protectedHeaderB; - let aadMember; - if (this.#protectedHeader) { - protectedHeaderS = b64u(JSON.stringify(this.#protectedHeader)); - protectedHeaderB = encode(protectedHeaderS); - } - else { - protectedHeaderS = ''; - protectedHeaderB = new Uint8Array(); - } - if (this.#aad) { - aadMember = b64u(this.#aad); - const aadMemberBytes = encode(aadMember); - additionalData = concat(protectedHeaderB, encode('.'), aadMemberBytes); - } - else { - additionalData = protectedHeaderB; - } - const { ciphertext, tag, iv } = await encrypt(enc, this.#plaintext, cek, this.#iv, additionalData); - const jwe = { - ciphertext: b64u(ciphertext), - }; - if (iv) { - jwe.iv = b64u(iv); - } - if (tag) { - jwe.tag = b64u(tag); - } - if (encryptedKey) { - jwe.encrypted_key = b64u(encryptedKey); - } - if (aadMember) { - jwe.aad = aadMember; - } - if (this.#protectedHeader) { - jwe.protected = protectedHeaderS; - } - if (this.#sharedUnprotectedHeader) { - jwe.unprotected = this.#sharedUnprotectedHeader; - } - if (this.#unprotectedHeader) { - jwe.header = this.#unprotectedHeader; - } - return jwe; - } -} diff --git a/node_modules/jose/dist/webapi/jwe/general/decrypt.js b/node_modules/jose/dist/webapi/jwe/general/decrypt.js deleted file mode 100644 index 65436af..0000000 --- a/node_modules/jose/dist/webapi/jwe/general/decrypt.js +++ /dev/null @@ -1,31 +0,0 @@ -import { flattenedDecrypt } from '../flattened/decrypt.js'; -import { JWEDecryptionFailed, JWEInvalid } from '../../util/errors.js'; -import { isObject } from '../../lib/is_object.js'; -export async function generalDecrypt(jwe, key, options) { - if (!isObject(jwe)) { - throw new JWEInvalid('General JWE must be an object'); - } - if (!Array.isArray(jwe.recipients) || !jwe.recipients.every(isObject)) { - throw new JWEInvalid('JWE Recipients missing or incorrect type'); - } - if (!jwe.recipients.length) { - throw new JWEInvalid('JWE Recipients has no members'); - } - for (const recipient of jwe.recipients) { - try { - return await flattenedDecrypt({ - aad: jwe.aad, - ciphertext: jwe.ciphertext, - encrypted_key: recipient.encrypted_key, - header: recipient.header, - iv: jwe.iv, - protected: jwe.protected, - tag: jwe.tag, - unprotected: jwe.unprotected, - }, key, options); - } - catch { - } - } - throw new JWEDecryptionFailed(); -} diff --git a/node_modules/jose/dist/webapi/jwe/general/encrypt.js b/node_modules/jose/dist/webapi/jwe/general/encrypt.js deleted file mode 100644 index 0ee1ebf..0000000 --- a/node_modules/jose/dist/webapi/jwe/general/encrypt.js +++ /dev/null @@ -1,187 +0,0 @@ -import { FlattenedEncrypt } from '../flattened/encrypt.js'; -import { unprotected } from '../../lib/private_symbols.js'; -import { JOSENotSupported, JWEInvalid } from '../../util/errors.js'; -import { generateCek } from '../../lib/cek.js'; -import { isDisjoint } from '../../lib/is_disjoint.js'; -import { encryptKeyManagement } from '../../lib/encrypt_key_management.js'; -import { encode as b64u } from '../../util/base64url.js'; -import { validateCrit } from '../../lib/validate_crit.js'; -import { normalizeKey } from '../../lib/normalize_key.js'; -import { checkKeyType } from '../../lib/check_key_type.js'; -class IndividualRecipient { - #parent; - unprotectedHeader; - keyManagementParameters; - key; - options; - constructor(enc, key, options) { - this.#parent = enc; - this.key = key; - this.options = options; - } - setUnprotectedHeader(unprotectedHeader) { - if (this.unprotectedHeader) { - throw new TypeError('setUnprotectedHeader can only be called once'); - } - this.unprotectedHeader = unprotectedHeader; - return this; - } - setKeyManagementParameters(parameters) { - if (this.keyManagementParameters) { - throw new TypeError('setKeyManagementParameters can only be called once'); - } - this.keyManagementParameters = parameters; - return this; - } - addRecipient(...args) { - return this.#parent.addRecipient(...args); - } - encrypt(...args) { - return this.#parent.encrypt(...args); - } - done() { - return this.#parent; - } -} -export class GeneralEncrypt { - #plaintext; - #recipients = []; - #protectedHeader; - #unprotectedHeader; - #aad; - constructor(plaintext) { - this.#plaintext = plaintext; - } - addRecipient(key, options) { - const recipient = new IndividualRecipient(this, key, { crit: options?.crit }); - this.#recipients.push(recipient); - return recipient; - } - setProtectedHeader(protectedHeader) { - if (this.#protectedHeader) { - throw new TypeError('setProtectedHeader can only be called once'); - } - this.#protectedHeader = protectedHeader; - return this; - } - setSharedUnprotectedHeader(sharedUnprotectedHeader) { - if (this.#unprotectedHeader) { - throw new TypeError('setSharedUnprotectedHeader can only be called once'); - } - this.#unprotectedHeader = sharedUnprotectedHeader; - return this; - } - setAdditionalAuthenticatedData(aad) { - this.#aad = aad; - return this; - } - async encrypt() { - if (!this.#recipients.length) { - throw new JWEInvalid('at least one recipient must be added'); - } - if (this.#recipients.length === 1) { - const [recipient] = this.#recipients; - const flattened = await new FlattenedEncrypt(this.#plaintext) - .setAdditionalAuthenticatedData(this.#aad) - .setProtectedHeader(this.#protectedHeader) - .setSharedUnprotectedHeader(this.#unprotectedHeader) - .setUnprotectedHeader(recipient.unprotectedHeader) - .encrypt(recipient.key, { ...recipient.options }); - const jwe = { - ciphertext: flattened.ciphertext, - iv: flattened.iv, - recipients: [{}], - tag: flattened.tag, - }; - if (flattened.aad) - jwe.aad = flattened.aad; - if (flattened.protected) - jwe.protected = flattened.protected; - if (flattened.unprotected) - jwe.unprotected = flattened.unprotected; - if (flattened.encrypted_key) - jwe.recipients[0].encrypted_key = flattened.encrypted_key; - if (flattened.header) - jwe.recipients[0].header = flattened.header; - return jwe; - } - let enc; - for (let i = 0; i < this.#recipients.length; i++) { - const recipient = this.#recipients[i]; - if (!isDisjoint(this.#protectedHeader, this.#unprotectedHeader, recipient.unprotectedHeader)) { - throw new JWEInvalid('JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint'); - } - const joseHeader = { - ...this.#protectedHeader, - ...this.#unprotectedHeader, - ...recipient.unprotectedHeader, - }; - const { alg } = joseHeader; - if (typeof alg !== 'string' || !alg) { - throw new JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid'); - } - if (alg === 'dir' || alg === 'ECDH-ES') { - throw new JWEInvalid('"dir" and "ECDH-ES" alg may only be used with a single recipient'); - } - if (typeof joseHeader.enc !== 'string' || !joseHeader.enc) { - throw new JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid'); - } - if (!enc) { - enc = joseHeader.enc; - } - else if (enc !== joseHeader.enc) { - throw new JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients'); - } - validateCrit(JWEInvalid, new Map(), recipient.options.crit, this.#protectedHeader, joseHeader); - if (joseHeader.zip !== undefined) { - throw new JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.'); - } - } - const cek = generateCek(enc); - const jwe = { - ciphertext: '', - recipients: [], - }; - for (let i = 0; i < this.#recipients.length; i++) { - const recipient = this.#recipients[i]; - const target = {}; - jwe.recipients.push(target); - if (i === 0) { - const flattened = await new FlattenedEncrypt(this.#plaintext) - .setAdditionalAuthenticatedData(this.#aad) - .setContentEncryptionKey(cek) - .setProtectedHeader(this.#protectedHeader) - .setSharedUnprotectedHeader(this.#unprotectedHeader) - .setUnprotectedHeader(recipient.unprotectedHeader) - .setKeyManagementParameters(recipient.keyManagementParameters) - .encrypt(recipient.key, { - ...recipient.options, - [unprotected]: true, - }); - jwe.ciphertext = flattened.ciphertext; - jwe.iv = flattened.iv; - jwe.tag = flattened.tag; - if (flattened.aad) - jwe.aad = flattened.aad; - if (flattened.protected) - jwe.protected = flattened.protected; - if (flattened.unprotected) - jwe.unprotected = flattened.unprotected; - target.encrypted_key = flattened.encrypted_key; - if (flattened.header) - target.header = flattened.header; - continue; - } - const alg = recipient.unprotectedHeader?.alg || - this.#protectedHeader?.alg || - this.#unprotectedHeader?.alg; - checkKeyType(alg === 'dir' ? enc : alg, recipient.key, 'encrypt'); - const k = await normalizeKey(recipient.key, alg); - const { encryptedKey, parameters } = await encryptKeyManagement(alg, enc, k, cek, recipient.keyManagementParameters); - target.encrypted_key = b64u(encryptedKey); - if (recipient.unprotectedHeader || parameters) - target.header = { ...recipient.unprotectedHeader, ...parameters }; - } - return jwe; - } -} diff --git a/node_modules/jose/dist/webapi/jwk/embedded.js b/node_modules/jose/dist/webapi/jwk/embedded.js deleted file mode 100644 index ac716b3..0000000 --- a/node_modules/jose/dist/webapi/jwk/embedded.js +++ /dev/null @@ -1,17 +0,0 @@ -import { importJWK } from '../key/import.js'; -import { isObject } from '../lib/is_object.js'; -import { JWSInvalid } from '../util/errors.js'; -export async function EmbeddedJWK(protectedHeader, token) { - const joseHeader = { - ...protectedHeader, - ...token?.header, - }; - if (!isObject(joseHeader.jwk)) { - throw new JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a JSON object'); - } - const key = await importJWK({ ...joseHeader.jwk, ext: true }, joseHeader.alg); - if (key instanceof Uint8Array || key.type !== 'public') { - throw new JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a public key'); - } - return key; -} diff --git a/node_modules/jose/dist/webapi/jwk/thumbprint.js b/node_modules/jose/dist/webapi/jwk/thumbprint.js deleted file mode 100644 index 51f5772..0000000 --- a/node_modules/jose/dist/webapi/jwk/thumbprint.js +++ /dev/null @@ -1,68 +0,0 @@ -import { digest } from '../lib/digest.js'; -import { encode as b64u } from '../util/base64url.js'; -import { JOSENotSupported, JWKInvalid } from '../util/errors.js'; -import { encode } from '../lib/buffer_utils.js'; -import { isKeyLike } from '../lib/is_key_like.js'; -import { isJWK } from '../lib/is_jwk.js'; -import { exportJWK } from '../key/export.js'; -import { invalidKeyInput } from '../lib/invalid_key_input.js'; -const check = (value, description) => { - if (typeof value !== 'string' || !value) { - throw new JWKInvalid(`${description} missing or invalid`); - } -}; -export async function calculateJwkThumbprint(key, digestAlgorithm) { - let jwk; - if (isJWK(key)) { - jwk = key; - } - else if (isKeyLike(key)) { - jwk = await exportJWK(key); - } - else { - throw new TypeError(invalidKeyInput(key, 'CryptoKey', 'KeyObject', 'JSON Web Key')); - } - digestAlgorithm ??= 'sha256'; - if (digestAlgorithm !== 'sha256' && - digestAlgorithm !== 'sha384' && - digestAlgorithm !== 'sha512') { - throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"'); - } - let components; - switch (jwk.kty) { - case 'AKP': - check(jwk.alg, '"alg" (Algorithm) Parameter'); - check(jwk.pub, '"pub" (Public key) Parameter'); - components = { alg: jwk.alg, kty: jwk.kty, pub: jwk.pub }; - break; - case 'EC': - check(jwk.crv, '"crv" (Curve) Parameter'); - check(jwk.x, '"x" (X Coordinate) Parameter'); - check(jwk.y, '"y" (Y Coordinate) Parameter'); - components = { crv: jwk.crv, kty: jwk.kty, x: jwk.x, y: jwk.y }; - break; - case 'OKP': - check(jwk.crv, '"crv" (Subtype of Key Pair) Parameter'); - check(jwk.x, '"x" (Public Key) Parameter'); - components = { crv: jwk.crv, kty: jwk.kty, x: jwk.x }; - break; - case 'RSA': - check(jwk.e, '"e" (Exponent) Parameter'); - check(jwk.n, '"n" (Modulus) Parameter'); - components = { e: jwk.e, kty: jwk.kty, n: jwk.n }; - break; - case 'oct': - check(jwk.k, '"k" (Key Value) Parameter'); - components = { k: jwk.k, kty: jwk.kty }; - break; - default: - throw new JOSENotSupported('"kty" (Key Type) Parameter missing or unsupported'); - } - const data = encode(JSON.stringify(components)); - return b64u(await digest(digestAlgorithm, data)); -} -export async function calculateJwkThumbprintUri(key, digestAlgorithm) { - digestAlgorithm ??= 'sha256'; - const thumbprint = await calculateJwkThumbprint(key, digestAlgorithm); - return `urn:ietf:params:oauth:jwk-thumbprint:sha-${digestAlgorithm.slice(-3)}:${thumbprint}`; -} diff --git a/node_modules/jose/dist/webapi/jwks/local.js b/node_modules/jose/dist/webapi/jwks/local.js deleted file mode 100644 index c62bdc7..0000000 --- a/node_modules/jose/dist/webapi/jwks/local.js +++ /dev/null @@ -1,119 +0,0 @@ -import { importJWK } from '../key/import.js'; -import { JWKSInvalid, JOSENotSupported, JWKSNoMatchingKey, JWKSMultipleMatchingKeys, } from '../util/errors.js'; -import { isObject } from '../lib/is_object.js'; -function getKtyFromAlg(alg) { - switch (typeof alg === 'string' && alg.slice(0, 2)) { - case 'RS': - case 'PS': - return 'RSA'; - case 'ES': - return 'EC'; - case 'Ed': - return 'OKP'; - case 'ML': - return 'AKP'; - default: - throw new JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set'); - } -} -function isJWKSLike(jwks) { - return (jwks && - typeof jwks === 'object' && - Array.isArray(jwks.keys) && - jwks.keys.every(isJWKLike)); -} -function isJWKLike(key) { - return isObject(key); -} -class LocalJWKSet { - #jwks; - #cached = new WeakMap(); - constructor(jwks) { - if (!isJWKSLike(jwks)) { - throw new JWKSInvalid('JSON Web Key Set malformed'); - } - this.#jwks = structuredClone(jwks); - } - jwks() { - return this.#jwks; - } - async getKey(protectedHeader, token) { - const { alg, kid } = { ...protectedHeader, ...token?.header }; - const kty = getKtyFromAlg(alg); - const candidates = this.#jwks.keys.filter((jwk) => { - let candidate = kty === jwk.kty; - if (candidate && typeof kid === 'string') { - candidate = kid === jwk.kid; - } - if (candidate && (typeof jwk.alg === 'string' || kty === 'AKP')) { - candidate = alg === jwk.alg; - } - if (candidate && typeof jwk.use === 'string') { - candidate = jwk.use === 'sig'; - } - if (candidate && Array.isArray(jwk.key_ops)) { - candidate = jwk.key_ops.includes('verify'); - } - if (candidate) { - switch (alg) { - case 'ES256': - candidate = jwk.crv === 'P-256'; - break; - case 'ES384': - candidate = jwk.crv === 'P-384'; - break; - case 'ES512': - candidate = jwk.crv === 'P-521'; - break; - case 'Ed25519': - case 'EdDSA': - candidate = jwk.crv === 'Ed25519'; - break; - } - } - return candidate; - }); - const { 0: jwk, length } = candidates; - if (length === 0) { - throw new JWKSNoMatchingKey(); - } - if (length !== 1) { - const error = new JWKSMultipleMatchingKeys(); - const _cached = this.#cached; - error[Symbol.asyncIterator] = async function* () { - for (const jwk of candidates) { - try { - yield await importWithAlgCache(_cached, jwk, alg); - } - catch { } - } - }; - throw error; - } - return importWithAlgCache(this.#cached, jwk, alg); - } -} -async function importWithAlgCache(cache, jwk, alg) { - const cached = cache.get(jwk) || cache.set(jwk, {}).get(jwk); - if (cached[alg] === undefined) { - const key = await importJWK({ ...jwk, ext: true }, alg); - if (key instanceof Uint8Array || key.type !== 'public') { - throw new JWKSInvalid('JSON Web Key Set members must be public keys'); - } - cached[alg] = key; - } - return cached[alg]; -} -export function createLocalJWKSet(jwks) { - const set = new LocalJWKSet(jwks); - const localJWKSet = async (protectedHeader, token) => set.getKey(protectedHeader, token); - Object.defineProperties(localJWKSet, { - jwks: { - value: () => structuredClone(set.jwks()), - enumerable: false, - configurable: false, - writable: false, - }, - }); - return localJWKSet; -} diff --git a/node_modules/jose/dist/webapi/jwks/remote.js b/node_modules/jose/dist/webapi/jwks/remote.js deleted file mode 100644 index 3a7f0d4..0000000 --- a/node_modules/jose/dist/webapi/jwks/remote.js +++ /dev/null @@ -1,179 +0,0 @@ -import { JOSEError, JWKSNoMatchingKey, JWKSTimeout } from '../util/errors.js'; -import { createLocalJWKSet } from './local.js'; -import { isObject } from '../lib/is_object.js'; -function isCloudflareWorkers() { - return (typeof WebSocketPair !== 'undefined' || - (typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers') || - (typeof EdgeRuntime !== 'undefined' && EdgeRuntime === 'vercel')); -} -let USER_AGENT; -if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) { - const NAME = 'jose'; - const VERSION = 'v6.1.3'; - USER_AGENT = `${NAME}/${VERSION}`; -} -export const customFetch = Symbol(); -async function fetchJwks(url, headers, signal, fetchImpl = fetch) { - const response = await fetchImpl(url, { - method: 'GET', - signal, - redirect: 'manual', - headers, - }).catch((err) => { - if (err.name === 'TimeoutError') { - throw new JWKSTimeout(); - } - throw err; - }); - if (response.status !== 200) { - throw new JOSEError('Expected 200 OK from the JSON Web Key Set HTTP response'); - } - try { - return await response.json(); - } - catch { - throw new JOSEError('Failed to parse the JSON Web Key Set HTTP response as JSON'); - } -} -export const jwksCache = Symbol(); -function isFreshJwksCache(input, cacheMaxAge) { - if (typeof input !== 'object' || input === null) { - return false; - } - if (!('uat' in input) || typeof input.uat !== 'number' || Date.now() - input.uat >= cacheMaxAge) { - return false; - } - if (!('jwks' in input) || - !isObject(input.jwks) || - !Array.isArray(input.jwks.keys) || - !Array.prototype.every.call(input.jwks.keys, isObject)) { - return false; - } - return true; -} -class RemoteJWKSet { - #url; - #timeoutDuration; - #cooldownDuration; - #cacheMaxAge; - #jwksTimestamp; - #pendingFetch; - #headers; - #customFetch; - #local; - #cache; - constructor(url, options) { - if (!(url instanceof URL)) { - throw new TypeError('url must be an instance of URL'); - } - this.#url = new URL(url.href); - this.#timeoutDuration = - typeof options?.timeoutDuration === 'number' ? options?.timeoutDuration : 5000; - this.#cooldownDuration = - typeof options?.cooldownDuration === 'number' ? options?.cooldownDuration : 30000; - this.#cacheMaxAge = typeof options?.cacheMaxAge === 'number' ? options?.cacheMaxAge : 600000; - this.#headers = new Headers(options?.headers); - if (USER_AGENT && !this.#headers.has('User-Agent')) { - this.#headers.set('User-Agent', USER_AGENT); - } - if (!this.#headers.has('accept')) { - this.#headers.set('accept', 'application/json'); - this.#headers.append('accept', 'application/jwk-set+json'); - } - this.#customFetch = options?.[customFetch]; - if (options?.[jwksCache] !== undefined) { - this.#cache = options?.[jwksCache]; - if (isFreshJwksCache(options?.[jwksCache], this.#cacheMaxAge)) { - this.#jwksTimestamp = this.#cache.uat; - this.#local = createLocalJWKSet(this.#cache.jwks); - } - } - } - pendingFetch() { - return !!this.#pendingFetch; - } - coolingDown() { - return typeof this.#jwksTimestamp === 'number' - ? Date.now() < this.#jwksTimestamp + this.#cooldownDuration - : false; - } - fresh() { - return typeof this.#jwksTimestamp === 'number' - ? Date.now() < this.#jwksTimestamp + this.#cacheMaxAge - : false; - } - jwks() { - return this.#local?.jwks(); - } - async getKey(protectedHeader, token) { - if (!this.#local || !this.fresh()) { - await this.reload(); - } - try { - return await this.#local(protectedHeader, token); - } - catch (err) { - if (err instanceof JWKSNoMatchingKey) { - if (this.coolingDown() === false) { - await this.reload(); - return this.#local(protectedHeader, token); - } - } - throw err; - } - } - async reload() { - if (this.#pendingFetch && isCloudflareWorkers()) { - this.#pendingFetch = undefined; - } - this.#pendingFetch ||= fetchJwks(this.#url.href, this.#headers, AbortSignal.timeout(this.#timeoutDuration), this.#customFetch) - .then((json) => { - this.#local = createLocalJWKSet(json); - if (this.#cache) { - this.#cache.uat = Date.now(); - this.#cache.jwks = json; - } - this.#jwksTimestamp = Date.now(); - this.#pendingFetch = undefined; - }) - .catch((err) => { - this.#pendingFetch = undefined; - throw err; - }); - await this.#pendingFetch; - } -} -export function createRemoteJWKSet(url, options) { - const set = new RemoteJWKSet(url, options); - const remoteJWKSet = async (protectedHeader, token) => set.getKey(protectedHeader, token); - Object.defineProperties(remoteJWKSet, { - coolingDown: { - get: () => set.coolingDown(), - enumerable: true, - configurable: false, - }, - fresh: { - get: () => set.fresh(), - enumerable: true, - configurable: false, - }, - reload: { - value: () => set.reload(), - enumerable: true, - configurable: false, - writable: false, - }, - reloading: { - get: () => set.pendingFetch(), - enumerable: true, - configurable: false, - }, - jwks: { - value: () => set.jwks(), - enumerable: true, - configurable: false, - writable: false, - }, - }); - return remoteJWKSet; -} diff --git a/node_modules/jose/dist/webapi/jws/compact/sign.js b/node_modules/jose/dist/webapi/jws/compact/sign.js deleted file mode 100644 index 2069b6d..0000000 --- a/node_modules/jose/dist/webapi/jws/compact/sign.js +++ /dev/null @@ -1,18 +0,0 @@ -import { FlattenedSign } from '../flattened/sign.js'; -export class CompactSign { - #flattened; - constructor(payload) { - this.#flattened = new FlattenedSign(payload); - } - setProtectedHeader(protectedHeader) { - this.#flattened.setProtectedHeader(protectedHeader); - return this; - } - async sign(key, options) { - const jws = await this.#flattened.sign(key, options); - if (jws.payload === undefined) { - throw new TypeError('use the flattened module for creating JWS with b64: false'); - } - return `${jws.protected}.${jws.payload}.${jws.signature}`; - } -} diff --git a/node_modules/jose/dist/webapi/jws/compact/verify.js b/node_modules/jose/dist/webapi/jws/compact/verify.js deleted file mode 100644 index c651ffb..0000000 --- a/node_modules/jose/dist/webapi/jws/compact/verify.js +++ /dev/null @@ -1,21 +0,0 @@ -import { flattenedVerify } from '../flattened/verify.js'; -import { JWSInvalid } from '../../util/errors.js'; -import { decoder } from '../../lib/buffer_utils.js'; -export async function compactVerify(jws, key, options) { - if (jws instanceof Uint8Array) { - jws = decoder.decode(jws); - } - if (typeof jws !== 'string') { - throw new JWSInvalid('Compact JWS must be a string or Uint8Array'); - } - const { 0: protectedHeader, 1: payload, 2: signature, length } = jws.split('.'); - if (length !== 3) { - throw new JWSInvalid('Invalid Compact JWS'); - } - const verified = await flattenedVerify({ payload, protected: protectedHeader, signature }, key, options); - const result = { payload: verified.payload, protectedHeader: verified.protectedHeader }; - if (typeof key === 'function') { - return { ...result, key: verified.key }; - } - return result; -} diff --git a/node_modules/jose/dist/webapi/jws/flattened/sign.js b/node_modules/jose/dist/webapi/jws/flattened/sign.js deleted file mode 100644 index e9d4a7d..0000000 --- a/node_modules/jose/dist/webapi/jws/flattened/sign.js +++ /dev/null @@ -1,92 +0,0 @@ -import { encode as b64u } from '../../util/base64url.js'; -import { sign } from '../../lib/sign.js'; -import { isDisjoint } from '../../lib/is_disjoint.js'; -import { JWSInvalid } from '../../util/errors.js'; -import { concat, encode } from '../../lib/buffer_utils.js'; -import { checkKeyType } from '../../lib/check_key_type.js'; -import { validateCrit } from '../../lib/validate_crit.js'; -import { normalizeKey } from '../../lib/normalize_key.js'; -export class FlattenedSign { - #payload; - #protectedHeader; - #unprotectedHeader; - constructor(payload) { - if (!(payload instanceof Uint8Array)) { - throw new TypeError('payload must be an instance of Uint8Array'); - } - this.#payload = payload; - } - setProtectedHeader(protectedHeader) { - if (this.#protectedHeader) { - throw new TypeError('setProtectedHeader can only be called once'); - } - this.#protectedHeader = protectedHeader; - return this; - } - setUnprotectedHeader(unprotectedHeader) { - if (this.#unprotectedHeader) { - throw new TypeError('setUnprotectedHeader can only be called once'); - } - this.#unprotectedHeader = unprotectedHeader; - return this; - } - async sign(key, options) { - if (!this.#protectedHeader && !this.#unprotectedHeader) { - throw new JWSInvalid('either setProtectedHeader or setUnprotectedHeader must be called before #sign()'); - } - if (!isDisjoint(this.#protectedHeader, this.#unprotectedHeader)) { - throw new JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint'); - } - const joseHeader = { - ...this.#protectedHeader, - ...this.#unprotectedHeader, - }; - const extensions = validateCrit(JWSInvalid, new Map([['b64', true]]), options?.crit, this.#protectedHeader, joseHeader); - let b64 = true; - if (extensions.has('b64')) { - b64 = this.#protectedHeader.b64; - if (typeof b64 !== 'boolean') { - throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean'); - } - } - const { alg } = joseHeader; - if (typeof alg !== 'string' || !alg) { - throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid'); - } - checkKeyType(alg, key, 'sign'); - let payloadS; - let payloadB; - if (b64) { - payloadS = b64u(this.#payload); - payloadB = encode(payloadS); - } - else { - payloadB = this.#payload; - payloadS = ''; - } - let protectedHeaderString; - let protectedHeaderBytes; - if (this.#protectedHeader) { - protectedHeaderString = b64u(JSON.stringify(this.#protectedHeader)); - protectedHeaderBytes = encode(protectedHeaderString); - } - else { - protectedHeaderString = ''; - protectedHeaderBytes = new Uint8Array(); - } - const data = concat(protectedHeaderBytes, encode('.'), payloadB); - const k = await normalizeKey(key, alg); - const signature = await sign(alg, k, data); - const jws = { - signature: b64u(signature), - payload: payloadS, - }; - if (this.#unprotectedHeader) { - jws.header = this.#unprotectedHeader; - } - if (this.#protectedHeader) { - jws.protected = protectedHeaderString; - } - return jws; - } -} diff --git a/node_modules/jose/dist/webapi/jws/flattened/verify.js b/node_modules/jose/dist/webapi/jws/flattened/verify.js deleted file mode 100644 index 3e74912..0000000 --- a/node_modules/jose/dist/webapi/jws/flattened/verify.js +++ /dev/null @@ -1,120 +0,0 @@ -import { decode as b64u } from '../../util/base64url.js'; -import { verify } from '../../lib/verify.js'; -import { JOSEAlgNotAllowed, JWSInvalid, JWSSignatureVerificationFailed } from '../../util/errors.js'; -import { concat, encoder, decoder, encode } from '../../lib/buffer_utils.js'; -import { isDisjoint } from '../../lib/is_disjoint.js'; -import { isObject } from '../../lib/is_object.js'; -import { checkKeyType } from '../../lib/check_key_type.js'; -import { validateCrit } from '../../lib/validate_crit.js'; -import { validateAlgorithms } from '../../lib/validate_algorithms.js'; -import { normalizeKey } from '../../lib/normalize_key.js'; -export async function flattenedVerify(jws, key, options) { - if (!isObject(jws)) { - throw new JWSInvalid('Flattened JWS must be an object'); - } - if (jws.protected === undefined && jws.header === undefined) { - throw new JWSInvalid('Flattened JWS must have either of the "protected" or "header" members'); - } - if (jws.protected !== undefined && typeof jws.protected !== 'string') { - throw new JWSInvalid('JWS Protected Header incorrect type'); - } - if (jws.payload === undefined) { - throw new JWSInvalid('JWS Payload missing'); - } - if (typeof jws.signature !== 'string') { - throw new JWSInvalid('JWS Signature missing or incorrect type'); - } - if (jws.header !== undefined && !isObject(jws.header)) { - throw new JWSInvalid('JWS Unprotected Header incorrect type'); - } - let parsedProt = {}; - if (jws.protected) { - try { - const protectedHeader = b64u(jws.protected); - parsedProt = JSON.parse(decoder.decode(protectedHeader)); - } - catch { - throw new JWSInvalid('JWS Protected Header is invalid'); - } - } - if (!isDisjoint(parsedProt, jws.header)) { - throw new JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint'); - } - const joseHeader = { - ...parsedProt, - ...jws.header, - }; - const extensions = validateCrit(JWSInvalid, new Map([['b64', true]]), options?.crit, parsedProt, joseHeader); - let b64 = true; - if (extensions.has('b64')) { - b64 = parsedProt.b64; - if (typeof b64 !== 'boolean') { - throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean'); - } - } - const { alg } = joseHeader; - if (typeof alg !== 'string' || !alg) { - throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid'); - } - const algorithms = options && validateAlgorithms('algorithms', options.algorithms); - if (algorithms && !algorithms.has(alg)) { - throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed'); - } - if (b64) { - if (typeof jws.payload !== 'string') { - throw new JWSInvalid('JWS Payload must be a string'); - } - } - else if (typeof jws.payload !== 'string' && !(jws.payload instanceof Uint8Array)) { - throw new JWSInvalid('JWS Payload must be a string or an Uint8Array instance'); - } - let resolvedKey = false; - if (typeof key === 'function') { - key = await key(parsedProt, jws); - resolvedKey = true; - } - checkKeyType(alg, key, 'verify'); - const data = concat(jws.protected !== undefined ? encode(jws.protected) : new Uint8Array(), encode('.'), typeof jws.payload === 'string' - ? b64 - ? encode(jws.payload) - : encoder.encode(jws.payload) - : jws.payload); - let signature; - try { - signature = b64u(jws.signature); - } - catch { - throw new JWSInvalid('Failed to base64url decode the signature'); - } - const k = await normalizeKey(key, alg); - const verified = await verify(alg, k, signature, data); - if (!verified) { - throw new JWSSignatureVerificationFailed(); - } - let payload; - if (b64) { - try { - payload = b64u(jws.payload); - } - catch { - throw new JWSInvalid('Failed to base64url decode the payload'); - } - } - else if (typeof jws.payload === 'string') { - payload = encoder.encode(jws.payload); - } - else { - payload = jws.payload; - } - const result = { payload }; - if (jws.protected !== undefined) { - result.protectedHeader = parsedProt; - } - if (jws.header !== undefined) { - result.unprotectedHeader = jws.header; - } - if (resolvedKey) { - return { ...result, key: k }; - } - return result; -} diff --git a/node_modules/jose/dist/webapi/jws/general/sign.js b/node_modules/jose/dist/webapi/jws/general/sign.js deleted file mode 100644 index d85de18..0000000 --- a/node_modules/jose/dist/webapi/jws/general/sign.js +++ /dev/null @@ -1,73 +0,0 @@ -import { FlattenedSign } from '../flattened/sign.js'; -import { JWSInvalid } from '../../util/errors.js'; -class IndividualSignature { - #parent; - protectedHeader; - unprotectedHeader; - options; - key; - constructor(sig, key, options) { - this.#parent = sig; - this.key = key; - this.options = options; - } - setProtectedHeader(protectedHeader) { - if (this.protectedHeader) { - throw new TypeError('setProtectedHeader can only be called once'); - } - this.protectedHeader = protectedHeader; - return this; - } - setUnprotectedHeader(unprotectedHeader) { - if (this.unprotectedHeader) { - throw new TypeError('setUnprotectedHeader can only be called once'); - } - this.unprotectedHeader = unprotectedHeader; - return this; - } - addSignature(...args) { - return this.#parent.addSignature(...args); - } - sign(...args) { - return this.#parent.sign(...args); - } - done() { - return this.#parent; - } -} -export class GeneralSign { - #payload; - #signatures = []; - constructor(payload) { - this.#payload = payload; - } - addSignature(key, options) { - const signature = new IndividualSignature(this, key, options); - this.#signatures.push(signature); - return signature; - } - async sign() { - if (!this.#signatures.length) { - throw new JWSInvalid('at least one signature must be added'); - } - const jws = { - signatures: [], - payload: '', - }; - for (let i = 0; i < this.#signatures.length; i++) { - const signature = this.#signatures[i]; - const flattened = new FlattenedSign(this.#payload); - flattened.setProtectedHeader(signature.protectedHeader); - flattened.setUnprotectedHeader(signature.unprotectedHeader); - const { payload, ...rest } = await flattened.sign(signature.key, signature.options); - if (i === 0) { - jws.payload = payload; - } - else if (jws.payload !== payload) { - throw new JWSInvalid('inconsistent use of JWS Unencoded Payload (RFC7797)'); - } - jws.signatures.push(rest); - } - return jws; - } -} diff --git a/node_modules/jose/dist/webapi/jws/general/verify.js b/node_modules/jose/dist/webapi/jws/general/verify.js deleted file mode 100644 index cb95d38..0000000 --- a/node_modules/jose/dist/webapi/jws/general/verify.js +++ /dev/null @@ -1,24 +0,0 @@ -import { flattenedVerify } from '../flattened/verify.js'; -import { JWSInvalid, JWSSignatureVerificationFailed } from '../../util/errors.js'; -import { isObject } from '../../lib/is_object.js'; -export async function generalVerify(jws, key, options) { - if (!isObject(jws)) { - throw new JWSInvalid('General JWS must be an object'); - } - if (!Array.isArray(jws.signatures) || !jws.signatures.every(isObject)) { - throw new JWSInvalid('JWS Signatures missing or incorrect type'); - } - for (const signature of jws.signatures) { - try { - return await flattenedVerify({ - header: signature.header, - payload: jws.payload, - protected: signature.protected, - signature: signature.signature, - }, key, options); - } - catch { - } - } - throw new JWSSignatureVerificationFailed(); -} diff --git a/node_modules/jose/dist/webapi/jwt/decrypt.js b/node_modules/jose/dist/webapi/jwt/decrypt.js deleted file mode 100644 index d75e3d7..0000000 --- a/node_modules/jose/dist/webapi/jwt/decrypt.js +++ /dev/null @@ -1,23 +0,0 @@ -import { compactDecrypt } from '../jwe/compact/decrypt.js'; -import { validateClaimsSet } from '../lib/jwt_claims_set.js'; -import { JWTClaimValidationFailed } from '../util/errors.js'; -export async function jwtDecrypt(jwt, key, options) { - const decrypted = await compactDecrypt(jwt, key, options); - const payload = validateClaimsSet(decrypted.protectedHeader, decrypted.plaintext, options); - const { protectedHeader } = decrypted; - if (protectedHeader.iss !== undefined && protectedHeader.iss !== payload.iss) { - throw new JWTClaimValidationFailed('replicated "iss" claim header parameter mismatch', payload, 'iss', 'mismatch'); - } - if (protectedHeader.sub !== undefined && protectedHeader.sub !== payload.sub) { - throw new JWTClaimValidationFailed('replicated "sub" claim header parameter mismatch', payload, 'sub', 'mismatch'); - } - if (protectedHeader.aud !== undefined && - JSON.stringify(protectedHeader.aud) !== JSON.stringify(payload.aud)) { - throw new JWTClaimValidationFailed('replicated "aud" claim header parameter mismatch', payload, 'aud', 'mismatch'); - } - const result = { payload, protectedHeader }; - if (typeof key === 'function') { - return { ...result, key: decrypted.key }; - } - return result; -} diff --git a/node_modules/jose/dist/webapi/jwt/encrypt.js b/node_modules/jose/dist/webapi/jwt/encrypt.js deleted file mode 100644 index 44282a8..0000000 --- a/node_modules/jose/dist/webapi/jwt/encrypt.js +++ /dev/null @@ -1,108 +0,0 @@ -import { CompactEncrypt } from '../jwe/compact/encrypt.js'; -import { JWTClaimsBuilder } from '../lib/jwt_claims_set.js'; -export class EncryptJWT { - #cek; - #iv; - #keyManagementParameters; - #protectedHeader; - #replicateIssuerAsHeader; - #replicateSubjectAsHeader; - #replicateAudienceAsHeader; - #jwt; - constructor(payload = {}) { - this.#jwt = new JWTClaimsBuilder(payload); - } - setIssuer(issuer) { - this.#jwt.iss = issuer; - return this; - } - setSubject(subject) { - this.#jwt.sub = subject; - return this; - } - setAudience(audience) { - this.#jwt.aud = audience; - return this; - } - setJti(jwtId) { - this.#jwt.jti = jwtId; - return this; - } - setNotBefore(input) { - this.#jwt.nbf = input; - return this; - } - setExpirationTime(input) { - this.#jwt.exp = input; - return this; - } - setIssuedAt(input) { - this.#jwt.iat = input; - return this; - } - setProtectedHeader(protectedHeader) { - if (this.#protectedHeader) { - throw new TypeError('setProtectedHeader can only be called once'); - } - this.#protectedHeader = protectedHeader; - return this; - } - setKeyManagementParameters(parameters) { - if (this.#keyManagementParameters) { - throw new TypeError('setKeyManagementParameters can only be called once'); - } - this.#keyManagementParameters = parameters; - return this; - } - setContentEncryptionKey(cek) { - if (this.#cek) { - throw new TypeError('setContentEncryptionKey can only be called once'); - } - this.#cek = cek; - return this; - } - setInitializationVector(iv) { - if (this.#iv) { - throw new TypeError('setInitializationVector can only be called once'); - } - this.#iv = iv; - return this; - } - replicateIssuerAsHeader() { - this.#replicateIssuerAsHeader = true; - return this; - } - replicateSubjectAsHeader() { - this.#replicateSubjectAsHeader = true; - return this; - } - replicateAudienceAsHeader() { - this.#replicateAudienceAsHeader = true; - return this; - } - async encrypt(key, options) { - const enc = new CompactEncrypt(this.#jwt.data()); - if (this.#protectedHeader && - (this.#replicateIssuerAsHeader || - this.#replicateSubjectAsHeader || - this.#replicateAudienceAsHeader)) { - this.#protectedHeader = { - ...this.#protectedHeader, - iss: this.#replicateIssuerAsHeader ? this.#jwt.iss : undefined, - sub: this.#replicateSubjectAsHeader ? this.#jwt.sub : undefined, - aud: this.#replicateAudienceAsHeader ? this.#jwt.aud : undefined, - }; - } - enc.setProtectedHeader(this.#protectedHeader); - if (this.#iv) { - enc.setInitializationVector(this.#iv); - } - if (this.#cek) { - enc.setContentEncryptionKey(this.#cek); - } - if (this.#keyManagementParameters) { - enc.setKeyManagementParameters(this.#keyManagementParameters); - } - return enc.encrypt(key, options); - } -} diff --git a/node_modules/jose/dist/webapi/jwt/sign.js b/node_modules/jose/dist/webapi/jwt/sign.js deleted file mode 100644 index 34b96c3..0000000 --- a/node_modules/jose/dist/webapi/jwt/sign.js +++ /dev/null @@ -1,52 +0,0 @@ -import { CompactSign } from '../jws/compact/sign.js'; -import { JWTInvalid } from '../util/errors.js'; -import { JWTClaimsBuilder } from '../lib/jwt_claims_set.js'; -export class SignJWT { - #protectedHeader; - #jwt; - constructor(payload = {}) { - this.#jwt = new JWTClaimsBuilder(payload); - } - setIssuer(issuer) { - this.#jwt.iss = issuer; - return this; - } - setSubject(subject) { - this.#jwt.sub = subject; - return this; - } - setAudience(audience) { - this.#jwt.aud = audience; - return this; - } - setJti(jwtId) { - this.#jwt.jti = jwtId; - return this; - } - setNotBefore(input) { - this.#jwt.nbf = input; - return this; - } - setExpirationTime(input) { - this.#jwt.exp = input; - return this; - } - setIssuedAt(input) { - this.#jwt.iat = input; - return this; - } - setProtectedHeader(protectedHeader) { - this.#protectedHeader = protectedHeader; - return this; - } - async sign(key, options) { - const sig = new CompactSign(this.#jwt.data()); - sig.setProtectedHeader(this.#protectedHeader); - if (Array.isArray(this.#protectedHeader?.crit) && - this.#protectedHeader.crit.includes('b64') && - this.#protectedHeader.b64 === false) { - throw new JWTInvalid('JWTs MUST NOT use unencoded payload'); - } - return sig.sign(key, options); - } -} diff --git a/node_modules/jose/dist/webapi/jwt/unsecured.js b/node_modules/jose/dist/webapi/jwt/unsecured.js deleted file mode 100644 index 18a20c8..0000000 --- a/node_modules/jose/dist/webapi/jwt/unsecured.js +++ /dev/null @@ -1,63 +0,0 @@ -import * as b64u from '../util/base64url.js'; -import { decoder } from '../lib/buffer_utils.js'; -import { JWTInvalid } from '../util/errors.js'; -import { validateClaimsSet, JWTClaimsBuilder } from '../lib/jwt_claims_set.js'; -export class UnsecuredJWT { - #jwt; - constructor(payload = {}) { - this.#jwt = new JWTClaimsBuilder(payload); - } - encode() { - const header = b64u.encode(JSON.stringify({ alg: 'none' })); - const payload = b64u.encode(this.#jwt.data()); - return `${header}.${payload}.`; - } - setIssuer(issuer) { - this.#jwt.iss = issuer; - return this; - } - setSubject(subject) { - this.#jwt.sub = subject; - return this; - } - setAudience(audience) { - this.#jwt.aud = audience; - return this; - } - setJti(jwtId) { - this.#jwt.jti = jwtId; - return this; - } - setNotBefore(input) { - this.#jwt.nbf = input; - return this; - } - setExpirationTime(input) { - this.#jwt.exp = input; - return this; - } - setIssuedAt(input) { - this.#jwt.iat = input; - return this; - } - static decode(jwt, options) { - if (typeof jwt !== 'string') { - throw new JWTInvalid('Unsecured JWT must be a string'); - } - const { 0: encodedHeader, 1: encodedPayload, 2: signature, length } = jwt.split('.'); - if (length !== 3 || signature !== '') { - throw new JWTInvalid('Invalid Unsecured JWT'); - } - let header; - try { - header = JSON.parse(decoder.decode(b64u.decode(encodedHeader))); - if (header.alg !== 'none') - throw new Error(); - } - catch { - throw new JWTInvalid('Invalid Unsecured JWT'); - } - const payload = validateClaimsSet(header, b64u.decode(encodedPayload), options); - return { payload, header }; - } -} diff --git a/node_modules/jose/dist/webapi/jwt/verify.js b/node_modules/jose/dist/webapi/jwt/verify.js deleted file mode 100644 index 5e4f915..0000000 --- a/node_modules/jose/dist/webapi/jwt/verify.js +++ /dev/null @@ -1,15 +0,0 @@ -import { compactVerify } from '../jws/compact/verify.js'; -import { validateClaimsSet } from '../lib/jwt_claims_set.js'; -import { JWTInvalid } from '../util/errors.js'; -export async function jwtVerify(jwt, key, options) { - const verified = await compactVerify(jwt, key, options); - if (verified.protectedHeader.crit?.includes('b64') && verified.protectedHeader.b64 === false) { - throw new JWTInvalid('JWTs MUST NOT use unencoded payload'); - } - const payload = validateClaimsSet(verified.protectedHeader, verified.payload, options); - const result = { payload, protectedHeader: verified.protectedHeader }; - if (typeof key === 'function') { - return { ...result, key: verified.key }; - } - return result; -} diff --git a/node_modules/jose/dist/webapi/key/export.js b/node_modules/jose/dist/webapi/key/export.js deleted file mode 100644 index 1d81adb..0000000 --- a/node_modules/jose/dist/webapi/key/export.js +++ /dev/null @@ -1,11 +0,0 @@ -import { toSPKI as exportPublic, toPKCS8 as exportPrivate } from '../lib/asn1.js'; -import { keyToJWK } from '../lib/key_to_jwk.js'; -export async function exportSPKI(key) { - return exportPublic(key); -} -export async function exportPKCS8(key) { - return exportPrivate(key); -} -export async function exportJWK(key) { - return keyToJWK(key); -} diff --git a/node_modules/jose/dist/webapi/key/generate_key_pair.js b/node_modules/jose/dist/webapi/key/generate_key_pair.js deleted file mode 100644 index 33d9f5e..0000000 --- a/node_modules/jose/dist/webapi/key/generate_key_pair.js +++ /dev/null @@ -1,97 +0,0 @@ -import { JOSENotSupported } from '../util/errors.js'; -function getModulusLengthOption(options) { - const modulusLength = options?.modulusLength ?? 2048; - if (typeof modulusLength !== 'number' || modulusLength < 2048) { - throw new JOSENotSupported('Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used'); - } - return modulusLength; -} -export async function generateKeyPair(alg, options) { - let algorithm; - let keyUsages; - switch (alg) { - case 'PS256': - case 'PS384': - case 'PS512': - algorithm = { - name: 'RSA-PSS', - hash: `SHA-${alg.slice(-3)}`, - publicExponent: Uint8Array.of(0x01, 0x00, 0x01), - modulusLength: getModulusLengthOption(options), - }; - keyUsages = ['sign', 'verify']; - break; - case 'RS256': - case 'RS384': - case 'RS512': - algorithm = { - name: 'RSASSA-PKCS1-v1_5', - hash: `SHA-${alg.slice(-3)}`, - publicExponent: Uint8Array.of(0x01, 0x00, 0x01), - modulusLength: getModulusLengthOption(options), - }; - keyUsages = ['sign', 'verify']; - break; - case 'RSA-OAEP': - case 'RSA-OAEP-256': - case 'RSA-OAEP-384': - case 'RSA-OAEP-512': - algorithm = { - name: 'RSA-OAEP', - hash: `SHA-${parseInt(alg.slice(-3), 10) || 1}`, - publicExponent: Uint8Array.of(0x01, 0x00, 0x01), - modulusLength: getModulusLengthOption(options), - }; - keyUsages = ['decrypt', 'unwrapKey', 'encrypt', 'wrapKey']; - break; - case 'ES256': - algorithm = { name: 'ECDSA', namedCurve: 'P-256' }; - keyUsages = ['sign', 'verify']; - break; - case 'ES384': - algorithm = { name: 'ECDSA', namedCurve: 'P-384' }; - keyUsages = ['sign', 'verify']; - break; - case 'ES512': - algorithm = { name: 'ECDSA', namedCurve: 'P-521' }; - keyUsages = ['sign', 'verify']; - break; - case 'Ed25519': - case 'EdDSA': { - keyUsages = ['sign', 'verify']; - algorithm = { name: 'Ed25519' }; - break; - } - case 'ML-DSA-44': - case 'ML-DSA-65': - case 'ML-DSA-87': { - keyUsages = ['sign', 'verify']; - algorithm = { name: alg }; - break; - } - case 'ECDH-ES': - case 'ECDH-ES+A128KW': - case 'ECDH-ES+A192KW': - case 'ECDH-ES+A256KW': { - keyUsages = ['deriveBits']; - const crv = options?.crv ?? 'P-256'; - switch (crv) { - case 'P-256': - case 'P-384': - case 'P-521': { - algorithm = { name: 'ECDH', namedCurve: crv }; - break; - } - case 'X25519': - algorithm = { name: 'X25519' }; - break; - default: - throw new JOSENotSupported('Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, and X25519'); - } - break; - } - default: - throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); - } - return crypto.subtle.generateKey(algorithm, options?.extractable ?? false, keyUsages); -} diff --git a/node_modules/jose/dist/webapi/key/generate_secret.js b/node_modules/jose/dist/webapi/key/generate_secret.js deleted file mode 100644 index 0fe2a12..0000000 --- a/node_modules/jose/dist/webapi/key/generate_secret.js +++ /dev/null @@ -1,40 +0,0 @@ -import { JOSENotSupported } from '../util/errors.js'; -export async function generateSecret(alg, options) { - let length; - let algorithm; - let keyUsages; - switch (alg) { - case 'HS256': - case 'HS384': - case 'HS512': - length = parseInt(alg.slice(-3), 10); - algorithm = { name: 'HMAC', hash: `SHA-${length}`, length }; - keyUsages = ['sign', 'verify']; - break; - case 'A128CBC-HS256': - case 'A192CBC-HS384': - case 'A256CBC-HS512': - length = parseInt(alg.slice(-3), 10); - return crypto.getRandomValues(new Uint8Array(length >> 3)); - case 'A128KW': - case 'A192KW': - case 'A256KW': - length = parseInt(alg.slice(1, 4), 10); - algorithm = { name: 'AES-KW', length }; - keyUsages = ['wrapKey', 'unwrapKey']; - break; - case 'A128GCMKW': - case 'A192GCMKW': - case 'A256GCMKW': - case 'A128GCM': - case 'A192GCM': - case 'A256GCM': - length = parseInt(alg.slice(1, 4), 10); - algorithm = { name: 'AES-GCM', length }; - keyUsages = ['encrypt', 'decrypt']; - break; - default: - throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); - } - return crypto.subtle.generateKey(algorithm, options?.extractable ?? false, keyUsages); -} diff --git a/node_modules/jose/dist/webapi/key/import.js b/node_modules/jose/dist/webapi/key/import.js deleted file mode 100644 index 16ba0ce..0000000 --- a/node_modules/jose/dist/webapi/key/import.js +++ /dev/null @@ -1,57 +0,0 @@ -import { decode as decodeBase64URL } from '../util/base64url.js'; -import { fromSPKI, fromPKCS8, fromX509 } from '../lib/asn1.js'; -import { jwkToKey } from '../lib/jwk_to_key.js'; -import { JOSENotSupported } from '../util/errors.js'; -import { isObject } from '../lib/is_object.js'; -export async function importSPKI(spki, alg, options) { - if (typeof spki !== 'string' || spki.indexOf('-----BEGIN PUBLIC KEY-----') !== 0) { - throw new TypeError('"spki" must be SPKI formatted string'); - } - return fromSPKI(spki, alg, options); -} -export async function importX509(x509, alg, options) { - if (typeof x509 !== 'string' || x509.indexOf('-----BEGIN CERTIFICATE-----') !== 0) { - throw new TypeError('"x509" must be X.509 formatted string'); - } - return fromX509(x509, alg, options); -} -export async function importPKCS8(pkcs8, alg, options) { - if (typeof pkcs8 !== 'string' || pkcs8.indexOf('-----BEGIN PRIVATE KEY-----') !== 0) { - throw new TypeError('"pkcs8" must be PKCS#8 formatted string'); - } - return fromPKCS8(pkcs8, alg, options); -} -export async function importJWK(jwk, alg, options) { - if (!isObject(jwk)) { - throw new TypeError('JWK must be an object'); - } - let ext; - alg ??= jwk.alg; - ext ??= options?.extractable ?? jwk.ext; - switch (jwk.kty) { - case 'oct': - if (typeof jwk.k !== 'string' || !jwk.k) { - throw new TypeError('missing "k" (Key Value) Parameter value'); - } - return decodeBase64URL(jwk.k); - case 'RSA': - if ('oth' in jwk && jwk.oth !== undefined) { - throw new JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported'); - } - return jwkToKey({ ...jwk, alg, ext }); - case 'AKP': { - if (typeof jwk.alg !== 'string' || !jwk.alg) { - throw new TypeError('missing "alg" (Algorithm) Parameter value'); - } - if (alg !== undefined && alg !== jwk.alg) { - throw new TypeError('JWK alg and alg option value mismatch'); - } - return jwkToKey({ ...jwk, ext }); - } - case 'EC': - case 'OKP': - return jwkToKey({ ...jwk, alg, ext }); - default: - throw new JOSENotSupported('Unsupported "kty" (Key Type) Parameter value'); - } -} diff --git a/node_modules/jose/dist/webapi/lib/aesgcmkw.js b/node_modules/jose/dist/webapi/lib/aesgcmkw.js deleted file mode 100644 index 924f4c5..0000000 --- a/node_modules/jose/dist/webapi/lib/aesgcmkw.js +++ /dev/null @@ -1,16 +0,0 @@ -import { encrypt } from './encrypt.js'; -import { decrypt } from './decrypt.js'; -import { encode as b64u } from '../util/base64url.js'; -export async function wrap(alg, key, cek, iv) { - const jweAlgorithm = alg.slice(0, 7); - const wrapped = await encrypt(jweAlgorithm, cek, key, iv, new Uint8Array()); - return { - encryptedKey: wrapped.ciphertext, - iv: b64u(wrapped.iv), - tag: b64u(wrapped.tag), - }; -} -export async function unwrap(alg, key, encryptedKey, iv, tag) { - const jweAlgorithm = alg.slice(0, 7); - return decrypt(jweAlgorithm, key, encryptedKey, iv, tag, new Uint8Array()); -} diff --git a/node_modules/jose/dist/webapi/lib/aeskw.js b/node_modules/jose/dist/webapi/lib/aeskw.js deleted file mode 100644 index 666b69c..0000000 --- a/node_modules/jose/dist/webapi/lib/aeskw.js +++ /dev/null @@ -1,25 +0,0 @@ -import { checkEncCryptoKey } from './crypto_key.js'; -function checkKeySize(key, alg) { - if (key.algorithm.length !== parseInt(alg.slice(1, 4), 10)) { - throw new TypeError(`Invalid key size for alg: ${alg}`); - } -} -function getCryptoKey(key, alg, usage) { - if (key instanceof Uint8Array) { - return crypto.subtle.importKey('raw', key, 'AES-KW', true, [usage]); - } - checkEncCryptoKey(key, alg, usage); - return key; -} -export async function wrap(alg, key, cek) { - const cryptoKey = await getCryptoKey(key, alg, 'wrapKey'); - checkKeySize(cryptoKey, alg); - const cryptoKeyCek = await crypto.subtle.importKey('raw', cek, { hash: 'SHA-256', name: 'HMAC' }, true, ['sign']); - return new Uint8Array(await crypto.subtle.wrapKey('raw', cryptoKeyCek, cryptoKey, 'AES-KW')); -} -export async function unwrap(alg, key, encryptedKey) { - const cryptoKey = await getCryptoKey(key, alg, 'unwrapKey'); - checkKeySize(cryptoKey, alg); - const cryptoKeyCek = await crypto.subtle.unwrapKey('raw', encryptedKey, cryptoKey, 'AES-KW', { hash: 'SHA-256', name: 'HMAC' }, true, ['sign']); - return new Uint8Array(await crypto.subtle.exportKey('raw', cryptoKeyCek)); -} diff --git a/node_modules/jose/dist/webapi/lib/asn1.js b/node_modules/jose/dist/webapi/lib/asn1.js deleted file mode 100644 index e9cd570..0000000 --- a/node_modules/jose/dist/webapi/lib/asn1.js +++ /dev/null @@ -1,243 +0,0 @@ -import { invalidKeyInput } from './invalid_key_input.js'; -import { encodeBase64, decodeBase64 } from '../lib/base64.js'; -import { JOSENotSupported } from '../util/errors.js'; -import { isCryptoKey, isKeyObject } from './is_key_like.js'; -const formatPEM = (b64, descriptor) => { - const newlined = (b64.match(/.{1,64}/g) || []).join('\n'); - return `-----BEGIN ${descriptor}-----\n${newlined}\n-----END ${descriptor}-----`; -}; -const genericExport = async (keyType, keyFormat, key) => { - if (isKeyObject(key)) { - if (key.type !== keyType) { - throw new TypeError(`key is not a ${keyType} key`); - } - return key.export({ format: 'pem', type: keyFormat }); - } - if (!isCryptoKey(key)) { - throw new TypeError(invalidKeyInput(key, 'CryptoKey', 'KeyObject')); - } - if (!key.extractable) { - throw new TypeError('CryptoKey is not extractable'); - } - if (key.type !== keyType) { - throw new TypeError(`key is not a ${keyType} key`); - } - return formatPEM(encodeBase64(new Uint8Array(await crypto.subtle.exportKey(keyFormat, key))), `${keyType.toUpperCase()} KEY`); -}; -export const toSPKI = (key) => genericExport('public', 'spki', key); -export const toPKCS8 = (key) => genericExport('private', 'pkcs8', key); -const bytesEqual = (a, b) => { - if (a.byteLength !== b.length) - return false; - for (let i = 0; i < a.byteLength; i++) { - if (a[i] !== b[i]) - return false; - } - return true; -}; -const createASN1State = (data) => ({ data, pos: 0 }); -const parseLength = (state) => { - const first = state.data[state.pos++]; - if (first & 0x80) { - const lengthOfLen = first & 0x7f; - let length = 0; - for (let i = 0; i < lengthOfLen; i++) { - length = (length << 8) | state.data[state.pos++]; - } - return length; - } - return first; -}; -const skipElement = (state, count = 1) => { - if (count <= 0) - return; - state.pos++; - const length = parseLength(state); - state.pos += length; - if (count > 1) { - skipElement(state, count - 1); - } -}; -const expectTag = (state, expectedTag, errorMessage) => { - if (state.data[state.pos++] !== expectedTag) { - throw new Error(errorMessage); - } -}; -const getSubarray = (state, length) => { - const result = state.data.subarray(state.pos, state.pos + length); - state.pos += length; - return result; -}; -const parseAlgorithmOID = (state) => { - expectTag(state, 0x06, 'Expected algorithm OID'); - const oidLen = parseLength(state); - return getSubarray(state, oidLen); -}; -function parsePKCS8Header(state) { - expectTag(state, 0x30, 'Invalid PKCS#8 structure'); - parseLength(state); - expectTag(state, 0x02, 'Expected version field'); - const verLen = parseLength(state); - state.pos += verLen; - expectTag(state, 0x30, 'Expected algorithm identifier'); - const algIdLen = parseLength(state); - const algIdStart = state.pos; - return { algIdStart, algIdLength: algIdLen }; -} -function parseSPKIHeader(state) { - expectTag(state, 0x30, 'Invalid SPKI structure'); - parseLength(state); - expectTag(state, 0x30, 'Expected algorithm identifier'); - const algIdLen = parseLength(state); - const algIdStart = state.pos; - return { algIdStart, algIdLength: algIdLen }; -} -const parseECAlgorithmIdentifier = (state) => { - const algOid = parseAlgorithmOID(state); - if (bytesEqual(algOid, [0x2b, 0x65, 0x6e])) { - return 'X25519'; - } - if (!bytesEqual(algOid, [0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01])) { - throw new Error('Unsupported key algorithm'); - } - expectTag(state, 0x06, 'Expected curve OID'); - const curveOidLen = parseLength(state); - const curveOid = getSubarray(state, curveOidLen); - for (const { name, oid } of [ - { name: 'P-256', oid: [0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07] }, - { name: 'P-384', oid: [0x2b, 0x81, 0x04, 0x00, 0x22] }, - { name: 'P-521', oid: [0x2b, 0x81, 0x04, 0x00, 0x23] }, - ]) { - if (bytesEqual(curveOid, oid)) { - return name; - } - } - throw new Error('Unsupported named curve'); -}; -const genericImport = async (keyFormat, keyData, alg, options) => { - let algorithm; - let keyUsages; - const isPublic = keyFormat === 'spki'; - const getSigUsages = () => (isPublic ? ['verify'] : ['sign']); - const getEncUsages = () => isPublic ? ['encrypt', 'wrapKey'] : ['decrypt', 'unwrapKey']; - switch (alg) { - case 'PS256': - case 'PS384': - case 'PS512': - algorithm = { name: 'RSA-PSS', hash: `SHA-${alg.slice(-3)}` }; - keyUsages = getSigUsages(); - break; - case 'RS256': - case 'RS384': - case 'RS512': - algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${alg.slice(-3)}` }; - keyUsages = getSigUsages(); - break; - case 'RSA-OAEP': - case 'RSA-OAEP-256': - case 'RSA-OAEP-384': - case 'RSA-OAEP-512': - algorithm = { - name: 'RSA-OAEP', - hash: `SHA-${parseInt(alg.slice(-3), 10) || 1}`, - }; - keyUsages = getEncUsages(); - break; - case 'ES256': - case 'ES384': - case 'ES512': { - const curveMap = { ES256: 'P-256', ES384: 'P-384', ES512: 'P-521' }; - algorithm = { name: 'ECDSA', namedCurve: curveMap[alg] }; - keyUsages = getSigUsages(); - break; - } - case 'ECDH-ES': - case 'ECDH-ES+A128KW': - case 'ECDH-ES+A192KW': - case 'ECDH-ES+A256KW': { - try { - const namedCurve = options.getNamedCurve(keyData); - algorithm = namedCurve === 'X25519' ? { name: 'X25519' } : { name: 'ECDH', namedCurve }; - } - catch (cause) { - throw new JOSENotSupported('Invalid or unsupported key format'); - } - keyUsages = isPublic ? [] : ['deriveBits']; - break; - } - case 'Ed25519': - case 'EdDSA': - algorithm = { name: 'Ed25519' }; - keyUsages = getSigUsages(); - break; - case 'ML-DSA-44': - case 'ML-DSA-65': - case 'ML-DSA-87': - algorithm = { name: alg }; - keyUsages = getSigUsages(); - break; - default: - throw new JOSENotSupported('Invalid or unsupported "alg" (Algorithm) value'); - } - return crypto.subtle.importKey(keyFormat, keyData, algorithm, options?.extractable ?? (isPublic ? true : false), keyUsages); -}; -const processPEMData = (pem, pattern) => { - return decodeBase64(pem.replace(pattern, '')); -}; -export const fromPKCS8 = (pem, alg, options) => { - const keyData = processPEMData(pem, /(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g); - let opts = options; - if (alg?.startsWith?.('ECDH-ES')) { - opts ||= {}; - opts.getNamedCurve = (keyData) => { - const state = createASN1State(keyData); - parsePKCS8Header(state); - return parseECAlgorithmIdentifier(state); - }; - } - return genericImport('pkcs8', keyData, alg, opts); -}; -export const fromSPKI = (pem, alg, options) => { - const keyData = processPEMData(pem, /(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g); - let opts = options; - if (alg?.startsWith?.('ECDH-ES')) { - opts ||= {}; - opts.getNamedCurve = (keyData) => { - const state = createASN1State(keyData); - parseSPKIHeader(state); - return parseECAlgorithmIdentifier(state); - }; - } - return genericImport('spki', keyData, alg, opts); -}; -function spkiFromX509(buf) { - const state = createASN1State(buf); - expectTag(state, 0x30, 'Invalid certificate structure'); - parseLength(state); - expectTag(state, 0x30, 'Invalid tbsCertificate structure'); - parseLength(state); - if (buf[state.pos] === 0xa0) { - skipElement(state, 6); - } - else { - skipElement(state, 5); - } - const spkiStart = state.pos; - expectTag(state, 0x30, 'Invalid SPKI structure'); - const spkiContentLen = parseLength(state); - return buf.subarray(spkiStart, spkiStart + spkiContentLen + (state.pos - spkiStart)); -} -function extractX509SPKI(x509) { - const derBytes = processPEMData(x509, /(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g); - return spkiFromX509(derBytes); -} -export const fromX509 = (pem, alg, options) => { - let spki; - try { - spki = extractX509SPKI(pem); - } - catch (cause) { - throw new TypeError('Failed to parse the X.509 certificate', { cause }); - } - return fromSPKI(formatPEM(encodeBase64(spki), 'PUBLIC KEY'), alg, options); -}; diff --git a/node_modules/jose/dist/webapi/lib/base64.js b/node_modules/jose/dist/webapi/lib/base64.js deleted file mode 100644 index 0ac97a7..0000000 --- a/node_modules/jose/dist/webapi/lib/base64.js +++ /dev/null @@ -1,22 +0,0 @@ -export function encodeBase64(input) { - if (Uint8Array.prototype.toBase64) { - return input.toBase64(); - } - const CHUNK_SIZE = 0x8000; - const arr = []; - for (let i = 0; i < input.length; i += CHUNK_SIZE) { - arr.push(String.fromCharCode.apply(null, input.subarray(i, i + CHUNK_SIZE))); - } - return btoa(arr.join('')); -} -export function decodeBase64(encoded) { - if (Uint8Array.fromBase64) { - return Uint8Array.fromBase64(encoded); - } - const binary = atob(encoded); - const bytes = new Uint8Array(binary.length); - for (let i = 0; i < binary.length; i++) { - bytes[i] = binary.charCodeAt(i); - } - return bytes; -} diff --git a/node_modules/jose/dist/webapi/lib/buffer_utils.js b/node_modules/jose/dist/webapi/lib/buffer_utils.js deleted file mode 100644 index 64fb377..0000000 --- a/node_modules/jose/dist/webapi/lib/buffer_utils.js +++ /dev/null @@ -1,43 +0,0 @@ -export const encoder = new TextEncoder(); -export const decoder = new TextDecoder(); -const MAX_INT32 = 2 ** 32; -export function concat(...buffers) { - const size = buffers.reduce((acc, { length }) => acc + length, 0); - const buf = new Uint8Array(size); - let i = 0; - for (const buffer of buffers) { - buf.set(buffer, i); - i += buffer.length; - } - return buf; -} -function writeUInt32BE(buf, value, offset) { - if (value < 0 || value >= MAX_INT32) { - throw new RangeError(`value must be >= 0 and <= ${MAX_INT32 - 1}. Received ${value}`); - } - buf.set([value >>> 24, value >>> 16, value >>> 8, value & 0xff], offset); -} -export function uint64be(value) { - const high = Math.floor(value / MAX_INT32); - const low = value % MAX_INT32; - const buf = new Uint8Array(8); - writeUInt32BE(buf, high, 0); - writeUInt32BE(buf, low, 4); - return buf; -} -export function uint32be(value) { - const buf = new Uint8Array(4); - writeUInt32BE(buf, value); - return buf; -} -export function encode(string) { - const bytes = new Uint8Array(string.length); - for (let i = 0; i < string.length; i++) { - const code = string.charCodeAt(i); - if (code > 127) { - throw new TypeError('non-ASCII string encountered in encode()'); - } - bytes[i] = code; - } - return bytes; -} diff --git a/node_modules/jose/dist/webapi/lib/cek.js b/node_modules/jose/dist/webapi/lib/cek.js deleted file mode 100644 index d10d2cb..0000000 --- a/node_modules/jose/dist/webapi/lib/cek.js +++ /dev/null @@ -1,19 +0,0 @@ -import { JOSENotSupported } from '../util/errors.js'; -export function cekLength(alg) { - switch (alg) { - case 'A128GCM': - return 128; - case 'A192GCM': - return 192; - case 'A256GCM': - case 'A128CBC-HS256': - return 256; - case 'A192CBC-HS384': - return 384; - case 'A256CBC-HS512': - return 512; - default: - throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`); - } -} -export const generateCek = (alg) => crypto.getRandomValues(new Uint8Array(cekLength(alg) >> 3)); diff --git a/node_modules/jose/dist/webapi/lib/check_cek_length.js b/node_modules/jose/dist/webapi/lib/check_cek_length.js deleted file mode 100644 index 8baaa1d..0000000 --- a/node_modules/jose/dist/webapi/lib/check_cek_length.js +++ /dev/null @@ -1,7 +0,0 @@ -import { JWEInvalid } from '../util/errors.js'; -export function checkCekLength(cek, expected) { - const actual = cek.byteLength << 3; - if (actual !== expected) { - throw new JWEInvalid(`Invalid Content Encryption Key length. Expected ${expected} bits, got ${actual} bits`); - } -} diff --git a/node_modules/jose/dist/webapi/lib/check_iv_length.js b/node_modules/jose/dist/webapi/lib/check_iv_length.js deleted file mode 100644 index 17718b1..0000000 --- a/node_modules/jose/dist/webapi/lib/check_iv_length.js +++ /dev/null @@ -1,7 +0,0 @@ -import { JWEInvalid } from '../util/errors.js'; -import { bitLength } from './iv.js'; -export function checkIvLength(enc, iv) { - if (iv.length << 3 !== bitLength(enc)) { - throw new JWEInvalid('Invalid Initialization Vector length'); - } -} diff --git a/node_modules/jose/dist/webapi/lib/check_key_length.js b/node_modules/jose/dist/webapi/lib/check_key_length.js deleted file mode 100644 index 8a02c97..0000000 --- a/node_modules/jose/dist/webapi/lib/check_key_length.js +++ /dev/null @@ -1,8 +0,0 @@ -export function checkKeyLength(alg, key) { - if (alg.startsWith('RS') || alg.startsWith('PS')) { - const { modulusLength } = key.algorithm; - if (typeof modulusLength !== 'number' || modulusLength < 2048) { - throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`); - } - } -} diff --git a/node_modules/jose/dist/webapi/lib/check_key_type.js b/node_modules/jose/dist/webapi/lib/check_key_type.js deleted file mode 100644 index 7d22a99..0000000 --- a/node_modules/jose/dist/webapi/lib/check_key_type.js +++ /dev/null @@ -1,122 +0,0 @@ -import { withAlg as invalidKeyInput } from './invalid_key_input.js'; -import { isKeyLike } from './is_key_like.js'; -import * as jwk from './is_jwk.js'; -const tag = (key) => key?.[Symbol.toStringTag]; -const jwkMatchesOp = (alg, key, usage) => { - if (key.use !== undefined) { - let expected; - switch (usage) { - case 'sign': - case 'verify': - expected = 'sig'; - break; - case 'encrypt': - case 'decrypt': - expected = 'enc'; - break; - } - if (key.use !== expected) { - throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`); - } - } - if (key.alg !== undefined && key.alg !== alg) { - throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`); - } - if (Array.isArray(key.key_ops)) { - let expectedKeyOp; - switch (true) { - case usage === 'sign' || usage === 'verify': - case alg === 'dir': - case alg.includes('CBC-HS'): - expectedKeyOp = usage; - break; - case alg.startsWith('PBES2'): - expectedKeyOp = 'deriveBits'; - break; - case /^A\d{3}(?:GCM)?(?:KW)?$/.test(alg): - if (!alg.includes('GCM') && alg.endsWith('KW')) { - expectedKeyOp = usage === 'encrypt' ? 'wrapKey' : 'unwrapKey'; - } - else { - expectedKeyOp = usage; - } - break; - case usage === 'encrypt' && alg.startsWith('RSA'): - expectedKeyOp = 'wrapKey'; - break; - case usage === 'decrypt': - expectedKeyOp = alg.startsWith('RSA') ? 'unwrapKey' : 'deriveBits'; - break; - } - if (expectedKeyOp && key.key_ops?.includes?.(expectedKeyOp) === false) { - throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`); - } - } - return true; -}; -const symmetricTypeCheck = (alg, key, usage) => { - if (key instanceof Uint8Array) - return; - if (jwk.isJWK(key)) { - if (jwk.isSecretJWK(key) && jwkMatchesOp(alg, key, usage)) - return; - throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`); - } - if (!isKeyLike(key)) { - throw new TypeError(invalidKeyInput(alg, key, 'CryptoKey', 'KeyObject', 'JSON Web Key', 'Uint8Array')); - } - if (key.type !== 'secret') { - throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`); - } -}; -const asymmetricTypeCheck = (alg, key, usage) => { - if (jwk.isJWK(key)) { - switch (usage) { - case 'decrypt': - case 'sign': - if (jwk.isPrivateJWK(key) && jwkMatchesOp(alg, key, usage)) - return; - throw new TypeError(`JSON Web Key for this operation must be a private JWK`); - case 'encrypt': - case 'verify': - if (jwk.isPublicJWK(key) && jwkMatchesOp(alg, key, usage)) - return; - throw new TypeError(`JSON Web Key for this operation must be a public JWK`); - } - } - if (!isKeyLike(key)) { - throw new TypeError(invalidKeyInput(alg, key, 'CryptoKey', 'KeyObject', 'JSON Web Key')); - } - if (key.type === 'secret') { - throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`); - } - if (key.type === 'public') { - switch (usage) { - case 'sign': - throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`); - case 'decrypt': - throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`); - } - } - if (key.type === 'private') { - switch (usage) { - case 'verify': - throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`); - case 'encrypt': - throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`); - } - } -}; -export function checkKeyType(alg, key, usage) { - switch (alg.substring(0, 2)) { - case 'A1': - case 'A2': - case 'di': - case 'HS': - case 'PB': - symmetricTypeCheck(alg, key, usage); - break; - default: - asymmetricTypeCheck(alg, key, usage); - } -} diff --git a/node_modules/jose/dist/webapi/lib/crypto_key.js b/node_modules/jose/dist/webapi/lib/crypto_key.js deleted file mode 100644 index 8154148..0000000 --- a/node_modules/jose/dist/webapi/lib/crypto_key.js +++ /dev/null @@ -1,143 +0,0 @@ -const unusable = (name, prop = 'algorithm.name') => new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`); -const isAlgorithm = (algorithm, name) => algorithm.name === name; -function getHashLength(hash) { - return parseInt(hash.name.slice(4), 10); -} -function getNamedCurve(alg) { - switch (alg) { - case 'ES256': - return 'P-256'; - case 'ES384': - return 'P-384'; - case 'ES512': - return 'P-521'; - default: - throw new Error('unreachable'); - } -} -function checkUsage(key, usage) { - if (usage && !key.usages.includes(usage)) { - throw new TypeError(`CryptoKey does not support this operation, its usages must include ${usage}.`); - } -} -export function checkSigCryptoKey(key, alg, usage) { - switch (alg) { - case 'HS256': - case 'HS384': - case 'HS512': { - if (!isAlgorithm(key.algorithm, 'HMAC')) - throw unusable('HMAC'); - const expected = parseInt(alg.slice(2), 10); - const actual = getHashLength(key.algorithm.hash); - if (actual !== expected) - throw unusable(`SHA-${expected}`, 'algorithm.hash'); - break; - } - case 'RS256': - case 'RS384': - case 'RS512': { - if (!isAlgorithm(key.algorithm, 'RSASSA-PKCS1-v1_5')) - throw unusable('RSASSA-PKCS1-v1_5'); - const expected = parseInt(alg.slice(2), 10); - const actual = getHashLength(key.algorithm.hash); - if (actual !== expected) - throw unusable(`SHA-${expected}`, 'algorithm.hash'); - break; - } - case 'PS256': - case 'PS384': - case 'PS512': { - if (!isAlgorithm(key.algorithm, 'RSA-PSS')) - throw unusable('RSA-PSS'); - const expected = parseInt(alg.slice(2), 10); - const actual = getHashLength(key.algorithm.hash); - if (actual !== expected) - throw unusable(`SHA-${expected}`, 'algorithm.hash'); - break; - } - case 'Ed25519': - case 'EdDSA': { - if (!isAlgorithm(key.algorithm, 'Ed25519')) - throw unusable('Ed25519'); - break; - } - case 'ML-DSA-44': - case 'ML-DSA-65': - case 'ML-DSA-87': { - if (!isAlgorithm(key.algorithm, alg)) - throw unusable(alg); - break; - } - case 'ES256': - case 'ES384': - case 'ES512': { - if (!isAlgorithm(key.algorithm, 'ECDSA')) - throw unusable('ECDSA'); - const expected = getNamedCurve(alg); - const actual = key.algorithm.namedCurve; - if (actual !== expected) - throw unusable(expected, 'algorithm.namedCurve'); - break; - } - default: - throw new TypeError('CryptoKey does not support this operation'); - } - checkUsage(key, usage); -} -export function checkEncCryptoKey(key, alg, usage) { - switch (alg) { - case 'A128GCM': - case 'A192GCM': - case 'A256GCM': { - if (!isAlgorithm(key.algorithm, 'AES-GCM')) - throw unusable('AES-GCM'); - const expected = parseInt(alg.slice(1, 4), 10); - const actual = key.algorithm.length; - if (actual !== expected) - throw unusable(expected, 'algorithm.length'); - break; - } - case 'A128KW': - case 'A192KW': - case 'A256KW': { - if (!isAlgorithm(key.algorithm, 'AES-KW')) - throw unusable('AES-KW'); - const expected = parseInt(alg.slice(1, 4), 10); - const actual = key.algorithm.length; - if (actual !== expected) - throw unusable(expected, 'algorithm.length'); - break; - } - case 'ECDH': { - switch (key.algorithm.name) { - case 'ECDH': - case 'X25519': - break; - default: - throw unusable('ECDH or X25519'); - } - break; - } - case 'PBES2-HS256+A128KW': - case 'PBES2-HS384+A192KW': - case 'PBES2-HS512+A256KW': - if (!isAlgorithm(key.algorithm, 'PBKDF2')) - throw unusable('PBKDF2'); - break; - case 'RSA-OAEP': - case 'RSA-OAEP-256': - case 'RSA-OAEP-384': - case 'RSA-OAEP-512': { - if (!isAlgorithm(key.algorithm, 'RSA-OAEP')) - throw unusable('RSA-OAEP'); - const expected = parseInt(alg.slice(9), 10) || 1; - const actual = getHashLength(key.algorithm.hash); - if (actual !== expected) - throw unusable(`SHA-${expected}`, 'algorithm.hash'); - break; - } - default: - throw new TypeError('CryptoKey does not support this operation'); - } - checkUsage(key, usage); -} diff --git a/node_modules/jose/dist/webapi/lib/decrypt.js b/node_modules/jose/dist/webapi/lib/decrypt.js deleted file mode 100644 index efe1e33..0000000 --- a/node_modules/jose/dist/webapi/lib/decrypt.js +++ /dev/null @@ -1,106 +0,0 @@ -import { concat, uint64be } from './buffer_utils.js'; -import { checkIvLength } from './check_iv_length.js'; -import { checkCekLength } from './check_cek_length.js'; -import { JOSENotSupported, JWEDecryptionFailed, JWEInvalid } from '../util/errors.js'; -import { checkEncCryptoKey } from './crypto_key.js'; -import { invalidKeyInput } from './invalid_key_input.js'; -import { isCryptoKey } from './is_key_like.js'; -async function timingSafeEqual(a, b) { - if (!(a instanceof Uint8Array)) { - throw new TypeError('First argument must be a buffer'); - } - if (!(b instanceof Uint8Array)) { - throw new TypeError('Second argument must be a buffer'); - } - const algorithm = { name: 'HMAC', hash: 'SHA-256' }; - const key = (await crypto.subtle.generateKey(algorithm, false, ['sign'])); - const aHmac = new Uint8Array(await crypto.subtle.sign(algorithm, key, a)); - const bHmac = new Uint8Array(await crypto.subtle.sign(algorithm, key, b)); - let out = 0; - let i = -1; - while (++i < 32) { - out |= aHmac[i] ^ bHmac[i]; - } - return out === 0; -} -async function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) { - if (!(cek instanceof Uint8Array)) { - throw new TypeError(invalidKeyInput(cek, 'Uint8Array')); - } - const keySize = parseInt(enc.slice(1, 4), 10); - const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, ['decrypt']); - const macKey = await crypto.subtle.importKey('raw', cek.subarray(0, keySize >> 3), { - hash: `SHA-${keySize << 1}`, - name: 'HMAC', - }, false, ['sign']); - const macData = concat(aad, iv, ciphertext, uint64be(aad.length << 3)); - const expectedTag = new Uint8Array((await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3)); - let macCheckPassed; - try { - macCheckPassed = await timingSafeEqual(tag, expectedTag); - } - catch { - } - if (!macCheckPassed) { - throw new JWEDecryptionFailed(); - } - let plaintext; - try { - plaintext = new Uint8Array(await crypto.subtle.decrypt({ iv: iv, name: 'AES-CBC' }, encKey, ciphertext)); - } - catch { - } - if (!plaintext) { - throw new JWEDecryptionFailed(); - } - return plaintext; -} -async function gcmDecrypt(enc, cek, ciphertext, iv, tag, aad) { - let encKey; - if (cek instanceof Uint8Array) { - encKey = await crypto.subtle.importKey('raw', cek, 'AES-GCM', false, ['decrypt']); - } - else { - checkEncCryptoKey(cek, enc, 'decrypt'); - encKey = cek; - } - try { - return new Uint8Array(await crypto.subtle.decrypt({ - additionalData: aad, - iv: iv, - name: 'AES-GCM', - tagLength: 128, - }, encKey, concat(ciphertext, tag))); - } - catch { - throw new JWEDecryptionFailed(); - } -} -export async function decrypt(enc, cek, ciphertext, iv, tag, aad) { - if (!isCryptoKey(cek) && !(cek instanceof Uint8Array)) { - throw new TypeError(invalidKeyInput(cek, 'CryptoKey', 'KeyObject', 'Uint8Array', 'JSON Web Key')); - } - if (!iv) { - throw new JWEInvalid('JWE Initialization Vector missing'); - } - if (!tag) { - throw new JWEInvalid('JWE Authentication Tag missing'); - } - checkIvLength(enc, iv); - switch (enc) { - case 'A128CBC-HS256': - case 'A192CBC-HS384': - case 'A256CBC-HS512': - if (cek instanceof Uint8Array) - checkCekLength(cek, parseInt(enc.slice(-3), 10)); - return cbcDecrypt(enc, cek, ciphertext, iv, tag, aad); - case 'A128GCM': - case 'A192GCM': - case 'A256GCM': - if (cek instanceof Uint8Array) - checkCekLength(cek, parseInt(enc.slice(1, 4), 10)); - return gcmDecrypt(enc, cek, ciphertext, iv, tag, aad); - default: - throw new JOSENotSupported('Unsupported JWE Content Encryption Algorithm'); - } -} diff --git a/node_modules/jose/dist/webapi/lib/decrypt_key_management.js b/node_modules/jose/dist/webapi/lib/decrypt_key_management.js deleted file mode 100644 index 1abfc0f..0000000 --- a/node_modules/jose/dist/webapi/lib/decrypt_key_management.js +++ /dev/null @@ -1,127 +0,0 @@ -import * as aeskw from './aeskw.js'; -import * as ecdhes from './ecdhes.js'; -import * as pbes2kw from './pbes2kw.js'; -import * as rsaes from './rsaes.js'; -import { decode as b64u } from '../util/base64url.js'; -import { JOSENotSupported, JWEInvalid } from '../util/errors.js'; -import { cekLength } from '../lib/cek.js'; -import { importJWK } from '../key/import.js'; -import { isObject } from './is_object.js'; -import { unwrap as aesGcmKw } from './aesgcmkw.js'; -import { assertCryptoKey } from './is_key_like.js'; -export async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) { - switch (alg) { - case 'dir': { - if (encryptedKey !== undefined) - throw new JWEInvalid('Encountered unexpected JWE Encrypted Key'); - return key; - } - case 'ECDH-ES': - if (encryptedKey !== undefined) - throw new JWEInvalid('Encountered unexpected JWE Encrypted Key'); - case 'ECDH-ES+A128KW': - case 'ECDH-ES+A192KW': - case 'ECDH-ES+A256KW': { - if (!isObject(joseHeader.epk)) - throw new JWEInvalid(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`); - assertCryptoKey(key); - if (!ecdhes.allowed(key)) - throw new JOSENotSupported('ECDH with the provided key is not allowed or not supported by your javascript runtime'); - const epk = await importJWK(joseHeader.epk, alg); - assertCryptoKey(epk); - let partyUInfo; - let partyVInfo; - if (joseHeader.apu !== undefined) { - if (typeof joseHeader.apu !== 'string') - throw new JWEInvalid(`JOSE Header "apu" (Agreement PartyUInfo) invalid`); - try { - partyUInfo = b64u(joseHeader.apu); - } - catch { - throw new JWEInvalid('Failed to base64url decode the apu'); - } - } - if (joseHeader.apv !== undefined) { - if (typeof joseHeader.apv !== 'string') - throw new JWEInvalid(`JOSE Header "apv" (Agreement PartyVInfo) invalid`); - try { - partyVInfo = b64u(joseHeader.apv); - } - catch { - throw new JWEInvalid('Failed to base64url decode the apv'); - } - } - const sharedSecret = await ecdhes.deriveKey(epk, key, alg === 'ECDH-ES' ? joseHeader.enc : alg, alg === 'ECDH-ES' ? cekLength(joseHeader.enc) : parseInt(alg.slice(-5, -2), 10), partyUInfo, partyVInfo); - if (alg === 'ECDH-ES') - return sharedSecret; - if (encryptedKey === undefined) - throw new JWEInvalid('JWE Encrypted Key missing'); - return aeskw.unwrap(alg.slice(-6), sharedSecret, encryptedKey); - } - case 'RSA-OAEP': - case 'RSA-OAEP-256': - case 'RSA-OAEP-384': - case 'RSA-OAEP-512': { - if (encryptedKey === undefined) - throw new JWEInvalid('JWE Encrypted Key missing'); - assertCryptoKey(key); - return rsaes.decrypt(alg, key, encryptedKey); - } - case 'PBES2-HS256+A128KW': - case 'PBES2-HS384+A192KW': - case 'PBES2-HS512+A256KW': { - if (encryptedKey === undefined) - throw new JWEInvalid('JWE Encrypted Key missing'); - if (typeof joseHeader.p2c !== 'number') - throw new JWEInvalid(`JOSE Header "p2c" (PBES2 Count) missing or invalid`); - const p2cLimit = options?.maxPBES2Count || 10_000; - if (joseHeader.p2c > p2cLimit) - throw new JWEInvalid(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`); - if (typeof joseHeader.p2s !== 'string') - throw new JWEInvalid(`JOSE Header "p2s" (PBES2 Salt) missing or invalid`); - let p2s; - try { - p2s = b64u(joseHeader.p2s); - } - catch { - throw new JWEInvalid('Failed to base64url decode the p2s'); - } - return pbes2kw.unwrap(alg, key, encryptedKey, joseHeader.p2c, p2s); - } - case 'A128KW': - case 'A192KW': - case 'A256KW': { - if (encryptedKey === undefined) - throw new JWEInvalid('JWE Encrypted Key missing'); - return aeskw.unwrap(alg, key, encryptedKey); - } - case 'A128GCMKW': - case 'A192GCMKW': - case 'A256GCMKW': { - if (encryptedKey === undefined) - throw new JWEInvalid('JWE Encrypted Key missing'); - if (typeof joseHeader.iv !== 'string') - throw new JWEInvalid(`JOSE Header "iv" (Initialization Vector) missing or invalid`); - if (typeof joseHeader.tag !== 'string') - throw new JWEInvalid(`JOSE Header "tag" (Authentication Tag) missing or invalid`); - let iv; - try { - iv = b64u(joseHeader.iv); - } - catch { - throw new JWEInvalid('Failed to base64url decode the iv'); - } - let tag; - try { - tag = b64u(joseHeader.tag); - } - catch { - throw new JWEInvalid('Failed to base64url decode the tag'); - } - return aesGcmKw(alg, key, encryptedKey, iv, tag); - } - default: { - throw new JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value'); - } - } -} diff --git a/node_modules/jose/dist/webapi/lib/digest.js b/node_modules/jose/dist/webapi/lib/digest.js deleted file mode 100644 index 697ffe9..0000000 --- a/node_modules/jose/dist/webapi/lib/digest.js +++ /dev/null @@ -1,4 +0,0 @@ -export async function digest(algorithm, data) { - const subtleDigest = `SHA-${algorithm.slice(-3)}`; - return new Uint8Array(await crypto.subtle.digest(subtleDigest, data)); -} diff --git a/node_modules/jose/dist/webapi/lib/ecdhes.js b/node_modules/jose/dist/webapi/lib/ecdhes.js deleted file mode 100644 index 4bd950f..0000000 --- a/node_modules/jose/dist/webapi/lib/ecdhes.js +++ /dev/null @@ -1,52 +0,0 @@ -import { encode, concat, uint32be } from './buffer_utils.js'; -import { checkEncCryptoKey } from './crypto_key.js'; -import { digest } from './digest.js'; -function lengthAndInput(input) { - return concat(uint32be(input.length), input); -} -async function concatKdf(Z, L, OtherInfo) { - const dkLen = L >> 3; - const hashLen = 32; - const reps = Math.ceil(dkLen / hashLen); - const dk = new Uint8Array(reps * hashLen); - for (let i = 1; i <= reps; i++) { - const hashInput = new Uint8Array(4 + Z.length + OtherInfo.length); - hashInput.set(uint32be(i), 0); - hashInput.set(Z, 4); - hashInput.set(OtherInfo, 4 + Z.length); - const hashResult = await digest('sha256', hashInput); - dk.set(hashResult, (i - 1) * hashLen); - } - return dk.slice(0, dkLen); -} -export async function deriveKey(publicKey, privateKey, algorithm, keyLength, apu = new Uint8Array(), apv = new Uint8Array()) { - checkEncCryptoKey(publicKey, 'ECDH'); - checkEncCryptoKey(privateKey, 'ECDH', 'deriveBits'); - const algorithmID = lengthAndInput(encode(algorithm)); - const partyUInfo = lengthAndInput(apu); - const partyVInfo = lengthAndInput(apv); - const suppPubInfo = uint32be(keyLength); - const suppPrivInfo = new Uint8Array(); - const otherInfo = concat(algorithmID, partyUInfo, partyVInfo, suppPubInfo, suppPrivInfo); - const Z = new Uint8Array(await crypto.subtle.deriveBits({ - name: publicKey.algorithm.name, - public: publicKey, - }, privateKey, getEcdhBitLength(publicKey))); - return concatKdf(Z, keyLength, otherInfo); -} -function getEcdhBitLength(publicKey) { - if (publicKey.algorithm.name === 'X25519') { - return 256; - } - return (Math.ceil(parseInt(publicKey.algorithm.namedCurve.slice(-3), 10) / 8) << 3); -} -export function allowed(key) { - switch (key.algorithm.namedCurve) { - case 'P-256': - case 'P-384': - case 'P-521': - return true; - default: - return key.algorithm.name === 'X25519'; - } -} diff --git a/node_modules/jose/dist/webapi/lib/encrypt.js b/node_modules/jose/dist/webapi/lib/encrypt.js deleted file mode 100644 index 44853a2..0000000 --- a/node_modules/jose/dist/webapi/lib/encrypt.js +++ /dev/null @@ -1,74 +0,0 @@ -import { concat, uint64be } from './buffer_utils.js'; -import { checkIvLength } from './check_iv_length.js'; -import { checkCekLength } from './check_cek_length.js'; -import { checkEncCryptoKey } from './crypto_key.js'; -import { invalidKeyInput } from './invalid_key_input.js'; -import { generateIv } from './iv.js'; -import { JOSENotSupported } from '../util/errors.js'; -import { isCryptoKey } from './is_key_like.js'; -async function cbcEncrypt(enc, plaintext, cek, iv, aad) { - if (!(cek instanceof Uint8Array)) { - throw new TypeError(invalidKeyInput(cek, 'Uint8Array')); - } - const keySize = parseInt(enc.slice(1, 4), 10); - const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, ['encrypt']); - const macKey = await crypto.subtle.importKey('raw', cek.subarray(0, keySize >> 3), { - hash: `SHA-${keySize << 1}`, - name: 'HMAC', - }, false, ['sign']); - const ciphertext = new Uint8Array(await crypto.subtle.encrypt({ - iv: iv, - name: 'AES-CBC', - }, encKey, plaintext)); - const macData = concat(aad, iv, ciphertext, uint64be(aad.length << 3)); - const tag = new Uint8Array((await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3)); - return { ciphertext, tag, iv }; -} -async function gcmEncrypt(enc, plaintext, cek, iv, aad) { - let encKey; - if (cek instanceof Uint8Array) { - encKey = await crypto.subtle.importKey('raw', cek, 'AES-GCM', false, ['encrypt']); - } - else { - checkEncCryptoKey(cek, enc, 'encrypt'); - encKey = cek; - } - const encrypted = new Uint8Array(await crypto.subtle.encrypt({ - additionalData: aad, - iv: iv, - name: 'AES-GCM', - tagLength: 128, - }, encKey, plaintext)); - const tag = encrypted.slice(-16); - const ciphertext = encrypted.slice(0, -16); - return { ciphertext, tag, iv }; -} -export async function encrypt(enc, plaintext, cek, iv, aad) { - if (!isCryptoKey(cek) && !(cek instanceof Uint8Array)) { - throw new TypeError(invalidKeyInput(cek, 'CryptoKey', 'KeyObject', 'Uint8Array', 'JSON Web Key')); - } - if (iv) { - checkIvLength(enc, iv); - } - else { - iv = generateIv(enc); - } - switch (enc) { - case 'A128CBC-HS256': - case 'A192CBC-HS384': - case 'A256CBC-HS512': - if (cek instanceof Uint8Array) { - checkCekLength(cek, parseInt(enc.slice(-3), 10)); - } - return cbcEncrypt(enc, plaintext, cek, iv, aad); - case 'A128GCM': - case 'A192GCM': - case 'A256GCM': - if (cek instanceof Uint8Array) { - checkCekLength(cek, parseInt(enc.slice(1, 4), 10)); - } - return gcmEncrypt(enc, plaintext, cek, iv, aad); - default: - throw new JOSENotSupported('Unsupported JWE Content Encryption Algorithm'); - } -} diff --git a/node_modules/jose/dist/webapi/lib/encrypt_key_management.js b/node_modules/jose/dist/webapi/lib/encrypt_key_management.js deleted file mode 100644 index da24d05..0000000 --- a/node_modules/jose/dist/webapi/lib/encrypt_key_management.js +++ /dev/null @@ -1,92 +0,0 @@ -import * as aeskw from './aeskw.js'; -import * as ecdhes from './ecdhes.js'; -import * as pbes2kw from './pbes2kw.js'; -import * as rsaes from './rsaes.js'; -import { encode as b64u } from '../util/base64url.js'; -import { normalizeKey } from './normalize_key.js'; -import { generateCek, cekLength } from '../lib/cek.js'; -import { JOSENotSupported } from '../util/errors.js'; -import { exportJWK } from '../key/export.js'; -import { wrap as aesGcmKw } from './aesgcmkw.js'; -import { assertCryptoKey } from './is_key_like.js'; -export async function encryptKeyManagement(alg, enc, key, providedCek, providedParameters = {}) { - let encryptedKey; - let parameters; - let cek; - switch (alg) { - case 'dir': { - cek = key; - break; - } - case 'ECDH-ES': - case 'ECDH-ES+A128KW': - case 'ECDH-ES+A192KW': - case 'ECDH-ES+A256KW': { - assertCryptoKey(key); - if (!ecdhes.allowed(key)) { - throw new JOSENotSupported('ECDH with the provided key is not allowed or not supported by your javascript runtime'); - } - const { apu, apv } = providedParameters; - let ephemeralKey; - if (providedParameters.epk) { - ephemeralKey = (await normalizeKey(providedParameters.epk, alg)); - } - else { - ephemeralKey = (await crypto.subtle.generateKey(key.algorithm, true, ['deriveBits'])).privateKey; - } - const { x, y, crv, kty } = await exportJWK(ephemeralKey); - const sharedSecret = await ecdhes.deriveKey(key, ephemeralKey, alg === 'ECDH-ES' ? enc : alg, alg === 'ECDH-ES' ? cekLength(enc) : parseInt(alg.slice(-5, -2), 10), apu, apv); - parameters = { epk: { x, crv, kty } }; - if (kty === 'EC') - parameters.epk.y = y; - if (apu) - parameters.apu = b64u(apu); - if (apv) - parameters.apv = b64u(apv); - if (alg === 'ECDH-ES') { - cek = sharedSecret; - break; - } - cek = providedCek || generateCek(enc); - const kwAlg = alg.slice(-6); - encryptedKey = await aeskw.wrap(kwAlg, sharedSecret, cek); - break; - } - case 'RSA-OAEP': - case 'RSA-OAEP-256': - case 'RSA-OAEP-384': - case 'RSA-OAEP-512': { - cek = providedCek || generateCek(enc); - assertCryptoKey(key); - encryptedKey = await rsaes.encrypt(alg, key, cek); - break; - } - case 'PBES2-HS256+A128KW': - case 'PBES2-HS384+A192KW': - case 'PBES2-HS512+A256KW': { - cek = providedCek || generateCek(enc); - const { p2c, p2s } = providedParameters; - ({ encryptedKey, ...parameters } = await pbes2kw.wrap(alg, key, cek, p2c, p2s)); - break; - } - case 'A128KW': - case 'A192KW': - case 'A256KW': { - cek = providedCek || generateCek(enc); - encryptedKey = await aeskw.wrap(alg, key, cek); - break; - } - case 'A128GCMKW': - case 'A192GCMKW': - case 'A256GCMKW': { - cek = providedCek || generateCek(enc); - const { iv } = providedParameters; - ({ encryptedKey, ...parameters } = await aesGcmKw(alg, key, cek, iv)); - break; - } - default: { - throw new JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value'); - } - } - return { cek, encryptedKey, parameters }; -} diff --git a/node_modules/jose/dist/webapi/lib/get_sign_verify_key.js b/node_modules/jose/dist/webapi/lib/get_sign_verify_key.js deleted file mode 100644 index 46b1c16..0000000 --- a/node_modules/jose/dist/webapi/lib/get_sign_verify_key.js +++ /dev/null @@ -1,12 +0,0 @@ -import { checkSigCryptoKey } from './crypto_key.js'; -import { invalidKeyInput } from './invalid_key_input.js'; -export async function getSigKey(alg, key, usage) { - if (key instanceof Uint8Array) { - if (!alg.startsWith('HS')) { - throw new TypeError(invalidKeyInput(key, 'CryptoKey', 'KeyObject', 'JSON Web Key')); - } - return crypto.subtle.importKey('raw', key, { hash: `SHA-${alg.slice(-3)}`, name: 'HMAC' }, false, [usage]); - } - checkSigCryptoKey(key, alg, usage); - return key; -} diff --git a/node_modules/jose/dist/webapi/lib/invalid_key_input.js b/node_modules/jose/dist/webapi/lib/invalid_key_input.js deleted file mode 100644 index 8bb76d4..0000000 --- a/node_modules/jose/dist/webapi/lib/invalid_key_input.js +++ /dev/null @@ -1,27 +0,0 @@ -function message(msg, actual, ...types) { - types = types.filter(Boolean); - if (types.length > 2) { - const last = types.pop(); - msg += `one of type ${types.join(', ')}, or ${last}.`; - } - else if (types.length === 2) { - msg += `one of type ${types[0]} or ${types[1]}.`; - } - else { - msg += `of type ${types[0]}.`; - } - if (actual == null) { - msg += ` Received ${actual}`; - } - else if (typeof actual === 'function' && actual.name) { - msg += ` Received function ${actual.name}`; - } - else if (typeof actual === 'object' && actual != null) { - if (actual.constructor?.name) { - msg += ` Received an instance of ${actual.constructor.name}`; - } - } - return msg; -} -export const invalidKeyInput = (actual, ...types) => message('Key must be ', actual, ...types); -export const withAlg = (alg, actual, ...types) => message(`Key for the ${alg} algorithm must be `, actual, ...types); diff --git a/node_modules/jose/dist/webapi/lib/is_disjoint.js b/node_modules/jose/dist/webapi/lib/is_disjoint.js deleted file mode 100644 index 5230e3b..0000000 --- a/node_modules/jose/dist/webapi/lib/is_disjoint.js +++ /dev/null @@ -1,21 +0,0 @@ -export function isDisjoint(...headers) { - const sources = headers.filter(Boolean); - if (sources.length === 0 || sources.length === 1) { - return true; - } - let acc; - for (const header of sources) { - const parameters = Object.keys(header); - if (!acc || acc.size === 0) { - acc = new Set(parameters); - continue; - } - for (const parameter of parameters) { - if (acc.has(parameter)) { - return false; - } - acc.add(parameter); - } - } - return true; -} diff --git a/node_modules/jose/dist/webapi/lib/is_jwk.js b/node_modules/jose/dist/webapi/lib/is_jwk.js deleted file mode 100644 index 017b1dd..0000000 --- a/node_modules/jose/dist/webapi/lib/is_jwk.js +++ /dev/null @@ -1,6 +0,0 @@ -import { isObject } from './is_object.js'; -export const isJWK = (key) => isObject(key) && typeof key.kty === 'string'; -export const isPrivateJWK = (key) => key.kty !== 'oct' && - ((key.kty === 'AKP' && typeof key.priv === 'string') || typeof key.d === 'string'); -export const isPublicJWK = (key) => key.kty !== 'oct' && key.d === undefined && key.priv === undefined; -export const isSecretJWK = (key) => key.kty === 'oct' && typeof key.k === 'string'; diff --git a/node_modules/jose/dist/webapi/lib/is_key_like.js b/node_modules/jose/dist/webapi/lib/is_key_like.js deleted file mode 100644 index 8b65dc2..0000000 --- a/node_modules/jose/dist/webapi/lib/is_key_like.js +++ /dev/null @@ -1,17 +0,0 @@ -export function assertCryptoKey(key) { - if (!isCryptoKey(key)) { - throw new Error('CryptoKey instance expected'); - } -} -export const isCryptoKey = (key) => { - if (key?.[Symbol.toStringTag] === 'CryptoKey') - return true; - try { - return key instanceof CryptoKey; - } - catch { - return false; - } -}; -export const isKeyObject = (key) => key?.[Symbol.toStringTag] === 'KeyObject'; -export const isKeyLike = (key) => isCryptoKey(key) || isKeyObject(key); diff --git a/node_modules/jose/dist/webapi/lib/is_object.js b/node_modules/jose/dist/webapi/lib/is_object.js deleted file mode 100644 index 246e61d..0000000 --- a/node_modules/jose/dist/webapi/lib/is_object.js +++ /dev/null @@ -1,14 +0,0 @@ -const isObjectLike = (value) => typeof value === 'object' && value !== null; -export function isObject(input) { - if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') { - return false; - } - if (Object.getPrototypeOf(input) === null) { - return true; - } - let proto = input; - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto); - } - return Object.getPrototypeOf(input) === proto; -} diff --git a/node_modules/jose/dist/webapi/lib/iv.js b/node_modules/jose/dist/webapi/lib/iv.js deleted file mode 100644 index 5342729..0000000 --- a/node_modules/jose/dist/webapi/lib/iv.js +++ /dev/null @@ -1,19 +0,0 @@ -import { JOSENotSupported } from '../util/errors.js'; -export function bitLength(alg) { - switch (alg) { - case 'A128GCM': - case 'A128GCMKW': - case 'A192GCM': - case 'A192GCMKW': - case 'A256GCM': - case 'A256GCMKW': - return 96; - case 'A128CBC-HS256': - case 'A192CBC-HS384': - case 'A256CBC-HS512': - return 128; - default: - throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`); - } -} -export const generateIv = (alg) => crypto.getRandomValues(new Uint8Array(bitLength(alg) >> 3)); diff --git a/node_modules/jose/dist/webapi/lib/jwk_to_key.js b/node_modules/jose/dist/webapi/lib/jwk_to_key.js deleted file mode 100644 index 1210d67..0000000 --- a/node_modules/jose/dist/webapi/lib/jwk_to_key.js +++ /dev/null @@ -1,109 +0,0 @@ -import { JOSENotSupported } from '../util/errors.js'; -function subtleMapping(jwk) { - let algorithm; - let keyUsages; - switch (jwk.kty) { - case 'AKP': { - switch (jwk.alg) { - case 'ML-DSA-44': - case 'ML-DSA-65': - case 'ML-DSA-87': - algorithm = { name: jwk.alg }; - keyUsages = jwk.priv ? ['sign'] : ['verify']; - break; - default: - throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); - } - break; - } - case 'RSA': { - switch (jwk.alg) { - case 'PS256': - case 'PS384': - case 'PS512': - algorithm = { name: 'RSA-PSS', hash: `SHA-${jwk.alg.slice(-3)}` }; - keyUsages = jwk.d ? ['sign'] : ['verify']; - break; - case 'RS256': - case 'RS384': - case 'RS512': - algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${jwk.alg.slice(-3)}` }; - keyUsages = jwk.d ? ['sign'] : ['verify']; - break; - case 'RSA-OAEP': - case 'RSA-OAEP-256': - case 'RSA-OAEP-384': - case 'RSA-OAEP-512': - algorithm = { - name: 'RSA-OAEP', - hash: `SHA-${parseInt(jwk.alg.slice(-3), 10) || 1}`, - }; - keyUsages = jwk.d ? ['decrypt', 'unwrapKey'] : ['encrypt', 'wrapKey']; - break; - default: - throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); - } - break; - } - case 'EC': { - switch (jwk.alg) { - case 'ES256': - algorithm = { name: 'ECDSA', namedCurve: 'P-256' }; - keyUsages = jwk.d ? ['sign'] : ['verify']; - break; - case 'ES384': - algorithm = { name: 'ECDSA', namedCurve: 'P-384' }; - keyUsages = jwk.d ? ['sign'] : ['verify']; - break; - case 'ES512': - algorithm = { name: 'ECDSA', namedCurve: 'P-521' }; - keyUsages = jwk.d ? ['sign'] : ['verify']; - break; - case 'ECDH-ES': - case 'ECDH-ES+A128KW': - case 'ECDH-ES+A192KW': - case 'ECDH-ES+A256KW': - algorithm = { name: 'ECDH', namedCurve: jwk.crv }; - keyUsages = jwk.d ? ['deriveBits'] : []; - break; - default: - throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); - } - break; - } - case 'OKP': { - switch (jwk.alg) { - case 'Ed25519': - case 'EdDSA': - algorithm = { name: 'Ed25519' }; - keyUsages = jwk.d ? ['sign'] : ['verify']; - break; - case 'ECDH-ES': - case 'ECDH-ES+A128KW': - case 'ECDH-ES+A192KW': - case 'ECDH-ES+A256KW': - algorithm = { name: jwk.crv }; - keyUsages = jwk.d ? ['deriveBits'] : []; - break; - default: - throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); - } - break; - } - default: - throw new JOSENotSupported('Invalid or unsupported JWK "kty" (Key Type) Parameter value'); - } - return { algorithm, keyUsages }; -} -export async function jwkToKey(jwk) { - if (!jwk.alg) { - throw new TypeError('"alg" argument is required when "jwk.alg" is not present'); - } - const { algorithm, keyUsages } = subtleMapping(jwk); - const keyData = { ...jwk }; - if (keyData.kty !== 'AKP') { - delete keyData.alg; - } - delete keyData.use; - return crypto.subtle.importKey('jwk', keyData, algorithm, jwk.ext ?? (jwk.d || jwk.priv ? false : true), jwk.key_ops ?? keyUsages); -} diff --git a/node_modules/jose/dist/webapi/lib/jwt_claims_set.js b/node_modules/jose/dist/webapi/lib/jwt_claims_set.js deleted file mode 100644 index 86976a8..0000000 --- a/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +++ /dev/null @@ -1,238 +0,0 @@ -import { JWTClaimValidationFailed, JWTExpired, JWTInvalid } from '../util/errors.js'; -import { encoder, decoder } from './buffer_utils.js'; -import { isObject } from './is_object.js'; -const epoch = (date) => Math.floor(date.getTime() / 1000); -const minute = 60; -const hour = minute * 60; -const day = hour * 24; -const week = day * 7; -const year = day * 365.25; -const REGEX = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i; -export function secs(str) { - const matched = REGEX.exec(str); - if (!matched || (matched[4] && matched[1])) { - throw new TypeError('Invalid time period format'); - } - const value = parseFloat(matched[2]); - const unit = matched[3].toLowerCase(); - let numericDate; - switch (unit) { - case 'sec': - case 'secs': - case 'second': - case 'seconds': - case 's': - numericDate = Math.round(value); - break; - case 'minute': - case 'minutes': - case 'min': - case 'mins': - case 'm': - numericDate = Math.round(value * minute); - break; - case 'hour': - case 'hours': - case 'hr': - case 'hrs': - case 'h': - numericDate = Math.round(value * hour); - break; - case 'day': - case 'days': - case 'd': - numericDate = Math.round(value * day); - break; - case 'week': - case 'weeks': - case 'w': - numericDate = Math.round(value * week); - break; - default: - numericDate = Math.round(value * year); - break; - } - if (matched[1] === '-' || matched[4] === 'ago') { - return -numericDate; - } - return numericDate; -} -function validateInput(label, input) { - if (!Number.isFinite(input)) { - throw new TypeError(`Invalid ${label} input`); - } - return input; -} -const normalizeTyp = (value) => { - if (value.includes('/')) { - return value.toLowerCase(); - } - return `application/${value.toLowerCase()}`; -}; -const checkAudiencePresence = (audPayload, audOption) => { - if (typeof audPayload === 'string') { - return audOption.includes(audPayload); - } - if (Array.isArray(audPayload)) { - return audOption.some(Set.prototype.has.bind(new Set(audPayload))); - } - return false; -}; -export function validateClaimsSet(protectedHeader, encodedPayload, options = {}) { - let payload; - try { - payload = JSON.parse(decoder.decode(encodedPayload)); - } - catch { - } - if (!isObject(payload)) { - throw new JWTInvalid('JWT Claims Set must be a top-level JSON object'); - } - const { typ } = options; - if (typ && - (typeof protectedHeader.typ !== 'string' || - normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ))) { - throw new JWTClaimValidationFailed('unexpected "typ" JWT header value', payload, 'typ', 'check_failed'); - } - const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options; - const presenceCheck = [...requiredClaims]; - if (maxTokenAge !== undefined) - presenceCheck.push('iat'); - if (audience !== undefined) - presenceCheck.push('aud'); - if (subject !== undefined) - presenceCheck.push('sub'); - if (issuer !== undefined) - presenceCheck.push('iss'); - for (const claim of new Set(presenceCheck.reverse())) { - if (!(claim in payload)) { - throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, payload, claim, 'missing'); - } - } - if (issuer && - !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) { - throw new JWTClaimValidationFailed('unexpected "iss" claim value', payload, 'iss', 'check_failed'); - } - if (subject && payload.sub !== subject) { - throw new JWTClaimValidationFailed('unexpected "sub" claim value', payload, 'sub', 'check_failed'); - } - if (audience && - !checkAudiencePresence(payload.aud, typeof audience === 'string' ? [audience] : audience)) { - throw new JWTClaimValidationFailed('unexpected "aud" claim value', payload, 'aud', 'check_failed'); - } - let tolerance; - switch (typeof options.clockTolerance) { - case 'string': - tolerance = secs(options.clockTolerance); - break; - case 'number': - tolerance = options.clockTolerance; - break; - case 'undefined': - tolerance = 0; - break; - default: - throw new TypeError('Invalid clockTolerance option type'); - } - const { currentDate } = options; - const now = epoch(currentDate || new Date()); - if ((payload.iat !== undefined || maxTokenAge) && typeof payload.iat !== 'number') { - throw new JWTClaimValidationFailed('"iat" claim must be a number', payload, 'iat', 'invalid'); - } - if (payload.nbf !== undefined) { - if (typeof payload.nbf !== 'number') { - throw new JWTClaimValidationFailed('"nbf" claim must be a number', payload, 'nbf', 'invalid'); - } - if (payload.nbf > now + tolerance) { - throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', payload, 'nbf', 'check_failed'); - } - } - if (payload.exp !== undefined) { - if (typeof payload.exp !== 'number') { - throw new JWTClaimValidationFailed('"exp" claim must be a number', payload, 'exp', 'invalid'); - } - if (payload.exp <= now - tolerance) { - throw new JWTExpired('"exp" claim timestamp check failed', payload, 'exp', 'check_failed'); - } - } - if (maxTokenAge) { - const age = now - payload.iat; - const max = typeof maxTokenAge === 'number' ? maxTokenAge : secs(maxTokenAge); - if (age - tolerance > max) { - throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', payload, 'iat', 'check_failed'); - } - if (age < 0 - tolerance) { - throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', payload, 'iat', 'check_failed'); - } - } - return payload; -} -export class JWTClaimsBuilder { - #payload; - constructor(payload) { - if (!isObject(payload)) { - throw new TypeError('JWT Claims Set MUST be an object'); - } - this.#payload = structuredClone(payload); - } - data() { - return encoder.encode(JSON.stringify(this.#payload)); - } - get iss() { - return this.#payload.iss; - } - set iss(value) { - this.#payload.iss = value; - } - get sub() { - return this.#payload.sub; - } - set sub(value) { - this.#payload.sub = value; - } - get aud() { - return this.#payload.aud; - } - set aud(value) { - this.#payload.aud = value; - } - set jti(value) { - this.#payload.jti = value; - } - set nbf(value) { - if (typeof value === 'number') { - this.#payload.nbf = validateInput('setNotBefore', value); - } - else if (value instanceof Date) { - this.#payload.nbf = validateInput('setNotBefore', epoch(value)); - } - else { - this.#payload.nbf = epoch(new Date()) + secs(value); - } - } - set exp(value) { - if (typeof value === 'number') { - this.#payload.exp = validateInput('setExpirationTime', value); - } - else if (value instanceof Date) { - this.#payload.exp = validateInput('setExpirationTime', epoch(value)); - } - else { - this.#payload.exp = epoch(new Date()) + secs(value); - } - } - set iat(value) { - if (value === undefined) { - this.#payload.iat = epoch(new Date()); - } - else if (value instanceof Date) { - this.#payload.iat = validateInput('setIssuedAt', epoch(value)); - } - else if (typeof value === 'string') { - this.#payload.iat = validateInput('setIssuedAt', epoch(new Date()) + secs(value)); - } - else { - this.#payload.iat = validateInput('setIssuedAt', value); - } - } -} diff --git a/node_modules/jose/dist/webapi/lib/key_to_jwk.js b/node_modules/jose/dist/webapi/lib/key_to_jwk.js deleted file mode 100644 index a236d25..0000000 --- a/node_modules/jose/dist/webapi/lib/key_to_jwk.js +++ /dev/null @@ -1,31 +0,0 @@ -import { invalidKeyInput } from './invalid_key_input.js'; -import { encode as b64u } from '../util/base64url.js'; -import { isCryptoKey, isKeyObject } from './is_key_like.js'; -export async function keyToJWK(key) { - if (isKeyObject(key)) { - if (key.type === 'secret') { - key = key.export(); - } - else { - return key.export({ format: 'jwk' }); - } - } - if (key instanceof Uint8Array) { - return { - kty: 'oct', - k: b64u(key), - }; - } - if (!isCryptoKey(key)) { - throw new TypeError(invalidKeyInput(key, 'CryptoKey', 'KeyObject', 'Uint8Array')); - } - if (!key.extractable) { - throw new TypeError('non-extractable CryptoKey cannot be exported as a JWK'); - } - const { ext, key_ops, alg, use, ...jwk } = await crypto.subtle.exportKey('jwk', key); - if (jwk.kty === 'AKP') { - ; - jwk.alg = alg; - } - return jwk; -} diff --git a/node_modules/jose/dist/webapi/lib/normalize_key.js b/node_modules/jose/dist/webapi/lib/normalize_key.js deleted file mode 100644 index fa8b709..0000000 --- a/node_modules/jose/dist/webapi/lib/normalize_key.js +++ /dev/null @@ -1,176 +0,0 @@ -import { isJWK } from './is_jwk.js'; -import { decode } from '../util/base64url.js'; -import { jwkToKey } from './jwk_to_key.js'; -import { isCryptoKey, isKeyObject } from './is_key_like.js'; -let cache; -const handleJWK = async (key, jwk, alg, freeze = false) => { - cache ||= new WeakMap(); - let cached = cache.get(key); - if (cached?.[alg]) { - return cached[alg]; - } - const cryptoKey = await jwkToKey({ ...jwk, alg }); - if (freeze) - Object.freeze(key); - if (!cached) { - cache.set(key, { [alg]: cryptoKey }); - } - else { - cached[alg] = cryptoKey; - } - return cryptoKey; -}; -const handleKeyObject = (keyObject, alg) => { - cache ||= new WeakMap(); - let cached = cache.get(keyObject); - if (cached?.[alg]) { - return cached[alg]; - } - const isPublic = keyObject.type === 'public'; - const extractable = isPublic ? true : false; - let cryptoKey; - if (keyObject.asymmetricKeyType === 'x25519') { - switch (alg) { - case 'ECDH-ES': - case 'ECDH-ES+A128KW': - case 'ECDH-ES+A192KW': - case 'ECDH-ES+A256KW': - break; - default: - throw new TypeError('given KeyObject instance cannot be used for this algorithm'); - } - cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, isPublic ? [] : ['deriveBits']); - } - if (keyObject.asymmetricKeyType === 'ed25519') { - if (alg !== 'EdDSA' && alg !== 'Ed25519') { - throw new TypeError('given KeyObject instance cannot be used for this algorithm'); - } - cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, [ - isPublic ? 'verify' : 'sign', - ]); - } - switch (keyObject.asymmetricKeyType) { - case 'ml-dsa-44': - case 'ml-dsa-65': - case 'ml-dsa-87': { - if (alg !== keyObject.asymmetricKeyType.toUpperCase()) { - throw new TypeError('given KeyObject instance cannot be used for this algorithm'); - } - cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, [ - isPublic ? 'verify' : 'sign', - ]); - } - } - if (keyObject.asymmetricKeyType === 'rsa') { - let hash; - switch (alg) { - case 'RSA-OAEP': - hash = 'SHA-1'; - break; - case 'RS256': - case 'PS256': - case 'RSA-OAEP-256': - hash = 'SHA-256'; - break; - case 'RS384': - case 'PS384': - case 'RSA-OAEP-384': - hash = 'SHA-384'; - break; - case 'RS512': - case 'PS512': - case 'RSA-OAEP-512': - hash = 'SHA-512'; - break; - default: - throw new TypeError('given KeyObject instance cannot be used for this algorithm'); - } - if (alg.startsWith('RSA-OAEP')) { - return keyObject.toCryptoKey({ - name: 'RSA-OAEP', - hash, - }, extractable, isPublic ? ['encrypt'] : ['decrypt']); - } - cryptoKey = keyObject.toCryptoKey({ - name: alg.startsWith('PS') ? 'RSA-PSS' : 'RSASSA-PKCS1-v1_5', - hash, - }, extractable, [isPublic ? 'verify' : 'sign']); - } - if (keyObject.asymmetricKeyType === 'ec') { - const nist = new Map([ - ['prime256v1', 'P-256'], - ['secp384r1', 'P-384'], - ['secp521r1', 'P-521'], - ]); - const namedCurve = nist.get(keyObject.asymmetricKeyDetails?.namedCurve); - if (!namedCurve) { - throw new TypeError('given KeyObject instance cannot be used for this algorithm'); - } - if (alg === 'ES256' && namedCurve === 'P-256') { - cryptoKey = keyObject.toCryptoKey({ - name: 'ECDSA', - namedCurve, - }, extractable, [isPublic ? 'verify' : 'sign']); - } - if (alg === 'ES384' && namedCurve === 'P-384') { - cryptoKey = keyObject.toCryptoKey({ - name: 'ECDSA', - namedCurve, - }, extractable, [isPublic ? 'verify' : 'sign']); - } - if (alg === 'ES512' && namedCurve === 'P-521') { - cryptoKey = keyObject.toCryptoKey({ - name: 'ECDSA', - namedCurve, - }, extractable, [isPublic ? 'verify' : 'sign']); - } - if (alg.startsWith('ECDH-ES')) { - cryptoKey = keyObject.toCryptoKey({ - name: 'ECDH', - namedCurve, - }, extractable, isPublic ? [] : ['deriveBits']); - } - } - if (!cryptoKey) { - throw new TypeError('given KeyObject instance cannot be used for this algorithm'); - } - if (!cached) { - cache.set(keyObject, { [alg]: cryptoKey }); - } - else { - cached[alg] = cryptoKey; - } - return cryptoKey; -}; -export async function normalizeKey(key, alg) { - if (key instanceof Uint8Array) { - return key; - } - if (isCryptoKey(key)) { - return key; - } - if (isKeyObject(key)) { - if (key.type === 'secret') { - return key.export(); - } - if ('toCryptoKey' in key && typeof key.toCryptoKey === 'function') { - try { - return handleKeyObject(key, alg); - } - catch (err) { - if (err instanceof TypeError) { - throw err; - } - } - } - let jwk = key.export({ format: 'jwk' }); - return handleJWK(key, jwk, alg); - } - if (isJWK(key)) { - if (key.k) { - return decode(key.k); - } - return handleJWK(key, key, alg, true); - } - throw new Error('unreachable'); -} diff --git a/node_modules/jose/dist/webapi/lib/pbes2kw.js b/node_modules/jose/dist/webapi/lib/pbes2kw.js deleted file mode 100644 index 2b0c20c..0000000 --- a/node_modules/jose/dist/webapi/lib/pbes2kw.js +++ /dev/null @@ -1,39 +0,0 @@ -import { encode as b64u } from '../util/base64url.js'; -import * as aeskw from './aeskw.js'; -import { checkEncCryptoKey } from './crypto_key.js'; -import { concat, encode } from './buffer_utils.js'; -import { JWEInvalid } from '../util/errors.js'; -function getCryptoKey(key, alg) { - if (key instanceof Uint8Array) { - return crypto.subtle.importKey('raw', key, 'PBKDF2', false, [ - 'deriveBits', - ]); - } - checkEncCryptoKey(key, alg, 'deriveBits'); - return key; -} -const concatSalt = (alg, p2sInput) => concat(encode(alg), Uint8Array.of(0x00), p2sInput); -async function deriveKey(p2s, alg, p2c, key) { - if (!(p2s instanceof Uint8Array) || p2s.length < 8) { - throw new JWEInvalid('PBES2 Salt Input must be 8 or more octets'); - } - const salt = concatSalt(alg, p2s); - const keylen = parseInt(alg.slice(13, 16), 10); - const subtleAlg = { - hash: `SHA-${alg.slice(8, 11)}`, - iterations: p2c, - name: 'PBKDF2', - salt, - }; - const cryptoKey = await getCryptoKey(key, alg); - return new Uint8Array(await crypto.subtle.deriveBits(subtleAlg, cryptoKey, keylen)); -} -export async function wrap(alg, key, cek, p2c = 2048, p2s = crypto.getRandomValues(new Uint8Array(16))) { - const derived = await deriveKey(p2s, alg, p2c, key); - const encryptedKey = await aeskw.wrap(alg.slice(-6), derived, cek); - return { encryptedKey, p2c, p2s: b64u(p2s) }; -} -export async function unwrap(alg, key, encryptedKey, p2c, p2s) { - const derived = await deriveKey(p2s, alg, p2c, key); - return aeskw.unwrap(alg.slice(-6), derived, encryptedKey); -} diff --git a/node_modules/jose/dist/webapi/lib/private_symbols.js b/node_modules/jose/dist/webapi/lib/private_symbols.js deleted file mode 100644 index fce302b..0000000 --- a/node_modules/jose/dist/webapi/lib/private_symbols.js +++ /dev/null @@ -1 +0,0 @@ -export const unprotected = Symbol(); diff --git a/node_modules/jose/dist/webapi/lib/rsaes.js b/node_modules/jose/dist/webapi/lib/rsaes.js deleted file mode 100644 index a1f48fa..0000000 --- a/node_modules/jose/dist/webapi/lib/rsaes.js +++ /dev/null @@ -1,24 +0,0 @@ -import { checkEncCryptoKey } from './crypto_key.js'; -import { checkKeyLength } from './check_key_length.js'; -import { JOSENotSupported } from '../util/errors.js'; -const subtleAlgorithm = (alg) => { - switch (alg) { - case 'RSA-OAEP': - case 'RSA-OAEP-256': - case 'RSA-OAEP-384': - case 'RSA-OAEP-512': - return 'RSA-OAEP'; - default: - throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`); - } -}; -export async function encrypt(alg, key, cek) { - checkEncCryptoKey(key, alg, 'encrypt'); - checkKeyLength(alg, key); - return new Uint8Array(await crypto.subtle.encrypt(subtleAlgorithm(alg), key, cek)); -} -export async function decrypt(alg, key, encryptedKey) { - checkEncCryptoKey(key, alg, 'decrypt'); - checkKeyLength(alg, key); - return new Uint8Array(await crypto.subtle.decrypt(subtleAlgorithm(alg), key, encryptedKey)); -} diff --git a/node_modules/jose/dist/webapi/lib/sign.js b/node_modules/jose/dist/webapi/lib/sign.js deleted file mode 100644 index baf41d1..0000000 --- a/node_modules/jose/dist/webapi/lib/sign.js +++ /dev/null @@ -1,9 +0,0 @@ -import { subtleAlgorithm } from './subtle_dsa.js'; -import { checkKeyLength } from './check_key_length.js'; -import { getSigKey } from './get_sign_verify_key.js'; -export async function sign(alg, key, data) { - const cryptoKey = await getSigKey(alg, key, 'sign'); - checkKeyLength(alg, cryptoKey); - const signature = await crypto.subtle.sign(subtleAlgorithm(alg, cryptoKey.algorithm), cryptoKey, data); - return new Uint8Array(signature); -} diff --git a/node_modules/jose/dist/webapi/lib/subtle_dsa.js b/node_modules/jose/dist/webapi/lib/subtle_dsa.js deleted file mode 100644 index 0c72c29..0000000 --- a/node_modules/jose/dist/webapi/lib/subtle_dsa.js +++ /dev/null @@ -1,31 +0,0 @@ -import { JOSENotSupported } from '../util/errors.js'; -export function subtleAlgorithm(alg, algorithm) { - const hash = `SHA-${alg.slice(-3)}`; - switch (alg) { - case 'HS256': - case 'HS384': - case 'HS512': - return { hash, name: 'HMAC' }; - case 'PS256': - case 'PS384': - case 'PS512': - return { hash, name: 'RSA-PSS', saltLength: parseInt(alg.slice(-3), 10) >> 3 }; - case 'RS256': - case 'RS384': - case 'RS512': - return { hash, name: 'RSASSA-PKCS1-v1_5' }; - case 'ES256': - case 'ES384': - case 'ES512': - return { hash, name: 'ECDSA', namedCurve: algorithm.namedCurve }; - case 'Ed25519': - case 'EdDSA': - return { name: 'Ed25519' }; - case 'ML-DSA-44': - case 'ML-DSA-65': - case 'ML-DSA-87': - return { name: alg }; - default: - throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`); - } -} diff --git a/node_modules/jose/dist/webapi/lib/validate_algorithms.js b/node_modules/jose/dist/webapi/lib/validate_algorithms.js deleted file mode 100644 index 3417f3f..0000000 --- a/node_modules/jose/dist/webapi/lib/validate_algorithms.js +++ /dev/null @@ -1,10 +0,0 @@ -export function validateAlgorithms(option, algorithms) { - if (algorithms !== undefined && - (!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== 'string'))) { - throw new TypeError(`"${option}" option must be an array of strings`); - } - if (!algorithms) { - return undefined; - } - return new Set(algorithms); -} diff --git a/node_modules/jose/dist/webapi/lib/validate_crit.js b/node_modules/jose/dist/webapi/lib/validate_crit.js deleted file mode 100644 index 44e77e3..0000000 --- a/node_modules/jose/dist/webapi/lib/validate_crit.js +++ /dev/null @@ -1,33 +0,0 @@ -import { JOSENotSupported, JWEInvalid, JWSInvalid } from '../util/errors.js'; -export function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) { - if (joseHeader.crit !== undefined && protectedHeader?.crit === undefined) { - throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected'); - } - if (!protectedHeader || protectedHeader.crit === undefined) { - return new Set(); - } - if (!Array.isArray(protectedHeader.crit) || - protectedHeader.crit.length === 0 || - protectedHeader.crit.some((input) => typeof input !== 'string' || input.length === 0)) { - throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present'); - } - let recognized; - if (recognizedOption !== undefined) { - recognized = new Map([...Object.entries(recognizedOption), ...recognizedDefault.entries()]); - } - else { - recognized = recognizedDefault; - } - for (const parameter of protectedHeader.crit) { - if (!recognized.has(parameter)) { - throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`); - } - if (joseHeader[parameter] === undefined) { - throw new Err(`Extension Header Parameter "${parameter}" is missing`); - } - if (recognized.get(parameter) && protectedHeader[parameter] === undefined) { - throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`); - } - } - return new Set(protectedHeader.crit); -} diff --git a/node_modules/jose/dist/webapi/lib/verify.js b/node_modules/jose/dist/webapi/lib/verify.js deleted file mode 100644 index 9470af5..0000000 --- a/node_modules/jose/dist/webapi/lib/verify.js +++ /dev/null @@ -1,14 +0,0 @@ -import { subtleAlgorithm } from './subtle_dsa.js'; -import { checkKeyLength } from './check_key_length.js'; -import { getSigKey } from './get_sign_verify_key.js'; -export async function verify(alg, key, signature, data) { - const cryptoKey = await getSigKey(alg, key, 'verify'); - checkKeyLength(alg, cryptoKey); - const algorithm = subtleAlgorithm(alg, cryptoKey.algorithm); - try { - return await crypto.subtle.verify(algorithm, cryptoKey, signature, data); - } - catch { - return false; - } -} diff --git a/node_modules/jose/dist/webapi/util/base64url.js b/node_modules/jose/dist/webapi/util/base64url.js deleted file mode 100644 index d18f1f5..0000000 --- a/node_modules/jose/dist/webapi/util/base64url.js +++ /dev/null @@ -1,30 +0,0 @@ -import { encoder, decoder } from '../lib/buffer_utils.js'; -import { encodeBase64, decodeBase64 } from '../lib/base64.js'; -export function decode(input) { - if (Uint8Array.fromBase64) { - return Uint8Array.fromBase64(typeof input === 'string' ? input : decoder.decode(input), { - alphabet: 'base64url', - }); - } - let encoded = input; - if (encoded instanceof Uint8Array) { - encoded = decoder.decode(encoded); - } - encoded = encoded.replace(/-/g, '+').replace(/_/g, '/'); - try { - return decodeBase64(encoded); - } - catch { - throw new TypeError('The input to be decoded is not correctly encoded.'); - } -} -export function encode(input) { - let unencoded = input; - if (typeof unencoded === 'string') { - unencoded = encoder.encode(unencoded); - } - if (Uint8Array.prototype.toBase64) { - return unencoded.toBase64({ alphabet: 'base64url', omitPadding: true }); - } - return encodeBase64(unencoded).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); -} diff --git a/node_modules/jose/dist/webapi/util/decode_jwt.js b/node_modules/jose/dist/webapi/util/decode_jwt.js deleted file mode 100644 index 93d84f0..0000000 --- a/node_modules/jose/dist/webapi/util/decode_jwt.js +++ /dev/null @@ -1,32 +0,0 @@ -import { decode as b64u } from './base64url.js'; -import { decoder } from '../lib/buffer_utils.js'; -import { isObject } from '../lib/is_object.js'; -import { JWTInvalid } from './errors.js'; -export function decodeJwt(jwt) { - if (typeof jwt !== 'string') - throw new JWTInvalid('JWTs must use Compact JWS serialization, JWT must be a string'); - const { 1: payload, length } = jwt.split('.'); - if (length === 5) - throw new JWTInvalid('Only JWTs using Compact JWS serialization can be decoded'); - if (length !== 3) - throw new JWTInvalid('Invalid JWT'); - if (!payload) - throw new JWTInvalid('JWTs must contain a payload'); - let decoded; - try { - decoded = b64u(payload); - } - catch { - throw new JWTInvalid('Failed to base64url decode the payload'); - } - let result; - try { - result = JSON.parse(decoder.decode(decoded)); - } - catch { - throw new JWTInvalid('Failed to parse the decoded payload as JSON'); - } - if (!isObject(result)) - throw new JWTInvalid('Invalid JWT Claims Set'); - return result; -} diff --git a/node_modules/jose/dist/webapi/util/decode_protected_header.js b/node_modules/jose/dist/webapi/util/decode_protected_header.js deleted file mode 100644 index a6da5a6..0000000 --- a/node_modules/jose/dist/webapi/util/decode_protected_header.js +++ /dev/null @@ -1,34 +0,0 @@ -import { decode as b64u } from './base64url.js'; -import { decoder } from '../lib/buffer_utils.js'; -import { isObject } from '../lib/is_object.js'; -export function decodeProtectedHeader(token) { - let protectedB64u; - if (typeof token === 'string') { - const parts = token.split('.'); - if (parts.length === 3 || parts.length === 5) { - ; - [protectedB64u] = parts; - } - } - else if (typeof token === 'object' && token) { - if ('protected' in token) { - protectedB64u = token.protected; - } - else { - throw new TypeError('Token does not contain a Protected Header'); - } - } - try { - if (typeof protectedB64u !== 'string' || !protectedB64u) { - throw new Error(); - } - const result = JSON.parse(decoder.decode(b64u(protectedB64u))); - if (!isObject(result)) { - throw new Error(); - } - return result; - } - catch { - throw new TypeError('Invalid Token or Protected Header formatting'); - } -} diff --git a/node_modules/jose/dist/webapi/util/errors.js b/node_modules/jose/dist/webapi/util/errors.js deleted file mode 100644 index 6fa9568..0000000 --- a/node_modules/jose/dist/webapi/util/errors.js +++ /dev/null @@ -1,99 +0,0 @@ -export class JOSEError extends Error { - static code = 'ERR_JOSE_GENERIC'; - code = 'ERR_JOSE_GENERIC'; - constructor(message, options) { - super(message, options); - this.name = this.constructor.name; - Error.captureStackTrace?.(this, this.constructor); - } -} -export class JWTClaimValidationFailed extends JOSEError { - static code = 'ERR_JWT_CLAIM_VALIDATION_FAILED'; - code = 'ERR_JWT_CLAIM_VALIDATION_FAILED'; - claim; - reason; - payload; - constructor(message, payload, claim = 'unspecified', reason = 'unspecified') { - super(message, { cause: { claim, reason, payload } }); - this.claim = claim; - this.reason = reason; - this.payload = payload; - } -} -export class JWTExpired extends JOSEError { - static code = 'ERR_JWT_EXPIRED'; - code = 'ERR_JWT_EXPIRED'; - claim; - reason; - payload; - constructor(message, payload, claim = 'unspecified', reason = 'unspecified') { - super(message, { cause: { claim, reason, payload } }); - this.claim = claim; - this.reason = reason; - this.payload = payload; - } -} -export class JOSEAlgNotAllowed extends JOSEError { - static code = 'ERR_JOSE_ALG_NOT_ALLOWED'; - code = 'ERR_JOSE_ALG_NOT_ALLOWED'; -} -export class JOSENotSupported extends JOSEError { - static code = 'ERR_JOSE_NOT_SUPPORTED'; - code = 'ERR_JOSE_NOT_SUPPORTED'; -} -export class JWEDecryptionFailed extends JOSEError { - static code = 'ERR_JWE_DECRYPTION_FAILED'; - code = 'ERR_JWE_DECRYPTION_FAILED'; - constructor(message = 'decryption operation failed', options) { - super(message, options); - } -} -export class JWEInvalid extends JOSEError { - static code = 'ERR_JWE_INVALID'; - code = 'ERR_JWE_INVALID'; -} -export class JWSInvalid extends JOSEError { - static code = 'ERR_JWS_INVALID'; - code = 'ERR_JWS_INVALID'; -} -export class JWTInvalid extends JOSEError { - static code = 'ERR_JWT_INVALID'; - code = 'ERR_JWT_INVALID'; -} -export class JWKInvalid extends JOSEError { - static code = 'ERR_JWK_INVALID'; - code = 'ERR_JWK_INVALID'; -} -export class JWKSInvalid extends JOSEError { - static code = 'ERR_JWKS_INVALID'; - code = 'ERR_JWKS_INVALID'; -} -export class JWKSNoMatchingKey extends JOSEError { - static code = 'ERR_JWKS_NO_MATCHING_KEY'; - code = 'ERR_JWKS_NO_MATCHING_KEY'; - constructor(message = 'no applicable key found in the JSON Web Key Set', options) { - super(message, options); - } -} -export class JWKSMultipleMatchingKeys extends JOSEError { - [Symbol.asyncIterator]; - static code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; - code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; - constructor(message = 'multiple matching keys found in the JSON Web Key Set', options) { - super(message, options); - } -} -export class JWKSTimeout extends JOSEError { - static code = 'ERR_JWKS_TIMEOUT'; - code = 'ERR_JWKS_TIMEOUT'; - constructor(message = 'request timed out', options) { - super(message, options); - } -} -export class JWSSignatureVerificationFailed extends JOSEError { - static code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; - code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; - constructor(message = 'signature verification failed', options) { - super(message, options); - } -} diff --git a/node_modules/jose/package.json b/node_modules/jose/package.json deleted file mode 100644 index e3ad85d..0000000 --- a/node_modules/jose/package.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "name": "jose", - "version": "6.1.3", - "description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes", - "keywords": [ - "akp", - "browser", - "bun", - "cloudflare", - "compact", - "decode", - "decrypt", - "deno", - "detached", - "ec", - "ecdsa", - "ed25519", - "eddsa", - "edge", - "electron", - "embedded", - "encrypt", - "flattened", - "general", - "jose", - "json web token", - "jsonwebtoken", - "jwa", - "jwe", - "jwk", - "jwks", - "jws", - "jwt-decode", - "jwt", - "ml-dsa", - "netlify", - "next", - "nextjs", - "oct", - "okp", - "payload", - "pem", - "pkcs8", - "rsa", - "sign", - "signature", - "spki", - "validate", - "vercel", - "verify", - "webcrypto", - "workerd", - "workers", - "x509" - ], - "homepage": "https://github.com/panva/jose", - "repository": "panva/jose", - "funding": { - "url": "https://github.com/sponsors/panva" - }, - "license": "MIT", - "author": "Filip Skokan ", - "sideEffects": false, - "type": "module", - "exports": { - ".": { - "types": "./dist/types/index.d.ts", - "default": "./dist/webapi/index.js" - }, - "./jwk/embedded": { - "types": "./dist/types/jwk/embedded.d.ts", - "default": "./dist/webapi/jwk/embedded.js" - }, - "./jwk/thumbprint": { - "types": "./dist/types/jwk/thumbprint.d.ts", - "default": "./dist/webapi/jwk/thumbprint.js" - }, - "./key/import": { - "types": "./dist/types/key/import.d.ts", - "default": "./dist/webapi/key/import.js" - }, - "./key/export": { - "types": "./dist/types/key/export.d.ts", - "default": "./dist/webapi/key/export.js" - }, - "./key/generate/keypair": { - "types": "./dist/types/key/generate_key_pair.d.ts", - "default": "./dist/webapi/key/generate_key_pair.js" - }, - "./key/generate/secret": { - "types": "./dist/types/key/generate_secret.d.ts", - "default": "./dist/webapi/key/generate_secret.js" - }, - "./jwks/remote": { - "types": "./dist/types/jwks/remote.d.ts", - "default": "./dist/webapi/jwks/remote.js" - }, - "./jwks/local": { - "types": "./dist/types/jwks/local.d.ts", - "default": "./dist/webapi/jwks/local.js" - }, - "./jwt/sign": { - "types": "./dist/types/jwt/sign.d.ts", - "default": "./dist/webapi/jwt/sign.js" - }, - "./jwt/verify": { - "types": "./dist/types/jwt/verify.d.ts", - "default": "./dist/webapi/jwt/verify.js" - }, - "./jwt/encrypt": { - "types": "./dist/types/jwt/encrypt.d.ts", - "default": "./dist/webapi/jwt/encrypt.js" - }, - "./jwt/decrypt": { - "types": "./dist/types/jwt/decrypt.d.ts", - "default": "./dist/webapi/jwt/decrypt.js" - }, - "./jwt/unsecured": { - "types": "./dist/types/jwt/unsecured.d.ts", - "default": "./dist/webapi/jwt/unsecured.js" - }, - "./jwt/decode": { - "types": "./dist/types/util/decode_jwt.d.ts", - "default": "./dist/webapi/util/decode_jwt.js" - }, - "./decode/protected_header": { - "types": "./dist/types/util/decode_protected_header.d.ts", - "default": "./dist/webapi/util/decode_protected_header.js" - }, - "./jws/compact/sign": { - "types": "./dist/types/jws/compact/sign.d.ts", - "default": "./dist/webapi/jws/compact/sign.js" - }, - "./jws/compact/verify": { - "types": "./dist/types/jws/compact/verify.d.ts", - "default": "./dist/webapi/jws/compact/verify.js" - }, - "./jws/flattened/sign": { - "types": "./dist/types/jws/flattened/sign.d.ts", - "default": "./dist/webapi/jws/flattened/sign.js" - }, - "./jws/flattened/verify": { - "types": "./dist/types/jws/flattened/verify.d.ts", - "default": "./dist/webapi/jws/flattened/verify.js" - }, - "./jws/general/sign": { - "types": "./dist/types/jws/general/sign.d.ts", - "default": "./dist/webapi/jws/general/sign.js" - }, - "./jws/general/verify": { - "types": "./dist/types/jws/general/verify.d.ts", - "default": "./dist/webapi/jws/general/verify.js" - }, - "./jwe/compact/encrypt": { - "types": "./dist/types/jwe/compact/encrypt.d.ts", - "default": "./dist/webapi/jwe/compact/encrypt.js" - }, - "./jwe/compact/decrypt": { - "types": "./dist/types/jwe/compact/decrypt.d.ts", - "default": "./dist/webapi/jwe/compact/decrypt.js" - }, - "./jwe/flattened/encrypt": { - "types": "./dist/types/jwe/flattened/encrypt.d.ts", - "default": "./dist/webapi/jwe/flattened/encrypt.js" - }, - "./jwe/flattened/decrypt": { - "types": "./dist/types/jwe/flattened/decrypt.d.ts", - "default": "./dist/webapi/jwe/flattened/decrypt.js" - }, - "./jwe/general/encrypt": { - "types": "./dist/types/jwe/general/encrypt.d.ts", - "default": "./dist/webapi/jwe/general/encrypt.js" - }, - "./jwe/general/decrypt": { - "types": "./dist/types/jwe/general/decrypt.d.ts", - "default": "./dist/webapi/jwe/general/decrypt.js" - }, - "./errors": { - "types": "./dist/types/util/errors.d.ts", - "default": "./dist/webapi/util/errors.js" - }, - "./base64url": { - "types": "./dist/types/util/base64url.d.ts", - "default": "./dist/webapi/util/base64url.js" - }, - "./package.json": "./package.json" - }, - "main": "./dist/webapi/index.js", - "types": "./dist/types/index.d.ts", - "files": [ - "dist/webapi/**/*.js", - "dist/types/**/*.d.ts", - "!dist/**/*.bundle.js", - "!dist/**/*.umd.js", - "!dist/**/*.min.js", - "!dist/types/runtime/*", - "!dist/types/lib/*", - "!dist/deno/**/*" - ] -} diff --git a/node_modules/json-schema-traverse/.eslintrc.yml b/node_modules/json-schema-traverse/.eslintrc.yml deleted file mode 100644 index 618559a..0000000 --- a/node_modules/json-schema-traverse/.eslintrc.yml +++ /dev/null @@ -1,27 +0,0 @@ -extends: eslint:recommended -env: - node: true - browser: true -rules: - block-scoped-var: 2 - complexity: [2, 15] - curly: [2, multi-or-nest, consistent] - dot-location: [2, property] - dot-notation: 2 - indent: [2, 2, SwitchCase: 1] - linebreak-style: [2, unix] - new-cap: 2 - no-console: [2, allow: [warn, error]] - no-else-return: 2 - no-eq-null: 2 - no-fallthrough: 2 - no-invalid-this: 2 - no-return-assign: 2 - no-shadow: 1 - no-trailing-spaces: 2 - no-use-before-define: [2, nofunc] - quotes: [2, single, avoid-escape] - semi: [2, always] - strict: [2, global] - valid-jsdoc: [2, requireReturn: false] - no-control-regex: 0 diff --git a/node_modules/json-schema-traverse/.github/FUNDING.yml b/node_modules/json-schema-traverse/.github/FUNDING.yml deleted file mode 100644 index 44f80f4..0000000 --- a/node_modules/json-schema-traverse/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: epoberezkin -tidelift: "npm/json-schema-traverse" diff --git a/node_modules/json-schema-traverse/.github/workflows/build.yml b/node_modules/json-schema-traverse/.github/workflows/build.yml deleted file mode 100644 index f8ef5ba..0000000 --- a/node_modules/json-schema-traverse/.github/workflows/build.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: build - -on: - push: - branches: [master] - pull_request: - branches: ["*"] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [10.x, 12.x, 14.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm test - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/json-schema-traverse/.github/workflows/publish.yml b/node_modules/json-schema-traverse/.github/workflows/publish.yml deleted file mode 100644 index 924825b..0000000 --- a/node_modules/json-schema-traverse/.github/workflows/publish.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: publish - -on: - release: - types: [published] - -jobs: - publish-npm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 14 - registry-url: https://registry.npmjs.org/ - - run: npm install - - run: npm test - - name: Publish beta version to npm - if: "github.event.release.prerelease" - run: npm publish --tag beta - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Publish to npm - if: "!github.event.release.prerelease" - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/node_modules/json-schema-traverse/LICENSE b/node_modules/json-schema-traverse/LICENSE deleted file mode 100644 index 7f15435..0000000 --- a/node_modules/json-schema-traverse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Evgeny Poberezkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/json-schema-traverse/README.md b/node_modules/json-schema-traverse/README.md deleted file mode 100644 index f3e6007..0000000 --- a/node_modules/json-schema-traverse/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# json-schema-traverse -Traverse JSON Schema passing each schema object to callback - -[![build](https://github.com/epoberezkin/json-schema-traverse/workflows/build/badge.svg)](https://github.com/epoberezkin/json-schema-traverse/actions?query=workflow%3Abuild) -[![npm](https://img.shields.io/npm/v/json-schema-traverse)](https://www.npmjs.com/package/json-schema-traverse) -[![coverage](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) - - -## Install - -``` -npm install json-schema-traverse -``` - - -## Usage - -```javascript -const traverse = require('json-schema-traverse'); -const schema = { - properties: { - foo: {type: 'string'}, - bar: {type: 'integer'} - } -}; - -traverse(schema, {cb}); -// cb is called 3 times with: -// 1. root schema -// 2. {type: 'string'} -// 3. {type: 'integer'} - -// Or: - -traverse(schema, {cb: {pre, post}}); -// pre is called 3 times with: -// 1. root schema -// 2. {type: 'string'} -// 3. {type: 'integer'} -// -// post is called 3 times with: -// 1. {type: 'string'} -// 2. {type: 'integer'} -// 3. root schema - -``` - -Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. - -Callback is passed these parameters: - -- _schema_: the current schema object -- _JSON pointer_: from the root schema to the current schema object -- _root schema_: the schema passed to `traverse` object -- _parent JSON pointer_: from the root schema to the parent schema object (see below) -- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) -- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema -- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` - - -## Traverse objects in all unknown keywords - -```javascript -const traverse = require('json-schema-traverse'); -const schema = { - mySchema: { - minimum: 1, - maximum: 2 - } -}; - -traverse(schema, {allKeys: true, cb}); -// cb is called 2 times with: -// 1. root schema -// 2. mySchema -``` - -Without option `allKeys: true` callback will be called only with root schema. - - -## Enterprise support - -json-schema-traverse package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-json-schema-traverse?utm_source=npm-json-schema-traverse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. - - -## Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. - - -## License - -[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) diff --git a/node_modules/json-schema-traverse/index.d.ts b/node_modules/json-schema-traverse/index.d.ts deleted file mode 100644 index 0772dae..0000000 --- a/node_modules/json-schema-traverse/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -declare function traverse( - schema: traverse.SchemaObject, - opts: traverse.Options, - cb?: traverse.Callback -): void; - -declare function traverse( - schema: traverse.SchemaObject, - cb: traverse.Callback -): void; - -declare namespace traverse { - interface SchemaObject { - $id?: string; - $schema?: string; - [x: string]: any; - } - - type Callback = ( - schema: SchemaObject, - jsonPtr: string, - rootSchema: SchemaObject, - parentJsonPtr?: string, - parentKeyword?: string, - parentSchema?: SchemaObject, - keyIndex?: string | number - ) => void; - - interface Options { - allKeys?: boolean; - cb?: - | Callback - | { - pre?: Callback; - post?: Callback; - }; - } -} - -export = traverse; diff --git a/node_modules/json-schema-traverse/index.js b/node_modules/json-schema-traverse/index.js deleted file mode 100644 index e521bfa..0000000 --- a/node_modules/json-schema-traverse/index.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -var traverse = module.exports = function (schema, opts, cb) { - // Legacy support for v0.3.1 and earlier. - if (typeof opts == 'function') { - cb = opts; - opts = {}; - } - - cb = opts.cb || cb; - var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; - var post = cb.post || function() {}; - - _traverse(opts, pre, post, schema, '', schema); -}; - - -traverse.keywords = { - additionalItems: true, - items: true, - contains: true, - additionalProperties: true, - propertyNames: true, - not: true, - if: true, - then: true, - else: true -}; - -traverse.arrayKeywords = { - items: true, - allOf: true, - anyOf: true, - oneOf: true -}; - -traverse.propsKeywords = { - $defs: true, - definitions: true, - properties: true, - patternProperties: true, - dependencies: true -}; - -traverse.skipKeywords = { - default: true, - enum: true, - const: true, - required: true, - maximum: true, - minimum: true, - exclusiveMaximum: true, - exclusiveMinimum: true, - multipleOf: true, - maxLength: true, - minLength: true, - pattern: true, - format: true, - maxItems: true, - minItems: true, - uniqueItems: true, - maxProperties: true, - minProperties: true -}; - - -function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { - if (schema && typeof schema == 'object' && !Array.isArray(schema)) { - pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); - for (var key in schema) { - var sch = schema[key]; - if (Array.isArray(sch)) { - if (key in traverse.arrayKeywords) { - for (var i=0; i - -All JSON Schema documentation and descriptions are copyright (c): - -2009 [draft-0] IETF Trust , Kris Zyp , -and SitePen (USA) . - -2009 [draft-1] IETF Trust , Kris Zyp , -and SitePen (USA) . - -2010 [draft-2] IETF Trust , Kris Zyp , -and SitePen (USA) . - -2010 [draft-3] IETF Trust , Kris Zyp , -Gary Court , and SitePen (USA) . - -2013 [draft-4] IETF Trust ), Francis Galiegue -, Kris Zyp , Gary Court -, and SitePen (USA) . - -2018 [draft-7] IETF Trust , Austin Wright , -Henry Andrews , Geraint Luff , and -Cloudflare, Inc. . - -2019 [draft-2019-09] IETF Trust , Austin Wright -, Henry Andrews , Ben Hutton -, and Greg Dennis . - -2020 [draft-2020-12] IETF Trust , Austin Wright -, Henry Andrews , Ben Hutton -, and Greg Dennis . - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/json-schema-typed/README.md b/node_modules/json-schema-typed/README.md deleted file mode 100644 index 790f53d..0000000 --- a/node_modules/json-schema-typed/README.md +++ /dev/null @@ -1,108 +0,0 @@ -[![npm](https://img.shields.io/npm/v/json-schema-typed.svg?style=flat-square)](https://npmjs.org/package/json-schema-typed) -[![downloads-per-month](https://img.shields.io/npm/dm/json-schema-typed.svg?style=flat-square&label=npm%20downloads)](https://npmjs.org/package/json-schema-typed) -[![License](https://img.shields.io/badge/license-BSD--2--Clause-blue.svg?style=flat-square)][license] - -# JSON Schema Typed - -JSON Schema TypeScript definitions with complete inline documentation. - -**NOTE:** This library only supports defining schemas. You will need a separate -library for data validation. - -There are 3 JSON Schema drafts included in this package: - -- `draft-07` -- `draft-2019-09` -- `draft-2020-12` - -## Install - -```sh -npm install json-schema-typed -``` - -## Usage - -1. Chose which draft you'd like to import. - -- The main package export points to the latest supported stable draft, currently - `draft-2020-12`. Future releases that point the main package export to a new - draft will always incur a bump to the major semantic version. - - ```ts - import { type JSONSchema } from "json-schema-typed"; - ``` - -- Or you can specify the exact draft you need. - ```ts - import { type JSONSchema } from "json-schema-typed/draft-2020-12"; - ``` - -2. Define a schema - - ```ts - import { Format, type JSONSchema } from "json-schema-typed"; - - const schema: JSONSchema = { - properties: { - email: { - format: Format.Email, - type: "string", - }, - }, - type: "object", - }; - - // The JSONSchema namespace also provides type-specific narrowed interfaces - const stringSchema: JSONSchema.String = { - // Only { type: "string" } and common keywords are allowed - maxLength: 100, - type: "string", - }; - ``` - -## Upgrading - -Version `8.0.0` has breaking changes from the previous release. - -- Now a - [pure ESM package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). -- Many exports were renamed. The table below reflects the new export names. - These are considered final and unlikely to change in future releases. -- The `JSONSchema` type was changed from an `interface` to a `type` which is a - mixed union that allows `boolean` values in order to properly align with the - JSON Schema spec. If you were previously extending the `JSONSchema` interface, - you can access the `interface` directly with `JSONSchema.Interface`. -- The previous main package export pointed to Draft 7. Import it directly if you - need to continue using it: - ```ts - import { type JSONSchema } from "json-schema-typed/draft-07"; - ``` - -## Exports supported in each draft module - -| Name | Type | Purpose | -| ----------------- | --------------- | ------------------------------------------------------------------ | -| `$schema` | `string` | Draft meta schema URL that can be used with the `$schema` keyword. | -| `ContentEncoding` | Enum object | String content encoding strategies. | -| `draft` | `string` | Draft version. | -| `Format` | Enum object | String formats. | -| `JSONSchema` | TypeScript Type | Used to define a JSON Schema. | -| `keywords` | `string[]` | All the keywords for the imported draft. | -| `TypeName` | Enum object | Simple type names for the `type` keyword. | - -## Versioning - -This library follows [semantic versioning](https://semver.org). - ---- - -## Maintainers - -- [Remy Rylan](https://github.com/RemyRylan) - -## License - -[BSD-2-Clause][license] - -[license]: https://github.com/RemyRylan/json-schema-typed/blob/main/dist/node/LICENSE.md diff --git a/node_modules/json-schema-typed/draft_07.d.ts b/node_modules/json-schema-typed/draft_07.d.ts deleted file mode 100644 index afe455b..0000000 --- a/node_modules/json-schema-typed/draft_07.d.ts +++ /dev/null @@ -1,882 +0,0 @@ -export declare const draft: "7"; -export declare const $schema: "https://json-schema.org/draft-07/schema"; -type MaybeReadonlyArray = Array | ReadonlyArray; -type ValueOf = T[keyof T]; -/** - * JSON Schema [Draft 7](https://json-schema.org/draft-07/json-schema-validation.html) - */ -export type JSONSchema ? "object" : JSONSchema.TypeValue> = boolean | { - /** - * This keyword is reserved for comments from schema authors to readers or - * maintainers of the schema. The value of this keyword MUST be a string. - * Implementations MUST NOT present this string to end users. Tools for - * editing schemas SHOULD support displaying and editing this keyword. - * - * The value of this keyword MAY be used in debug or error output which is - * intended for developers making use of schemas. Schema vocabularies - * SHOULD allow `comment` within any object containing vocabulary - * keywords. - * - * Implementations MAY assume `comment` is allowed unless the vocabulary - * specifically forbids it. Vocabularies MUST NOT specify any effect of - * `comment` beyond what is described in this specification. Tools that - * translate other media types or programming languages to and from - * `application/schema+json` MAY choose to convert that media type or - * programming language's native comments to or from `comment` values. - * - * The behavior of such translation when both native comments and - * `comment` properties are present is implementation-dependent. - * Implementations SHOULD treat `comment` identically to an unknown - * extension keyword. - * - * They MAY strip `comment` values at any point during processing. In - * particular, this allows for shortening schemas when the size of deployed - * schemas is a concern. Implementations MUST NOT take any other action - * based on the presence, absence, or contents of `comment` properties. - */ - $comment?: string; - /** - * The `$id` keyword defines a URI for the schema, and the base URI that - * other URI references within the schema are resolved against. A - * subschema's `$id` is resolved against the base URI of its parent - * schema. If no parent sets an explicit base with `$id`, the base URI is - * that of the entire document, as determined per - * [RFC 3986 section 5][RFC3986]. - * - * If present, the value for this keyword MUST be a string, and MUST - * represent a valid [URI-reference][RFC3986]. This value SHOULD be - * normalized, and SHOULD NOT be an empty fragment `#` or an empty string. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - * - * @format "uri-reference" - */ - $id?: string; - /** - * The `$ref` keyword is used to reference a schema, and provides the - * ability to validate recursive structures through self-reference. - * - * An object schema with a `$ref` property MUST be interpreted as a - * `$ref` reference. The value of the `$ref` property MUST be a URI - * Reference. Resolved against the current URI base, it identifies the URI - * of a schema to use. All other properties in a `$ref` object MUST be - * ignored. - * - * The URI is not a network locator, only an identifier. A schema need not - * be downloadable from the address if it is a network-addressable URL, and - * implementations SHOULD NOT assume they should perform a network - * operation when they encounter a network-addressable URI. - * - * A schema MUST NOT be run into an infinite loop against a schema. For - * example, if two schemas `"#alice"` and `"#bob"` both have an - * `allOf` property that refers to the other, a naive validator might get - * stuck in an infinite recursive loop trying to validate the instance. - * Schemas SHOULD NOT make use of infinite recursive nesting like this; the - * behavior is undefined. - * - * @format "uri-reference" - */ - $ref?: string; - /** - * The `$schema` keyword is both used as a JSON Schema version identifier - * and the location of a resource which is itself a JSON Schema, which - * describes any schema written for this particular version. - * - * The value of this keyword MUST be a [URI][RFC3986] (containing a scheme) - * and this URI MUST be normalized. The current schema MUST be valid - * against the meta-schema identified by this URI. - * - * If this URI identifies a retrievable resource, that resource SHOULD be - * of media type `application/schema+json`. - * - * The `$schema` keyword SHOULD be used in a root schema. It MUST NOT - * appear in subschemas. - * - * Values for this property are defined in other documents and by other - * parties. JSON Schema implementations SHOULD implement support for - * current and previous published drafts of JSON Schema vocabularies as - * deemed reasonable. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - * - * @format "uri" - */ - $schema?: string; - /** - * The value of `additionalItems` MUST be a valid JSON Schema. - * - * This keyword determines how child instances validate for arrays, and - * does not directly validate the immediate instance itself. - * - * If `items` is an array of schemas, validation succeeds if every - * instance element at a position greater than the size of `items` - * validates against `additionalItems`. - * - * Otherwise, `additionalItems` MUST be ignored, as the `items` schema - * (possibly the default value of an empty schema) is applied to all - * elements. - * - * Omitting this keyword has the same behavior as an empty schema. - */ - additionalItems?: JSONSchema; - /** - * The value of `additionalProperties` MUST be a valid JSON Schema. - * - * This keyword determines how child instances validate for objects, and - * does not directly validate the immediate instance itself. - * - * Validation with `additionalProperties` applies only to the child - * values of instance names that do not match any names in `properties`, - * and do not match any regular expression in `patternProperties`. - * - * For all such properties, validation succeeds if the child instance - * validates against the `additionalProperties` schema. - * - * Omitting this keyword has the same behavior as an empty schema. - */ - additionalProperties?: JSONSchema; - /** - * This keyword's value MUST be a non-empty array. Each item of the array - * MUST be a valid JSON Schema. - * - * An instance validates successfully against this keyword if it validates - * successfully against all schemas defined by this keyword's value. - */ - allOf?: MaybeReadonlyArray>; - /** - * This keyword's value MUST be a non-empty array. Each item of the array - * MUST be a valid JSON Schema. - * - * An instance validates successfully against this keyword if it validates - * successfully against at least one schema defined by this keyword's - * value. - */ - anyOf?: MaybeReadonlyArray>; - /** - * An instance validates successfully against this keyword if its value is - * equal to the value of the keyword. - * - * Use of this keyword is functionally equivalent to the `enum` keyword - * with a single value. - */ - const?: Value; - /** - * The value of this keyword MUST be a valid JSON Schema. - * - * An array instance is valid against `contains` if at least one of its - * elements is valid against the given schema. - */ - contains?: JSONSchema; - /** - * If the instance value is a string, this property defines that the - * string SHOULD be interpreted as binary data and decoded using the - * encoding named by this property. [RFC 2045, Sec 6.1][RFC2045] lists the - * possible values for this property. - * - * The value of this property SHOULD be ignored if the instance described - * is not a string. - * - * [RFC2045]: https://datatracker.ietf.org/doc/html/rfc2045#section-6.1 - */ - contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token"; - /** - * The value of this property must be a media type, as defined by - * [RFC 2046][RFC2046]. This property defines the media type of instances - * which this schema defines. - * - * The value of this property SHOULD be ignored if the instance described - * is not a string. - * - * If the `contentEncoding` property is not present, but the instance - * value is a string, then the value of this property SHOULD specify a text - * document type, and the character set SHOULD be the character set into - * which the JSON string value was decoded (for which the default is - * Unicode). - * - * [RFC2046]: https://datatracker.ietf.org/doc/html/rfc2046 - */ - contentMediaType?: string; - /** - * This keyword can be used to supply a default JSON value associated with - * a particular schema. It is RECOMMENDED that a `default` value be valid - * against the associated schema. - */ - default?: Value; - /** - * The `definitions` keywords provides a standardized location for schema - * authors to inline re-usable JSON Schemas into a more general schema. The - * keyword does not directly affect the validation result. - * - * This keyword's value MUST be an object. Each member value of this object - * MUST be a valid JSON Schema. - */ - definitions?: Record; - /** - * This keyword specifies rules that are evaluated if the instance is an - * object and contains a certain property. - * - * This keyword's value MUST be an object. Each property specifies a - * dependency. Each dependency value MUST be an array or a valid JSON - * Schema. - * - * If the dependency value is a subschema, and the dependency key is a - * property in the instance, the entire instance must validate against the - * dependency value. - * - * If the dependency value is an array, each element in the array, if any, - * MUST be a string, and MUST be unique. If the dependency key is a - * property in the instance, each of the items in the dependency value must - * be a property that exists in the instance. - * - * Omitting this keyword has the same behavior as an empty object. - */ - dependencies?: Record | JSONSchema>; - /** - * Can be used to decorate a user interface with explanation or information - * about the data produced. - */ - description?: string; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * When `if` is present, and the instance fails to validate against its - * subschema, then validation succeeds against this keyword if the instance - * successfully validates against this keyword's subschema. - * - * This keyword has no effect when `if` is absent, or when the instance - * successfully validates against its subschema. Implementations MUST NOT - * evaluate the instance against this keyword, for either validation or - * annotation collection purposes, in such cases. - */ - else?: JSONSchema; - /** - * The value of this keyword MUST be an array. This array SHOULD have at - * least one element. Elements in the array SHOULD be unique. - * - * An instance validates successfully against this keyword if its value is - * equal to one of the elements in this keyword's array value. - * - * Elements in the array might be of any type, including `null`. - */ - enum?: MaybeReadonlyArray; - /** - * The value of this keyword MUST be an array. When multiple occurrences of - * this keyword are applicable to a single sub-instance, implementations - * MUST provide a flat array of all values rather than an array of arrays. - * - * This keyword can be used to provide sample JSON values associated with a - * particular schema, for the purpose of illustrating usage. It is - * RECOMMENDED that these values be valid against the associated schema. - * - * Implementations MAY use the value(s) of `default`, if present, as an - * additional example. If `examples` is absent, `default` MAY still be - * used in this manner. - */ - examples?: MaybeReadonlyArray; - /** - * The value of `exclusiveMaximum` MUST be a number, representing an - * exclusive upper limit for a numeric instance. - * - * If the instance is a number, then the instance is valid only if it has a - * value strictly less than (not equal to) `exclusiveMaximum`. - */ - exclusiveMaximum?: number; - /** - * The value of `exclusiveMinimum` MUST be a number, representing an - * exclusive lower limit for a numeric instance. - * - * If the instance is a number, then the instance is valid only if it has a - * value strictly greater than (not equal to) `exclusiveMinimum`. - */ - exclusiveMinimum?: number; - /** - * The `format` keyword functions as both an [annotation][annotation] and - * as an [assertion][assertion]. While no special effort is required to - * implement it as an annotation conveying semantic meaning, implementing - * validation is non-trivial. - * - * Implementations MAY support the `format` keyword as a validation - * assertion. - * - * Implementations MAY add custom `format` attributes. Save for agreement - * between parties, schema authors SHALL NOT expect a peer implementation - * to support this keyword and/or custom `format` attributes. - * - * [annotation]: https://json-schema.org/draft-07/json-schema-validation.html#annotations - * [assertion]: https://json-schema.org/draft-07/json-schema-validation.html#assertions - */ - format?: string; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * This validation outcome of this keyword's subschema has no direct effect - * on the overall validation result. Rather, it controls which of the - * `then` or `else` keywords are evaluated. - * - * Instances that successfully validate against this keyword's subschema - * MUST also be valid against the subschema value of the `then` keyword, - * if present. - * - * Instances that fail to validate against this keyword's subschema MUST - * also be valid against the subschema value of the `else` keyword, if - * present. - * - * If [annotations][annotations] are being collected, they are collected - * from this keyword's subschema in the usual way, including when the - * keyword is present without either `then` or `else`. - * - * [annotations]: https://json-schema.org/draft-07/json-schema-validation.html#annotations - */ - if?: JSONSchema; - /** - * The value of `items` MUST be either a valid JSON Schema or an array of - * valid JSON Schemas. - * - * This keyword determines how child instances validate for arrays, and - * does not directly validate the immediate instance itself. - * - * If `items` is a schema, validation succeeds if all elements in the - * array successfully validate against that schema. - * - * If `items` is an array of schemas, validation succeeds if each element - * of the instance validates against the schema at the same position, if - * any. - * - * Omitting this keyword has the same behavior as an empty schema. - */ - items?: MaybeReadonlyArray | JSONSchema; - /** - * The value of `maximum` MUST be a number, representing an inclusive - * upper limit for a numeric instance. - * - * If the instance is a number, then this keyword validates only if the - * instance is less than or exactly equal to `maximum`. - */ - maximum?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An array instance is valid against `maxItems` if its size is less - * than, or equal to, the value of this keyword. - * - * @minimum 0 - */ - maxItems?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * A string instance is valid against this keyword if its length is less - * than, or equal to, the value of this keyword. - * - * The length of a string instance is defined as the number of its - * characters as defined by [RFC 7159][RFC7159]. - * - * [RFC7159]: https://datatracker.ietf.org/doc/html/rfc7159 - * - * @minimum 0 - */ - maxLength?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An object instance is valid against `maxProperties` if its number of - * `properties` is less than, or equal to, the value of this keyword. - * - * @minimum 0 - */ - maxProperties?: number; - /** - * The value of `minimum` MUST be a number, representing an inclusive - * lower limit for a numeric instance. - * - * If the instance is a number, then this keyword validates only if the - * instance is greater than or exactly equal to `minimum`. - */ - minimum?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An array instance is valid against `minItems` if its size is greater - * than, or equal to, the value of this keyword. - * - * Omitting this keyword has the same behavior as a value of `0`. - * - * @default 0 - * @minimum 0 - */ - minItems?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * A string instance is valid against this keyword if its length is greater - * than, or equal to, the value of this keyword. - * - * The length of a string instance is defined as the number of its - * characters as defined by [RFC 7159][RFC7159]. - * - * Omitting this keyword has the same behavior as a value of `0`. - * - * [RFC7159]: https://datatracker.ietf.org/doc/html/rfc7159 - * - * @default 0 - * @minimum 0 - */ - minLength?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An object instance is valid against `minProperties` if its number of - * `properties` is greater than, or equal to, the value of this keyword. - * - * Omitting this keyword has the same behavior as a value of `0`. - * - * @default 0 - * @minimum 0 - */ - minProperties?: number; - /** - * The value of `multipleOf` MUST be a number, strictly greater than - * `0`. - * - * A numeric instance is valid only if division by this keyword's value - * results in an integer. - * - * @exclusiveMinimum 0 - */ - multipleOf?: number; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * An instance is valid against this keyword if it fails to validate - * successfully against the schema defined by this keyword. - */ - not?: JSONSchema; - /** - * This keyword's value MUST be a non-empty array. Each item of the array - * MUST be a valid JSON Schema. - * - * An instance validates successfully against this keyword if it validates - * successfully against exactly one schema defined by this keyword's value. - */ - oneOf?: MaybeReadonlyArray>; - /** - * The value of this keyword MUST be a string. This string SHOULD be a - * valid regular expression, according to the [ECMA-262][ecma262] regular - * expression dialect. - * - * A string instance is considered valid if the regular expression matches - * the instance successfully. Recall: regular expressions are not - * implicitly anchored. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - * - * @format "regex" - */ - pattern?: string; - /** - * The value of `patternProperties` MUST be an object. Each property name - * of this object SHOULD be a valid regular expression, according to the - * [ECMA-262][ecma262] regular expression dialect. Each property value of - * this object MUST be a valid JSON Schema. - * - * This keyword determines how child instances validate for objects, and - * does not directly validate the immediate instance itself. Validation of - * the primitive instance type against this keyword always succeeds. - * - * Validation succeeds if, for each instance name that matches any regular - * expressions that appear as a property name in this keyword's value, the - * child instance for that name successfully validates against each schema - * that corresponds to a matching regular expression. - * - * Omitting this keyword has the same behavior as an empty object. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - */ - patternProperties?: Record; - /** - * The value of `properties` MUST be an object. Each value of this object - * MUST be a valid JSON Schema. - * - * This keyword determines how child instances validate for objects, and - * does not directly validate the immediate instance itself. - * - * Validation succeeds if, for each name that appears in both the instance - * and as a name within this keyword's value, the child instance for that - * name successfully validates against the corresponding schema. - * - * Omitting this keyword has the same behavior as an empty object. - */ - properties?: Record; - /** - * The value of `propertyNames` MUST be a valid JSON Schema. - * - * If the instance is an object, this keyword validates if every property - * name in the instance validates against the provided schema. Note the - * property name that the schema is testing will always be a string. - * - * Omitting this keyword has the same behavior as an empty schema. - */ - propertyNames?: JSONSchema; - /** - * The value of this keyword MUST be a boolean. When multiple occurrences - * of this keyword are applicable to a single sub-instance, the resulting - * value MUST be `true` if any occurrence specifies a `true` value, and - * MUST be `false` otherwise. - * - * If `readOnly` has a value of boolean `true`, it indicates that the - * value of the instance is managed exclusively by the owning authority, - * and attempts by an application to modify the value of this property are - * expected to be ignored or rejected by that owning authority. - * - * An instance document that is marked as `readOnly` for the entire - * document MAY be ignored if sent to the owning authority, or MAY result - * in an error, at the authority's discretion. - * - * For example, `readOnly` would be used to mark a database-generated - * serial number as read-only. - * - * This keyword can be used to assist in user interface instance - * generation. - * - * @default false - */ - readOnly?: boolean; - /** - * The value of this keyword MUST be an array. Elements of this array, if - * any, MUST be strings, and MUST be unique. - * - * An object instance is valid against this keyword if every item in the - * array is the name of a property in the instance. - * - * Omitting this keyword has the same behavior as an empty array. - */ - required?: MaybeReadonlyArray; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * When `if` is present, and the instance successfully validates against - * its subschema, then validation succeeds against this keyword if the - * instance also successfully validates against this keyword's subschema. - * - * This keyword has no effect when `if` is absent, or when the instance - * fails to validate against its subschema. Implementations MUST NOT - * evaluate the instance against this keyword, for either validation or - * annotation collection purposes, in such cases. - */ - then?: JSONSchema; - /** - * Can be used to decorate a user interface with a short label about the - * data produced. - */ - title?: string; - /** - * The value of this keyword MUST be either a string or an array. If it is - * an array, elements of the array MUST be strings and MUST be unique. - * - * String values MUST be one of the six primitive types (`"null"`, - * `"boolean"`, `"object"`, `"array"`, `"number"`, or - * `"string"`), or `"integer"` which matches any number with a zero - * fractional part. - * - * An instance validates if and only if the instance is in any of the sets - * listed for this keyword. - */ - type?: SchemaType; - /** - * The value of this keyword MUST be a boolean. - * - * If this keyword has boolean value `false`, the instance validates - * successfully. If it has boolean value `true`, the instance validates - * successfully if all of its elements are unique. - * - * Omitting this keyword has the same behavior as a value of `false`. - * - * @default false - */ - uniqueItems?: boolean; - /** - * The value of this keyword MUST be a boolean. When multiple occurrences - * of this keyword is applicable to a single sub-instance, the resulting - * value MUST be `true` if any occurrence specifies a `true` value, and - * MUST be `false` otherwise. - * - * If `writeOnly` has a value of boolean `true`, it indicates that the - * value is never present when the instance is retrieved from the owning - * authority. It can be present when sent to the owning authority to update - * or create the document (or the resource it represents), but it will not - * be included in any updated or newly created version of the instance. - * - * An instance document that is marked as `writeOnly` for the entire - * document MAY be returned as a blank document of some sort, or MAY - * produce an error upon retrieval, or have the retrieval request ignored, - * at the authority's discretion. - * - * For example, `writeOnly` would be used to mark a password input field. - * - * These keywords can be used to assist in user interface instance - * generation. In particular, an application MAY choose to use a widget - * that hides input values as they are typed for write-only fields. - * - * @default false - */ - writeOnly?: boolean; -}; -export declare namespace JSONSchema { - type TypeValue = ValueOf | TypeName | Array | TypeName> | ReadonlyArray | TypeName>; - /** - * JSON Schema interface - */ - type Interface = Exclude, boolean>; - type Array = Pick, KeywordByType.Any | KeywordByType.Array>; - type Boolean = Pick, KeywordByType.Any>; - type Integer = Pick, KeywordByType.Any | KeywordByType.Number>; - type Number = Pick, KeywordByType.Any | KeywordByType.Number>; - type Null = Pick, KeywordByType.Any>; - type Object = Pick, KeywordByType.Any | KeywordByType.Object>; - type String = Pick, KeywordByType.Any | KeywordByType.String>; -} -declare namespace KeywordByType { - type Any = "$comment" | "$id" | "$ref" | "$schema" | "allOf" | "anyOf" | "const" | "default" | "definitions" | "description" | "else" | "enum" | "examples" | "if" | "not" | "oneOf" | "readOnly" | "then" | "title" | "type" | "writeOnly"; - type Array = "additionalItems" | "contains" | "items" | "maxItems" | "minItems" | "uniqueItems"; - type Number = "exclusiveMaximum" | "exclusiveMinimum" | "maximum" | "minimum" | "multipleOf"; - type Object = "additionalProperties" | "dependencies" | "maxProperties" | "minProperties" | "patternProperties" | "properties" | "propertyNames" | "required"; - type String = "contentEncoding" | "contentMediaType" | "format" | "maxLength" | "minLength" | "pattern"; -} -/** - * Content encoding strategy enum. - * - * - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1) - * - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705) - */ -export declare enum ContentEncoding { - /** - * Only US-ASCII characters, which use the lower 7 bits for each character. - * - * Each line must be less than 1,000 characters. - */ - "7bit" = "7bit", - /** - * Allow extended ASCII characters which can use the 8th (highest) bit to - * indicate special characters not available in 7bit. - * - * Each line must be less than 1,000 characters. - */ - "8bit" = "8bit", - /** - * Useful for data that is mostly non-text. - */ - Base64 = "base64", - /** - * Same character set as 8bit, with no line length restriction. - */ - Binary = "binary", - /** - * An extension token defined by a standards-track RFC and registered with - * IANA. - */ - IETFToken = "ietf-token", - /** - * Lines are limited to 76 characters, and line breaks are represented using - * special characters that are escaped. - */ - QuotedPrintable = "quoted-printable", - /** - * The two characters "X-" or "x-" followed, with no intervening white space, - * by any token. - */ - XToken = "x-token" -} -/** - * This enum provides well-known formats that apply to strings. - */ -export declare enum Format { - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "full-date" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Date = "date", - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "date-time" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - DateTime = "date-time", - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by [RFC 5322, section 3.4.1][RFC5322]. - * - * [RFC5322]: https://datatracker.ietf.org/doc/html/rfc5322 - */ - Email = "email", - /** - * As defined by [RFC 1034, section 3.1][RFC1034], including host names - * produced using the Punycode algorithm specified in - * [RFC 5891, section 4.4][RFC5891]. - * - * [RFC1034]: https://datatracker.ietf.org/doc/html/rfc1034 - * [RFC5891]: https://datatracker.ietf.org/doc/html/rfc5891 - */ - Hostname = "hostname", - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by [RFC 6531][RFC6531]. - * - * [RFC6531]: https://datatracker.ietf.org/doc/html/rfc6531 - */ - IDNEmail = "idn-email", - /** - * As defined by either [RFC 1034, section 3.1][RFC1034] as for hostname, or - * an internationalized hostname as defined by - * [RFC 5890, section 2.3.2.3][RFC5890]. - * - * [RFC1034]: https://datatracker.ietf.org/doc/html/rfc1034 - * [RFC5890]: https://datatracker.ietf.org/doc/html/rfc5890 - */ - IDNHostname = "idn-hostname", - /** - * An IPv4 address according to the "dotted-quad" ABNF syntax as defined in - * [RFC 2673, section 3.2][RFC2673]. - * - * [RFC2673]: https://datatracker.ietf.org/doc/html/rfc2673 - */ - IPv4 = "ipv4", - /** - * An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291]. - * - * [RFC4291]: https://datatracker.ietf.org/doc/html/rfc4291 - */ - IPv6 = "ipv6", - /** - * A string instance is valid against this attribute if it is a valid IRI, - * according to [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - IRI = "iri", - /** - * A string instance is valid against this attribute if it is a valid IRI - * Reference (either an IRI or a relative-reference), according to - * [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - IRIReference = "iri-reference", - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - JSONPointer = "json-pointer", - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer fragment, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - JSONPointerURIFragment = "json-pointer-uri-fragment", - /** - * This attribute applies to string instances. - * - * A regular expression, which SHOULD be valid according to the - * [ECMA-262][ecma262] regular expression dialect. - * - * Implementations that validate formats MUST accept at least the subset of - * [ECMA-262][ecma262] defined in the [Regular Expressions][regexInterop] - * section of this specification, and SHOULD accept all valid - * [ECMA-262][ecma262] expressions. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - * [regexInterop]: https://json-schema.org/draft-07/json-schema-validation.html#regexInterop - */ - RegEx = "regex", - /** - * A string instance is valid against this attribute if it is a valid - * [Relative JSON Pointer][relative-json-pointer]. - * - * [relative-json-pointer]: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01 - */ - RelativeJSONPointer = "relative-json-pointer", - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "time" production in [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Time = "time", - /** - * A string instance is valid against this attribute if it is a valid URI, - * according to [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - URI = "uri", - /** - * A string instance is valid against this attribute if it is a valid URI - * Reference (either a URI or a relative-reference), according to - * [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - URIReference = "uri-reference", - /** - * A string instance is valid against this attribute if it is a valid URI - * Template (of any level), according to [RFC6570][RFC6570]. - * - * Note that URI Templates may be used for IRIs; there is no separate IRI - * Template specification. - * - * [RFC6570]: https://datatracker.ietf.org/doc/html/rfc6570 - */ - URITemplate = "uri-template", - /** - * UUID - */ - UUID = "uuid" -} -/** - * Enum consisting of simple type names for the `type` keyword - */ -export declare enum TypeName { - /** - * Value MUST be an array. - */ - Array = "array", - /** - * Value MUST be a boolean. - */ - Boolean = "boolean", - /** - * Value MUST be an integer, no floating point numbers are allowed. This is a - * subset of the number type. - */ - Integer = "integer", - /** - * Value MUST be null. Note this is mainly for purpose of being able use union - * types to define nullability. If this type is not included in a union, null - * values are not allowed (the primitives listed above do not allow nulls on - * their own). - */ - Null = "null", - /** - * Value MUST be a number, floating point numbers are allowed. - */ - Number = "number", - /** - * Value MUST be an object. - */ - Object = "object", - /** - * Value MUST be a string. - */ - String = "string" -} -export declare const keywords: readonly ["$comment", "$id", "$ref", "$schema", "additionalItems", "additionalProperties", "allOf", "anyOf", "const", "contains", "contentEncoding", "contentMediaType", "default", "definitions", "dependencies", "description", "else", "enum", "examples", "exclusiveMaximum", "exclusiveMinimum", "format", "if", "items", "maximum", "maxItems", "maxLength", "maxProperties", "minimum", "minItems", "minLength", "minProperties", "multipleOf", "not", "oneOf", "pattern", "patternProperties", "properties", "propertyNames", "readOnly", "required", "then", "title", "type", "uniqueItems", "writeOnly"]; -export {}; diff --git a/node_modules/json-schema-typed/draft_07.js b/node_modules/json-schema-typed/draft_07.js deleted file mode 100644 index cfae574..0000000 --- a/node_modules/json-schema-typed/draft_07.js +++ /dev/null @@ -1,328 +0,0 @@ -// @generated -// This code is automatically generated. Manual editing is not recommended. -/* - * BSD-2-Clause License - * - * Original source code is copyright (c) 2019-2025 Remy Rylan - * - * - * Documentation and keyword descriptions are copyright (c) 2018 IETF Trust - * , Austin Wright , Henry Andrews - * , Geraint Luff , and Cloudflare, - * Inc. . All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -export const draft = "7"; -export const $schema = "https://json-schema.org/draft-07/schema"; -// ----------------------------------------------------------------------------- -/** - * Content encoding strategy enum. - * - * - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1) - * - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705) - */ -export var ContentEncoding; -(function (ContentEncoding) { - /** - * Only US-ASCII characters, which use the lower 7 bits for each character. - * - * Each line must be less than 1,000 characters. - */ - ContentEncoding["7bit"] = "7bit"; - /** - * Allow extended ASCII characters which can use the 8th (highest) bit to - * indicate special characters not available in 7bit. - * - * Each line must be less than 1,000 characters. - */ - ContentEncoding["8bit"] = "8bit"; - /** - * Useful for data that is mostly non-text. - */ - ContentEncoding["Base64"] = "base64"; - /** - * Same character set as 8bit, with no line length restriction. - */ - ContentEncoding["Binary"] = "binary"; - /** - * An extension token defined by a standards-track RFC and registered with - * IANA. - */ - ContentEncoding["IETFToken"] = "ietf-token"; - /** - * Lines are limited to 76 characters, and line breaks are represented using - * special characters that are escaped. - */ - ContentEncoding["QuotedPrintable"] = "quoted-printable"; - /** - * The two characters "X-" or "x-" followed, with no intervening white space, - * by any token. - */ - ContentEncoding["XToken"] = "x-token"; -})(ContentEncoding || (ContentEncoding = {})); -/** - * This enum provides well-known formats that apply to strings. - */ -export var Format; -(function (Format) { - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "full-date" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Format["Date"] = "date"; - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "date-time" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Format["DateTime"] = "date-time"; - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by [RFC 5322, section 3.4.1][RFC5322]. - * - * [RFC5322]: https://datatracker.ietf.org/doc/html/rfc5322 - */ - Format["Email"] = "email"; - /** - * As defined by [RFC 1034, section 3.1][RFC1034], including host names - * produced using the Punycode algorithm specified in - * [RFC 5891, section 4.4][RFC5891]. - * - * [RFC1034]: https://datatracker.ietf.org/doc/html/rfc1034 - * [RFC5891]: https://datatracker.ietf.org/doc/html/rfc5891 - */ - Format["Hostname"] = "hostname"; - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by [RFC 6531][RFC6531]. - * - * [RFC6531]: https://datatracker.ietf.org/doc/html/rfc6531 - */ - Format["IDNEmail"] = "idn-email"; - /** - * As defined by either [RFC 1034, section 3.1][RFC1034] as for hostname, or - * an internationalized hostname as defined by - * [RFC 5890, section 2.3.2.3][RFC5890]. - * - * [RFC1034]: https://datatracker.ietf.org/doc/html/rfc1034 - * [RFC5890]: https://datatracker.ietf.org/doc/html/rfc5890 - */ - Format["IDNHostname"] = "idn-hostname"; - /** - * An IPv4 address according to the "dotted-quad" ABNF syntax as defined in - * [RFC 2673, section 3.2][RFC2673]. - * - * [RFC2673]: https://datatracker.ietf.org/doc/html/rfc2673 - */ - Format["IPv4"] = "ipv4"; - /** - * An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291]. - * - * [RFC4291]: https://datatracker.ietf.org/doc/html/rfc4291 - */ - Format["IPv6"] = "ipv6"; - /** - * A string instance is valid against this attribute if it is a valid IRI, - * according to [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - Format["IRI"] = "iri"; - /** - * A string instance is valid against this attribute if it is a valid IRI - * Reference (either an IRI or a relative-reference), according to - * [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - Format["IRIReference"] = "iri-reference"; - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - Format["JSONPointer"] = "json-pointer"; - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer fragment, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - Format["JSONPointerURIFragment"] = "json-pointer-uri-fragment"; - /** - * This attribute applies to string instances. - * - * A regular expression, which SHOULD be valid according to the - * [ECMA-262][ecma262] regular expression dialect. - * - * Implementations that validate formats MUST accept at least the subset of - * [ECMA-262][ecma262] defined in the [Regular Expressions][regexInterop] - * section of this specification, and SHOULD accept all valid - * [ECMA-262][ecma262] expressions. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - * [regexInterop]: https://json-schema.org/draft-07/json-schema-validation.html#regexInterop - */ - Format["RegEx"] = "regex"; - /** - * A string instance is valid against this attribute if it is a valid - * [Relative JSON Pointer][relative-json-pointer]. - * - * [relative-json-pointer]: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01 - */ - Format["RelativeJSONPointer"] = "relative-json-pointer"; - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "time" production in [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Format["Time"] = "time"; - /** - * A string instance is valid against this attribute if it is a valid URI, - * according to [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - Format["URI"] = "uri"; - /** - * A string instance is valid against this attribute if it is a valid URI - * Reference (either a URI or a relative-reference), according to - * [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - Format["URIReference"] = "uri-reference"; - /** - * A string instance is valid against this attribute if it is a valid URI - * Template (of any level), according to [RFC6570][RFC6570]. - * - * Note that URI Templates may be used for IRIs; there is no separate IRI - * Template specification. - * - * [RFC6570]: https://datatracker.ietf.org/doc/html/rfc6570 - */ - Format["URITemplate"] = "uri-template"; - /** - * UUID - */ - Format["UUID"] = "uuid"; -})(Format || (Format = {})); -/** - * Enum consisting of simple type names for the `type` keyword - */ -export var TypeName; -(function (TypeName) { - /** - * Value MUST be an array. - */ - TypeName["Array"] = "array"; - /** - * Value MUST be a boolean. - */ - TypeName["Boolean"] = "boolean"; - /** - * Value MUST be an integer, no floating point numbers are allowed. This is a - * subset of the number type. - */ - TypeName["Integer"] = "integer"; - /** - * Value MUST be null. Note this is mainly for purpose of being able use union - * types to define nullability. If this type is not included in a union, null - * values are not allowed (the primitives listed above do not allow nulls on - * their own). - */ - TypeName["Null"] = "null"; - /** - * Value MUST be a number, floating point numbers are allowed. - */ - TypeName["Number"] = "number"; - /** - * Value MUST be an object. - */ - TypeName["Object"] = "object"; - /** - * Value MUST be a string. - */ - TypeName["String"] = "string"; -})(TypeName || (TypeName = {})); -// ----------------------------------------------------------------------------- -// Keywords -// ----------------------------------------------------------------------------- -export const keywords = [ - "$comment", - "$id", - "$ref", - "$schema", - "additionalItems", - "additionalProperties", - "allOf", - "anyOf", - "const", - "contains", - "contentEncoding", - "contentMediaType", - "default", - "definitions", - "dependencies", - "description", - "else", - "enum", - "examples", - "exclusiveMaximum", - "exclusiveMinimum", - "format", - "if", - "items", - "maximum", - "maxItems", - "maxLength", - "maxProperties", - "minimum", - "minItems", - "minLength", - "minProperties", - "multipleOf", - "not", - "oneOf", - "pattern", - "patternProperties", - "properties", - "propertyNames", - "readOnly", - "required", - "then", - "title", - "type", - "uniqueItems", - "writeOnly", -]; diff --git a/node_modules/json-schema-typed/draft_2019_09.d.ts b/node_modules/json-schema-typed/draft_2019_09.d.ts deleted file mode 100644 index 1ca9730..0000000 --- a/node_modules/json-schema-typed/draft_2019_09.d.ts +++ /dev/null @@ -1,1247 +0,0 @@ -export declare const draft: "2019-09"; -export declare const $schema: "https://json-schema.org/draft/2019-09/schema"; -type MaybeReadonlyArray = Array | ReadonlyArray; -type ValueOf = T[keyof T]; -/** - * JSON Schema [Draft 2019-09](https://json-schema.org/draft/2019-09/json-schema-validation.html) - */ -export type JSONSchema ? "object" : JSONSchema.TypeValue> = boolean | { - /** - * Using JSON Pointer fragments requires knowledge of the structure of the - * schema. When writing schema documents with the intention to provide - * re-usable schemas, it may be preferable to use a plain name fragment - * that is not tied to any particular structural location. This allows a - * subschema to be relocated without requiring JSON Pointer references to - * be updated. - * - * The `$anchor` keyword is used to specify such a fragment. It is an - * identifier keyword that can only be used to create plain name fragments. - * - * If present, the value of this keyword MUST be a string, which MUST start - * with a letter `[A-Za-z]`, followed by any number of letters, digits - * `[0-9]`, hyphens `-`, underscores `_`, colons `:`, - * or periods `.`. - * - * Note that the anchor string does not include the `#` character, - * as it is not a URI-reference. An `{"$anchor": "foo"}` becomes the - * fragment `#foo` when used in a URI. - * - * The base URI to which the resulting fragment is appended is determined - * by the `$id` keyword as explained in the previous section. - * Two `$anchor` keywords in the same schema document MAY have the same - * value if they apply to different base URIs, as the resulting full URIs - * will be distinct. However, the effect of two `$anchor` keywords - * with the same value and the same base URI is undefined. Implementations - * MAY raise an error if such usage is detected. - */ - $anchor?: string; - /** - * This keyword reserves a location for comments from schema authors - * to readers or maintainers of the schema. - * - * The value of this keyword MUST be a string. Implementations MUST NOT - * present this string to end users. Tools for editing schemas SHOULD - * support displaying and editing this keyword. The value of this keyword - * MAY be used in debug or error output which is intended for developers - * making use of schemas. - * - * Schema vocabularies SHOULD allow `$comment` within any object - * containing vocabulary keywords. Implementations MAY assume `$comment` - * is allowed unless the vocabulary specifically forbids it. Vocabularies - * MUST NOT specify any effect of `$comment` beyond what is described in - * this specification. - * - * Tools that translate other media types or programming languages - * to and from `application/schema+json` MAY choose to convert that media - * type or programming language's native comments to or from `$comment` - * values. The behavior of such translation when both native comments and - * `$comment` properties are present is implementation-dependent. - * - * Implementations SHOULD treat `$comment` identically to an unknown - * extension keyword. They MAY strip `$comment` values at any point - * during processing. In particular, this allows for shortening schemas - * when the size of deployed schemas is a concern. - * - * Implementations MUST NOT take any other action based on the presence, - * absence, or contents of `$comment` properties. In particular, the - * value of `$comment` MUST NOT be collected as an annotation result. - */ - $comment?: string; - /** - * The `$defs` keywords provides a standardized location for schema - * authors to inline re-usable JSON Schemas into a more general schema. The - * keyword does not directly affect the validation result. - * - * This keyword's value MUST be an object. Each member value of this object - * MUST be a valid JSON Schema. - */ - $defs?: Record; - /** - * The `$id` keyword identifies a schema resource with its - * [canonical][[RFC6596]] URI. - * - * Note that this URI is an identifier and not necessarily a network - * locator. In the case of a network-addressable URL, a schema need not be - * downloadable from its canonical URI. - * - * If present, the value for this keyword MUST be a string, and MUST - * represent a valid [URI-reference][RFC3986]. This URI-reference SHOULD - * be normalized, and MUST resolve to an [absolute-URI][RFC3986] (without a - * fragment). Therefore, `$id` MUST NOT contain a non-empty fragment, - * and SHOULD NOT contain an empty fragment. - * - * Since an empty fragment in the context of the - * `application/schema+json` media type refers to the same resource as - * the base URI without a fragment, an implementation MAY normalize a URI - * ending with an empty fragment by removing the fragment. However, schema - * authors SHOULD NOT rely on this behavior across implementations. - * - * This URI also serves as the base URI for relative URI-references in - * keywords within the schema resource, in accordance with - * [RFC 3986][RFC3986] section 5.1.1 regarding base URIs embedded in - * content. - * - * The presence of `$id` in a subschema indicates that the subschema - * constitutes a distinct schema resource within a single schema document. - * Furthermore, in accordance with [RFC 3986][RFC3986] section 5.1.2 - * regarding encapsulating entities, if an `$id` in a subschema is a - * relative URI-reference, the base URI for resolving that reference is the - * URI of the parent schema resource. - * - * If no parent schema object explicitly identifies itself as a resource - * with `$id`, the base URI is that of the entire document. - * - * The root schema of a JSON Schema document SHOULD contain an `$id` - * keyword with an [absolute-URI][RFC3986] (containing a scheme, but no - * fragment). - * - * [RFC6596]: https://datatracker.ietf.org/doc/html/rfc6596 - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - * - * @format "uri-reference" - */ - $id?: string; - /** - * The value of the `$recursiveAnchor` property MUST be a boolean. - * - * `$recursiveAnchor` is used to dynamically identify a base URI at - * runtime for `$recursiveRef` by marking where such a calculation can - * start, and where it stops. This keyword MUST NOT affect the base URI of - * other keywords, unless they are explicitly defined to rely on it. - * - * If set to `true`, then when the containing schema object is used as a - * target of `$recursiveRef`, a new base URI is determined by examining - * the [dynamic scope][scopes] for the outermost schema that also contains - * `$recursiveAnchor` with a value of `true`. The base URI of that - * schema is then used as the dynamic base URI. - * - * - If no such schema exists, then the base URI is unchanged. - * - If this keyword is set to `false`, the base URI is unchanged. - * - * Omitting this keyword has the same behavior as a value of `false`. - * - * [scopes]: https://json-schema.org/draft/2019-09/json-schema-core.html#scopes - */ - $recursiveAnchor?: boolean; - /** - * The value of the `$recursiveRef` property MUST be a string which is - * a URI-reference. It is a by-reference applicator that uses a - * dynamically calculated base URI to resolve its value. - * - * The behavior of this keyword is defined only for the value `"#"`. - * Implementations MAY choose to consider other values to be errors. - * - * The value of `$recursiveRef` is initially resolved against the - * current base URI, in the same manner as for `$ref`. - * - * The schema identified by the resulting URI is examined for the - * presence of `$recursiveAnchor`, and a new base URI is calculated. - * - * Finally, the value of `$recursiveRef` is resolved against the new base - * URI determined according to `$recursiveAnchor` producing the final - * resolved reference URI. - * - * Note that in the absence of `$recursiveAnchor` (and in some cases - * when it is present), `$recursiveRef`'s behavior is identical to - * that of `$ref`. - * - * As with `$ref`, the results of this keyword are the results of the - * referenced schema. - * - * @format "uri-reference" - */ - $recursiveRef?: string; - /** - * The `$ref` keyword is an applicator that is used to reference a - * statically identified schema. Its results are the results of the - * referenced schema. Other keywords can appear alongside of `$ref` in - * the same schema object. - * - * The value of the `$ref` property MUST be a string which is a - * URI-Reference. Resolved against the current URI base, it produces the - * URI of the schema to apply. - * - * @format "uri-reference" - */ - $ref?: string; - /** - * The `$schema` keyword is both used as a JSON Schema version identifier - * and the location of a resource which is itself a JSON Schema, which - * describes any schema written for this particular version. - * - * The value of this keyword MUST be a [URI][RFC3986] (containing a scheme) - * and this URI MUST be normalized. The current schema MUST be valid - * against the meta-schema identified by this URI. - * - * If this URI identifies a retrievable resource, that resource SHOULD be - * of media type `application/schema+json`. - * - * The `$schema` keyword SHOULD be used in a resource root schema. - * It MUST NOT appear in resource subschemas. If absent from the root - * schema, the resulting behavior is implementation-defined. - * - * If multiple schema resources are present in a single document, then all - * schema resources SHOULD Have the same value for `$schema`. The result - * of differing values for "$schema" within the same schema document is - * implementation-defined. - * - * Values for this property are defined elsewhere in this and other - * documents, and by other parties. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - * - * @format "uri" - */ - $schema?: string; - /** - * The `$vocabulary` keyword is used in meta-schemas to identify the - * vocabularies available for use in schemas described by that meta-schema. - * It is also used to indicate whether each vocabulary is required or - * optional, in the sense that an implementation MUST understand the - * required vocabularies in order to successfully process the schema. - * - * The value of this keyword MUST be an object. The property names in the - * object MUST be URIs (containing a scheme) and this URI MUST be - * normalized. Each URI that appears as a property name identifies a - * specific set of keywords and their semantics. - * - * The URI MAY be a URL, but the nature of the retrievable resource is - * currently undefined, and reserved for future use. Vocabulary authors - * MAY use the URL of the vocabulary specification, in a human-readable - * media type such as `text/html` or `text/plain`, as the vocabulary - * URI. - * - * The values of the object properties MUST be booleans. - * If the value is `true`, then implementations that do not recognize - * the vocabulary MUST refuse to process any schemas that declare - * this meta-schema with "$schema". If the value is `false`, - * implementations that do not recognize the vocabulary SHOULD proceed with - * processing such schemas. - * - * Unrecognized keywords SHOULD be ignored. This remains the case for - * keywords defined by unrecognized vocabularies. It is not currently - * possible to distinguish between unrecognized keywords that are defined - * in vocabularies from those that are not part of any vocabulary. - * - * The `$vocabulary` keyword SHOULD be used in the root schema of any - * schema document intended for use as a meta-schema. It MUST NOT appear - * in subschemas. - * - * The `$vocabulary` keyword MUST be ignored in schema documents that are - * not being processed as a meta-schema. - */ - $vocabulary?: Record; - /** - * The value of `additionalItems` MUST be a valid JSON Schema. - * - * The behavior of this keyword depends on the presence and annotation - * result of `items` within the same schema object. - * If `items` is present, and its annotation result is a number, - * validation succeeds if every instance element at an index greater than - * that number validates against `additionalItems`. - * - * Otherwise, if `items` is absent or its annotation result is the - * boolean `true`, `additionalItems` MUST be ignored. - * - * If the `additionalItems` subschema is applied to any positions within - * the instance array, it produces an annotation result of boolean - * `true`, analogous to the single schema behavior of `items`. If any - * `additionalItems` keyword from any subschema applied to the same - * instance location produces an annotation value of `true`, then the - * combined result from these keywords is also `true`. - * - * Omitting this keyword has the same assertion behavior as an empty - * schema. - * - * Implementations MAY choose to implement or optimize this keyword in - * another way that produces the same effect, such as by directly - * checking for the presence and size of an `items` array. - */ - additionalItems?: JSONSchema; - /** - * The value of `additionalProperties` MUST be a valid JSON Schema. - * - * The behavior of this keyword depends on the presence and annotation - * results of `properties` and `patternProperties` within the same - * schema object. Validation with `additionalProperties` applies only to - * the child values of instance names that do not appear in the annotation - * results of either `properties` or `patternProperties`. - * - * For all such properties, validation succeeds if the child instance - * validates against the `additionalProperties` schema. - * - * The annotation result of this keyword is the set of instance property - * names validated by this keyword's subschema. Annotation results for - * `additionalProperties` keywords from multiple schemas applied to the - * same instance location are combined by taking the union of the sets. - * - * Omitting this keyword has the same assertion behavior as an empty - * schema. - * - * Implementations MAY choose to implement or optimize this keyword in - * another way that produces the same effect, such as by directly checking - * the names in `properties` and the patterns in `patternProperties` - * against the instance property set. - */ - additionalProperties?: JSONSchema; - /** - * This keyword's value MUST be a non-empty array. Each item of the array - * MUST be a valid JSON Schema. - * - * An instance validates successfully against this keyword if it validates - * successfully against all schemas defined by this keyword's value. - */ - allOf?: MaybeReadonlyArray>; - /** - * This keyword's value MUST be a non-empty array. Each item of the array - * MUST be a valid JSON Schema. - * - * An instance validates successfully against this keyword if it validates - * successfully against at least one schema defined by this keyword's - * value. - */ - anyOf?: MaybeReadonlyArray>; - /** - * An instance validates successfully against this keyword if its value is - * equal to the value of the keyword. - * - * Use of this keyword is functionally equivalent to the `enum` keyword - * with a single value. - */ - const?: Value; - /** - * An array instance is valid against `contains` if at least one of - * its elements is valid against the given schema. Note that when - * collecting annotations, the subschema MUST be applied to every - * array element even after the first match has been found. This - * is to ensure that all possible annotations are collected. - */ - contains?: JSONSchema; - /** - * If the instance value is a string, this property defines that the - * string SHOULD be interpreted as binary data and decoded using the - * encoding named by this property. [RFC 2045, Sec 6.1][RFC2045] lists the - * possible values for this property. - * - * The value of this property SHOULD be ignored if the instance described - * is not a string. - * - * If this keyword is absent, but `contentMediaType` is present, this - * indicates that the media type could be encoded into `UTF-8` like any - * other JSON string value, and does not require additional decoding. - * - * The value of this property MUST be a string. - * - * [RFC2045]: https://datatracker.ietf.org/doc/html/rfc2045#section-6.1 - */ - contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token"; - /** - * If the instance is a string, this property indicates the media type - * of the contents of the string. If `contentEncoding` is present, - * this property describes the decoded string. - * - * The value of this property must be a media type, as defined by - * [RFC 2046][RFC2046]. This property defines the media type of instances - * which this schema defines. - * - * The value of this property SHOULD be ignored if the instance described - * is not a string. - * - * If the `contentEncoding` property is not present, but the instance - * value is a string, then the value of this property SHOULD specify a text - * document type, and the character set SHOULD be the character set into - * which the JSON string value was decoded (for which the default is - * Unicode). - * - * [RFC2046]: https://datatracker.ietf.org/doc/html/rfc2046 - */ - contentMediaType?: string; - /** - * If the instance is a string, and if `contentMediaType` is present, - * this property contains a schema which describes the structure of the - * string. - * - * This keyword MAY be used with any media type that can be mapped into - * JSON Schema's data model. - * - * The value of this property SHOULD be ignored if `contentMediaType` is - * not present. - */ - contentSchema?: JSONSchema; - /** - * This keyword can be used to supply a default JSON value associated with - * a particular schema. It is RECOMMENDED that a `default` value be valid - * against the associated schema. - */ - default?: Value; - /** - * @deprecated `definitions` has been renamed to `$defs`. - */ - definitions?: Record; - /** - * @deprecated `dependencies` has been split into two keywords: - * `dependentSchemas` and `dependentRequired`. - */ - dependencies?: Record | JSONSchema>; - /** - * The value of this keyword MUST be an object. Properties in - * this object, if any, MUST be arrays. Elements in each array, - * if any, MUST be strings, and MUST be unique. - * - * This keyword specifies properties that are required if a specific - * other property is present. Their requirement is dependent on the - * presence of the other property. - * - * Validation succeeds if, for each name that appears in both - * the instance and as a name within this keyword's value, every - * item in the corresponding array is also the name of a property - * in the instance. - * - * Omitting this keyword has the same behavior as an empty object. - */ - dependentRequired?: Record>; - /** - * This keyword specifies subschemas that are evaluated if the instance is - * an object and contains a certain property. - * - * This keyword's value MUST be an object. Each value in the object MUST be - * a valid JSON Schema. - * - * If the object key is a property in the instance, the entire instance - * must validate against the subschema. Its use is dependent on the - * presence of the property. - * - * Omitting this keyword has the same behavior as an empty object. - */ - dependentSchemas?: Record; - /** - * The value of this keyword MUST be a boolean. When multiple occurrences - * of this keyword are applicable to a single sub-instance, applications - * SHOULD consider the instance location to be deprecated if any occurrence - * specifies a `true` value. - * - * If `deprecated` has a value of boolean `true`, it indicates that - * applications SHOULD refrain from usage of the declared property. It MAY - * mean the property is going to be removed in the future. - * - * A root schema containing `deprecated` with a value of `true` - * indicates that the entire resource being described MAY be removed in the - * future. - * - * When the `deprecated` keyword is applied to an item in an array by - * means of `items`, if `items` is a single schema, the deprecation - * relates to the whole array, while if `items` is an array of schemas, - * the deprecation relates to the corresponding item according to the - * subschemas position. - * - * Omitting this keyword has the same behavior as a value of `false`. - */ - deprecated?: boolean; - /** - * Can be used to decorate a user interface with explanation or information - * about the data produced. - */ - description?: string; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * When `if` is present, and the instance fails to validate against its - * subschema, then validation succeeds against this keyword if the instance - * successfully validates against this keyword's subschema. - * - * This keyword has no effect when `if` is absent, or when the instance - * successfully validates against its subschema. Implementations MUST NOT - * evaluate the instance against this keyword, for either validation or - * annotation collection purposes, in such cases. - */ - else?: JSONSchema; - /** - * The value of this keyword MUST be an array. This array SHOULD have at - * least one element. Elements in the array SHOULD be unique. - * - * An instance validates successfully against this keyword if its value is - * equal to one of the elements in this keyword's array value. - * - * Elements in the array might be of any type, including `null`. - */ - enum?: MaybeReadonlyArray; - /** - * The value of this keyword MUST be an array. When multiple occurrences of - * this keyword are applicable to a single sub-instance, implementations - * MUST provide a flat array of all values rather than an array of arrays. - * - * This keyword can be used to provide sample JSON values associated with a - * particular schema, for the purpose of illustrating usage. It is - * RECOMMENDED that these values be valid against the associated schema. - * - * Implementations MAY use the value(s) of `default`, if present, as an - * additional example. If `examples` is absent, `default` MAY still be - * used in this manner. - */ - examples?: MaybeReadonlyArray; - /** - * The value of `exclusiveMaximum` MUST be a number, representing an - * exclusive upper limit for a numeric instance. - * - * If the instance is a number, then the instance is valid only if it has a - * value strictly less than (not equal to) `exclusiveMaximum`. - */ - exclusiveMaximum?: number; - /** - * The value of `exclusiveMinimum` MUST be a number, representing an - * exclusive lower limit for a numeric instance. - * - * If the instance is a number, then the instance is valid only if it has a - * value strictly greater than (not equal to) `exclusiveMinimum`. - */ - exclusiveMinimum?: number; - /** - * Implementations MAY treat `format` as an assertion in addition to an - * annotation, and attempt to validate the value's conformance to the - * specified semantics. - * - * The value of this keyword is called a format attribute. It MUST be a - * string. A format attribute can generally only validate a given set - * of instance types. If the type of the instance to validate is not in - * this set, validation for this format attribute and instance SHOULD - * succeed. Format attributes are most often applied to strings, but can - * be specified to apply to any type. - * - * Implementations MAY support custom format attributes. Save for agreement - * between parties, schema authors SHALL NOT expect a peer implementation - * to support such custom format attributes. An implementation MUST NOT - * fail validation or cease processing due to an unknown format attribute. - * When treating `format` as an annotation, implementations SHOULD - * collect both known and unknown format attribute values. - */ - format?: string; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * This validation outcome of this keyword's subschema has no direct effect - * on the overall validation result. Rather, it controls which of the - * `then` or `else` keywords are evaluated. - * - * Instances that successfully validate against this keyword's subschema - * MUST also be valid against the subschema value of the `then` keyword, - * if present. - * - * Instances that fail to validate against this keyword's subschema MUST - * also be valid against the subschema value of the `else` keyword, if - * present. - * - * If annotations are being collected, they are collected - * from this keyword's subschema in the usual way, including when the - * keyword is present without either `then` or `else`. - */ - if?: JSONSchema; - /** - * The value of `items` MUST be either a valid JSON Schema or an array of - * valid JSON Schemas. - * - * If `items` is a schema, validation succeeds if all elements in the - * array successfully validate against that schema. - * - * If `items` is an array of schemas, validation succeeds if each element - * of the instance validates against the schema at the same position, if - * any. - * - * This keyword produces an annotation value which is the largest index to - * which this keyword applied a subschema. The value MAY be a boolean - * `true` if a subschema was applied to every index of the instance, such - * as when `items` is a schema. - * - * Annotation results for `items` keywords from multiple schemas applied - * to the same instance location are combined by setting the combined - * result to `true` if any of the values are `true`, and otherwise - * retaining the largest numerical value. - * - * Omitting this keyword has the same assertion behavior as an empty - * schema. - */ - items?: MaybeReadonlyArray | JSONSchema; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An array instance is valid against `maxContains` if the number of - * elements that are valid against the schema for - * `contains` is less than, or equal to, the value of this keyword. - * - * If `contains` is not present within the same schema object, then this - * keyword has no effect. - */ - maxContains?: number; - /** - * The value of `maximum` MUST be a number, representing an inclusive - * upper limit for a numeric instance. - * - * If the instance is a number, then this keyword validates only if the - * instance is less than or exactly equal to `maximum`. - */ - maximum?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An array instance is valid against `maxItems` if its size is less - * than, or equal to, the value of this keyword. - * - * @minimum 0 - */ - maxItems?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * A string instance is valid against this keyword if its length is less - * than, or equal to, the value of this keyword. - * - * The length of a string instance is defined as the number of its - * characters as defined by [RFC 8259][RFC8259]. - * - * [RFC8259]: https://datatracker.ietf.org/doc/html/rfc8259 - * - * @minimum 0 - */ - maxLength?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An object instance is valid against `maxProperties` if its number of - * `properties` is less than, or equal to, the value of this keyword. - * - * @minimum 0 - */ - maxProperties?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An array instance is valid against `minContains` if the number of - * elements that are valid against the schema for `contains` is - * greater than, or equal to, the value of this keyword. - * - * A value of `0` is allowed, but is only useful for setting a range - * of occurrences from `0` to the value of `maxContains`. A value of - * `0` with no `maxContains` causes `contains` to always pass - * validation. - * - * If `contains` is not present within the same schema object, then this - * keyword has no effect. - * - * Omitting this keyword has the same behavior as a value of `1`. - * - * @default 1 - */ - minContains?: number; - /** - * The value of `minimum` MUST be a number, representing an inclusive - * lower limit for a numeric instance. - * - * If the instance is a number, then this keyword validates only if the - * instance is greater than or exactly equal to `minimum`. - */ - minimum?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An array instance is valid against `minItems` if its size is greater - * than, or equal to, the value of this keyword. - * - * Omitting this keyword has the same behavior as a value of `0`. - * - * @default 0 - * @minimum 0 - */ - minItems?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * A string instance is valid against this keyword if its length is greater - * than, or equal to, the value of this keyword. - * - * The length of a string instance is defined as the number of its - * characters as defined by [RFC 8259][RFC8259]. - * - * Omitting this keyword has the same behavior as a value of `0`. - * - * [RFC8259]: https://datatracker.ietf.org/doc/html/rfc8259 - * - * @default 0 - * @minimum 0 - */ - minLength?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An object instance is valid against `minProperties` if its number of - * `properties` is greater than, or equal to, the value of this keyword. - * - * Omitting this keyword has the same behavior as a value of `0`. - * - * @default 0 - * @minimum 0 - */ - minProperties?: number; - /** - * The value of `multipleOf` MUST be a number, strictly greater than - * `0`. - * - * A numeric instance is valid only if division by this keyword's value - * results in an integer. - * - * @exclusiveMinimum 0 - */ - multipleOf?: number; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * An instance is valid against this keyword if it fails to validate - * successfully against the schema defined by this keyword. - */ - not?: JSONSchema; - /** - * This keyword's value MUST be a non-empty array. Each item of the array - * MUST be a valid JSON Schema. - * - * An instance validates successfully against this keyword if it validates - * successfully against exactly one schema defined by this keyword's value. - */ - oneOf?: MaybeReadonlyArray>; - /** - * The value of this keyword MUST be a string. This string SHOULD be a - * valid regular expression, according to the [ECMA-262][ecma262] regular - * expression dialect. - * - * A string instance is considered valid if the regular expression matches - * the instance successfully. Recall: regular expressions are not - * implicitly anchored. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - * - * @format "regex" - */ - pattern?: string; - /** - * The value of `patternProperties` MUST be an object. Each property name - * of this object SHOULD be a valid regular expression, according to the - * [ECMA-262][ecma262] regular expression dialect. Each property value of - * this object MUST be a valid JSON Schema. - * - * Validation succeeds if, for each instance name that matches any regular - * expressions that appear as a property name in this keyword's value, - * the child instance for that name successfully validates against each - * schema that corresponds to a matching regular expression. - * - * The annotation result of this keyword is the set of instance property - * names matched by this keyword. Annotation results for - * `patternProperties` keywords from multiple schemas applied to the same - * instance location are combined by taking the union of the sets. - * - * Omitting this keyword has the same assertion behavior as an empty - * object. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - */ - patternProperties?: Record; - /** - * The value of `properties` MUST be an object. Each value of this object - * MUST be a valid JSON Schema. - * - * Validation succeeds if, for each name that appears in both the instance - * and as a name within this keyword's value, the child instance for that - * name successfully validates against the corresponding schema. - * - * The annotation result of this keyword is the set of instance property - * names matched by this keyword. Annotation results for `properties` - * keywords from multiple schemas applied to the same instance location are - * combined by taking the union of the sets. - * - * Omitting this keyword has the same assertion behavior as an empty - * object. - */ - properties?: Record; - /** - * The value of `propertyNames` MUST be a valid JSON Schema. - * - * If the instance is an object, this keyword validates if every property - * name in the instance validates against the provided schema. - * Note the property name that the schema is testing will always be a - * string. - * - * Omitting this keyword has the same behavior as an empty schema. - */ - propertyNames?: JSONSchema; - /** - * The value of this keyword MUST be a boolean. When multiple occurrences - * of this keyword are applicable to a single sub-instance, the resulting - * value MUST be `true` if any occurrence specifies a `true` value, and - * MUST be `false` otherwise. - * - * If `readOnly` has a value of boolean `true`, it indicates that the - * value of the instance is managed exclusively by the owning authority, - * and attempts by an application to modify the value of this property are - * expected to be ignored or rejected by that owning authority. - * - * An instance document that is marked as `readOnly` for the entire - * document MAY be ignored if sent to the owning authority, or MAY result - * in an error, at the authority's discretion. - * - * For example, `readOnly` would be used to mark a database-generated - * serial number as read-only. - * - * This keyword can be used to assist in user interface instance - * generation. - * - * @default false - */ - readOnly?: boolean; - /** - * The value of this keyword MUST be an array. Elements of this array, if - * any, MUST be strings, and MUST be unique. - * - * An object instance is valid against this keyword if every item in the - * array is the name of a property in the instance. - * - * Omitting this keyword has the same behavior as an empty array. - */ - required?: MaybeReadonlyArray; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * When `if` is present, and the instance successfully validates against - * its subschema, then validation succeeds against this keyword if the - * instance also successfully validates against this keyword's subschema. - * - * This keyword has no effect when `if` is absent, or when the instance - * fails to validate against its subschema. Implementations MUST NOT - * evaluate the instance against this keyword, for either validation or - * annotation collection purposes, in such cases. - */ - then?: JSONSchema; - /** - * Can be used to decorate a user interface with a short label about the - * data produced. - */ - title?: string; - /** - * The value of this keyword MUST be either a string or an array. If it is - * an array, elements of the array MUST be strings and MUST be unique. - * - * String values MUST be one of the six primitive types (`"null"`, - * `"boolean"`, `"object"`, `"array"`, `"number"`, or - * `"string"`), or `"integer"` which matches any number with a zero - * fractional part. - * - * An instance validates if and only if the instance is in any of the sets - * listed for this keyword. - */ - type?: SchemaType; - /** - * The value of `unevaluatedItems` MUST be a valid JSON Schema. - * - * The behavior of this keyword depends on the annotation results of - * adjacent keywords that apply to the instance location being validated. - * Specifically, the annotations from `items` and `additionalItems`, - * which can come from those keywords when they are adjacent to the - * `unevaluatedItems` keyword. Those two annotations, as well as - * `unevaluatedItems`, can also result from any and all adjacent - * [in-place applicator][in-place-applicator] keywords. - * - * If an `items` annotation is present, and its annotation result is a - * number, and no "additionalItems" or `unevaluatedItems` annotation is - * present, then validation succeeds if every instance element at an index - * greater than the `items` annotation validates against - * `unevaluatedItems`. - * - * Otherwise, if any `items`, `additionalItems`, or - * `unevaluatedItems` annotations are present with a value of boolean - * `true`, then `unevaluatedItems` MUST be ignored. However, if none - * of these annotations are present, `unevaluatedItems` MUST be applied - * to all locations in the array. - * - * This means that `items`, `additionalItems`, and all in-place - * applicators MUST be evaluated before this keyword can be evaluated. - * Authors of extension keywords MUST NOT define an in-place applicator - * that would need to be evaluated before this keyword. - * - * If the `unevaluatedItems` subschema is applied to any positions within - * the instance array, it produces an annotation result of boolean - * `true`, analogous to the single schema behavior of `items`. If any - * `unevaluatedItems` keyword from any subschema applied to the same - * instance location produces an annotation value of `true`, then the - * combined result from these keywords is also `true`. - * - * Omitting this keyword has the same assertion behavior as an empty - * schema. - * - * Implementations that do not collect annotations MUST raise an error - * upon encountering this keyword. - * - * [in-place-applicator]: https://json-schema.org/draft/2019-09/json-schema-core.html#in-place - */ - unevaluatedItems?: JSONSchema; - /** - * The value of `unevaluatedProperties` MUST be a valid JSON Schema. - * - * The behavior of this keyword depends on the annotation results of - * adjacent keywords that apply to the instance location being validated. - * Specifically, the annotations from `properties`, - * `patternProperties`, and `additionalProperties`, which can come from - * those keywords when they are adjacent to the `unevaluatedProperties` - * keyword. Those three annotations, as well as `unevaluatedProperties`, - * can also result from any and all adjacent - * [in-place applicator][in-place-applicator] keywords. - * - * Validation with `unevaluatedProperties` applies only to the child - * values of instance names that do not appear in the `properties`, - * `patternProperties`, `additionalProperties`, or - * `unevaluatedProperties` annotation results that apply to the - * instance location being validated. - * - * For all such properties, validation succeeds if the child instance - * validates against the "unevaluatedProperties" schema. - * - * This means that `properties`, `patternProperties`, - * `additionalProperties`, and all in-place applicators MUST be evaluated - * before this keyword can be evaluated. Authors of extension keywords - * MUST NOT define an in-place applicator that would need to be evaluated - * before this keyword. - * - * The annotation result of this keyword is the set of instance property - * names validated by this keyword's subschema. Annotation results for - * `unevaluatedProperties` keywords from multiple schemas applied to the - * same instance location are combined by taking the union of the sets. - * - * Omitting this keyword has the same assertion behavior as an empty - * schema. - * - * Implementations that do not collect annotations MUST raise an error upon - * encountering this keyword. - * - * [in-place-applicator]: https://json-schema.org/draft/2019-09/json-schema-core.html#in-place - */ - unevaluatedProperties?: JSONSchema; - /** - * The value of this keyword MUST be a boolean. - * - * If this keyword has boolean value `false`, the instance validates - * successfully. If it has boolean value `true`, the instance validates - * successfully if all of its elements are unique. - * - * Omitting this keyword has the same behavior as a value of `false`. - * - * @default false - */ - uniqueItems?: boolean; - /** - * The value of this keyword MUST be a boolean. When multiple occurrences - * of this keyword is applicable to a single sub-instance, the resulting - * value MUST be `true` if any occurrence specifies a `true` value, and - * MUST be `false` otherwise. - * - * If `writeOnly` has a value of boolean `true`, it indicates that the - * value is never present when the instance is retrieved from the owning - * authority. It can be present when sent to the owning authority to update - * or create the document (or the resource it represents), but it will not - * be included in any updated or newly created version of the instance. - * - * An instance document that is marked as `writeOnly` for the entire - * document MAY be returned as a blank document of some sort, or MAY - * produce an error upon retrieval, or have the retrieval request ignored, - * at the authority's discretion. - * - * For example, `writeOnly` would be used to mark a password input field. - * - * These keywords can be used to assist in user interface instance - * generation. In particular, an application MAY choose to use a widget - * that hides input values as they are typed for write-only fields. - * - * @default false - */ - writeOnly?: boolean; -}; -export declare namespace JSONSchema { - type TypeValue = ValueOf | TypeName | Array | TypeName> | ReadonlyArray | TypeName>; - /** - * JSON Schema interface - */ - type Interface = Exclude, boolean>; - type Array = Pick, KeywordByType.Any | KeywordByType.Array>; - type Boolean = Pick, KeywordByType.Any>; - type Integer = Pick, KeywordByType.Any | KeywordByType.Number>; - type Number = Pick, KeywordByType.Any | KeywordByType.Number>; - type Null = Pick, KeywordByType.Any>; - type Object = Pick, KeywordByType.Any | KeywordByType.Object>; - type String = Pick, KeywordByType.Any | KeywordByType.String>; -} -declare namespace KeywordByType { - type Any = "$anchor" | "$comment" | "$defs" | "$id" | "$recursiveAnchor" | "$recursiveRef" | "$ref" | "$schema" | "$vocabulary" | "allOf" | "anyOf" | "const" | "default" | "definitions" | "deprecated" | "description" | "else" | "enum" | "examples" | "format" | "if" | "not" | "oneOf" | "readOnly" | "then" | "title" | "type" | "writeOnly"; - type Array = "additionalItems" | "contains" | "items" | "maxContains" | "maxItems" | "minContains" | "minItems" | "unevaluatedItems" | "uniqueItems"; - type Number = "exclusiveMaximum" | "exclusiveMinimum" | "maximum" | "minimum" | "multipleOf"; - type Object = "additionalProperties" | "dependencies" | "dependentRequired" | "dependentSchemas" | "maxProperties" | "minProperties" | "patternProperties" | "properties" | "propertyNames" | "required" | "unevaluatedProperties"; - type String = "contentEncoding" | "contentMediaType" | "contentSchema" | "maxLength" | "minLength" | "pattern"; -} -/** - * Content encoding strategy enum. - * - * - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1) - * - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705) - */ -export declare enum ContentEncoding { - /** - * Only US-ASCII characters, which use the lower 7 bits for each character. - * - * Each line must be less than 1,000 characters. - */ - "7bit" = "7bit", - /** - * Allow extended ASCII characters which can use the 8th (highest) bit to - * indicate special characters not available in 7bit. - * - * Each line must be less than 1,000 characters. - */ - "8bit" = "8bit", - /** - * Useful for data that is mostly non-text. - */ - Base64 = "base64", - /** - * Same character set as 8bit, with no line length restriction. - */ - Binary = "binary", - /** - * An extension token defined by a standards-track RFC and registered with - * IANA. - */ - IETFToken = "ietf-token", - /** - * Lines are limited to 76 characters, and line breaks are represented using - * special characters that are escaped. - */ - QuotedPrintable = "quoted-printable", - /** - * The two characters "X-" or "x-" followed, with no intervening white space, - * by any token. - */ - XToken = "x-token" -} -/** - * This enum provides well-known formats that apply to strings. - */ -export declare enum Format { - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "full-date" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Date = "date", - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "date-time" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - DateTime = "date-time", - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "duration" production. - */ - Duration = "duration", - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by [RFC 5322, section 3.4.1][RFC5322]. - * - * [RFC5322]: https://datatracker.ietf.org/doc/html/rfc5322 - */ - Email = "email", - /** - * As defined by [RFC 1123, section 2.1][RFC1123], including host names - * produced using the Punycode algorithm specified in - * [RFC 5891, section 4.4][RFC5891]. - * - * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123 - * [RFC5891]: https://datatracker.ietf.org/doc/html/rfc5891 - */ - Hostname = "hostname", - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by [RFC 6531][RFC6531]. - * - * [RFC6531]: https://datatracker.ietf.org/doc/html/rfc6531 - */ - IDNEmail = "idn-email", - /** - * As defined by either [RFC 1123, section 2.1][RFC1123] as for hostname, or - * an internationalized hostname as defined by - * [RFC 5890, section 2.3.2.3][RFC5890]. - * - * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123 - * [RFC5890]: https://datatracker.ietf.org/doc/html/rfc5890 - */ - IDNHostname = "idn-hostname", - /** - * An IPv4 address according to the "dotted-quad" ABNF syntax as defined in - * [RFC 2673, section 3.2][RFC2673]. - * - * [RFC2673]: https://datatracker.ietf.org/doc/html/rfc2673 - */ - IPv4 = "ipv4", - /** - * An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291]. - * - * [RFC4291]: https://datatracker.ietf.org/doc/html/rfc4291 - */ - IPv6 = "ipv6", - /** - * A string instance is valid against this attribute if it is a valid IRI, - * according to [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - IRI = "iri", - /** - * A string instance is valid against this attribute if it is a valid IRI - * Reference (either an IRI or a relative-reference), according to - * [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - IRIReference = "iri-reference", - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - JSONPointer = "json-pointer", - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer fragment, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - JSONPointerURIFragment = "json-pointer-uri-fragment", - /** - * This attribute applies to string instances. - * - * A regular expression, which SHOULD be valid according to the - * [ECMA-262][ecma262] regular expression dialect. - * - * Implementations that validate formats MUST accept at least the subset of - * [ECMA-262][ecma262] defined in the [Regular Expressions][regexInterop] - * section of this specification, and SHOULD accept all valid - * [ECMA-262][ecma262] expressions. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - * [regexInterop]: https://json-schema.org/draft/2019-09/json-schema-validation.html#regexInterop - */ - RegEx = "regex", - /** - * A string instance is valid against this attribute if it is a valid - * [Relative JSON Pointer][relative-json-pointer]. - * - * [relative-json-pointer]: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01 - */ - RelativeJSONPointer = "relative-json-pointer", - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "time" production in [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Time = "time", - /** - * A string instance is valid against this attribute if it is a valid URI, - * according to [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - URI = "uri", - /** - * A string instance is valid against this attribute if it is a valid URI - * Reference (either a URI or a relative-reference), according to - * [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - URIReference = "uri-reference", - /** - * A string instance is valid against this attribute if it is a valid URI - * Template (of any level), according to [RFC 6570][RFC6570]. - * - * Note that URI Templates may be used for IRIs; there is no separate IRI - * Template specification. - * - * [RFC6570]: https://datatracker.ietf.org/doc/html/rfc6570 - */ - URITemplate = "uri-template", - /** - * A string instance is valid against this attribute if it is a valid string - * representation of a UUID, according to [RFC 4122][RFC4122]. - * - * [RFC4122]: https://datatracker.ietf.org/doc/html/rfc4122 - */ - UUID = "uuid" -} -/** - * Enum consisting of simple type names for the `type` keyword - */ -export declare enum TypeName { - /** - * Value MUST be an array. - */ - Array = "array", - /** - * Value MUST be a boolean. - */ - Boolean = "boolean", - /** - * Value MUST be an integer, no floating point numbers are allowed. This is a - * subset of the number type. - */ - Integer = "integer", - /** - * Value MUST be null. Note this is mainly for purpose of being able use union - * types to define nullability. If this type is not included in a union, null - * values are not allowed (the primitives listed above do not allow nulls on - * their own). - */ - Null = "null", - /** - * Value MUST be a number, floating point numbers are allowed. - */ - Number = "number", - /** - * Value MUST be an object. - */ - Object = "object", - /** - * Value MUST be a string. - */ - String = "string" -} -export declare const keywords: readonly ["$anchor", "$comment", "$defs", "$id", "$recursiveAnchor", "$recursiveRef", "$ref", "$schema", "$vocabulary", "additionalItems", "additionalProperties", "allOf", "anyOf", "const", "contains", "contentEncoding", "contentMediaType", "contentSchema", "default", "definitions", "dependencies", "dependentRequired", "dependentSchemas", "deprecated", "description", "else", "enum", "examples", "exclusiveMaximum", "exclusiveMinimum", "format", "if", "items", "maxContains", "maximum", "maxItems", "maxLength", "maxProperties", "minContains", "minimum", "minItems", "minLength", "minProperties", "multipleOf", "not", "oneOf", "pattern", "patternProperties", "properties", "propertyNames", "readOnly", "required", "then", "title", "type", "unevaluatedItems", "unevaluatedProperties", "uniqueItems", "writeOnly"]; -export {}; diff --git a/node_modules/json-schema-typed/draft_2019_09.js b/node_modules/json-schema-typed/draft_2019_09.js deleted file mode 100644 index bb0a91b..0000000 --- a/node_modules/json-schema-typed/draft_2019_09.js +++ /dev/null @@ -1,349 +0,0 @@ -// @generated -// This code is automatically generated. Manual editing is not recommended. -/* - * BSD-2-Clause License - * - * Original source code is copyright (c) 2025 Remy Rylan - * - * - * Documentation and keyword descriptions are copyright (c) 2019 IETF Trust - * , Austin Wright , Henry Andrews - * , Ben Hutton , and Greg Dennis - * . All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -export const draft = "2019-09"; -export const $schema = "https://json-schema.org/draft/2019-09/schema"; -// ----------------------------------------------------------------------------- -/** - * Content encoding strategy enum. - * - * - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1) - * - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705) - */ -export var ContentEncoding; -(function (ContentEncoding) { - /** - * Only US-ASCII characters, which use the lower 7 bits for each character. - * - * Each line must be less than 1,000 characters. - */ - ContentEncoding["7bit"] = "7bit"; - /** - * Allow extended ASCII characters which can use the 8th (highest) bit to - * indicate special characters not available in 7bit. - * - * Each line must be less than 1,000 characters. - */ - ContentEncoding["8bit"] = "8bit"; - /** - * Useful for data that is mostly non-text. - */ - ContentEncoding["Base64"] = "base64"; - /** - * Same character set as 8bit, with no line length restriction. - */ - ContentEncoding["Binary"] = "binary"; - /** - * An extension token defined by a standards-track RFC and registered with - * IANA. - */ - ContentEncoding["IETFToken"] = "ietf-token"; - /** - * Lines are limited to 76 characters, and line breaks are represented using - * special characters that are escaped. - */ - ContentEncoding["QuotedPrintable"] = "quoted-printable"; - /** - * The two characters "X-" or "x-" followed, with no intervening white space, - * by any token. - */ - ContentEncoding["XToken"] = "x-token"; -})(ContentEncoding || (ContentEncoding = {})); -/** - * This enum provides well-known formats that apply to strings. - */ -export var Format; -(function (Format) { - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "full-date" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Format["Date"] = "date"; - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "date-time" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Format["DateTime"] = "date-time"; - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "duration" production. - */ - Format["Duration"] = "duration"; - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by [RFC 5322, section 3.4.1][RFC5322]. - * - * [RFC5322]: https://datatracker.ietf.org/doc/html/rfc5322 - */ - Format["Email"] = "email"; - /** - * As defined by [RFC 1123, section 2.1][RFC1123], including host names - * produced using the Punycode algorithm specified in - * [RFC 5891, section 4.4][RFC5891]. - * - * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123 - * [RFC5891]: https://datatracker.ietf.org/doc/html/rfc5891 - */ - Format["Hostname"] = "hostname"; - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by [RFC 6531][RFC6531]. - * - * [RFC6531]: https://datatracker.ietf.org/doc/html/rfc6531 - */ - Format["IDNEmail"] = "idn-email"; - /** - * As defined by either [RFC 1123, section 2.1][RFC1123] as for hostname, or - * an internationalized hostname as defined by - * [RFC 5890, section 2.3.2.3][RFC5890]. - * - * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123 - * [RFC5890]: https://datatracker.ietf.org/doc/html/rfc5890 - */ - Format["IDNHostname"] = "idn-hostname"; - /** - * An IPv4 address according to the "dotted-quad" ABNF syntax as defined in - * [RFC 2673, section 3.2][RFC2673]. - * - * [RFC2673]: https://datatracker.ietf.org/doc/html/rfc2673 - */ - Format["IPv4"] = "ipv4"; - /** - * An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291]. - * - * [RFC4291]: https://datatracker.ietf.org/doc/html/rfc4291 - */ - Format["IPv6"] = "ipv6"; - /** - * A string instance is valid against this attribute if it is a valid IRI, - * according to [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - Format["IRI"] = "iri"; - /** - * A string instance is valid against this attribute if it is a valid IRI - * Reference (either an IRI or a relative-reference), according to - * [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - Format["IRIReference"] = "iri-reference"; - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - Format["JSONPointer"] = "json-pointer"; - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer fragment, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - Format["JSONPointerURIFragment"] = "json-pointer-uri-fragment"; - /** - * This attribute applies to string instances. - * - * A regular expression, which SHOULD be valid according to the - * [ECMA-262][ecma262] regular expression dialect. - * - * Implementations that validate formats MUST accept at least the subset of - * [ECMA-262][ecma262] defined in the [Regular Expressions][regexInterop] - * section of this specification, and SHOULD accept all valid - * [ECMA-262][ecma262] expressions. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - * [regexInterop]: https://json-schema.org/draft/2019-09/json-schema-validation.html#regexInterop - */ - Format["RegEx"] = "regex"; - /** - * A string instance is valid against this attribute if it is a valid - * [Relative JSON Pointer][relative-json-pointer]. - * - * [relative-json-pointer]: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01 - */ - Format["RelativeJSONPointer"] = "relative-json-pointer"; - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "time" production in [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Format["Time"] = "time"; - /** - * A string instance is valid against this attribute if it is a valid URI, - * according to [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - Format["URI"] = "uri"; - /** - * A string instance is valid against this attribute if it is a valid URI - * Reference (either a URI or a relative-reference), according to - * [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - Format["URIReference"] = "uri-reference"; - /** - * A string instance is valid against this attribute if it is a valid URI - * Template (of any level), according to [RFC 6570][RFC6570]. - * - * Note that URI Templates may be used for IRIs; there is no separate IRI - * Template specification. - * - * [RFC6570]: https://datatracker.ietf.org/doc/html/rfc6570 - */ - Format["URITemplate"] = "uri-template"; - /** - * A string instance is valid against this attribute if it is a valid string - * representation of a UUID, according to [RFC 4122][RFC4122]. - * - * [RFC4122]: https://datatracker.ietf.org/doc/html/rfc4122 - */ - Format["UUID"] = "uuid"; -})(Format || (Format = {})); -/** - * Enum consisting of simple type names for the `type` keyword - */ -export var TypeName; -(function (TypeName) { - /** - * Value MUST be an array. - */ - TypeName["Array"] = "array"; - /** - * Value MUST be a boolean. - */ - TypeName["Boolean"] = "boolean"; - /** - * Value MUST be an integer, no floating point numbers are allowed. This is a - * subset of the number type. - */ - TypeName["Integer"] = "integer"; - /** - * Value MUST be null. Note this is mainly for purpose of being able use union - * types to define nullability. If this type is not included in a union, null - * values are not allowed (the primitives listed above do not allow nulls on - * their own). - */ - TypeName["Null"] = "null"; - /** - * Value MUST be a number, floating point numbers are allowed. - */ - TypeName["Number"] = "number"; - /** - * Value MUST be an object. - */ - TypeName["Object"] = "object"; - /** - * Value MUST be a string. - */ - TypeName["String"] = "string"; -})(TypeName || (TypeName = {})); -// ----------------------------------------------------------------------------- -// Keywords -// ----------------------------------------------------------------------------- -export const keywords = [ - "$anchor", - "$comment", - "$defs", - "$id", - "$recursiveAnchor", - "$recursiveRef", - "$ref", - "$schema", - "$vocabulary", - "additionalItems", - "additionalProperties", - "allOf", - "anyOf", - "const", - "contains", - "contentEncoding", - "contentMediaType", - "contentSchema", - "default", - "definitions", - "dependencies", - "dependentRequired", - "dependentSchemas", - "deprecated", - "description", - "else", - "enum", - "examples", - "exclusiveMaximum", - "exclusiveMinimum", - "format", - "if", - "items", - "maxContains", - "maximum", - "maxItems", - "maxLength", - "maxProperties", - "minContains", - "minimum", - "minItems", - "minLength", - "minProperties", - "multipleOf", - "not", - "oneOf", - "pattern", - "patternProperties", - "properties", - "propertyNames", - "readOnly", - "required", - "then", - "title", - "type", - "unevaluatedItems", - "unevaluatedProperties", - "uniqueItems", - "writeOnly", -]; diff --git a/node_modules/json-schema-typed/draft_2020_12.d.ts b/node_modules/json-schema-typed/draft_2020_12.d.ts deleted file mode 100644 index f49a6cf..0000000 --- a/node_modules/json-schema-typed/draft_2020_12.d.ts +++ /dev/null @@ -1,1239 +0,0 @@ -export declare const draft: "2020-12"; -export declare const $schema: "https://json-schema.org/draft/2020-12/schema"; -type MaybeReadonlyArray = Array | ReadonlyArray; -type ValueOf = T[keyof T]; -/** - * JSON Schema [Draft 2020-12](https://json-schema.org/draft/2020-12/json-schema-validation.html) - */ -export type JSONSchema ? "object" : JSONSchema.TypeValue> = boolean | { - /** - * Using JSON Pointer fragments requires knowledge of the structure of the - * schema. When writing schema documents with the intention to provide - * re-usable schemas, it may be preferable to use a plain name fragment - * that is not tied to any particular structural location. This allows a - * subschema to be relocated without requiring JSON Pointer references to - * be updated. - * - * The `$anchor` keyword is used to specify such a fragment. It is an - * identifier keyword that can only be used to create plain name fragments. - * - * If present, the value of this keyword MUST be a string, which MUST start - * with a letter `[A-Za-z]`, followed by any number of letters, digits - * `[0-9]`, hyphens `-`, underscores `_`, colons `:`, - * or periods `.`. - * - * Note that the anchor string does not include the `#` character, - * as it is not a URI-reference. An `{"$anchor": "foo"}` becomes the - * fragment `#foo` when used in a URI. - * - * The base URI to which the resulting fragment is appended is determined - * by the `$id` keyword as explained in the previous section. - * Two `$anchor` keywords in the same schema document MAY have the same - * value if they apply to different base URIs, as the resulting full URIs - * will be distinct. However, the effect of two `$anchor` keywords - * with the same value and the same base URI is undefined. Implementations - * MAY raise an error if such usage is detected. - */ - $anchor?: string; - /** - * This keyword reserves a location for comments from schema authors to - * readers or maintainers of the schema. - * - * The value of this keyword MUST be a string. Implementations MUST NOT - * present this string to end users. Tools for editing schemas SHOULD - * support displaying and editing this keyword. The value of this keyword - * MAY be used in debug or error output which is intended for developers - * making use of schemas. - * - * Schema vocabularies SHOULD allow `$comment` within any object - * containing vocabulary keywords. Implementations MAY assume `$comment` - * is allowed unless the vocabulary specifically forbids it. Vocabularies - * MUST NOT specify any effect of `$comment` beyond what is described in - * this specification. - * - * Tools that translate other media types or programming languages - * to and from `application/schema+json` MAY choose to convert that media - * type or programming language's native comments to or from `$comment` - * values. The behavior of such translation when both native comments and - * `$comment` properties are present is implementation-dependent. - * - * Implementations MAY strip `$comment` values at any point during - * processing. In particular, this allows for shortening schemas when the - * size of deployed schemas is a concern. - * - * Implementations MUST NOT take any other action based on the presence, - * absence, or contents of `$comment` properties. In particular, the - * value of `$comment` MUST NOT be collected as an annotation result. - */ - $comment?: string; - /** - * The `$defs` keyword reserves a location for schema authors to inline - * re-usable JSON Schemas into a more general schema. The keyword does not - * directly affect the validation result. - * - * This keyword's value MUST be an object. Each member value of this object - * MUST be a valid JSON Schema. - */ - $defs?: Record; - /** - * "The `$dynamicAnchor` indicates that the fragment is an extension - * point when used with the `$dynamicRef` keyword. This low-level, - * advanced feature makes it easier to extend recursive schemas such as the - * meta-schemas, without imposing any particular semantics on that - * extension. See `$dynamicRef` for more details. - */ - $dynamicAnchor?: string; - /** - * The `$dynamicRef` keyword is an applicator that allows for deferring - * the full resolution until runtime, at which point it is resolved each - * time it is encountered while evaluating an instance. - * - * Together with `$dynamicAnchor`, `$dynamicRef` implements a - * cooperative extension mechanism that is primarily useful with recursive - * schemas (schemas that reference themselves). Both the extension point - * and the runtime-determined extension target are defined with - * `$dynamicAnchor`, and only exhibit runtime dynamic behavior when - * referenced with `$dynamicRef`. - * - * The value of the `$dynamicRef` property MUST be a string which is - * a URI-Reference. Resolved against the current URI base, it produces - * the URI used as the starting point for runtime resolution. This initial - * resolution is safe to perform on schema load. - * - * If the initially resolved starting point URI includes a fragment that - * was created by the `$dynamicAnchor` keyword, the initial URI MUST be - * replaced by the URI (including the fragment) for the outermost schema - * resource in the [dynamic scope][scopes] that defines - * an identically named fragment with `$dynamicAnchor`. - * - * Otherwise, its behavior is identical to `$ref`, and no runtime - * resolution is needed. - * - * [scopes]: https://json-schema.org/draft/2020-12/json-schema-core.html#scopes - * - * @format "uri-reference" - */ - $dynamicRef?: string; - /** - * The `$id` keyword identifies a schema resource with its - * [canonical][[RFC6596]] URI. - * - * Note that this URI is an identifier and not necessarily a network - * locator. In the case of a network-addressable URL, a schema need not be - * downloadable from its canonical URI. - * - * If present, the value for this keyword MUST be a string, and MUST - * represent a valid [URI-reference][RFC3986]. This URI-reference SHOULD - * be normalized, and MUST resolve to an [absolute-URI][RFC3986] (without a - * fragment). Therefore, `$id` MUST NOT contain a non-empty fragment, - * and SHOULD NOT contain an empty fragment. - * - * Since an empty fragment in the context of the - * `application/schema+json` media type refers to the same resource as - * the base URI without a fragment, an implementation MAY normalize a URI - * ending with an empty fragment by removing the fragment. However, schema - * authors SHOULD NOT rely on this behavior across implementations. - * - * This URI also serves as the base URI for relative URI-references in - * keywords within the schema resource, in accordance with - * [RFC 3986][RFC3986] section 5.1.1 regarding base URIs embedded in - * content. - * - * The presence of `$id` in a subschema indicates that the subschema - * constitutes a distinct schema resource within a single schema document. - * Furthermore, in accordance with [RFC 3986][RFC3986] section 5.1.2 - * regarding encapsulating entities, if an `$id` in a subschema is a - * relative URI-reference, the base URI for resolving that reference is the - * URI of the parent schema resource. - * - * If no parent schema object explicitly identifies itself as a resource - * with `$id`, the base URI is that of the entire document. - * - * The root schema of a JSON Schema document SHOULD contain an `$id` - * keyword with an [absolute-URI][RFC3986] (containing a scheme, but no - * fragment). - * - * [RFC6596]: https://datatracker.ietf.org/doc/html/rfc6596 - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - * - * @format "uri-reference" - */ - $id?: string; - /** - * The `$ref` keyword is an applicator that is used to reference a - * statically identified schema. Its results are the results of the - * referenced schema. Other keywords can appear alongside of `$ref` in - * the same schema object. - * - * The value of the `$ref` property MUST be a string which is a - * URI-Reference. Resolved against the current URI base, it produces the - * URI of the schema to apply. - * - * @format "uri-reference" - */ - $ref?: string; - /** - * The `$schema` keyword is both used as a JSON Schema dialect identifier - * and as the identifier of a resource which is itself a JSON Schema, which - * describes the set of valid schemas written for this particular dialect. - * - * The value of this keyword MUST be a [URI][RFC3986] (containing a scheme) - * and this URI MUST be normalized. The current schema MUST be valid - * against the meta-schema identified by this URI. - * - * If this URI identifies a retrievable resource, that resource SHOULD be - * of media type `application/schema+json`. - * - * The `$schema` keyword SHOULD be used in the document root schema - * object, and MAY be used in the root schema objects of embedded schema - * resources. It MUST NOT appear in non-resource root schema objects. If - * absent from the document root schema, the resulting behavior is - * implementation-defined. - * - * Values for this property are defined elsewhere in this and other - * documents, and by other parties. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - * - * @format "uri" - */ - $schema?: string; - /** - * The `$vocabulary` keyword is used in meta-schemas to identify the - * vocabularies available for use in schemas described by that meta-schema. - * It is also used to indicate whether each vocabulary is required or - * optional, in the sense that an implementation MUST understand the - * required vocabularies in order to successfully process the schema. - * Together, this information forms a dialect. Any vocabulary that is - * understood by the implementation MUST be processed in a manner - * consistent with the semantic definitions contained within the - * vocabulary. - * - * The value of this keyword MUST be an object. The property names in the - * object MUST be URIs (containing a scheme) and this URI MUST be - * normalized. Each URI that appears as a property name identifies a - * specific set of keywords and their semantics. - * - * The URI MAY be a URL, but the nature of the retrievable resource is - * currently undefined, and reserved for future use. Vocabulary authors - * MAY use the URL of the vocabulary specification, in a human-readable - * media type such as `text/html` or `text/plain`, as the vocabulary - * URI. - * - * The values of the object properties MUST be booleans. If the value is - * `true`, then implementations that do not recognize the vocabulary MUST - * refuse to process any schemas that declare this meta-schema with - * `$schema`. If the value is `false`, implementations that do not - * recognize the vocabulary SHOULD proceed with processing such schemas. - * The value has no impact if the implementation understands the - * vocabulary. - * - * Unrecognized keywords SHOULD be ignored. This remains the case for - * keywords defined by unrecognized vocabularies. It is not currently - * possible to distinguish between unrecognized keywords that are defined - * in vocabularies from those that are not part of any vocabulary. - * - * The `$vocabulary` keyword SHOULD be used in the root schema of any - * schema document intended for use as a meta-schema. It MUST NOT appear - * in subschemas. - * - * The `$vocabulary` keyword MUST be ignored in schema documents that are - * not being processed as a meta-schema. - */ - $vocabulary?: Record; - /** - * @deprecated `additionalItems` has been deprecated in favor of `prefixItems` - * paired with `items`. - */ - additionalItems?: JSONSchema; - /** - * The value of `additionalProperties` MUST be a valid JSON Schema. - * - * The behavior of this keyword depends on the presence and annotation - * results of `properties` and `patternProperties` within the same - * schema object. Validation with `additionalProperties` applies only to - * the child values of instance names that do not appear in the annotation - * results of either `properties` or `patternProperties`. - * - * For all such properties, validation succeeds if the child instance - * validates against the `additionalProperties` schema. - * - * The annotation result of this keyword is the set of instance property - * names validated by this keyword's subschema. Annotation results for - * `additionalProperties` keywords from multiple schemas applied to the - * same instance location are combined by taking the union of the sets. - * - * Omitting this keyword has the same assertion behavior as an empty - * schema. - * - * Implementations MAY choose to implement or optimize this keyword in - * another way that produces the same effect, such as by directly checking - * the names in `properties` and the patterns in `patternProperties` - * against the instance property set. - */ - additionalProperties?: JSONSchema; - /** - * This keyword's value MUST be a non-empty array. Each item of the array - * MUST be a valid JSON Schema. - * - * An instance validates successfully against this keyword if it validates - * successfully against all schemas defined by this keyword's value. - */ - allOf?: MaybeReadonlyArray>; - /** - * This keyword's value MUST be a non-empty array. Each item of the array - * MUST be a valid JSON Schema. - * - * An instance validates successfully against this keyword if it validates - * successfully against at least one schema defined by this keyword's - * value. - */ - anyOf?: MaybeReadonlyArray>; - /** - * An instance validates successfully against this keyword if its value is - * equal to the value of the keyword. - * - * Use of this keyword is functionally equivalent to the `enum` keyword - * with a single value. - */ - const?: Value; - /** - * The value of this keyword MUST be a valid JSON Schema. - * - * An array instance is valid against `contains` if at least one of its - * elements is valid against the given schema. The subschema MUST be - * applied to every array element even after the first match has been - * found, in order to collect annotations for use by other keywords. - * This is to ensure that all possible annotations are collected. - * - * Logically, the validation result of applying the value subschema to each - * item in the array MUST be OR'ed with `false`, resulting in an overall - * validation result. - * - * This keyword produces an annotation value which is an array of the - * indexes to which this keyword validates successfully when applying its - * subschema, in ascending order. The value MAY be a boolean `true` if - * the subschema validates successfully when applied to every index of the - * instance. The annotation MUST be present if the instance array to which - * this keyword's schema applies is empty. - */ - contains?: JSONSchema; - /** - * If the instance value is a string, this property defines that the - * string SHOULD be interpreted as binary data and decoded using the - * encoding named by this property. [RFC 2045, Sec 6.1][RFC2045] lists the - * possible values for this property. - * - * The value of this property SHOULD be ignored if the instance described - * is not a string. - * - * If this keyword is absent, but `contentMediaType` is present, this - * indicates that the media type could be encoded into `UTF-8` like any - * other JSON string value, and does not require additional decoding. - * - * The value of this property MUST be a string. - * - * [RFC2045]: https://datatracker.ietf.org/doc/html/rfc2045#section-6.1 - */ - contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token"; - /** - * If the instance is a string, this property indicates the media type - * of the contents of the string. If `contentEncoding` is present, - * this property describes the decoded string. - * - * The value of this property must be a media type, as defined by - * [RFC 2046][RFC2046]. This property defines the media type of instances - * which this schema defines. - * - * The value of this property SHOULD be ignored if the instance described - * is not a string. - * - * If the `contentEncoding` property is not present, but the instance - * value is a string, then the value of this property SHOULD specify a text - * document type, and the character set SHOULD be the character set into - * which the JSON string value was decoded (for which the default is - * Unicode). - * - * [RFC2046]: https://datatracker.ietf.org/doc/html/rfc2046 - */ - contentMediaType?: string; - /** - * If the instance is a string, and if `contentMediaType` is present, - * this property contains a schema which describes the structure of the - * string. - * - * This keyword MAY be used with any media type that can be mapped into - * JSON Schema's data model. - * - * The value of this property MUST be a valid JSON schema. It SHOULD be - * ignored if `contentMediaType` is not present. - */ - contentSchema?: JSONSchema; - /** - * This keyword can be used to supply a default JSON value associated with - * a particular schema. It is RECOMMENDED that a `default` value be valid - * against the associated schema. - */ - default?: Value; - /** - * @deprecated `definitions` has been renamed to `$defs`. - */ - definitions?: Record; - /** - * @deprecated `dependencies` has been split into two keywords: - * `dependentSchemas` and `dependentRequired`. - */ - dependencies?: Record | JSONSchema>; - /** - * The value of this keyword MUST be an object. Properties in - * this object, if any, MUST be arrays. Elements in each array, - * if any, MUST be strings, and MUST be unique. - * - * This keyword specifies properties that are required if a specific - * other property is present. Their requirement is dependent on the - * presence of the other property. - * - * Validation succeeds if, for each name that appears in both - * the instance and as a name within this keyword's value, every - * item in the corresponding array is also the name of a property - * in the instance. - * - * Omitting this keyword has the same behavior as an empty object. - */ - dependentRequired?: Record>; - /** - * This keyword specifies subschemas that are evaluated if the instance is - * an object and contains a certain property. - * - * This keyword's value MUST be an object. Each value in the object MUST be - * a valid JSON Schema. - * - * If the object key is a property in the instance, the entire instance - * must validate against the subschema. Its use is dependent on the - * presence of the property. - * - * Omitting this keyword has the same behavior as an empty object. - */ - dependentSchemas?: Record; - /** - * The value of this keyword MUST be a boolean. When multiple occurrences - * of this keyword are applicable to a single sub-instance, applications - * SHOULD consider the instance location to be deprecated if any occurrence - * specifies a `true` value. - * - * If `deprecated` has a value of boolean `true`, it indicates that - * applications SHOULD refrain from usage of the declared property. It MAY - * mean the property is going to be removed in the future. - * - * A root schema containing `deprecated` with a value of `true` - * indicates that the entire resource being described MAY be removed in the - * future. - * - * The `deprecated` keyword applies to each instance location to which - * the schema object containing the keyword successfully applies. This can - * result in scenarios where every array item or object property is - * deprecated even though the containing array or object is not. - * - * Omitting this keyword has the same behavior as a value of `false`. - */ - deprecated?: boolean; - /** - * Can be used to decorate a user interface with explanation or information - * about the data produced. - */ - description?: string; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * When `if` is present, and the instance fails to validate against its - * subschema, then validation succeeds against this keyword if the instance - * successfully validates against this keyword's subschema. - * - * This keyword has no effect when `if` is absent, or when the instance - * successfully validates against its subschema. Implementations MUST NOT - * evaluate the instance against this keyword, for either validation or - * annotation collection purposes, in such cases. - */ - else?: JSONSchema; - /** - * The value of this keyword MUST be an array. This array SHOULD have at - * least one element. Elements in the array SHOULD be unique. - * - * An instance validates successfully against this keyword if its value is - * equal to one of the elements in this keyword's array value. - * - * Elements in the array might be of any type, including `null`. - */ - enum?: MaybeReadonlyArray; - /** - * The value of this keyword MUST be an array. When multiple occurrences of - * this keyword are applicable to a single sub-instance, implementations - * MUST provide a flat array of all values rather than an array of arrays. - * - * This keyword can be used to provide sample JSON values associated with a - * particular schema, for the purpose of illustrating usage. It is - * RECOMMENDED that these values be valid against the associated schema. - * - * Implementations MAY use the value(s) of `default`, if present, as an - * additional example. If `examples` is absent, `default` MAY still be - * used in this manner. - */ - examples?: MaybeReadonlyArray; - /** - * The value of `exclusiveMaximum` MUST be a number, representing an - * exclusive upper limit for a numeric instance. - * - * If the instance is a number, then the instance is valid only if it has a - * value strictly less than (not equal to) `exclusiveMaximum`. - */ - exclusiveMaximum?: number; - /** - * The value of `exclusiveMinimum` MUST be a number, representing an - * exclusive lower limit for a numeric instance. - * - * If the instance is a number, then the instance is valid only if it has a - * value strictly greater than (not equal to) `exclusiveMinimum`. - */ - exclusiveMinimum?: number; - /** - * Implementations MAY treat `format` as an assertion in addition to an - * annotation, and attempt to validate the value's conformance to the - * specified semantics. - * - * The value of this keyword is called a format attribute. It MUST be a - * string. A format attribute can generally only validate a given set - * of instance types. If the type of the instance to validate is not in - * this set, validation for this format attribute and instance SHOULD - * succeed. Format attributes are most often applied to strings, but can - * be specified to apply to any type. - * - * Implementations MAY support custom format attributes. Save for agreement - * between parties, schema authors SHALL NOT expect a peer implementation - * to support such custom format attributes. An implementation MUST NOT - * fail validation or cease processing due to an unknown format attribute. - * When treating `format` as an annotation, implementations SHOULD - * collect both known and unknown format attribute values. - */ - format?: string; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * This validation outcome of this keyword's subschema has no direct effect - * on the overall validation result. Rather, it controls which of the - * `then` or `else` keywords are evaluated. - * - * Instances that successfully validate against this keyword's subschema - * MUST also be valid against the subschema value of the `then` keyword, - * if present. - * - * Instances that fail to validate against this keyword's subschema MUST - * also be valid against the subschema value of the `else` keyword, if - * present. - * - * If annotations are being collected, they are collected - * from this keyword's subschema in the usual way, including when the - * keyword is present without either `then` or `else`. - */ - if?: JSONSchema; - /** - * The value of `items` MUST be a valid JSON Schema. - * - * This keyword applies its subschema to all instance elements at indexes - * greater than the length of the `prefixItems` array in the same schema - * object, as reported by the annotation result of that `prefixItems` - * keyword. If no such annotation result exists, `items` applies its - * subschema to all instance array elements. - * - * Note that the behavior of `items` without `prefixItems` is identical - * to that of the schema form of `items` in prior drafts. - * - * When `prefixItems` is present, the behavior of `items` is identical - * to the former `additionalItems` keyword. - * - * If the `items` subschema is applied to any positions within the - * instance array, it produces an annotation result of boolean `true`, - * indicating that all remaining array elements have been evaluated against - * this keyword's subschema. - * - * Omitting this keyword has the same assertion behavior as an empty - * schema. - * - * Implementations MAY choose to implement or optimize this keyword - * in another way that produces the same effect, such as by directly - * checking for the presence and size of a `prefixItems` array. - */ - items?: JSONSchema; - /** - * The value of this keyword MUST be a non-negative integer. - * - * If `contains` is not present within the same schema object, then this - * keyword has no effect. - * - * An instance array is valid against `maxContains` in two ways, - * depending on the form of the annotation result of an adjacent - * `contains` keyword. The first way is if the annotation result is an - * array and the length of that array is less than or equal to the - * `maxContains` value. The second way is if the annotation result is a - * boolean `true` and the instance array length is less than or equal to - * the `maxContains` value. - */ - maxContains?: number; - /** - * The value of `maximum` MUST be a number, representing an inclusive - * upper limit for a numeric instance. - * - * If the instance is a number, then this keyword validates only if the - * instance is less than or exactly equal to `maximum`. - */ - maximum?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An array instance is valid against `maxItems` if its size is less - * than, or equal to, the value of this keyword. - * - * @minimum 0 - */ - maxItems?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * A string instance is valid against this keyword if its length is less - * than, or equal to, the value of this keyword. - * - * The length of a string instance is defined as the number of its - * characters as defined by [RFC 8259][RFC8259]. - * - * [RFC8259]: https://datatracker.ietf.org/doc/html/rfc8259 - * - * @minimum 0 - */ - maxLength?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An object instance is valid against `maxProperties` if its number of - * `properties` is less than, or equal to, the value of this keyword. - * - * @minimum 0 - */ - maxProperties?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * If `contains` is not present within the same schema object, then this - * keyword has no effect. - * - * An instance array is valid against `minContains` in two ways, - * depending on the form of the annotation result of an adjacent - * `contains` keyword. The first way is if the annotation result is an - * array and the length of that array is greater than or equal to the - * `minContains` value. The second way is if the annotation result is a - * boolean `true` and the instance array length is greater than or equal - * to the `minContains` value. - * - * A value of `0` is allowed, but is only useful for setting a range - * of occurrences from `0` to the value of `maxContains`. A value of - * `0` with no `maxContains` causes `contains` to always pass - * validation. - * - * Omitting this keyword has the same behavior as a value of `1`. - * - * @default 1 - */ - minContains?: number; - /** - * The value of `minimum` MUST be a number, representing an inclusive - * lower limit for a numeric instance. - * - * If the instance is a number, then this keyword validates only if the - * instance is greater than or exactly equal to `minimum`. - */ - minimum?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An array instance is valid against `minItems` if its size is greater - * than, or equal to, the value of this keyword. - * - * Omitting this keyword has the same behavior as a value of `0`. - * - * @default 0 - * @minimum 0 - */ - minItems?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * A string instance is valid against this keyword if its length is greater - * than, or equal to, the value of this keyword. - * - * The length of a string instance is defined as the number of its - * characters as defined by [RFC 8259][RFC8259]. - * - * Omitting this keyword has the same behavior as a value of `0`. - * - * [RFC8259]: https://datatracker.ietf.org/doc/html/rfc8259 - * - * @default 0 - * @minimum 0 - */ - minLength?: number; - /** - * The value of this keyword MUST be a non-negative integer. - * - * An object instance is valid against `minProperties` if its number of - * `properties` is greater than, or equal to, the value of this keyword. - * - * Omitting this keyword has the same behavior as a value of `0`. - * - * @default 0 - * @minimum 0 - */ - minProperties?: number; - /** - * The value of `multipleOf` MUST be a number, strictly greater than - * `0`. - * - * A numeric instance is valid only if division by this keyword's value - * results in an integer. - * - * @exclusiveMinimum 0 - */ - multipleOf?: number; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * An instance is valid against this keyword if it fails to validate - * successfully against the schema defined by this keyword. - */ - not?: JSONSchema; - /** - * This keyword's value MUST be a non-empty array. Each item of the array - * MUST be a valid JSON Schema. - * - * An instance validates successfully against this keyword if it validates - * successfully against exactly one schema defined by this keyword's value. - */ - oneOf?: MaybeReadonlyArray>; - /** - * The value of this keyword MUST be a string. This string SHOULD be a - * valid regular expression, according to the [ECMA-262][ecma262] regular - * expression dialect. - * - * A string instance is considered valid if the regular expression matches - * the instance successfully. Recall: regular expressions are not - * implicitly anchored. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - * - * @format "regex" - */ - pattern?: string; - /** - * The value of `patternProperties` MUST be an object. Each property name - * of this object SHOULD be a valid regular expression, according to the - * [ECMA-262][ecma262] regular expression dialect. Each property value of - * this object MUST be a valid JSON Schema. - * - * Validation succeeds if, for each instance name that matches any regular - * expressions that appear as a property name in this keyword's value, - * the child instance for that name successfully validates against each - * schema that corresponds to a matching regular expression. - * - * The annotation result of this keyword is the set of instance property - * names matched by this keyword. Omitting this keyword has the same - * assertion behavior as an empty object. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - */ - patternProperties?: Record; - /** - * The value of `prefixItems` MUST be a non-empty array of valid JSON - * Schemas. - * - * Validation succeeds if each element of the instance validates against - * the schema at the same position, if any. This keyword does not - * constrain the length of the array. If the array is longer than this - * keyword's value, this keyword validates only the prefix of matching - * length. - * - * This keyword produces an annotation value which is the largest index to - * which this keyword applied a subschema. The value MAY be a boolean - * `true` if a subschema was applied to every index of the instance, such - * as is produced by the `items` keyword. - * This annotation affects the behavior of `items` and - * `unevaluatedItems`. - * - * Omitting this keyword has the same assertion behavior as an empty array. - */ - prefixItems?: MaybeReadonlyArray | JSONSchema; - /** - * The value of `properties` MUST be an object. Each value of this object - * MUST be a valid JSON Schema. - * - * Validation succeeds if, for each name that appears in both the instance - * and as a name within this keyword's value, the child instance for that - * name successfully validates against the corresponding schema. - * - * The annotation result of this keyword is the set of instance property - * names matched by this keyword. - * - * Omitting this keyword has the same assertion behavior as an empty - * object. - */ - properties?: Record; - /** - * The value of `propertyNames` MUST be a valid JSON Schema. - * - * If the instance is an object, this keyword validates if every property - * name in the instance validates against the provided schema. - * Note the property name that the schema is testing will always be a - * string. - * - * Omitting this keyword has the same behavior as an empty schema. - */ - propertyNames?: JSONSchema; - /** - * The value of this keyword MUST be a boolean. When multiple occurrences - * of this keyword are applicable to a single sub-instance, the resulting - * value MUST be `true` if any occurrence specifies a `true` value, and - * MUST be `false` otherwise. - * - * If `readOnly` has a value of boolean `true`, it indicates that the - * value of the instance is managed exclusively by the owning authority, - * and attempts by an application to modify the value of this property are - * expected to be ignored or rejected by that owning authority. - * - * An instance document that is marked as `readOnly` for the entire - * document MAY be ignored if sent to the owning authority, or MAY result - * in an error, at the authority's discretion. - * - * For example, `readOnly` would be used to mark a database-generated - * serial number as read-only. - * - * This keyword can be used to assist in user interface instance - * generation. - * - * @default false - */ - readOnly?: boolean; - /** - * The value of this keyword MUST be an array. Elements of this array, if - * any, MUST be strings, and MUST be unique. - * - * An object instance is valid against this keyword if every item in the - * array is the name of a property in the instance. - * - * Omitting this keyword has the same behavior as an empty array. - */ - required?: MaybeReadonlyArray; - /** - * This keyword's value MUST be a valid JSON Schema. - * - * When `if` is present, and the instance successfully validates against - * its subschema, then validation succeeds against this keyword if the - * instance also successfully validates against this keyword's subschema. - * - * This keyword has no effect when `if` is absent, or when the instance - * fails to validate against its subschema. Implementations MUST NOT - * evaluate the instance against this keyword, for either validation or - * annotation collection purposes, in such cases. - */ - then?: JSONSchema; - /** - * Can be used to decorate a user interface with a short label about the - * data produced. - */ - title?: string; - /** - * The value of this keyword MUST be either a string or an array. If it is - * an array, elements of the array MUST be strings and MUST be unique. - * - * String values MUST be one of the six primitive types (`"null"`, - * `"boolean"`, `"object"`, `"array"`, `"number"`, or - * `"string"`), or `"integer"` which matches any number with a zero - * fractional part. - * - * An instance validates if and only if the instance is in any of the sets - * listed for this keyword. - */ - type?: SchemaType; - /** - * The value of `unevaluatedItems` MUST be a valid JSON Schema. - * - * The behavior of this keyword depends on the annotation results of - * adjacent keywords that apply to the instance location being validated. - * Specifically, the annotations from `prefixItems`, `items`, and - * `contains`, which can come from those keywords when they are adjacent - * to the `unevaluatedItems` keyword. Those three annotations, as well as - * `unevaluatedItems`, can also result from any and all adjacent - * [in-place applicator][in-place-applicator] keywords. - * - * If no relevant annotations are present, the `unevaluatedItems` - * subschema MUST be applied to all locations in the array. - * If a boolean `true` value is present from any of the relevant - * annotations, `unevaluatedItems` MUST be ignored. Otherwise, the - * subschema MUST be applied to any index greater than the largest - * annotation value for `prefixItems`, which does not appear in any - * annotation value for `contains`. - * - * This means that `prefixItems`, `items`, `contains`, and all - * in-place applicators MUST be evaluated before this keyword can be - * evaluated. Authors of extension keywords MUST NOT define an in-place - * applicator that would need to be evaluated after this keyword. - * - * If the `unevaluatedItems` subschema is applied to any positions within - * the instance array, it produces an annotation result of boolean - * `true`, analogous to the behavior of `items`. - * - * Omitting this keyword has the same assertion behavior as an empty - * schema. - * - * [in-place-applicator]: https://json-schema.org/draft/2020-12/json-schema-core.html#in-place - */ - unevaluatedItems?: JSONSchema; - /** - * The value of `unevaluatedProperties` MUST be a valid JSON Schema. - * - * The behavior of this keyword depends on the annotation results of - * adjacent keywords that apply to the instance location being validated. - * Specifically, the annotations from `properties`, - * `patternProperties`, and `additionalProperties`, which can come from - * those keywords when they are adjacent to the `unevaluatedProperties` - * keyword. Those three annotations, as well as `unevaluatedProperties`, - * can also result from any and all adjacent - * [in-place applicator][in-place-applicator] keywords. - * - * Validation with `unevaluatedProperties` applies only to the child - * values of instance names that do not appear in the `properties`, - * `patternProperties`, `additionalProperties`, or - * `unevaluatedProperties` annotation results that apply to the - * instance location being validated. - * - * For all such properties, validation succeeds if the child instance - * validates against the "unevaluatedProperties" schema. - * - * This means that `properties`, `patternProperties`, - * `additionalProperties`, and all in-place applicators MUST be evaluated - * before this keyword can be evaluated. Authors of extension keywords - * MUST NOT define an in-place applicator that would need to be evaluated - * after this keyword. - * - * The annotation result of this keyword is the set of instance property - * names validated by this keyword's subschema. - * - * Omitting this keyword has the same assertion behavior as an empty - * schema. - * - * [in-place-applicator]: https://json-schema.org/draft/2020-12/json-schema-core.html#in-place - */ - unevaluatedProperties?: JSONSchema; - /** - * The value of this keyword MUST be a boolean. - * - * If this keyword has boolean value `false`, the instance validates - * successfully. If it has boolean value `true`, the instance validates - * successfully if all of its elements are unique. - * - * Omitting this keyword has the same behavior as a value of `false`. - * - * @default false - */ - uniqueItems?: boolean; - /** - * The value of this keyword MUST be a boolean. When multiple occurrences - * of this keyword is applicable to a single sub-instance, the resulting - * value MUST be `true` if any occurrence specifies a `true` value, and - * MUST be `false` otherwise. - * - * If `writeOnly` has a value of boolean `true`, it indicates that the - * value is never present when the instance is retrieved from the owning - * authority. It can be present when sent to the owning authority to update - * or create the document (or the resource it represents), but it will not - * be included in any updated or newly created version of the instance. - * - * An instance document that is marked as `writeOnly` for the entire - * document MAY be returned as a blank document of some sort, or MAY - * produce an error upon retrieval, or have the retrieval request ignored, - * at the authority's discretion. - * - * For example, `writeOnly` would be used to mark a password input field. - * - * These keywords can be used to assist in user interface instance - * generation. In particular, an application MAY choose to use a widget - * that hides input values as they are typed for write-only fields. - * - * @default false - */ - writeOnly?: boolean; -}; -export declare namespace JSONSchema { - type TypeValue = ValueOf | TypeName | Array | TypeName> | ReadonlyArray | TypeName>; - /** - * JSON Schema interface - */ - type Interface = Exclude, boolean>; - type Array = Pick, KeywordByType.Any | KeywordByType.Array>; - type Boolean = Pick, KeywordByType.Any>; - type Integer = Pick, KeywordByType.Any | KeywordByType.Number>; - type Number = Pick, KeywordByType.Any | KeywordByType.Number>; - type Null = Pick, KeywordByType.Any>; - type Object = Pick, KeywordByType.Any | KeywordByType.Object>; - type String = Pick, KeywordByType.Any | KeywordByType.String>; -} -declare namespace KeywordByType { - type Any = "$anchor" | "$comment" | "$defs" | "$dynamicAnchor" | "$dynamicRef" | "$id" | "$ref" | "$schema" | "$vocabulary" | "allOf" | "anyOf" | "const" | "default" | "definitions" | "deprecated" | "description" | "else" | "enum" | "examples" | "format" | "if" | "not" | "oneOf" | "readOnly" | "then" | "title" | "type" | "writeOnly"; - type Array = "additionalItems" | "contains" | "items" | "maxContains" | "maxItems" | "minContains" | "minItems" | "prefixItems" | "unevaluatedItems" | "uniqueItems"; - type Number = "exclusiveMaximum" | "exclusiveMinimum" | "maximum" | "minimum" | "multipleOf"; - type Object = "additionalProperties" | "dependencies" | "dependentRequired" | "dependentSchemas" | "maxProperties" | "minProperties" | "patternProperties" | "properties" | "propertyNames" | "required" | "unevaluatedProperties"; - type String = "contentEncoding" | "contentMediaType" | "contentSchema" | "maxLength" | "minLength" | "pattern"; -} -/** - * Content encoding strategy enum. - * - * - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1) - * - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705) - */ -export declare enum ContentEncoding { - /** - * Only US-ASCII characters, which use the lower 7 bits for each character. - * - * Each line must be less than 1,000 characters. - */ - "7bit" = "7bit", - /** - * Allow extended ASCII characters which can use the 8th (highest) bit to - * indicate special characters not available in 7bit. - * - * Each line must be less than 1,000 characters. - */ - "8bit" = "8bit", - /** - * Useful for data that is mostly non-text. - */ - Base64 = "base64", - /** - * Same character set as 8bit, with no line length restriction. - */ - Binary = "binary", - /** - * An extension token defined by a standards-track RFC and registered with - * IANA. - */ - IETFToken = "ietf-token", - /** - * Lines are limited to 76 characters, and line breaks are represented using - * special characters that are escaped. - */ - QuotedPrintable = "quoted-printable", - /** - * The two characters "X-" or "x-" followed, with no intervening white space, - * by any token. - */ - XToken = "x-token" -} -/** - * This enum provides well-known formats that apply to strings. - */ -export declare enum Format { - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "full-date" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Date = "date", - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "date-time" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - DateTime = "date-time", - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "duration" production. - */ - Duration = "duration", - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by by the "Mailbox" ABNF rule in [RFC - * 5321][RFC5322], section 4.1.2. - * - * [RFC5321]: https://datatracker.ietf.org/doc/html/rfc5321 - */ - Email = "email", - /** - * As defined by [RFC 1123, section 2.1][RFC1123], including host names - * produced using the Punycode algorithm specified in - * [RFC 5891, section 4.4][RFC5891]. - * - * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123 - * [RFC5891]: https://datatracker.ietf.org/doc/html/rfc5891 - */ - Hostname = "hostname", - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by the extended "Mailbox" ABNF rule in - * [RFC 6531][RFC6531], section 3.3. - * - * [RFC6531]: https://datatracker.ietf.org/doc/html/rfc6531 - */ - IDNEmail = "idn-email", - /** - * As defined by either [RFC 1123, section 2.1][RFC1123] as for hostname, or - * an internationalized hostname as defined by - * [RFC 5890, section 2.3.2.3][RFC5890]. - * - * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123 - * [RFC5890]: https://datatracker.ietf.org/doc/html/rfc5890 - */ - IDNHostname = "idn-hostname", - /** - * An IPv4 address according to the "dotted-quad" ABNF syntax as defined in - * [RFC 2673, section 3.2][RFC2673]. - * - * [RFC2673]: https://datatracker.ietf.org/doc/html/rfc2673 - */ - IPv4 = "ipv4", - /** - * An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291]. - * - * [RFC4291]: https://datatracker.ietf.org/doc/html/rfc4291 - */ - IPv6 = "ipv6", - /** - * A string instance is valid against this attribute if it is a valid IRI, - * according to [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - IRI = "iri", - /** - * A string instance is valid against this attribute if it is a valid IRI - * Reference (either an IRI or a relative-reference), according to - * [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - IRIReference = "iri-reference", - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - JSONPointer = "json-pointer", - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer fragment, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - JSONPointerURIFragment = "json-pointer-uri-fragment", - /** - * This attribute applies to string instances. - * - * A regular expression, which SHOULD be valid according to the - * [ECMA-262][ecma262] regular expression dialect. - * - * Implementations that validate formats MUST accept at least the subset of - * [ECMA-262][ecma262] defined in the [Regular Expressions][regexInterop] - * section of this specification, and SHOULD accept all valid - * [ECMA-262][ecma262] expressions. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - * [regexInterop]: https://json-schema.org/draft/2020-12/json-schema-validation.html#regexInterop - */ - RegEx = "regex", - /** - * A string instance is valid against this attribute if it is a valid - * [Relative JSON Pointer][relative-json-pointer]. - * - * [relative-json-pointer]: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01 - */ - RelativeJSONPointer = "relative-json-pointer", - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "time" production in [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Time = "time", - /** - * A string instance is valid against this attribute if it is a valid URI, - * according to [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - URI = "uri", - /** - * A string instance is valid against this attribute if it is a valid URI - * Reference (either a URI or a relative-reference), according to - * [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - URIReference = "uri-reference", - /** - * A string instance is valid against this attribute if it is a valid URI - * Template (of any level), according to [RFC 6570][RFC6570]. - * - * Note that URI Templates may be used for IRIs; there is no separate IRI - * Template specification. - * - * [RFC6570]: https://datatracker.ietf.org/doc/html/rfc6570 - */ - URITemplate = "uri-template", - /** - * A string instance is valid against this attribute if it is a valid string - * representation of a UUID, according to [RFC 4122][RFC4122]. - * - * [RFC4122]: https://datatracker.ietf.org/doc/html/rfc4122 - */ - UUID = "uuid" -} -/** - * Enum consisting of simple type names for the `type` keyword - */ -export declare enum TypeName { - /** - * Value MUST be an array. - */ - Array = "array", - /** - * Value MUST be a boolean. - */ - Boolean = "boolean", - /** - * Value MUST be an integer, no floating point numbers are allowed. This is a - * subset of the number type. - */ - Integer = "integer", - /** - * Value MUST be null. Note this is mainly for purpose of being able use union - * types to define nullability. If this type is not included in a union, null - * values are not allowed (the primitives listed above do not allow nulls on - * their own). - */ - Null = "null", - /** - * Value MUST be a number, floating point numbers are allowed. - */ - Number = "number", - /** - * Value MUST be an object. - */ - Object = "object", - /** - * Value MUST be a string. - */ - String = "string" -} -export declare const keywords: readonly ["$anchor", "$comment", "$defs", "$dynamicAnchor", "$dynamicRef", "$id", "$ref", "$schema", "$vocabulary", "additionalItems", "additionalProperties", "allOf", "anyOf", "const", "contains", "contentEncoding", "contentMediaType", "contentSchema", "default", "definitions", "dependencies", "dependentRequired", "dependentSchemas", "deprecated", "description", "else", "enum", "examples", "exclusiveMaximum", "exclusiveMinimum", "format", "if", "items", "maxContains", "maximum", "maxItems", "maxLength", "maxProperties", "minContains", "minimum", "minItems", "minLength", "minProperties", "multipleOf", "not", "oneOf", "pattern", "patternProperties", "prefixItems", "properties", "propertyNames", "readOnly", "required", "then", "title", "type", "unevaluatedItems", "unevaluatedProperties", "uniqueItems", "writeOnly"]; -export {}; diff --git a/node_modules/json-schema-typed/draft_2020_12.js b/node_modules/json-schema-typed/draft_2020_12.js deleted file mode 100644 index 8a47619..0000000 --- a/node_modules/json-schema-typed/draft_2020_12.js +++ /dev/null @@ -1,352 +0,0 @@ -// @generated -// This code is automatically generated. Manual editing is not recommended. -/* - * BSD-2-Clause License - * - * Original source code is copyright (c) 2025 Remy Rylan - * - * - * Documentation and keyword descriptions are copyright (c) 2020 IETF Trust - * , Austin Wright , Henry Andrews - * , Ben Hutton , and Greg Dennis - * . All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -export const draft = "2020-12"; -export const $schema = "https://json-schema.org/draft/2020-12/schema"; -// ----------------------------------------------------------------------------- -/** - * Content encoding strategy enum. - * - * - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1) - * - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705) - */ -export var ContentEncoding; -(function (ContentEncoding) { - /** - * Only US-ASCII characters, which use the lower 7 bits for each character. - * - * Each line must be less than 1,000 characters. - */ - ContentEncoding["7bit"] = "7bit"; - /** - * Allow extended ASCII characters which can use the 8th (highest) bit to - * indicate special characters not available in 7bit. - * - * Each line must be less than 1,000 characters. - */ - ContentEncoding["8bit"] = "8bit"; - /** - * Useful for data that is mostly non-text. - */ - ContentEncoding["Base64"] = "base64"; - /** - * Same character set as 8bit, with no line length restriction. - */ - ContentEncoding["Binary"] = "binary"; - /** - * An extension token defined by a standards-track RFC and registered with - * IANA. - */ - ContentEncoding["IETFToken"] = "ietf-token"; - /** - * Lines are limited to 76 characters, and line breaks are represented using - * special characters that are escaped. - */ - ContentEncoding["QuotedPrintable"] = "quoted-printable"; - /** - * The two characters "X-" or "x-" followed, with no intervening white space, - * by any token. - */ - ContentEncoding["XToken"] = "x-token"; -})(ContentEncoding || (ContentEncoding = {})); -/** - * This enum provides well-known formats that apply to strings. - */ -export var Format; -(function (Format) { - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "full-date" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Format["Date"] = "date"; - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "date-time" production in - * [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Format["DateTime"] = "date-time"; - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "duration" production. - */ - Format["Duration"] = "duration"; - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by by the "Mailbox" ABNF rule in [RFC - * 5321][RFC5322], section 4.1.2. - * - * [RFC5321]: https://datatracker.ietf.org/doc/html/rfc5321 - */ - Format["Email"] = "email"; - /** - * As defined by [RFC 1123, section 2.1][RFC1123], including host names - * produced using the Punycode algorithm specified in - * [RFC 5891, section 4.4][RFC5891]. - * - * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123 - * [RFC5891]: https://datatracker.ietf.org/doc/html/rfc5891 - */ - Format["Hostname"] = "hostname"; - /** - * A string instance is valid against this attribute if it is a valid Internet - * email address as defined by the extended "Mailbox" ABNF rule in - * [RFC 6531][RFC6531], section 3.3. - * - * [RFC6531]: https://datatracker.ietf.org/doc/html/rfc6531 - */ - Format["IDNEmail"] = "idn-email"; - /** - * As defined by either [RFC 1123, section 2.1][RFC1123] as for hostname, or - * an internationalized hostname as defined by - * [RFC 5890, section 2.3.2.3][RFC5890]. - * - * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123 - * [RFC5890]: https://datatracker.ietf.org/doc/html/rfc5890 - */ - Format["IDNHostname"] = "idn-hostname"; - /** - * An IPv4 address according to the "dotted-quad" ABNF syntax as defined in - * [RFC 2673, section 3.2][RFC2673]. - * - * [RFC2673]: https://datatracker.ietf.org/doc/html/rfc2673 - */ - Format["IPv4"] = "ipv4"; - /** - * An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291]. - * - * [RFC4291]: https://datatracker.ietf.org/doc/html/rfc4291 - */ - Format["IPv6"] = "ipv6"; - /** - * A string instance is valid against this attribute if it is a valid IRI, - * according to [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - Format["IRI"] = "iri"; - /** - * A string instance is valid against this attribute if it is a valid IRI - * Reference (either an IRI or a relative-reference), according to - * [RFC 3987][RFC3987]. - * - * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987 - */ - Format["IRIReference"] = "iri-reference"; - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - Format["JSONPointer"] = "json-pointer"; - /** - * A string instance is valid against this attribute if it is a valid JSON - * string representation of a JSON Pointer fragment, according to - * [RFC 6901, section 5][RFC6901]. - * - * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 - */ - Format["JSONPointerURIFragment"] = "json-pointer-uri-fragment"; - /** - * This attribute applies to string instances. - * - * A regular expression, which SHOULD be valid according to the - * [ECMA-262][ecma262] regular expression dialect. - * - * Implementations that validate formats MUST accept at least the subset of - * [ECMA-262][ecma262] defined in the [Regular Expressions][regexInterop] - * section of this specification, and SHOULD accept all valid - * [ECMA-262][ecma262] expressions. - * - * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ - * [regexInterop]: https://json-schema.org/draft/2020-12/json-schema-validation.html#regexInterop - */ - Format["RegEx"] = "regex"; - /** - * A string instance is valid against this attribute if it is a valid - * [Relative JSON Pointer][relative-json-pointer]. - * - * [relative-json-pointer]: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01 - */ - Format["RelativeJSONPointer"] = "relative-json-pointer"; - /** - * A string instance is valid against this attribute if it is a valid - * representation according to the "time" production in [RFC 3339][RFC3339]. - * - * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339 - */ - Format["Time"] = "time"; - /** - * A string instance is valid against this attribute if it is a valid URI, - * according to [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - Format["URI"] = "uri"; - /** - * A string instance is valid against this attribute if it is a valid URI - * Reference (either a URI or a relative-reference), according to - * [RFC3986][RFC3986]. - * - * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 - */ - Format["URIReference"] = "uri-reference"; - /** - * A string instance is valid against this attribute if it is a valid URI - * Template (of any level), according to [RFC 6570][RFC6570]. - * - * Note that URI Templates may be used for IRIs; there is no separate IRI - * Template specification. - * - * [RFC6570]: https://datatracker.ietf.org/doc/html/rfc6570 - */ - Format["URITemplate"] = "uri-template"; - /** - * A string instance is valid against this attribute if it is a valid string - * representation of a UUID, according to [RFC 4122][RFC4122]. - * - * [RFC4122]: https://datatracker.ietf.org/doc/html/rfc4122 - */ - Format["UUID"] = "uuid"; -})(Format || (Format = {})); -/** - * Enum consisting of simple type names for the `type` keyword - */ -export var TypeName; -(function (TypeName) { - /** - * Value MUST be an array. - */ - TypeName["Array"] = "array"; - /** - * Value MUST be a boolean. - */ - TypeName["Boolean"] = "boolean"; - /** - * Value MUST be an integer, no floating point numbers are allowed. This is a - * subset of the number type. - */ - TypeName["Integer"] = "integer"; - /** - * Value MUST be null. Note this is mainly for purpose of being able use union - * types to define nullability. If this type is not included in a union, null - * values are not allowed (the primitives listed above do not allow nulls on - * their own). - */ - TypeName["Null"] = "null"; - /** - * Value MUST be a number, floating point numbers are allowed. - */ - TypeName["Number"] = "number"; - /** - * Value MUST be an object. - */ - TypeName["Object"] = "object"; - /** - * Value MUST be a string. - */ - TypeName["String"] = "string"; -})(TypeName || (TypeName = {})); -// ----------------------------------------------------------------------------- -// Keywords -// ----------------------------------------------------------------------------- -export const keywords = [ - "$anchor", - "$comment", - "$defs", - "$dynamicAnchor", - "$dynamicRef", - "$id", - "$ref", - "$schema", - "$vocabulary", - "additionalItems", - "additionalProperties", - "allOf", - "anyOf", - "const", - "contains", - "contentEncoding", - "contentMediaType", - "contentSchema", - "default", - "definitions", - "dependencies", - "dependentRequired", - "dependentSchemas", - "deprecated", - "description", - "else", - "enum", - "examples", - "exclusiveMaximum", - "exclusiveMinimum", - "format", - "if", - "items", - "maxContains", - "maximum", - "maxItems", - "maxLength", - "maxProperties", - "minContains", - "minimum", - "minItems", - "minLength", - "minProperties", - "multipleOf", - "not", - "oneOf", - "pattern", - "patternProperties", - "prefixItems", - "properties", - "propertyNames", - "readOnly", - "required", - "then", - "title", - "type", - "unevaluatedItems", - "unevaluatedProperties", - "uniqueItems", - "writeOnly", -]; diff --git a/node_modules/json-schema-typed/package.json b/node_modules/json-schema-typed/package.json deleted file mode 100644 index 41f44cf..0000000 --- a/node_modules/json-schema-typed/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "json-schema-typed", - "description": "JSON Schema TypeScript definitions with complete inline documentation.", - "license": "BSD-2-Clause", - "version": "8.0.2", - "homepage": "https://github.com/RemyRylan/json-schema-typed/tree/main/dist/node", - "repository": { - "type": "git", - "url": "https://github.com/RemyRylan/json-schema-typed.git" - }, - "author": { - "name": "Remy Rylan", - "url": "https://github.com/RemyRylan" - }, - "main": "./draft_2020_12.js", - "types": "./draft_2020_12.d.ts", - "type": "module", - "exports": { - ".": { - "types": "./draft_2020_12.d.ts", - "default": "./draft_2020_12.js" - }, - "./draft-07": { - "types": "./draft_07.d.ts", - "default": "./draft_07.js" - }, - "./draft-2019-09": { - "types": "./draft_2019_09.d.ts", - "default": "./draft_2019_09.js" - }, - "./draft-2020-12": { - "types": "./draft_2020_12.d.ts", - "default": "./draft_2020_12.js" - } - }, - "keywords": [ - "jsonschema", - "typescript", - "types", - "definitions", - "json", - "schema" - ] -} diff --git a/node_modules/math-intrinsics/.eslintrc b/node_modules/math-intrinsics/.eslintrc deleted file mode 100644 index d90a1bc..0000000 --- a/node_modules/math-intrinsics/.eslintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "eqeqeq": ["error", "allow-null"], - "id-length": "off", - "new-cap": ["error", { - "capIsNewExceptions": [ - "RequireObjectCoercible", - "ToObject", - ], - }], - }, -} diff --git a/node_modules/math-intrinsics/.github/FUNDING.yml b/node_modules/math-intrinsics/.github/FUNDING.yml deleted file mode 100644 index 868f4ff..0000000 --- a/node_modules/math-intrinsics/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/math-intrinsics -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/math-intrinsics/CHANGELOG.md b/node_modules/math-intrinsics/CHANGELOG.md deleted file mode 100644 index 9cf48f5..0000000 --- a/node_modules/math-intrinsics/CHANGELOG.md +++ /dev/null @@ -1,24 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.1.0](https://github.com/es-shims/math-intrinsics/compare/v1.0.0...v1.1.0) - 2024-12-18 - -### Commits - -- [New] add `round` [`7cfb044`](https://github.com/es-shims/math-intrinsics/commit/7cfb04460c0fbdf1ca101eecbac3f59d11994130) -- [Tests] add attw [`e96be8f`](https://github.com/es-shims/math-intrinsics/commit/e96be8fbf58449eafe976446a0470e6ea561ad8d) -- [Dev Deps] update `@types/tape` [`30d0023`](https://github.com/es-shims/math-intrinsics/commit/30d00234ce8a3fa0094a61cd55d6686eb91e36ec) - -## v1.0.0 - 2024-12-11 - -### Commits - -- Initial implementation, tests, readme, types [`b898caa`](https://github.com/es-shims/math-intrinsics/commit/b898caae94e9994a94a42b8740f7bbcfd0a868fe) -- Initial commit [`02745b0`](https://github.com/es-shims/math-intrinsics/commit/02745b03a62255af8a332771987b55d127538d9c) -- [New] add `constants/maxArrayLength`, `mod` [`b978178`](https://github.com/es-shims/math-intrinsics/commit/b978178a57685bd23ed1c7efe2137f3784f5fcc5) -- npm init [`a39fc57`](https://github.com/es-shims/math-intrinsics/commit/a39fc57e5639a645d0bd52a0dc56202480223be2) -- Only apps should have lockfiles [`9451580`](https://github.com/es-shims/math-intrinsics/commit/94515800fb34db4f3cc7e99290042d45609ac7bd) diff --git a/node_modules/math-intrinsics/LICENSE b/node_modules/math-intrinsics/LICENSE deleted file mode 100644 index 34995e7..0000000 --- a/node_modules/math-intrinsics/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 ECMAScript Shims - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/math-intrinsics/README.md b/node_modules/math-intrinsics/README.md deleted file mode 100644 index 4a66dcf..0000000 --- a/node_modules/math-intrinsics/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# math-intrinsics [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -ES Math-related intrinsics and helpers, robustly cached. - - - `abs` - - `floor` - - `isFinite` - - `isInteger` - - `isNaN` - - `isNegativeZero` - - `max` - - `min` - - `mod` - - `pow` - - `round` - - `sign` - - `constants/maxArrayLength` - - `constants/maxSafeInteger` - - `constants/maxValue` - - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -## Security - -Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. - -[package-url]: https://npmjs.org/package/math-intrinsics -[npm-version-svg]: https://versionbadg.es/es-shims/math-intrinsics.svg -[deps-svg]: https://david-dm.org/es-shims/math-intrinsics.svg -[deps-url]: https://david-dm.org/es-shims/math-intrinsics -[dev-deps-svg]: https://david-dm.org/es-shims/math-intrinsics/dev-status.svg -[dev-deps-url]: https://david-dm.org/es-shims/math-intrinsics#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/math-intrinsics.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/math-intrinsics.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/es-object.svg -[downloads-url]: https://npm-stat.com/charts.html?package=math-intrinsics -[codecov-image]: https://codecov.io/gh/es-shims/math-intrinsics/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/es-shims/math-intrinsics/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/math-intrinsics -[actions-url]: https://github.com/es-shims/math-intrinsics/actions diff --git a/node_modules/math-intrinsics/abs.d.ts b/node_modules/math-intrinsics/abs.d.ts deleted file mode 100644 index 14ad9c6..0000000 --- a/node_modules/math-intrinsics/abs.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Math.abs; \ No newline at end of file diff --git a/node_modules/math-intrinsics/abs.js b/node_modules/math-intrinsics/abs.js deleted file mode 100644 index a751424..0000000 --- a/node_modules/math-intrinsics/abs.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./abs')} */ -module.exports = Math.abs; diff --git a/node_modules/math-intrinsics/constants/maxArrayLength.d.ts b/node_modules/math-intrinsics/constants/maxArrayLength.d.ts deleted file mode 100644 index b92d46b..0000000 --- a/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const MAX_ARRAY_LENGTH: 4294967295; - -export = MAX_ARRAY_LENGTH; \ No newline at end of file diff --git a/node_modules/math-intrinsics/constants/maxArrayLength.js b/node_modules/math-intrinsics/constants/maxArrayLength.js deleted file mode 100644 index cfc6aff..0000000 --- a/node_modules/math-intrinsics/constants/maxArrayLength.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./maxArrayLength')} */ -module.exports = 4294967295; // Math.pow(2, 32) - 1; diff --git a/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts b/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts deleted file mode 100644 index fee3f62..0000000 --- a/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const MAX_SAFE_INTEGER: 9007199254740991; - -export = MAX_SAFE_INTEGER; \ No newline at end of file diff --git a/node_modules/math-intrinsics/constants/maxSafeInteger.js b/node_modules/math-intrinsics/constants/maxSafeInteger.js deleted file mode 100644 index b568ad3..0000000 --- a/node_modules/math-intrinsics/constants/maxSafeInteger.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -/** @type {import('./maxSafeInteger')} */ -// eslint-disable-next-line no-extra-parens -module.exports = /** @type {import('./maxSafeInteger')} */ (Number.MAX_SAFE_INTEGER) || 9007199254740991; // Math.pow(2, 53) - 1; diff --git a/node_modules/math-intrinsics/constants/maxValue.d.ts b/node_modules/math-intrinsics/constants/maxValue.d.ts deleted file mode 100644 index 292cb82..0000000 --- a/node_modules/math-intrinsics/constants/maxValue.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const MAX_VALUE: 1.7976931348623157e+308; - -export = MAX_VALUE; diff --git a/node_modules/math-intrinsics/constants/maxValue.js b/node_modules/math-intrinsics/constants/maxValue.js deleted file mode 100644 index a2202dc..0000000 --- a/node_modules/math-intrinsics/constants/maxValue.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -/** @type {import('./maxValue')} */ -// eslint-disable-next-line no-extra-parens -module.exports = /** @type {import('./maxValue')} */ (Number.MAX_VALUE) || 1.7976931348623157e+308; diff --git a/node_modules/math-intrinsics/floor.d.ts b/node_modules/math-intrinsics/floor.d.ts deleted file mode 100644 index 9265236..0000000 --- a/node_modules/math-intrinsics/floor.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Math.floor; \ No newline at end of file diff --git a/node_modules/math-intrinsics/floor.js b/node_modules/math-intrinsics/floor.js deleted file mode 100644 index ab0e5d7..0000000 --- a/node_modules/math-intrinsics/floor.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./floor')} */ -module.exports = Math.floor; diff --git a/node_modules/math-intrinsics/isFinite.d.ts b/node_modules/math-intrinsics/isFinite.d.ts deleted file mode 100644 index 6daae33..0000000 --- a/node_modules/math-intrinsics/isFinite.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare function isFinite(x: unknown): x is number | bigint; - -export = isFinite; \ No newline at end of file diff --git a/node_modules/math-intrinsics/isFinite.js b/node_modules/math-intrinsics/isFinite.js deleted file mode 100644 index b201a5a..0000000 --- a/node_modules/math-intrinsics/isFinite.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var $isNaN = require('./isNaN'); - -/** @type {import('./isFinite')} */ -module.exports = function isFinite(x) { - return (typeof x === 'number' || typeof x === 'bigint') - && !$isNaN(x) - && x !== Infinity - && x !== -Infinity; -}; - diff --git a/node_modules/math-intrinsics/isInteger.d.ts b/node_modules/math-intrinsics/isInteger.d.ts deleted file mode 100644 index 13935a8..0000000 --- a/node_modules/math-intrinsics/isInteger.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare function isInteger(argument: unknown): argument is number; - -export = isInteger; \ No newline at end of file diff --git a/node_modules/math-intrinsics/isInteger.js b/node_modules/math-intrinsics/isInteger.js deleted file mode 100644 index 4b1b9a5..0000000 --- a/node_modules/math-intrinsics/isInteger.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -var $abs = require('./abs'); -var $floor = require('./floor'); - -var $isNaN = require('./isNaN'); -var $isFinite = require('./isFinite'); - -/** @type {import('./isInteger')} */ -module.exports = function isInteger(argument) { - if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { - return false; - } - var absValue = $abs(argument); - return $floor(absValue) === absValue; -}; diff --git a/node_modules/math-intrinsics/isNaN.d.ts b/node_modules/math-intrinsics/isNaN.d.ts deleted file mode 100644 index c1d4c55..0000000 --- a/node_modules/math-intrinsics/isNaN.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Number.isNaN; \ No newline at end of file diff --git a/node_modules/math-intrinsics/isNaN.js b/node_modules/math-intrinsics/isNaN.js deleted file mode 100644 index e36475c..0000000 --- a/node_modules/math-intrinsics/isNaN.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -/** @type {import('./isNaN')} */ -module.exports = Number.isNaN || function isNaN(a) { - return a !== a; -}; diff --git a/node_modules/math-intrinsics/isNegativeZero.d.ts b/node_modules/math-intrinsics/isNegativeZero.d.ts deleted file mode 100644 index 7ad8819..0000000 --- a/node_modules/math-intrinsics/isNegativeZero.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare function isNegativeZero(x: unknown): boolean; - -export = isNegativeZero; \ No newline at end of file diff --git a/node_modules/math-intrinsics/isNegativeZero.js b/node_modules/math-intrinsics/isNegativeZero.js deleted file mode 100644 index b69adcc..0000000 --- a/node_modules/math-intrinsics/isNegativeZero.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -/** @type {import('./isNegativeZero')} */ -module.exports = function isNegativeZero(x) { - return x === 0 && 1 / x === 1 / -0; -}; diff --git a/node_modules/math-intrinsics/max.d.ts b/node_modules/math-intrinsics/max.d.ts deleted file mode 100644 index ad6f43e..0000000 --- a/node_modules/math-intrinsics/max.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Math.max; \ No newline at end of file diff --git a/node_modules/math-intrinsics/max.js b/node_modules/math-intrinsics/max.js deleted file mode 100644 index edb55df..0000000 --- a/node_modules/math-intrinsics/max.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./max')} */ -module.exports = Math.max; diff --git a/node_modules/math-intrinsics/min.d.ts b/node_modules/math-intrinsics/min.d.ts deleted file mode 100644 index fd90f2d..0000000 --- a/node_modules/math-intrinsics/min.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Math.min; \ No newline at end of file diff --git a/node_modules/math-intrinsics/min.js b/node_modules/math-intrinsics/min.js deleted file mode 100644 index 5a4a7c7..0000000 --- a/node_modules/math-intrinsics/min.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./min')} */ -module.exports = Math.min; diff --git a/node_modules/math-intrinsics/mod.d.ts b/node_modules/math-intrinsics/mod.d.ts deleted file mode 100644 index 549dbd4..0000000 --- a/node_modules/math-intrinsics/mod.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare function mod(number: number, modulo: number): number; - -export = mod; \ No newline at end of file diff --git a/node_modules/math-intrinsics/mod.js b/node_modules/math-intrinsics/mod.js deleted file mode 100644 index 4a98362..0000000 --- a/node_modules/math-intrinsics/mod.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var $floor = require('./floor'); - -/** @type {import('./mod')} */ -module.exports = function mod(number, modulo) { - var remain = number % modulo; - return $floor(remain >= 0 ? remain : remain + modulo); -}; diff --git a/node_modules/math-intrinsics/package.json b/node_modules/math-intrinsics/package.json deleted file mode 100644 index 0676273..0000000 --- a/node_modules/math-intrinsics/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "math-intrinsics", - "version": "1.1.0", - "description": "ES Math-related intrinsics and helpers, robustly cached.", - "main": false, - "exports": { - "./abs": "./abs.js", - "./floor": "./floor.js", - "./isFinite": "./isFinite.js", - "./isInteger": "./isInteger.js", - "./isNaN": "./isNaN.js", - "./isNegativeZero": "./isNegativeZero.js", - "./max": "./max.js", - "./min": "./min.js", - "./mod": "./mod.js", - "./pow": "./pow.js", - "./sign": "./sign.js", - "./round": "./round.js", - "./constants/maxArrayLength": "./constants/maxArrayLength.js", - "./constants/maxSafeInteger": "./constants/maxSafeInteger.js", - "./constants/maxValue": "./constants/maxValue.js", - "./package.json": "./package.json" - }, - "sideEffects": false, - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "pretest": "npm run lint", - "test": "npm run tests-only", - "tests-only": "nyc tape 'test/**/*.js'", - "posttest": "npx npm@'>= 10.2' audit --production", - "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", - "lint": "eslint --ext=js,mjs .", - "postlint": "tsc && attw -P", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/es-shims/math-intrinsics.git" - }, - "author": "Jordan Harband ", - "license": "MIT", - "bugs": { - "url": "https://github.com/es-shims/math-intrinsics/issues" - }, - "homepage": "https://github.com/es-shims/math-intrinsics#readme", - "devDependencies": { - "@arethetypeswrong/cli": "^0.17.1", - "@ljharb/eslint-config": "^21.1.1", - "@ljharb/tsconfig": "^0.2.2", - "@types/for-each": "^0.3.3", - "@types/object-inspect": "^1.13.0", - "@types/tape": "^5.8.0", - "auto-changelog": "^2.5.0", - "eclint": "^2.8.1", - "es-value-fixtures": "^1.5.0", - "eslint": "^8.8.0", - "evalmd": "^0.0.19", - "for-each": "^0.3.3", - "in-publish": "^2.0.1", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "object-inspect": "^1.13.3", - "safe-publish-latest": "^2.0.0", - "tape": "^5.9.0", - "typescript": "next" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - }, - "engines": { - "node": ">= 0.4" - } -} diff --git a/node_modules/math-intrinsics/pow.d.ts b/node_modules/math-intrinsics/pow.d.ts deleted file mode 100644 index 5873c44..0000000 --- a/node_modules/math-intrinsics/pow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Math.pow; \ No newline at end of file diff --git a/node_modules/math-intrinsics/pow.js b/node_modules/math-intrinsics/pow.js deleted file mode 100644 index c0a4103..0000000 --- a/node_modules/math-intrinsics/pow.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./pow')} */ -module.exports = Math.pow; diff --git a/node_modules/math-intrinsics/round.d.ts b/node_modules/math-intrinsics/round.d.ts deleted file mode 100644 index da1fde3..0000000 --- a/node_modules/math-intrinsics/round.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Math.round; \ No newline at end of file diff --git a/node_modules/math-intrinsics/round.js b/node_modules/math-intrinsics/round.js deleted file mode 100644 index b792156..0000000 --- a/node_modules/math-intrinsics/round.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./round')} */ -module.exports = Math.round; diff --git a/node_modules/math-intrinsics/sign.d.ts b/node_modules/math-intrinsics/sign.d.ts deleted file mode 100644 index c49ceca..0000000 --- a/node_modules/math-intrinsics/sign.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare function sign(x: number): number; - -export = sign; \ No newline at end of file diff --git a/node_modules/math-intrinsics/sign.js b/node_modules/math-intrinsics/sign.js deleted file mode 100644 index 9e5173c..0000000 --- a/node_modules/math-intrinsics/sign.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var $isNaN = require('./isNaN'); - -/** @type {import('./sign')} */ -module.exports = function sign(number) { - if ($isNaN(number) || number === 0) { - return number; - } - return number < 0 ? -1 : +1; -}; diff --git a/node_modules/math-intrinsics/test/index.js b/node_modules/math-intrinsics/test/index.js deleted file mode 100644 index 0f90a5d..0000000 --- a/node_modules/math-intrinsics/test/index.js +++ /dev/null @@ -1,192 +0,0 @@ -'use strict'; - -var test = require('tape'); -var v = require('es-value-fixtures'); -var forEach = require('for-each'); -var inspect = require('object-inspect'); - -var abs = require('../abs'); -var floor = require('../floor'); -var isFinite = require('../isFinite'); -var isInteger = require('../isInteger'); -var isNaN = require('../isNaN'); -var isNegativeZero = require('../isNegativeZero'); -var max = require('../max'); -var min = require('../min'); -var mod = require('../mod'); -var pow = require('../pow'); -var round = require('../round'); -var sign = require('../sign'); - -var maxArrayLength = require('../constants/maxArrayLength'); -var maxSafeInteger = require('../constants/maxSafeInteger'); -var maxValue = require('../constants/maxValue'); - -test('abs', function (t) { - t.equal(abs(-1), 1, 'abs(-1) === 1'); - t.equal(abs(+1), 1, 'abs(+1) === 1'); - t.equal(abs(+0), +0, 'abs(+0) === +0'); - t.equal(abs(-0), +0, 'abs(-0) === +0'); - - t.end(); -}); - -test('floor', function (t) { - t.equal(floor(-1.1), -2, 'floor(-1.1) === -2'); - t.equal(floor(+1.1), 1, 'floor(+1.1) === 1'); - t.equal(floor(+0), +0, 'floor(+0) === +0'); - t.equal(floor(-0), -0, 'floor(-0) === -0'); - t.equal(floor(-Infinity), -Infinity, 'floor(-Infinity) === -Infinity'); - t.equal(floor(Number(Infinity)), Number(Infinity), 'floor(+Infinity) === +Infinity'); - t.equal(floor(NaN), NaN, 'floor(NaN) === NaN'); - t.equal(floor(0), +0, 'floor(0) === +0'); - t.equal(floor(-0), -0, 'floor(-0) === -0'); - t.equal(floor(1), 1, 'floor(1) === 1'); - t.equal(floor(-1), -1, 'floor(-1) === -1'); - t.equal(floor(1.1), 1, 'floor(1.1) === 1'); - t.equal(floor(-1.1), -2, 'floor(-1.1) === -2'); - t.equal(floor(maxValue), maxValue, 'floor(maxValue) === maxValue'); - t.equal(floor(maxSafeInteger), maxSafeInteger, 'floor(maxSafeInteger) === maxSafeInteger'); - - t.end(); -}); - -test('isFinite', function (t) { - t.equal(isFinite(0), true, 'isFinite(+0) === true'); - t.equal(isFinite(-0), true, 'isFinite(-0) === true'); - t.equal(isFinite(1), true, 'isFinite(1) === true'); - t.equal(isFinite(Infinity), false, 'isFinite(Infinity) === false'); - t.equal(isFinite(-Infinity), false, 'isFinite(-Infinity) === false'); - t.equal(isFinite(NaN), false, 'isFinite(NaN) === false'); - - forEach(v.nonNumbers, function (nonNumber) { - t.equal(isFinite(nonNumber), false, 'isFinite(' + inspect(nonNumber) + ') === false'); - }); - - t.end(); -}); - -test('isInteger', function (t) { - forEach([].concat( - // @ts-expect-error TS sucks with concat - v.nonNumbers, - v.nonIntegerNumbers - ), function (nonInteger) { - t.equal(isInteger(nonInteger), false, 'isInteger(' + inspect(nonInteger) + ') === false'); - }); - - t.end(); -}); - -test('isNaN', function (t) { - forEach([].concat( - // @ts-expect-error TS sucks with concat - v.nonNumbers, - v.infinities, - v.zeroes, - v.integerNumbers - ), function (nonNaN) { - t.equal(isNaN(nonNaN), false, 'isNaN(' + inspect(nonNaN) + ') === false'); - }); - - t.equal(isNaN(NaN), true, 'isNaN(NaN) === true'); - - t.end(); -}); - -test('isNegativeZero', function (t) { - t.equal(isNegativeZero(-0), true, 'isNegativeZero(-0) === true'); - t.equal(isNegativeZero(+0), false, 'isNegativeZero(+0) === false'); - t.equal(isNegativeZero(1), false, 'isNegativeZero(1) === false'); - t.equal(isNegativeZero(-1), false, 'isNegativeZero(-1) === false'); - t.equal(isNegativeZero(NaN), false, 'isNegativeZero(NaN) === false'); - t.equal(isNegativeZero(Infinity), false, 'isNegativeZero(Infinity) === false'); - t.equal(isNegativeZero(-Infinity), false, 'isNegativeZero(-Infinity) === false'); - - forEach(v.nonNumbers, function (nonNumber) { - t.equal(isNegativeZero(nonNumber), false, 'isNegativeZero(' + inspect(nonNumber) + ') === false'); - }); - - t.end(); -}); - -test('max', function (t) { - t.equal(max(1, 2), 2, 'max(1, 2) === 2'); - t.equal(max(1, 2, 3), 3, 'max(1, 2, 3) === 3'); - t.equal(max(1, 2, 3, 4), 4, 'max(1, 2, 3, 4) === 4'); - t.equal(max(1, 2, 3, 4, 5), 5, 'max(1, 2, 3, 4, 5) === 5'); - t.equal(max(1, 2, 3, 4, 5, 6), 6, 'max(1, 2, 3, 4, 5, 6) === 6'); - t.equal(max(1, 2, 3, 4, 5, 6, 7), 7, 'max(1, 2, 3, 4, 5, 6, 7) === 7'); - - t.end(); -}); - -test('min', function (t) { - t.equal(min(1, 2), 1, 'min(1, 2) === 1'); - t.equal(min(1, 2, 3), 1, 'min(1, 2, 3) === 1'); - t.equal(min(1, 2, 3, 4), 1, 'min(1, 2, 3, 4) === 1'); - t.equal(min(1, 2, 3, 4, 5), 1, 'min(1, 2, 3, 4, 5) === 1'); - t.equal(min(1, 2, 3, 4, 5, 6), 1, 'min(1, 2, 3, 4, 5, 6) === 1'); - - t.end(); -}); - -test('mod', function (t) { - t.equal(mod(1, 2), 1, 'mod(1, 2) === 1'); - t.equal(mod(2, 2), 0, 'mod(2, 2) === 0'); - t.equal(mod(3, 2), 1, 'mod(3, 2) === 1'); - t.equal(mod(4, 2), 0, 'mod(4, 2) === 0'); - t.equal(mod(5, 2), 1, 'mod(5, 2) === 1'); - t.equal(mod(6, 2), 0, 'mod(6, 2) === 0'); - t.equal(mod(7, 2), 1, 'mod(7, 2) === 1'); - t.equal(mod(8, 2), 0, 'mod(8, 2) === 0'); - t.equal(mod(9, 2), 1, 'mod(9, 2) === 1'); - t.equal(mod(10, 2), 0, 'mod(10, 2) === 0'); - t.equal(mod(11, 2), 1, 'mod(11, 2) === 1'); - - t.end(); -}); - -test('pow', function (t) { - t.equal(pow(2, 2), 4, 'pow(2, 2) === 4'); - t.equal(pow(2, 3), 8, 'pow(2, 3) === 8'); - t.equal(pow(2, 4), 16, 'pow(2, 4) === 16'); - t.equal(pow(2, 5), 32, 'pow(2, 5) === 32'); - t.equal(pow(2, 6), 64, 'pow(2, 6) === 64'); - t.equal(pow(2, 7), 128, 'pow(2, 7) === 128'); - t.equal(pow(2, 8), 256, 'pow(2, 8) === 256'); - t.equal(pow(2, 9), 512, 'pow(2, 9) === 512'); - t.equal(pow(2, 10), 1024, 'pow(2, 10) === 1024'); - - t.end(); -}); - -test('round', function (t) { - t.equal(round(1.1), 1, 'round(1.1) === 1'); - t.equal(round(1.5), 2, 'round(1.5) === 2'); - t.equal(round(1.9), 2, 'round(1.9) === 2'); - - t.end(); -}); - -test('sign', function (t) { - t.equal(sign(-1), -1, 'sign(-1) === -1'); - t.equal(sign(+1), +1, 'sign(+1) === +1'); - t.equal(sign(+0), +0, 'sign(+0) === +0'); - t.equal(sign(-0), -0, 'sign(-0) === -0'); - t.equal(sign(NaN), NaN, 'sign(NaN) === NaN'); - t.equal(sign(Infinity), +1, 'sign(Infinity) === +1'); - t.equal(sign(-Infinity), -1, 'sign(-Infinity) === -1'); - t.equal(sign(maxValue), +1, 'sign(maxValue) === +1'); - t.equal(sign(maxSafeInteger), +1, 'sign(maxSafeInteger) === +1'); - - t.end(); -}); - -test('constants', function (t) { - t.equal(typeof maxArrayLength, 'number', 'typeof maxArrayLength === "number"'); - t.equal(typeof maxSafeInteger, 'number', 'typeof maxSafeInteger === "number"'); - t.equal(typeof maxValue, 'number', 'typeof maxValue === "number"'); - - t.end(); -}); diff --git a/node_modules/math-intrinsics/tsconfig.json b/node_modules/math-intrinsics/tsconfig.json deleted file mode 100644 index b131000..0000000 --- a/node_modules/math-intrinsics/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@ljharb/tsconfig", -} diff --git a/node_modules/media-typer/HISTORY.md b/node_modules/media-typer/HISTORY.md deleted file mode 100644 index 538ade1..0000000 --- a/node_modules/media-typer/HISTORY.md +++ /dev/null @@ -1,50 +0,0 @@ -1.1.0 / 2019-04-24 -================== - - * Add `test(string)` function - -1.0.2 / 2019-04-19 -================== - - * Fix JSDoc comment for `parse` function - -1.0.1 / 2018-10-20 -================== - - * Remove left over `parameters` property from class - -1.0.0 / 2018-10-20 -================== - -This major release brings the module back to it's RFC 6838 roots. If you want -a module to parse the `Content-Type` or similar HTTP headers, use the -`content-type` module instead. - - * Drop support for Node.js below 0.8 - * Remove parameter handling, which is outside RFC 6838 scope - * Remove `parse(req)` and `parse(res)` signatures - * perf: enable strict mode - * perf: use a class for object creation - -0.3.0 / 2014-09-07 -================== - - * Support Node.js 0.6 - * Throw error when parameter format invalid on parse - -0.2.0 / 2014-06-18 -================== - - * Add `typer.format()` to format media types - -0.1.0 / 2014-06-17 -================== - - * Accept `req` as argument to `parse` - * Accept `res` as argument to `parse` - * Parse media type with extra LWS between type and first parameter - -0.0.0 / 2014-06-13 -================== - - * Initial implementation diff --git a/node_modules/media-typer/LICENSE b/node_modules/media-typer/LICENSE deleted file mode 100644 index 84441fb..0000000 --- a/node_modules/media-typer/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2017 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/media-typer/README.md b/node_modules/media-typer/README.md deleted file mode 100644 index 37edad1..0000000 --- a/node_modules/media-typer/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# media-typer - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Simple RFC 6838 media type parser. - -This module will parse a given media type into it's component parts, like type, -subtype, and suffix. A formatter is also provided to put them back together and -the two can be combined to normalize media types into a canonical form. - -If you are looking to parse the string that represents a media type and it's -parameters in HTTP (for example, the `Content-Type` header), use the -[content-type module](https://www.npmjs.com/package/content-type). - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install media-typer -``` - -## API - - - -```js -var typer = require('media-typer') -``` - -### typer.parse(string) - - - -```js -var obj = typer.parse('image/svg+xml') -``` - -Parse a media type string. This will return an object with the following -properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): - - - `type`: The type of the media type (always lower case). Example: `'image'` - - - `subtype`: The subtype of the media type (always lower case). Example: `'svg'` - - - `suffix`: The suffix of the media type (always lower case). Example: `'xml'` - -If the given type string is invalid, then a `TypeError` is thrown. - -### typer.format(obj) - - - -```js -var obj = typer.format({ type: 'image', subtype: 'svg', suffix: 'xml' }) -``` - -Format an object into a media type string. This will return a string of the -mime type for the given object. For the properties of the object, see the -documentation for `typer.parse(string)`. - -If any of the given object values are invalid, then a `TypeError` is thrown. - -### typer.test(string) - - - -```js -var valid = typer.test('image/svg+xml') -``` - -Validate a media type string. This will return `true` is the string is a well- -formatted media type, or `false` otherwise. - -## License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/media-typer/master -[coveralls-url]: https://coveralls.io/r/jshttp/media-typer?branch=master -[node-version-image]: https://badgen.net/npm/node/media-typer -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/media-typer -[npm-url]: https://npmjs.org/package/media-typer -[npm-version-image]: https://badgen.net/npm/v/media-typer -[travis-image]: https://badgen.net/travis/jshttp/media-typer/master -[travis-url]: https://travis-ci.org/jshttp/media-typer diff --git a/node_modules/media-typer/index.js b/node_modules/media-typer/index.js deleted file mode 100644 index 897cae1..0000000 --- a/node_modules/media-typer/index.js +++ /dev/null @@ -1,143 +0,0 @@ -/*! - * media-typer - * Copyright(c) 2014-2017 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * RegExp to match type in RFC 6838 - * - * type-name = restricted-name - * subtype-name = restricted-name - * restricted-name = restricted-name-first *126restricted-name-chars - * restricted-name-first = ALPHA / DIGIT - * restricted-name-chars = ALPHA / DIGIT / "!" / "#" / - * "$" / "&" / "-" / "^" / "_" - * restricted-name-chars =/ "." ; Characters before first dot always - * ; specify a facet name - * restricted-name-chars =/ "+" ; Characters after last plus always - * ; specify a structured syntax suffix - * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z - * DIGIT = %x30-39 ; 0-9 - */ -var SUBTYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/ -var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/ -var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/ - -/** - * Module exports. - */ - -exports.format = format -exports.parse = parse -exports.test = test - -/** - * Format object to media type. - * - * @param {object} obj - * @return {string} - * @public - */ - -function format (obj) { - if (!obj || typeof obj !== 'object') { - throw new TypeError('argument obj is required') - } - - var subtype = obj.subtype - var suffix = obj.suffix - var type = obj.type - - if (!type || !TYPE_NAME_REGEXP.test(type)) { - throw new TypeError('invalid type') - } - - if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) { - throw new TypeError('invalid subtype') - } - - // format as type/subtype - var string = type + '/' + subtype - - // append +suffix - if (suffix) { - if (!TYPE_NAME_REGEXP.test(suffix)) { - throw new TypeError('invalid suffix') - } - - string += '+' + suffix - } - - return string -} - -/** - * Test media type. - * - * @param {string} string - * @return {object} - * @public - */ - -function test (string) { - if (!string) { - throw new TypeError('argument string is required') - } - - if (typeof string !== 'string') { - throw new TypeError('argument string is required to be a string') - } - - return TYPE_REGEXP.test(string.toLowerCase()) -} - -/** - * Parse media type to object. - * - * @param {string} string - * @return {object} - * @public - */ - -function parse (string) { - if (!string) { - throw new TypeError('argument string is required') - } - - if (typeof string !== 'string') { - throw new TypeError('argument string is required to be a string') - } - - var match = TYPE_REGEXP.exec(string.toLowerCase()) - - if (!match) { - throw new TypeError('invalid media type') - } - - var type = match[1] - var subtype = match[2] - var suffix - - // suffix after last + - var index = subtype.lastIndexOf('+') - if (index !== -1) { - suffix = subtype.substr(index + 1) - subtype = subtype.substr(0, index) - } - - return new MediaType(type, subtype, suffix) -} - -/** - * Class for MediaType object. - * @public - */ - -function MediaType (type, subtype, suffix) { - this.type = type - this.subtype = subtype - this.suffix = suffix -} diff --git a/node_modules/media-typer/package.json b/node_modules/media-typer/package.json deleted file mode 100644 index 1dca712..0000000 --- a/node_modules/media-typer/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "media-typer", - "description": "Simple RFC 6838 media type parser and formatter", - "version": "1.1.0", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "repository": "jshttp/media-typer", - "devDependencies": { - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", - "mocha": "6.1.4", - "nyc": "14.0.0" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "index.js" - ], - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --check-leaks --bail test/", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "test-travis": "nyc --reporter=text npm test" - } -} diff --git a/node_modules/merge-descriptors/index.d.ts b/node_modules/merge-descriptors/index.d.ts deleted file mode 100644 index df8f91f..0000000 --- a/node_modules/merge-descriptors/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** -Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties. - -@param destination - The object to receive properties. -@param source - The object providing properties. -@param overwrite - Optional boolean to control overwriting of existing properties. Defaults to true. -@returns The modified destination object. -*/ -declare function mergeDescriptors(destination: T, source: U, overwrite?: boolean): T & U; - -export = mergeDescriptors; diff --git a/node_modules/merge-descriptors/index.js b/node_modules/merge-descriptors/index.js deleted file mode 100644 index 51228e5..0000000 --- a/node_modules/merge-descriptors/index.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -function mergeDescriptors(destination, source, overwrite = true) { - if (!destination) { - throw new TypeError('The `destination` argument is required.'); - } - - if (!source) { - throw new TypeError('The `source` argument is required.'); - } - - for (const name of Object.getOwnPropertyNames(source)) { - if (!overwrite && Object.hasOwn(destination, name)) { - // Skip descriptor - continue; - } - - // Copy descriptor - const descriptor = Object.getOwnPropertyDescriptor(source, name); - Object.defineProperty(destination, name, descriptor); - } - - return destination; -} - -module.exports = mergeDescriptors; diff --git a/node_modules/merge-descriptors/license b/node_modules/merge-descriptors/license deleted file mode 100644 index c509d45..0000000 --- a/node_modules/merge-descriptors/license +++ /dev/null @@ -1,11 +0,0 @@ -MIT License - -Copyright (c) Jonathan Ong -Copyright (c) Douglas Christopher Wilson -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/merge-descriptors/package.json b/node_modules/merge-descriptors/package.json deleted file mode 100644 index 9bedb25..0000000 --- a/node_modules/merge-descriptors/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "merge-descriptors", - "version": "2.0.0", - "description": "Merge objects using their property descriptors", - "license": "MIT", - "repository": "sindresorhus/merge-descriptors", - "funding": "https://github.com/sponsors/sindresorhus", - "contributors": [ - "Jonathan Ong ", - "Douglas Christopher Wilson ", - "Mike Grabowski ", - "Sindre Sorhus " - ], - "exports": { - "types": "./index.d.ts", - "default": "./index.js" - }, - "main": "./index.js", - "types": "./index.d.ts", - "sideEffects": false, - "engines": { - "node": ">=18" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "merge", - "descriptors", - "object", - "property", - "properties", - "merging", - "getter", - "setter" - ], - "devDependencies": { - "ava": "^5.3.1", - "xo": "^0.56.0" - }, - "xo": { - "rules": { - "unicorn/prefer-module": "off" - } - } -} diff --git a/node_modules/merge-descriptors/readme.md b/node_modules/merge-descriptors/readme.md deleted file mode 100644 index 1dee67d..0000000 --- a/node_modules/merge-descriptors/readme.md +++ /dev/null @@ -1,55 +0,0 @@ -# merge-descriptors - -> Merge objects using their property descriptors - -## Install - -```sh -npm install merge-descriptors -``` - -## Usage - -```js -import mergeDescriptors from 'merge-descriptors'; - -const thing = { - get name() { - return 'John' - } -} - -const animal = {}; - -mergeDescriptors(animal, thing); - -console.log(animal.name); -//=> 'John' -``` - -## API - -### merge(destination, source, overwrite?) - -Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties. - -Returns the modified destination object. - -#### destination - -Type: `object` - -The object to receive properties. - -#### source - -Type: `object` - -The object providing properties. - -#### overwrite - -Type: `boolean`\ -Default: `true` - -A boolean to control overwriting of existing properties. diff --git a/node_modules/mime-db/HISTORY.md b/node_modules/mime-db/HISTORY.md deleted file mode 100644 index fb35bec..0000000 --- a/node_modules/mime-db/HISTORY.md +++ /dev/null @@ -1,541 +0,0 @@ -1.54.0 / 2025-03-17 -=================== - - * Update mime type for DCM format (#362) - * mark application/octet-stream as compressible (#163) - * Fix typo in application/x-zip-compressed mimetype (#359) - * Add mime-type for Jupyter notebooks (#282) - * Add Google Drive MIME types (#311) - * Add .blend file type (#338) - * Add support for the FBX file extension (#342) - * Add Adobe DNG file (#340) - * Add Procreate Brush and Brush Set file Types (#339) - * Add support for Procreate Dreams (#341) - * replace got with undici (#352) - * Added extensions list for model/step (#293) - * Add m4b as a type of audio/mp4 (#357) - * windows 11 application/x-zip-compressed (#346) - * add dotLottie mime type (#351) - * Add some MS-related extensions and types (#336) - -1.53.0 / 2024-07-12 -=================== - - * Add extension `.sql` to `application/sql` - * Add extensions `.aac` and `.adts` to `audio/aac` - * Add extensions `.js` and `.mjs` to `text/javascript` - * Add extensions for `application/mp4` from IANA - * Add extensions from IANA for more MIME types - * Add Microsoft app installer types and extensions - * Add new upstream MIME types - * Fix extensions for `text/markdown` to match IANA - * Remove extension `.mjs` from `application/javascript` - * Remove obsolete MIME types from IANA data - -1.52.0 / 2022-02-21 -=================== - - * Add extensions from IANA for more `image/*` types - * Add extension `.asc` to `application/pgp-keys` - * Add extensions to various XML types - * Add new upstream MIME types - -1.51.0 / 2021-11-08 -=================== - - * Add new upstream MIME types - * Mark `image/vnd.microsoft.icon` as compressible - * Mark `image/vnd.ms-dds` as compressible - -1.50.0 / 2021-09-15 -=================== - - * Add deprecated iWorks mime types and extensions - * Add new upstream MIME types - -1.49.0 / 2021-07-26 -=================== - - * Add extension `.trig` to `application/trig` - * Add new upstream MIME types - -1.48.0 / 2021-05-30 -=================== - - * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` - * Add new upstream MIME types - * Mark `text/yaml` as compressible - -1.47.0 / 2021-04-01 -=================== - - * Add new upstream MIME types - * Remove ambiguous extensions from IANA for `application/*+xml` types - * Update primary extension to `.es` for `application/ecmascript` - -1.46.0 / 2021-02-13 -=================== - - * Add extension `.amr` to `audio/amr` - * Add extension `.m4s` to `video/iso.segment` - * Add extension `.opus` to `audio/ogg` - * Add new upstream MIME types - -1.45.0 / 2020-09-22 -=================== - - * Add `application/ubjson` with extension `.ubj` - * Add `image/avif` with extension `.avif` - * Add `image/ktx2` with extension `.ktx2` - * Add extension `.dbf` to `application/vnd.dbf` - * Add extension `.rar` to `application/vnd.rar` - * Add extension `.td` to `application/urc-targetdesc+xml` - * Add new upstream MIME types - * Fix extension of `application/vnd.apple.keynote` to be `.key` - -1.44.0 / 2020-04-22 -=================== - - * Add charsets from IANA - * Add extension `.cjs` to `application/node` - * Add new upstream MIME types - -1.43.0 / 2020-01-05 -=================== - - * Add `application/x-keepass2` with extension `.kdbx` - * Add extension `.mxmf` to `audio/mobile-xmf` - * Add extensions from IANA for `application/*+xml` types - * Add new upstream MIME types - -1.42.0 / 2019-09-25 -=================== - - * Add `image/vnd.ms-dds` with extension `.dds` - * Add new upstream MIME types - * Remove compressible from `multipart/mixed` - -1.41.0 / 2019-08-30 -=================== - - * Add new upstream MIME types - * Add `application/toml` with extension `.toml` - * Mark `font/ttf` as compressible - -1.40.0 / 2019-04-20 -=================== - - * Add extensions from IANA for `model/*` types - * Add `text/mdx` with extension `.mdx` - -1.39.0 / 2019-04-04 -=================== - - * Add extensions `.siv` and `.sieve` to `application/sieve` - * Add new upstream MIME types - -1.38.0 / 2019-02-04 -=================== - - * Add extension `.nq` to `application/n-quads` - * Add extension `.nt` to `application/n-triples` - * Add new upstream MIME types - * Mark `text/less` as compressible - -1.37.0 / 2018-10-19 -=================== - - * Add extensions to HEIC image types - * Add new upstream MIME types - -1.36.0 / 2018-08-20 -=================== - - * Add Apple file extensions from IANA - * Add extensions from IANA for `image/*` types - * Add new upstream MIME types - -1.35.0 / 2018-07-15 -=================== - - * Add extension `.owl` to `application/rdf+xml` - * Add new upstream MIME types - - Removes extension `.woff` from `application/font-woff` - -1.34.0 / 2018-06-03 -=================== - - * Add extension `.csl` to `application/vnd.citationstyles.style+xml` - * Add extension `.es` to `application/ecmascript` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/turtle` - * Mark all XML-derived types as compressible - -1.33.0 / 2018-02-15 -=================== - - * Add extensions from IANA for `message/*` types - * Add new upstream MIME types - * Fix some incorrect OOXML types - * Remove `application/font-woff2` - -1.32.0 / 2017-11-29 -=================== - - * Add new upstream MIME types - * Update `text/hjson` to registered `application/hjson` - * Add `text/shex` with extension `.shex` - -1.31.0 / 2017-10-25 -=================== - - * Add `application/raml+yaml` with extension `.raml` - * Add `application/wasm` with extension `.wasm` - * Add new `font` type from IANA - * Add new upstream font extensions - * Add new upstream MIME types - * Add extensions for JPEG-2000 images - -1.30.0 / 2017-08-27 -=================== - - * Add `application/vnd.ms-outlook` - * Add `application/x-arj` - * Add extension `.mjs` to `application/javascript` - * Add glTF types and extensions - * Add new upstream MIME types - * Add `text/x-org` - * Add VirtualBox MIME types - * Fix `source` records for `video/*` types that are IANA - * Update `font/opentype` to registered `font/otf` - -1.29.0 / 2017-07-10 -=================== - - * Add `application/fido.trusted-apps+json` - * Add extension `.wadl` to `application/vnd.sun.wadl+xml` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/css` - -1.28.0 / 2017-05-14 -=================== - - * Add new upstream MIME types - * Add extension `.gz` to `application/gzip` - * Update extensions `.md` and `.markdown` to be `text/markdown` - -1.27.0 / 2017-03-16 -=================== - - * Add new upstream MIME types - * Add `image/apng` with extension `.apng` - -1.26.0 / 2017-01-14 -=================== - - * Add new upstream MIME types - * Add extension `.geojson` to `application/geo+json` - -1.25.0 / 2016-11-11 -=================== - - * Add new upstream MIME types - -1.24.0 / 2016-09-18 -=================== - - * Add `audio/mp3` - * Add new upstream MIME types - -1.23.0 / 2016-05-01 -=================== - - * Add new upstream MIME types - * Add extension `.3gpp` to `audio/3gpp` - -1.22.0 / 2016-02-15 -=================== - - * Add `text/slim` - * Add extension `.rng` to `application/xml` - * Add new upstream MIME types - * Fix extension of `application/dash+xml` to be `.mpd` - * Update primary extension to `.m4a` for `audio/mp4` - -1.21.0 / 2016-01-06 -=================== - - * Add Google document types - * Add new upstream MIME types - -1.20.0 / 2015-11-10 -=================== - - * Add `text/x-suse-ymp` - * Add new upstream MIME types - -1.19.0 / 2015-09-17 -=================== - - * Add `application/vnd.apple.pkpass` - * Add new upstream MIME types - -1.18.0 / 2015-09-03 -=================== - - * Add new upstream MIME types - -1.17.0 / 2015-08-13 -=================== - - * Add `application/x-msdos-program` - * Add `audio/g711-0` - * Add `image/vnd.mozilla.apng` - * Add extension `.exe` to `application/x-msdos-program` - -1.16.0 / 2015-07-29 -=================== - - * Add `application/vnd.uri-map` - -1.15.0 / 2015-07-13 -=================== - - * Add `application/x-httpd-php` - -1.14.0 / 2015-06-25 -=================== - - * Add `application/scim+json` - * Add `application/vnd.3gpp.ussd+xml` - * Add `application/vnd.biopax.rdf+xml` - * Add `text/x-processing` - -1.13.0 / 2015-06-07 -=================== - - * Add nginx as a source - * Add `application/x-cocoa` - * Add `application/x-java-archive-diff` - * Add `application/x-makeself` - * Add `application/x-perl` - * Add `application/x-pilot` - * Add `application/x-redhat-package-manager` - * Add `application/x-sea` - * Add `audio/x-m4a` - * Add `audio/x-realaudio` - * Add `image/x-jng` - * Add `text/mathml` - -1.12.0 / 2015-06-05 -=================== - - * Add `application/bdoc` - * Add `application/vnd.hyperdrive+json` - * Add `application/x-bdoc` - * Add extension `.rtf` to `text/rtf` - -1.11.0 / 2015-05-31 -=================== - - * Add `audio/wav` - * Add `audio/wave` - * Add extension `.litcoffee` to `text/coffeescript` - * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` - * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` - -1.10.0 / 2015-05-19 -=================== - - * Add `application/vnd.balsamiq.bmpr` - * Add `application/vnd.microsoft.portable-executable` - * Add `application/x-ns-proxy-autoconfig` - -1.9.1 / 2015-04-19 -================== - - * Remove `.json` extension from `application/manifest+json` - - This is causing bugs downstream - -1.9.0 / 2015-04-19 -================== - - * Add `application/manifest+json` - * Add `application/vnd.micro+json` - * Add `image/vnd.zbrush.pcx` - * Add `image/x-ms-bmp` - -1.8.0 / 2015-03-13 -================== - - * Add `application/vnd.citationstyles.style+xml` - * Add `application/vnd.fastcopy-disk-image` - * Add `application/vnd.gov.sk.xmldatacontainer+xml` - * Add extension `.jsonld` to `application/ld+json` - -1.7.0 / 2015-02-08 -================== - - * Add `application/vnd.gerber` - * Add `application/vnd.msa-disk-image` - -1.6.1 / 2015-02-05 -================== - - * Community extensions ownership transferred from `node-mime` - -1.6.0 / 2015-01-29 -================== - - * Add `application/jose` - * Add `application/jose+json` - * Add `application/json-seq` - * Add `application/jwk+json` - * Add `application/jwk-set+json` - * Add `application/jwt` - * Add `application/rdap+json` - * Add `application/vnd.gov.sk.e-form+xml` - * Add `application/vnd.ims.imsccv1p3` - -1.5.0 / 2014-12-30 -================== - - * Add `application/vnd.oracle.resource+json` - * Fix various invalid MIME type entries - - `application/mbox+xml` - - `application/oscp-response` - - `application/vwg-multiplexed` - - `audio/g721` - -1.4.0 / 2014-12-21 -================== - - * Add `application/vnd.ims.imsccv1p2` - * Fix various invalid MIME type entries - - `application/vnd-acucobol` - - `application/vnd-curl` - - `application/vnd-dart` - - `application/vnd-dxr` - - `application/vnd-fdf` - - `application/vnd-mif` - - `application/vnd-sema` - - `application/vnd-wap-wmlc` - - `application/vnd.adobe.flash-movie` - - `application/vnd.dece-zip` - - `application/vnd.dvb_service` - - `application/vnd.micrografx-igx` - - `application/vnd.sealed-doc` - - `application/vnd.sealed-eml` - - `application/vnd.sealed-mht` - - `application/vnd.sealed-ppt` - - `application/vnd.sealed-tiff` - - `application/vnd.sealed-xls` - - `application/vnd.sealedmedia.softseal-html` - - `application/vnd.sealedmedia.softseal-pdf` - - `application/vnd.wap-slc` - - `application/vnd.wap-wbxml` - - `audio/vnd.sealedmedia.softseal-mpeg` - - `image/vnd-djvu` - - `image/vnd-svf` - - `image/vnd-wap-wbmp` - - `image/vnd.sealed-png` - - `image/vnd.sealedmedia.softseal-gif` - - `image/vnd.sealedmedia.softseal-jpg` - - `model/vnd-dwf` - - `model/vnd.parasolid.transmit-binary` - - `model/vnd.parasolid.transmit-text` - - `text/vnd-a` - - `text/vnd-curl` - - `text/vnd.wap-wml` - * Remove example template MIME types - - `application/example` - - `audio/example` - - `image/example` - - `message/example` - - `model/example` - - `multipart/example` - - `text/example` - - `video/example` - -1.3.1 / 2014-12-16 -================== - - * Fix missing extensions - - `application/json5` - - `text/hjson` - -1.3.0 / 2014-12-07 -================== - - * Add `application/a2l` - * Add `application/aml` - * Add `application/atfx` - * Add `application/atxml` - * Add `application/cdfx+xml` - * Add `application/dii` - * Add `application/json5` - * Add `application/lxf` - * Add `application/mf4` - * Add `application/vnd.apache.thrift.compact` - * Add `application/vnd.apache.thrift.json` - * Add `application/vnd.coffeescript` - * Add `application/vnd.enphase.envoy` - * Add `application/vnd.ims.imsccv1p1` - * Add `text/csv-schema` - * Add `text/hjson` - * Add `text/markdown` - * Add `text/yaml` - -1.2.0 / 2014-11-09 -================== - - * Add `application/cea` - * Add `application/dit` - * Add `application/vnd.gov.sk.e-form+zip` - * Add `application/vnd.tmd.mediaflex.api+xml` - * Type `application/epub+zip` is now IANA-registered - -1.1.2 / 2014-10-23 -================== - - * Rebuild database for `application/x-www-form-urlencoded` change - -1.1.1 / 2014-10-20 -================== - - * Mark `application/x-www-form-urlencoded` as compressible. - -1.1.0 / 2014-09-28 -================== - - * Add `application/font-woff2` - -1.0.3 / 2014-09-25 -================== - - * Fix engine requirement in package - -1.0.2 / 2014-09-25 -================== - - * Add `application/coap-group+json` - * Add `application/dcd` - * Add `application/vnd.apache.thrift.binary` - * Add `image/vnd.tencent.tap` - * Mark all JSON-derived types as compressible - * Update `text/vtt` data - -1.0.1 / 2014-08-30 -================== - - * Fix extension ordering - -1.0.0 / 2014-08-30 -================== - - * Add `application/atf` - * Add `application/merge-patch+json` - * Add `multipart/x-mixed-replace` - * Add `source: 'apache'` metadata - * Add `source: 'iana'` metadata - * Remove badly-assumed charset data diff --git a/node_modules/mime-db/LICENSE b/node_modules/mime-db/LICENSE deleted file mode 100644 index 0751cb1..0000000 --- a/node_modules/mime-db/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015-2022 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mime-db/README.md b/node_modules/mime-db/README.md deleted file mode 100644 index ee93fa0..0000000 --- a/node_modules/mime-db/README.md +++ /dev/null @@ -1,109 +0,0 @@ -# mime-db - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][ci-image]][ci-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -This is a large database of mime types and information about them. -It consists of a single, public JSON file and does not include any logic, -allowing it to remain as un-opinionated as possible with an API. -It aggregates data from the following sources: - -- https://www.iana.org/assignments/media-types/media-types.xhtml -- https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -- https://hg.nginx.org/nginx/raw-file/default/conf/mime.types - -## Installation - -```bash -npm install mime-db -``` - -### Database Download - -If you intend to use this in a web browser, you can conveniently access the JSON file via [jsDelivr](https://www.jsdelivr.com/), a popular CDN (Content Delivery Network). To ensure stability and compatibility, it is advisable to specify [a release tag](https://github.com/jshttp/mime-db/tags) instead of using the 'master' branch. This is because the JSON file's format might change in future updates, and relying on a specific release tag will prevent potential issues arising from these changes. - -``` -https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json -``` - -## Usage - -```js -var db = require('mime-db') - -// grab data on .js files -var data = db['application/javascript'] -``` - -## Data Structure - -The JSON file is a map lookup for lowercased mime types. -Each mime type has the following properties: - -- `.source` - where the mime type is defined. - If not set, it's probably a custom media type. - - `apache` - [Apache common media types](https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) - - `iana` - [IANA-defined media types](https://www.iana.org/assignments/media-types/media-types.xhtml) - - `nginx` - [nginx media types](https://hg.nginx.org/nginx/raw-file/default/conf/mime.types) -- `.extensions[]` - known extensions associated with this mime type. -- `.compressible` - whether a file of this type can be gzipped. -- `.charset` - the default charset associated with this type, if any. - -If unknown, every property could be `undefined`. - -## Note on MIME Type Data and Semver - -This package considers the programmatic api as the semver compatibility. This means the MIME type resolution is *not* considered -in the semver bumps. This means that if you want to pin your `mime-db` data you will need to do it in your application. While -this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is a breaking change. - -## Contributing - -The primary way to contribute to this database is by updating the data in -one of the upstream sources. The database is updated from the upstreams -periodically and will pull in any changes. - -### Registering Media Types - -The best way to get new media types included in this library is to register -them with the IANA. The community registration procedure is outlined in -[RFC 6838 section 5](https://tools.ietf.org/html/rfc6838#section-5). Types -registered with the IANA are automatically pulled into this library. - -### Direct Inclusion - -If that is not possible / feasible, they can be added directly here as a -"custom" type. To do this, it is required to have a primary source that -definitively lists the media type. If an extension is going to be listed as -associated with this media type, the source must definitively link the -media type and extension as well. - -To edit the database, only make PRs against `src/custom-types.json` or -`src/custom-suffix.json`. - -The `src/custom-types.json` file is a JSON object with the MIME type as the -keys and the values being an object with the following keys: - -- `compressible` - leave out if you don't know, otherwise `true`/`false` to - indicate whether the data represented by the type is typically compressible. -- `extensions` - include an array of file extensions that are associated with - the type. -- `notes` - human-readable notes about the type, typically what the type is. -- `sources` - include an array of URLs of where the MIME type and the associated - extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); - links to type aggregating sites and Wikipedia are _not acceptable_. - -To update the build, run `npm run build`. - -[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci -[ci-url]: https://github.com/jshttp/mime-db/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master -[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master -[node-image]: https://badgen.net/npm/node/mime-db -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/mime-db -[npm-url]: https://npmjs.org/package/mime-db -[npm-version-image]: https://badgen.net/npm/v/mime-db diff --git a/node_modules/mime-db/db.json b/node_modules/mime-db/db.json deleted file mode 100644 index 7e74733..0000000 --- a/node_modules/mime-db/db.json +++ /dev/null @@ -1,9342 +0,0 @@ -{ - "application/1d-interleaved-parityfec": { - "source": "iana" - }, - "application/3gpdash-qoe-report+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/3gpp-ims+xml": { - "source": "iana", - "compressible": true - }, - "application/3gpphal+json": { - "source": "iana", - "compressible": true - }, - "application/3gpphalforms+json": { - "source": "iana", - "compressible": true - }, - "application/a2l": { - "source": "iana" - }, - "application/ace+cbor": { - "source": "iana" - }, - "application/ace+json": { - "source": "iana", - "compressible": true - }, - "application/ace-groupcomm+cbor": { - "source": "iana" - }, - "application/ace-trl+cbor": { - "source": "iana" - }, - "application/activemessage": { - "source": "iana" - }, - "application/activity+json": { - "source": "iana", - "compressible": true - }, - "application/aif+cbor": { - "source": "iana" - }, - "application/aif+json": { - "source": "iana", - "compressible": true - }, - "application/alto-cdni+json": { - "source": "iana", - "compressible": true - }, - "application/alto-cdnifilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-directory+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcost+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcostparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointprop+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointpropparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-error+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-propmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-propmapparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-tips+json": { - "source": "iana", - "compressible": true - }, - "application/alto-tipsparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamcontrol+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamparams+json": { - "source": "iana", - "compressible": true - }, - "application/aml": { - "source": "iana" - }, - "application/andrew-inset": { - "source": "iana", - "extensions": ["ez"] - }, - "application/appinstaller": { - "compressible": false, - "extensions": ["appinstaller"] - }, - "application/applefile": { - "source": "iana" - }, - "application/applixware": { - "source": "apache", - "extensions": ["aw"] - }, - "application/appx": { - "compressible": false, - "extensions": ["appx"] - }, - "application/appxbundle": { - "compressible": false, - "extensions": ["appxbundle"] - }, - "application/at+jwt": { - "source": "iana" - }, - "application/atf": { - "source": "iana" - }, - "application/atfx": { - "source": "iana" - }, - "application/atom+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atom"] - }, - "application/atomcat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomcat"] - }, - "application/atomdeleted+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomdeleted"] - }, - "application/atomicmail": { - "source": "iana" - }, - "application/atomsvc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomsvc"] - }, - "application/atsc-dwd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dwd"] - }, - "application/atsc-dynamic-event-message": { - "source": "iana" - }, - "application/atsc-held+xml": { - "source": "iana", - "compressible": true, - "extensions": ["held"] - }, - "application/atsc-rdt+json": { - "source": "iana", - "compressible": true - }, - "application/atsc-rsat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsat"] - }, - "application/atxml": { - "source": "iana" - }, - "application/auth-policy+xml": { - "source": "iana", - "compressible": true - }, - "application/automationml-aml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["aml"] - }, - "application/automationml-amlx+zip": { - "source": "iana", - "compressible": false, - "extensions": ["amlx"] - }, - "application/bacnet-xdd+zip": { - "source": "iana", - "compressible": false - }, - "application/batch-smtp": { - "source": "iana" - }, - "application/bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/beep+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/bufr": { - "source": "iana" - }, - "application/c2pa": { - "source": "iana" - }, - "application/calendar+json": { - "source": "iana", - "compressible": true - }, - "application/calendar+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xcs"] - }, - "application/call-completion": { - "source": "iana" - }, - "application/cals-1840": { - "source": "iana" - }, - "application/captive+json": { - "source": "iana", - "compressible": true - }, - "application/cbor": { - "source": "iana" - }, - "application/cbor-seq": { - "source": "iana" - }, - "application/cccex": { - "source": "iana" - }, - "application/ccmp+xml": { - "source": "iana", - "compressible": true - }, - "application/ccxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ccxml"] - }, - "application/cda+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/cdfx+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdfx"] - }, - "application/cdmi-capability": { - "source": "iana", - "extensions": ["cdmia"] - }, - "application/cdmi-container": { - "source": "iana", - "extensions": ["cdmic"] - }, - "application/cdmi-domain": { - "source": "iana", - "extensions": ["cdmid"] - }, - "application/cdmi-object": { - "source": "iana", - "extensions": ["cdmio"] - }, - "application/cdmi-queue": { - "source": "iana", - "extensions": ["cdmiq"] - }, - "application/cdni": { - "source": "iana" - }, - "application/ce+cbor": { - "source": "iana" - }, - "application/cea": { - "source": "iana" - }, - "application/cea-2018+xml": { - "source": "iana", - "compressible": true - }, - "application/cellml+xml": { - "source": "iana", - "compressible": true - }, - "application/cfw": { - "source": "iana" - }, - "application/cid-edhoc+cbor-seq": { - "source": "iana" - }, - "application/city+json": { - "source": "iana", - "compressible": true - }, - "application/city+json-seq": { - "source": "iana" - }, - "application/clr": { - "source": "iana" - }, - "application/clue+xml": { - "source": "iana", - "compressible": true - }, - "application/clue_info+xml": { - "source": "iana", - "compressible": true - }, - "application/cms": { - "source": "iana" - }, - "application/cnrp+xml": { - "source": "iana", - "compressible": true - }, - "application/coap-eap": { - "source": "iana" - }, - "application/coap-group+json": { - "source": "iana", - "compressible": true - }, - "application/coap-payload": { - "source": "iana" - }, - "application/commonground": { - "source": "iana" - }, - "application/concise-problem-details+cbor": { - "source": "iana" - }, - "application/conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/cose": { - "source": "iana" - }, - "application/cose-key": { - "source": "iana" - }, - "application/cose-key-set": { - "source": "iana" - }, - "application/cose-x509": { - "source": "iana" - }, - "application/cpl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cpl"] - }, - "application/csrattrs": { - "source": "iana" - }, - "application/csta+xml": { - "source": "iana", - "compressible": true - }, - "application/cstadata+xml": { - "source": "iana", - "compressible": true - }, - "application/csvm+json": { - "source": "iana", - "compressible": true - }, - "application/cu-seeme": { - "source": "apache", - "extensions": ["cu"] - }, - "application/cwl": { - "source": "iana", - "extensions": ["cwl"] - }, - "application/cwl+json": { - "source": "iana", - "compressible": true - }, - "application/cwl+yaml": { - "source": "iana" - }, - "application/cwt": { - "source": "iana" - }, - "application/cybercash": { - "source": "iana" - }, - "application/dart": { - "compressible": true - }, - "application/dash+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpd"] - }, - "application/dash-patch+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpp"] - }, - "application/dashdelta": { - "source": "iana" - }, - "application/davmount+xml": { - "source": "iana", - "compressible": true, - "extensions": ["davmount"] - }, - "application/dca-rft": { - "source": "iana" - }, - "application/dcd": { - "source": "iana" - }, - "application/dec-dx": { - "source": "iana" - }, - "application/dialog-info+xml": { - "source": "iana", - "compressible": true - }, - "application/dicom": { - "source": "iana", - "extensions": ["dcm"] - }, - "application/dicom+json": { - "source": "iana", - "compressible": true - }, - "application/dicom+xml": { - "source": "iana", - "compressible": true - }, - "application/dii": { - "source": "iana" - }, - "application/dit": { - "source": "iana" - }, - "application/dns": { - "source": "iana" - }, - "application/dns+json": { - "source": "iana", - "compressible": true - }, - "application/dns-message": { - "source": "iana" - }, - "application/docbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dbk"] - }, - "application/dots+cbor": { - "source": "iana" - }, - "application/dpop+jwt": { - "source": "iana" - }, - "application/dskpp+xml": { - "source": "iana", - "compressible": true - }, - "application/dssc+der": { - "source": "iana", - "extensions": ["dssc"] - }, - "application/dssc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdssc"] - }, - "application/dvcs": { - "source": "iana" - }, - "application/eat+cwt": { - "source": "iana" - }, - "application/eat+jwt": { - "source": "iana" - }, - "application/eat-bun+cbor": { - "source": "iana" - }, - "application/eat-bun+json": { - "source": "iana", - "compressible": true - }, - "application/eat-ucs+cbor": { - "source": "iana" - }, - "application/eat-ucs+json": { - "source": "iana", - "compressible": true - }, - "application/ecmascript": { - "source": "apache", - "compressible": true, - "extensions": ["ecma"] - }, - "application/edhoc+cbor-seq": { - "source": "iana" - }, - "application/edi-consent": { - "source": "iana" - }, - "application/edi-x12": { - "source": "iana", - "compressible": false - }, - "application/edifact": { - "source": "iana", - "compressible": false - }, - "application/efi": { - "source": "iana" - }, - "application/elm+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/elm+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.cap+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/emergencycalldata.comment+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.control+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.deviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.ecall.msd": { - "source": "iana" - }, - "application/emergencycalldata.legacyesn+json": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.providerinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.serviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.subscriberinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.veds+xml": { - "source": "iana", - "compressible": true - }, - "application/emma+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emma"] - }, - "application/emotionml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emotionml"] - }, - "application/encaprtp": { - "source": "iana" - }, - "application/entity-statement+jwt": { - "source": "iana" - }, - "application/epp+xml": { - "source": "iana", - "compressible": true - }, - "application/epub+zip": { - "source": "iana", - "compressible": false, - "extensions": ["epub"] - }, - "application/eshop": { - "source": "iana" - }, - "application/exi": { - "source": "iana", - "extensions": ["exi"] - }, - "application/expect-ct-report+json": { - "source": "iana", - "compressible": true - }, - "application/express": { - "source": "iana", - "extensions": ["exp"] - }, - "application/fastinfoset": { - "source": "iana" - }, - "application/fastsoap": { - "source": "iana" - }, - "application/fdf": { - "source": "iana", - "extensions": ["fdf"] - }, - "application/fdt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fdt"] - }, - "application/fhir+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fhir+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fido.trusted-apps+json": { - "compressible": true - }, - "application/fits": { - "source": "iana" - }, - "application/flexfec": { - "source": "iana" - }, - "application/font-sfnt": { - "source": "iana" - }, - "application/font-tdpfr": { - "source": "iana", - "extensions": ["pfr"] - }, - "application/font-woff": { - "source": "iana", - "compressible": false - }, - "application/framework-attributes+xml": { - "source": "iana", - "compressible": true - }, - "application/geo+json": { - "source": "iana", - "compressible": true, - "extensions": ["geojson"] - }, - "application/geo+json-seq": { - "source": "iana" - }, - "application/geopackage+sqlite3": { - "source": "iana" - }, - "application/geopose+json": { - "source": "iana", - "compressible": true - }, - "application/geoxacml+json": { - "source": "iana", - "compressible": true - }, - "application/geoxacml+xml": { - "source": "iana", - "compressible": true - }, - "application/gltf-buffer": { - "source": "iana" - }, - "application/gml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["gml"] - }, - "application/gnap-binding-jws": { - "source": "iana" - }, - "application/gnap-binding-jwsd": { - "source": "iana" - }, - "application/gnap-binding-rotation-jws": { - "source": "iana" - }, - "application/gnap-binding-rotation-jwsd": { - "source": "iana" - }, - "application/gpx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["gpx"] - }, - "application/grib": { - "source": "iana" - }, - "application/gxf": { - "source": "apache", - "extensions": ["gxf"] - }, - "application/gzip": { - "source": "iana", - "compressible": false, - "extensions": ["gz"] - }, - "application/h224": { - "source": "iana" - }, - "application/held+xml": { - "source": "iana", - "compressible": true - }, - "application/hjson": { - "extensions": ["hjson"] - }, - "application/hl7v2+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/http": { - "source": "iana" - }, - "application/hyperstudio": { - "source": "iana", - "extensions": ["stk"] - }, - "application/ibe-key-request+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pkg-reply+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pp-data": { - "source": "iana" - }, - "application/iges": { - "source": "iana" - }, - "application/im-iscomposing+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/index": { - "source": "iana" - }, - "application/index.cmd": { - "source": "iana" - }, - "application/index.obj": { - "source": "iana" - }, - "application/index.response": { - "source": "iana" - }, - "application/index.vnd": { - "source": "iana" - }, - "application/inkml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ink","inkml"] - }, - "application/iotp": { - "source": "iana" - }, - "application/ipfix": { - "source": "iana", - "extensions": ["ipfix"] - }, - "application/ipp": { - "source": "iana" - }, - "application/isup": { - "source": "iana" - }, - "application/its+xml": { - "source": "iana", - "compressible": true, - "extensions": ["its"] - }, - "application/java-archive": { - "source": "iana", - "compressible": false, - "extensions": ["jar","war","ear"] - }, - "application/java-serialized-object": { - "source": "apache", - "compressible": false, - "extensions": ["ser"] - }, - "application/java-vm": { - "source": "apache", - "compressible": false, - "extensions": ["class"] - }, - "application/javascript": { - "source": "apache", - "charset": "UTF-8", - "compressible": true, - "extensions": ["js"] - }, - "application/jf2feed+json": { - "source": "iana", - "compressible": true - }, - "application/jose": { - "source": "iana" - }, - "application/jose+json": { - "source": "iana", - "compressible": true - }, - "application/jrd+json": { - "source": "iana", - "compressible": true - }, - "application/jscalendar+json": { - "source": "iana", - "compressible": true - }, - "application/jscontact+json": { - "source": "iana", - "compressible": true - }, - "application/json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["json","map"] - }, - "application/json-patch+json": { - "source": "iana", - "compressible": true - }, - "application/json-seq": { - "source": "iana" - }, - "application/json5": { - "extensions": ["json5"] - }, - "application/jsonml+json": { - "source": "apache", - "compressible": true, - "extensions": ["jsonml"] - }, - "application/jsonpath": { - "source": "iana" - }, - "application/jwk+json": { - "source": "iana", - "compressible": true - }, - "application/jwk-set+json": { - "source": "iana", - "compressible": true - }, - "application/jwk-set+jwt": { - "source": "iana" - }, - "application/jwt": { - "source": "iana" - }, - "application/kpml-request+xml": { - "source": "iana", - "compressible": true - }, - "application/kpml-response+xml": { - "source": "iana", - "compressible": true - }, - "application/ld+json": { - "source": "iana", - "compressible": true, - "extensions": ["jsonld"] - }, - "application/lgr+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lgr"] - }, - "application/link-format": { - "source": "iana" - }, - "application/linkset": { - "source": "iana" - }, - "application/linkset+json": { - "source": "iana", - "compressible": true - }, - "application/load-control+xml": { - "source": "iana", - "compressible": true - }, - "application/logout+jwt": { - "source": "iana" - }, - "application/lost+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lostxml"] - }, - "application/lostsync+xml": { - "source": "iana", - "compressible": true - }, - "application/lpf+zip": { - "source": "iana", - "compressible": false - }, - "application/lxf": { - "source": "iana" - }, - "application/mac-binhex40": { - "source": "iana", - "extensions": ["hqx"] - }, - "application/mac-compactpro": { - "source": "apache", - "extensions": ["cpt"] - }, - "application/macwriteii": { - "source": "iana" - }, - "application/mads+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mads"] - }, - "application/manifest+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["webmanifest"] - }, - "application/marc": { - "source": "iana", - "extensions": ["mrc"] - }, - "application/marcxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mrcx"] - }, - "application/mathematica": { - "source": "iana", - "extensions": ["ma","nb","mb"] - }, - "application/mathml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mathml"] - }, - "application/mathml-content+xml": { - "source": "iana", - "compressible": true - }, - "application/mathml-presentation+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-associated-procedure-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-deregister+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-envelope+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-protection-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-reception-report+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-schedule+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-user-service-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbox": { - "source": "iana", - "extensions": ["mbox"] - }, - "application/media-policy-dataset+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpf"] - }, - "application/media_control+xml": { - "source": "iana", - "compressible": true - }, - "application/mediaservercontrol+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mscml"] - }, - "application/merge-patch+json": { - "source": "iana", - "compressible": true - }, - "application/metalink+xml": { - "source": "apache", - "compressible": true, - "extensions": ["metalink"] - }, - "application/metalink4+xml": { - "source": "iana", - "compressible": true, - "extensions": ["meta4"] - }, - "application/mets+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mets"] - }, - "application/mf4": { - "source": "iana" - }, - "application/mikey": { - "source": "iana" - }, - "application/mipc": { - "source": "iana" - }, - "application/missing-blocks+cbor-seq": { - "source": "iana" - }, - "application/mmt-aei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["maei"] - }, - "application/mmt-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musd"] - }, - "application/mods+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mods"] - }, - "application/moss-keys": { - "source": "iana" - }, - "application/moss-signature": { - "source": "iana" - }, - "application/mosskey-data": { - "source": "iana" - }, - "application/mosskey-request": { - "source": "iana" - }, - "application/mp21": { - "source": "iana", - "extensions": ["m21","mp21"] - }, - "application/mp4": { - "source": "iana", - "extensions": ["mp4","mpg4","mp4s","m4p"] - }, - "application/mpeg4-generic": { - "source": "iana" - }, - "application/mpeg4-iod": { - "source": "iana" - }, - "application/mpeg4-iod-xmt": { - "source": "iana" - }, - "application/mrb-consumer+xml": { - "source": "iana", - "compressible": true - }, - "application/mrb-publish+xml": { - "source": "iana", - "compressible": true - }, - "application/msc-ivr+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msc-mixer+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msix": { - "compressible": false, - "extensions": ["msix"] - }, - "application/msixbundle": { - "compressible": false, - "extensions": ["msixbundle"] - }, - "application/msword": { - "source": "iana", - "compressible": false, - "extensions": ["doc","dot"] - }, - "application/mud+json": { - "source": "iana", - "compressible": true - }, - "application/multipart-core": { - "source": "iana" - }, - "application/mxf": { - "source": "iana", - "extensions": ["mxf"] - }, - "application/n-quads": { - "source": "iana", - "extensions": ["nq"] - }, - "application/n-triples": { - "source": "iana", - "extensions": ["nt"] - }, - "application/nasdata": { - "source": "iana" - }, - "application/news-checkgroups": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-groupinfo": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-transmission": { - "source": "iana" - }, - "application/nlsml+xml": { - "source": "iana", - "compressible": true - }, - "application/node": { - "source": "iana", - "extensions": ["cjs"] - }, - "application/nss": { - "source": "iana" - }, - "application/oauth-authz-req+jwt": { - "source": "iana" - }, - "application/oblivious-dns-message": { - "source": "iana" - }, - "application/ocsp-request": { - "source": "iana" - }, - "application/ocsp-response": { - "source": "iana" - }, - "application/octet-stream": { - "source": "iana", - "compressible": true, - "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] - }, - "application/oda": { - "source": "iana", - "extensions": ["oda"] - }, - "application/odm+xml": { - "source": "iana", - "compressible": true - }, - "application/odx": { - "source": "iana" - }, - "application/oebps-package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["opf"] - }, - "application/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogx"] - }, - "application/ohttp-keys": { - "source": "iana" - }, - "application/omdoc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["omdoc"] - }, - "application/onenote": { - "source": "apache", - "extensions": ["onetoc","onetoc2","onetmp","onepkg","one","onea"] - }, - "application/opc-nodeset+xml": { - "source": "iana", - "compressible": true - }, - "application/oscore": { - "source": "iana" - }, - "application/oxps": { - "source": "iana", - "extensions": ["oxps"] - }, - "application/p21": { - "source": "iana" - }, - "application/p21+zip": { - "source": "iana", - "compressible": false - }, - "application/p2p-overlay+xml": { - "source": "iana", - "compressible": true, - "extensions": ["relo"] - }, - "application/parityfec": { - "source": "iana" - }, - "application/passport": { - "source": "iana" - }, - "application/patch-ops-error+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xer"] - }, - "application/pdf": { - "source": "iana", - "compressible": false, - "extensions": ["pdf"] - }, - "application/pdx": { - "source": "iana" - }, - "application/pem-certificate-chain": { - "source": "iana" - }, - "application/pgp-encrypted": { - "source": "iana", - "compressible": false, - "extensions": ["pgp"] - }, - "application/pgp-keys": { - "source": "iana", - "extensions": ["asc"] - }, - "application/pgp-signature": { - "source": "iana", - "extensions": ["sig","asc"] - }, - "application/pics-rules": { - "source": "apache", - "extensions": ["prf"] - }, - "application/pidf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pidf-diff+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pkcs10": { - "source": "iana", - "extensions": ["p10"] - }, - "application/pkcs12": { - "source": "iana" - }, - "application/pkcs7-mime": { - "source": "iana", - "extensions": ["p7m","p7c"] - }, - "application/pkcs7-signature": { - "source": "iana", - "extensions": ["p7s"] - }, - "application/pkcs8": { - "source": "iana", - "extensions": ["p8"] - }, - "application/pkcs8-encrypted": { - "source": "iana" - }, - "application/pkix-attr-cert": { - "source": "iana", - "extensions": ["ac"] - }, - "application/pkix-cert": { - "source": "iana", - "extensions": ["cer"] - }, - "application/pkix-crl": { - "source": "iana", - "extensions": ["crl"] - }, - "application/pkix-pkipath": { - "source": "iana", - "extensions": ["pkipath"] - }, - "application/pkixcmp": { - "source": "iana", - "extensions": ["pki"] - }, - "application/pls+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pls"] - }, - "application/poc-settings+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/postscript": { - "source": "iana", - "compressible": true, - "extensions": ["ai","eps","ps"] - }, - "application/ppsp-tracker+json": { - "source": "iana", - "compressible": true - }, - "application/private-token-issuer-directory": { - "source": "iana" - }, - "application/private-token-request": { - "source": "iana" - }, - "application/private-token-response": { - "source": "iana" - }, - "application/problem+json": { - "source": "iana", - "compressible": true - }, - "application/problem+xml": { - "source": "iana", - "compressible": true - }, - "application/provenance+xml": { - "source": "iana", - "compressible": true, - "extensions": ["provx"] - }, - "application/provided-claims+jwt": { - "source": "iana" - }, - "application/prs.alvestrand.titrax-sheet": { - "source": "iana" - }, - "application/prs.cww": { - "source": "iana", - "extensions": ["cww"] - }, - "application/prs.cyn": { - "source": "iana", - "charset": "7-BIT" - }, - "application/prs.hpub+zip": { - "source": "iana", - "compressible": false - }, - "application/prs.implied-document+xml": { - "source": "iana", - "compressible": true - }, - "application/prs.implied-executable": { - "source": "iana" - }, - "application/prs.implied-object+json": { - "source": "iana", - "compressible": true - }, - "application/prs.implied-object+json-seq": { - "source": "iana" - }, - "application/prs.implied-object+yaml": { - "source": "iana" - }, - "application/prs.implied-structure": { - "source": "iana" - }, - "application/prs.mayfile": { - "source": "iana" - }, - "application/prs.nprend": { - "source": "iana" - }, - "application/prs.plucker": { - "source": "iana" - }, - "application/prs.rdf-xml-crypt": { - "source": "iana" - }, - "application/prs.vcfbzip2": { - "source": "iana" - }, - "application/prs.xsf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xsf"] - }, - "application/pskc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pskcxml"] - }, - "application/pvd+json": { - "source": "iana", - "compressible": true - }, - "application/qsig": { - "source": "iana" - }, - "application/raml+yaml": { - "compressible": true, - "extensions": ["raml"] - }, - "application/raptorfec": { - "source": "iana" - }, - "application/rdap+json": { - "source": "iana", - "compressible": true - }, - "application/rdf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rdf","owl"] - }, - "application/reginfo+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rif"] - }, - "application/relax-ng-compact-syntax": { - "source": "iana", - "extensions": ["rnc"] - }, - "application/remote-printing": { - "source": "apache" - }, - "application/reputon+json": { - "source": "iana", - "compressible": true - }, - "application/resolve-response+jwt": { - "source": "iana" - }, - "application/resource-lists+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rl"] - }, - "application/resource-lists-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rld"] - }, - "application/rfc+xml": { - "source": "iana", - "compressible": true - }, - "application/riscos": { - "source": "iana" - }, - "application/rlmi+xml": { - "source": "iana", - "compressible": true - }, - "application/rls-services+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rs"] - }, - "application/route-apd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rapd"] - }, - "application/route-s-tsid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sls"] - }, - "application/route-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rusd"] - }, - "application/rpki-checklist": { - "source": "iana" - }, - "application/rpki-ghostbusters": { - "source": "iana", - "extensions": ["gbr"] - }, - "application/rpki-manifest": { - "source": "iana", - "extensions": ["mft"] - }, - "application/rpki-publication": { - "source": "iana" - }, - "application/rpki-roa": { - "source": "iana", - "extensions": ["roa"] - }, - "application/rpki-signed-tal": { - "source": "iana" - }, - "application/rpki-updown": { - "source": "iana" - }, - "application/rsd+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rsd"] - }, - "application/rss+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rss"] - }, - "application/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "application/rtploopback": { - "source": "iana" - }, - "application/rtx": { - "source": "iana" - }, - "application/samlassertion+xml": { - "source": "iana", - "compressible": true - }, - "application/samlmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/sarif+json": { - "source": "iana", - "compressible": true - }, - "application/sarif-external-properties+json": { - "source": "iana", - "compressible": true - }, - "application/sbe": { - "source": "iana" - }, - "application/sbml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sbml"] - }, - "application/scaip+xml": { - "source": "iana", - "compressible": true - }, - "application/scim+json": { - "source": "iana", - "compressible": true - }, - "application/scvp-cv-request": { - "source": "iana", - "extensions": ["scq"] - }, - "application/scvp-cv-response": { - "source": "iana", - "extensions": ["scs"] - }, - "application/scvp-vp-request": { - "source": "iana", - "extensions": ["spq"] - }, - "application/scvp-vp-response": { - "source": "iana", - "extensions": ["spp"] - }, - "application/sdp": { - "source": "iana", - "extensions": ["sdp"] - }, - "application/secevent+jwt": { - "source": "iana" - }, - "application/senml+cbor": { - "source": "iana" - }, - "application/senml+json": { - "source": "iana", - "compressible": true - }, - "application/senml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["senmlx"] - }, - "application/senml-etch+cbor": { - "source": "iana" - }, - "application/senml-etch+json": { - "source": "iana", - "compressible": true - }, - "application/senml-exi": { - "source": "iana" - }, - "application/sensml+cbor": { - "source": "iana" - }, - "application/sensml+json": { - "source": "iana", - "compressible": true - }, - "application/sensml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sensmlx"] - }, - "application/sensml-exi": { - "source": "iana" - }, - "application/sep+xml": { - "source": "iana", - "compressible": true - }, - "application/sep-exi": { - "source": "iana" - }, - "application/session-info": { - "source": "iana" - }, - "application/set-payment": { - "source": "iana" - }, - "application/set-payment-initiation": { - "source": "iana", - "extensions": ["setpay"] - }, - "application/set-registration": { - "source": "iana" - }, - "application/set-registration-initiation": { - "source": "iana", - "extensions": ["setreg"] - }, - "application/sgml": { - "source": "iana" - }, - "application/sgml-open-catalog": { - "source": "iana" - }, - "application/shf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["shf"] - }, - "application/sieve": { - "source": "iana", - "extensions": ["siv","sieve"] - }, - "application/simple-filter+xml": { - "source": "iana", - "compressible": true - }, - "application/simple-message-summary": { - "source": "iana" - }, - "application/simplesymbolcontainer": { - "source": "iana" - }, - "application/sipc": { - "source": "iana" - }, - "application/slate": { - "source": "iana" - }, - "application/smil": { - "source": "apache" - }, - "application/smil+xml": { - "source": "iana", - "compressible": true, - "extensions": ["smi","smil"] - }, - "application/smpte336m": { - "source": "iana" - }, - "application/soap+fastinfoset": { - "source": "iana" - }, - "application/soap+xml": { - "source": "iana", - "compressible": true - }, - "application/sparql-query": { - "source": "iana", - "extensions": ["rq"] - }, - "application/sparql-results+xml": { - "source": "iana", - "compressible": true, - "extensions": ["srx"] - }, - "application/spdx+json": { - "source": "iana", - "compressible": true - }, - "application/spirits-event+xml": { - "source": "iana", - "compressible": true - }, - "application/sql": { - "source": "iana", - "extensions": ["sql"] - }, - "application/srgs": { - "source": "iana", - "extensions": ["gram"] - }, - "application/srgs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["grxml"] - }, - "application/sru+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sru"] - }, - "application/ssdl+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ssdl"] - }, - "application/sslkeylogfile": { - "source": "iana" - }, - "application/ssml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ssml"] - }, - "application/st2110-41": { - "source": "iana" - }, - "application/stix+json": { - "source": "iana", - "compressible": true - }, - "application/stratum": { - "source": "iana" - }, - "application/swid+cbor": { - "source": "iana" - }, - "application/swid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["swidtag"] - }, - "application/tamp-apex-update": { - "source": "iana" - }, - "application/tamp-apex-update-confirm": { - "source": "iana" - }, - "application/tamp-community-update": { - "source": "iana" - }, - "application/tamp-community-update-confirm": { - "source": "iana" - }, - "application/tamp-error": { - "source": "iana" - }, - "application/tamp-sequence-adjust": { - "source": "iana" - }, - "application/tamp-sequence-adjust-confirm": { - "source": "iana" - }, - "application/tamp-status-query": { - "source": "iana" - }, - "application/tamp-status-response": { - "source": "iana" - }, - "application/tamp-update": { - "source": "iana" - }, - "application/tamp-update-confirm": { - "source": "iana" - }, - "application/tar": { - "compressible": true - }, - "application/taxii+json": { - "source": "iana", - "compressible": true - }, - "application/td+json": { - "source": "iana", - "compressible": true - }, - "application/tei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tei","teicorpus"] - }, - "application/tetra_isi": { - "source": "iana" - }, - "application/thraud+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tfi"] - }, - "application/timestamp-query": { - "source": "iana" - }, - "application/timestamp-reply": { - "source": "iana" - }, - "application/timestamped-data": { - "source": "iana", - "extensions": ["tsd"] - }, - "application/tlsrpt+gzip": { - "source": "iana" - }, - "application/tlsrpt+json": { - "source": "iana", - "compressible": true - }, - "application/tm+json": { - "source": "iana", - "compressible": true - }, - "application/tnauthlist": { - "source": "iana" - }, - "application/toc+cbor": { - "source": "iana" - }, - "application/token-introspection+jwt": { - "source": "iana" - }, - "application/toml": { - "source": "iana", - "compressible": true, - "extensions": ["toml"] - }, - "application/trickle-ice-sdpfrag": { - "source": "iana" - }, - "application/trig": { - "source": "iana", - "extensions": ["trig"] - }, - "application/trust-chain+json": { - "source": "iana", - "compressible": true - }, - "application/trust-mark+jwt": { - "source": "iana" - }, - "application/trust-mark-delegation+jwt": { - "source": "iana" - }, - "application/ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ttml"] - }, - "application/tve-trigger": { - "source": "iana" - }, - "application/tzif": { - "source": "iana" - }, - "application/tzif-leap": { - "source": "iana" - }, - "application/ubjson": { - "compressible": false, - "extensions": ["ubj"] - }, - "application/uccs+cbor": { - "source": "iana" - }, - "application/ujcs+json": { - "source": "iana", - "compressible": true - }, - "application/ulpfec": { - "source": "iana" - }, - "application/urc-grpsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/urc-ressheet+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsheet"] - }, - "application/urc-targetdesc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["td"] - }, - "application/urc-uisocketdesc+xml": { - "source": "iana", - "compressible": true - }, - "application/vc": { - "source": "iana" - }, - "application/vc+cose": { - "source": "iana" - }, - "application/vc+jwt": { - "source": "iana" - }, - "application/vcard+json": { - "source": "iana", - "compressible": true - }, - "application/vcard+xml": { - "source": "iana", - "compressible": true - }, - "application/vemmi": { - "source": "iana" - }, - "application/vividence.scriptfile": { - "source": "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - "source": "iana", - "compressible": true, - "extensions": ["1km"] - }, - "application/vnd.1ob": { - "source": "iana" - }, - "application/vnd.3gpp-prose+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-prose-pc3a+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-prose-pc3ach+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-prose-pc8+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-v2x-local-service-information": { - "source": "iana" - }, - "application/vnd.3gpp.5gnas": { - "source": "iana" - }, - "application/vnd.3gpp.5gsa2x": { - "source": "iana" - }, - "application/vnd.3gpp.5gsa2x-local-service-information": { - "source": "iana" - }, - "application/vnd.3gpp.5gsv2x": { - "source": "iana" - }, - "application/vnd.3gpp.5gsv2x-local-service-information": { - "source": "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.bsf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.crs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.current-location-discovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.gmop+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.gtpc": { - "source": "iana" - }, - "application/vnd.3gpp.interworking-data": { - "source": "iana" - }, - "application/vnd.3gpp.lpp": { - "source": "iana" - }, - "application/vnd.3gpp.mc-signalling-ear": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-payload": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-regroup+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-signalling": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-regroup+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-regroup+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mid-call+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.ngap": { - "source": "iana" - }, - "application/vnd.3gpp.pfcp": { - "source": "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - "source": "iana", - "extensions": ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - "source": "iana", - "extensions": ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - "source": "iana", - "extensions": ["pvb"] - }, - "application/vnd.3gpp.pinapp-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.s1ap": { - "source": "iana" - }, - "application/vnd.3gpp.seal-group-doc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-network-qos-management-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-ue-config-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-unicast-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-user-profile-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.sms": { - "source": "iana" - }, - "application/vnd.3gpp.sms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.ussd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.v2x": { - "source": "iana" - }, - "application/vnd.3gpp.vae-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.sms": { - "source": "iana" - }, - "application/vnd.3gpp2.tcap": { - "source": "iana", - "extensions": ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - "source": "iana" - }, - "application/vnd.3m.post-it-notes": { - "source": "iana", - "extensions": ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - "source": "iana", - "extensions": ["aso"] - }, - "application/vnd.accpac.simply.imp": { - "source": "iana", - "extensions": ["imp"] - }, - "application/vnd.acm.addressxfer+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.acm.chatbot+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.acucobol": { - "source": "iana", - "extensions": ["acu"] - }, - "application/vnd.acucorp": { - "source": "iana", - "extensions": ["atc","acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - "source": "apache", - "compressible": false, - "extensions": ["air"] - }, - "application/vnd.adobe.flash.movie": { - "source": "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - "source": "iana", - "extensions": ["fcdt"] - }, - "application/vnd.adobe.fxp": { - "source": "iana", - "extensions": ["fxp","fxpl"] - }, - "application/vnd.adobe.partial-upload": { - "source": "iana" - }, - "application/vnd.adobe.xdp+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdp"] - }, - "application/vnd.adobe.xfdf": { - "source": "apache", - "extensions": ["xfdf"] - }, - "application/vnd.aether.imp": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - "source": "iana" - }, - "application/vnd.afpc.cmoca-cmresource": { - "source": "iana" - }, - "application/vnd.afpc.foca-charset": { - "source": "iana" - }, - "application/vnd.afpc.foca-codedfont": { - "source": "iana" - }, - "application/vnd.afpc.foca-codepage": { - "source": "iana" - }, - "application/vnd.afpc.modca": { - "source": "iana" - }, - "application/vnd.afpc.modca-cmtable": { - "source": "iana" - }, - "application/vnd.afpc.modca-formdef": { - "source": "iana" - }, - "application/vnd.afpc.modca-mediummap": { - "source": "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - "source": "iana" - }, - "application/vnd.afpc.modca-overlay": { - "source": "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - "source": "iana" - }, - "application/vnd.age": { - "source": "iana", - "extensions": ["age"] - }, - "application/vnd.ah-barcode": { - "source": "apache" - }, - "application/vnd.ahead.space": { - "source": "iana", - "extensions": ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - "source": "iana", - "extensions": ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - "source": "iana", - "extensions": ["azs"] - }, - "application/vnd.amadeus+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.amazon.ebook": { - "source": "apache", - "extensions": ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - "source": "iana" - }, - "application/vnd.americandynamics.acc": { - "source": "iana", - "extensions": ["acc"] - }, - "application/vnd.amiga.ami": { - "source": "iana", - "extensions": ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.android.ota": { - "source": "iana" - }, - "application/vnd.android.package-archive": { - "source": "apache", - "compressible": false, - "extensions": ["apk"] - }, - "application/vnd.anki": { - "source": "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - "source": "iana", - "extensions": ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - "source": "apache", - "extensions": ["fti"] - }, - "application/vnd.antix.game-component": { - "source": "iana", - "extensions": ["atx"] - }, - "application/vnd.apache.arrow.file": { - "source": "iana" - }, - "application/vnd.apache.arrow.stream": { - "source": "iana" - }, - "application/vnd.apache.parquet": { - "source": "iana" - }, - "application/vnd.apache.thrift.binary": { - "source": "iana" - }, - "application/vnd.apache.thrift.compact": { - "source": "iana" - }, - "application/vnd.apache.thrift.json": { - "source": "iana" - }, - "application/vnd.apexlang": { - "source": "iana" - }, - "application/vnd.api+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.aplextor.warrp+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apothekende.reservation+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apple.installer+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpkg"] - }, - "application/vnd.apple.keynote": { - "source": "iana", - "extensions": ["key"] - }, - "application/vnd.apple.mpegurl": { - "source": "iana", - "extensions": ["m3u8"] - }, - "application/vnd.apple.numbers": { - "source": "iana", - "extensions": ["numbers"] - }, - "application/vnd.apple.pages": { - "source": "iana", - "extensions": ["pages"] - }, - "application/vnd.apple.pkpass": { - "compressible": false, - "extensions": ["pkpass"] - }, - "application/vnd.arastra.swi": { - "source": "apache" - }, - "application/vnd.aristanetworks.swi": { - "source": "iana", - "extensions": ["swi"] - }, - "application/vnd.artisan+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.artsquare": { - "source": "iana" - }, - "application/vnd.astraea-software.iota": { - "source": "iana", - "extensions": ["iota"] - }, - "application/vnd.audiograph": { - "source": "iana", - "extensions": ["aep"] - }, - "application/vnd.autodesk.fbx": { - "extensions": ["fbx"] - }, - "application/vnd.autopackage": { - "source": "iana" - }, - "application/vnd.avalon+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.avistar+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.balsamiq.bmml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - "source": "iana" - }, - "application/vnd.banana-accounting": { - "source": "iana" - }, - "application/vnd.bbf.usp.error": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bekitzur-stech+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.belightsoft.lhzd+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.belightsoft.lhzl+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.bint.med-content": { - "source": "iana" - }, - "application/vnd.biopax.rdf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.blink-idb-value-wrapper": { - "source": "iana" - }, - "application/vnd.blueice.multipass": { - "source": "iana", - "extensions": ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - "source": "iana" - }, - "application/vnd.bluetooth.le.oob": { - "source": "iana" - }, - "application/vnd.bmi": { - "source": "iana", - "extensions": ["bmi"] - }, - "application/vnd.bpf": { - "source": "iana" - }, - "application/vnd.bpf3": { - "source": "iana" - }, - "application/vnd.businessobjects": { - "source": "iana", - "extensions": ["rep"] - }, - "application/vnd.byu.uapi+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bzip3": { - "source": "iana" - }, - "application/vnd.c3voc.schedule+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cab-jscript": { - "source": "iana" - }, - "application/vnd.canon-cpdl": { - "source": "iana" - }, - "application/vnd.canon-lips": { - "source": "iana" - }, - "application/vnd.capasystems-pg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cendio.thinlinc.clientconf": { - "source": "iana" - }, - "application/vnd.century-systems.tcp_stream": { - "source": "iana" - }, - "application/vnd.chemdraw+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdxml"] - }, - "application/vnd.chess-pgn": { - "source": "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - "source": "iana", - "extensions": ["mmd"] - }, - "application/vnd.ciedi": { - "source": "iana" - }, - "application/vnd.cinderella": { - "source": "iana", - "extensions": ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - "source": "iana" - }, - "application/vnd.citationstyles.style+xml": { - "source": "iana", - "compressible": true, - "extensions": ["csl"] - }, - "application/vnd.claymore": { - "source": "iana", - "extensions": ["cla"] - }, - "application/vnd.cloanto.rp9": { - "source": "iana", - "extensions": ["rp9"] - }, - "application/vnd.clonk.c4group": { - "source": "iana", - "extensions": ["c4g","c4d","c4f","c4p","c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - "source": "iana", - "extensions": ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - "source": "iana", - "extensions": ["c11amz"] - }, - "application/vnd.cncf.helm.chart.content.v1.tar+gzip": { - "source": "iana" - }, - "application/vnd.cncf.helm.chart.provenance.v1.prov": { - "source": "iana" - }, - "application/vnd.cncf.helm.config.v1+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.coffeescript": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - "source": "iana" - }, - "application/vnd.collection+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.doc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.next+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.comicbook+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.comicbook-rar": { - "source": "iana" - }, - "application/vnd.commerce-battelle": { - "source": "iana" - }, - "application/vnd.commonspace": { - "source": "iana", - "extensions": ["csp"] - }, - "application/vnd.contact.cmsg": { - "source": "iana", - "extensions": ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cosmocaller": { - "source": "iana", - "extensions": ["cmc"] - }, - "application/vnd.crick.clicker": { - "source": "iana", - "extensions": ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - "source": "iana", - "extensions": ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - "source": "iana", - "extensions": ["clkp"] - }, - "application/vnd.crick.clicker.template": { - "source": "iana", - "extensions": ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - "source": "iana", - "extensions": ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.crypto-shade-file": { - "source": "iana" - }, - "application/vnd.cryptomator.encrypted": { - "source": "iana" - }, - "application/vnd.cryptomator.vault": { - "source": "iana" - }, - "application/vnd.ctc-posml": { - "source": "iana", - "extensions": ["pml"] - }, - "application/vnd.ctct.ws+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cups-pdf": { - "source": "iana" - }, - "application/vnd.cups-postscript": { - "source": "iana" - }, - "application/vnd.cups-ppd": { - "source": "iana", - "extensions": ["ppd"] - }, - "application/vnd.cups-raster": { - "source": "iana" - }, - "application/vnd.cups-raw": { - "source": "iana" - }, - "application/vnd.curl": { - "source": "iana" - }, - "application/vnd.curl.car": { - "source": "apache", - "extensions": ["car"] - }, - "application/vnd.curl.pcurl": { - "source": "apache", - "extensions": ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cybank": { - "source": "iana" - }, - "application/vnd.cyclonedx+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cyclonedx+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.d2l.coursepackage1p0+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.d3m-dataset": { - "source": "iana" - }, - "application/vnd.d3m-problem": { - "source": "iana" - }, - "application/vnd.dart": { - "source": "iana", - "compressible": true, - "extensions": ["dart"] - }, - "application/vnd.data-vision.rdz": { - "source": "iana", - "extensions": ["rdz"] - }, - "application/vnd.datalog": { - "source": "iana" - }, - "application/vnd.datapackage+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dataresource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dbf": { - "source": "iana", - "extensions": ["dbf"] - }, - "application/vnd.dcmp+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dcmp"] - }, - "application/vnd.debian.binary-package": { - "source": "iana" - }, - "application/vnd.dece.data": { - "source": "iana", - "extensions": ["uvf","uvvf","uvd","uvvd"] - }, - "application/vnd.dece.ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uvt","uvvt"] - }, - "application/vnd.dece.unspecified": { - "source": "iana", - "extensions": ["uvx","uvvx"] - }, - "application/vnd.dece.zip": { - "source": "iana", - "extensions": ["uvz","uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - "source": "iana", - "extensions": ["fe_launch"] - }, - "application/vnd.desmume.movie": { - "source": "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - "source": "iana" - }, - "application/vnd.dm.delegation+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dna": { - "source": "iana", - "extensions": ["dna"] - }, - "application/vnd.document+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dolby.mlp": { - "source": "apache", - "extensions": ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - "source": "iana" - }, - "application/vnd.dolby.mobile.2": { - "source": "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - "source": "iana" - }, - "application/vnd.dpgraph": { - "source": "iana", - "extensions": ["dpg"] - }, - "application/vnd.dreamfactory": { - "source": "iana", - "extensions": ["dfac"] - }, - "application/vnd.drive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ds-keypoint": { - "source": "apache", - "extensions": ["kpxx"] - }, - "application/vnd.dtg.local": { - "source": "iana" - }, - "application/vnd.dtg.local.flash": { - "source": "iana" - }, - "application/vnd.dtg.local.html": { - "source": "iana" - }, - "application/vnd.dvb.ait": { - "source": "iana", - "extensions": ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.dvbj": { - "source": "iana" - }, - "application/vnd.dvb.esgcontainer": { - "source": "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - "source": "iana" - }, - "application/vnd.dvb.ipdcroaming": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - "source": "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-container+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-generic+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-init+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.pfr": { - "source": "iana" - }, - "application/vnd.dvb.service": { - "source": "iana", - "extensions": ["svc"] - }, - "application/vnd.dxr": { - "source": "iana" - }, - "application/vnd.dynageo": { - "source": "iana", - "extensions": ["geo"] - }, - "application/vnd.dzr": { - "source": "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - "source": "iana" - }, - "application/vnd.ecdis-update": { - "source": "iana" - }, - "application/vnd.ecip.rlp": { - "source": "iana" - }, - "application/vnd.eclipse.ditto+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ecowin.chart": { - "source": "iana", - "extensions": ["mag"] - }, - "application/vnd.ecowin.filerequest": { - "source": "iana" - }, - "application/vnd.ecowin.fileupdate": { - "source": "iana" - }, - "application/vnd.ecowin.series": { - "source": "iana" - }, - "application/vnd.ecowin.seriesrequest": { - "source": "iana" - }, - "application/vnd.ecowin.seriesupdate": { - "source": "iana" - }, - "application/vnd.efi.img": { - "source": "iana" - }, - "application/vnd.efi.iso": { - "source": "iana" - }, - "application/vnd.eln+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.emclient.accessrequest+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.enliven": { - "source": "iana", - "extensions": ["nml"] - }, - "application/vnd.enphase.envoy": { - "source": "iana" - }, - "application/vnd.eprints.data+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.epson.esf": { - "source": "iana", - "extensions": ["esf"] - }, - "application/vnd.epson.msf": { - "source": "iana", - "extensions": ["msf"] - }, - "application/vnd.epson.quickanime": { - "source": "iana", - "extensions": ["qam"] - }, - "application/vnd.epson.salt": { - "source": "iana", - "extensions": ["slt"] - }, - "application/vnd.epson.ssf": { - "source": "iana", - "extensions": ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - "source": "iana" - }, - "application/vnd.erofs": { - "source": "iana" - }, - "application/vnd.espass-espass+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.eszigno3+xml": { - "source": "iana", - "compressible": true, - "extensions": ["es3","et3"] - }, - "application/vnd.etsi.aoc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.asic-e+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.asic-s+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.cug+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvcommand+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvservice+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsync+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mcid+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mheg5": { - "source": "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.pstn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.sci+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.simservs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.timestamp-token": { - "source": "iana" - }, - "application/vnd.etsi.tsl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.tsl.der": { - "source": "iana" - }, - "application/vnd.eu.kasparian.car+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.eudora.data": { - "source": "iana" - }, - "application/vnd.evolv.ecig.profile": { - "source": "iana" - }, - "application/vnd.evolv.ecig.settings": { - "source": "iana" - }, - "application/vnd.evolv.ecig.theme": { - "source": "iana" - }, - "application/vnd.exstream-empower+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.exstream-package": { - "source": "iana" - }, - "application/vnd.ezpix-album": { - "source": "iana", - "extensions": ["ez2"] - }, - "application/vnd.ezpix-package": { - "source": "iana", - "extensions": ["ez3"] - }, - "application/vnd.f-secure.mobile": { - "source": "iana" - }, - "application/vnd.familysearch.gedcom+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.fastcopy-disk-image": { - "source": "iana" - }, - "application/vnd.fdf": { - "source": "apache", - "extensions": ["fdf"] - }, - "application/vnd.fdsn.mseed": { - "source": "iana", - "extensions": ["mseed"] - }, - "application/vnd.fdsn.seed": { - "source": "iana", - "extensions": ["seed","dataless"] - }, - "application/vnd.fdsn.stationxml+xml": { - "source": "iana", - "charset": "XML-BASED", - "compressible": true - }, - "application/vnd.ffsns": { - "source": "iana" - }, - "application/vnd.ficlab.flb+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.filmit.zfc": { - "source": "iana" - }, - "application/vnd.fints": { - "source": "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - "source": "iana" - }, - "application/vnd.flographit": { - "source": "iana", - "extensions": ["gph"] - }, - "application/vnd.fluxtime.clip": { - "source": "iana", - "extensions": ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - "source": "iana" - }, - "application/vnd.framemaker": { - "source": "iana", - "extensions": ["fm","frame","maker","book"] - }, - "application/vnd.freelog.comic": { - "source": "iana" - }, - "application/vnd.frogans.fnc": { - "source": "apache", - "extensions": ["fnc"] - }, - "application/vnd.frogans.ltf": { - "source": "apache", - "extensions": ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - "source": "iana", - "extensions": ["fsc"] - }, - "application/vnd.fujifilm.fb.docuworks": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujifilm.fb.jfi+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.fujitsu.oasys": { - "source": "iana", - "extensions": ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - "source": "iana", - "extensions": ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - "source": "iana", - "extensions": ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - "source": "iana", - "extensions": ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - "source": "iana", - "extensions": ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - "source": "iana" - }, - "application/vnd.fujixerox.art4": { - "source": "iana" - }, - "application/vnd.fujixerox.ddd": { - "source": "iana", - "extensions": ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - "source": "iana", - "extensions": ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - "source": "iana", - "extensions": ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujixerox.hbpl": { - "source": "iana" - }, - "application/vnd.fut-misnet": { - "source": "iana" - }, - "application/vnd.futoin+cbor": { - "source": "iana" - }, - "application/vnd.futoin+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.fuzzysheet": { - "source": "iana", - "extensions": ["fzs"] - }, - "application/vnd.ga4gh.passport+jwt": { - "source": "iana" - }, - "application/vnd.genomatix.tuxedo": { - "source": "iana", - "extensions": ["txd"] - }, - "application/vnd.genozip": { - "source": "iana" - }, - "application/vnd.gentics.grd+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.gentoo.catmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.gentoo.ebuild": { - "source": "iana" - }, - "application/vnd.gentoo.eclass": { - "source": "iana" - }, - "application/vnd.gentoo.gpkg": { - "source": "iana" - }, - "application/vnd.gentoo.manifest": { - "source": "iana" - }, - "application/vnd.gentoo.pkgmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.gentoo.xpak": { - "source": "iana" - }, - "application/vnd.geo+json": { - "source": "apache", - "compressible": true - }, - "application/vnd.geocube+xml": { - "source": "apache", - "compressible": true - }, - "application/vnd.geogebra.file": { - "source": "iana", - "extensions": ["ggb"] - }, - "application/vnd.geogebra.pinboard": { - "source": "iana" - }, - "application/vnd.geogebra.slides": { - "source": "iana", - "extensions": ["ggs"] - }, - "application/vnd.geogebra.tool": { - "source": "iana", - "extensions": ["ggt"] - }, - "application/vnd.geometry-explorer": { - "source": "iana", - "extensions": ["gex","gre"] - }, - "application/vnd.geonext": { - "source": "iana", - "extensions": ["gxt"] - }, - "application/vnd.geoplan": { - "source": "iana", - "extensions": ["g2w"] - }, - "application/vnd.geospace": { - "source": "iana", - "extensions": ["g3w"] - }, - "application/vnd.gerber": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - "source": "iana" - }, - "application/vnd.gmx": { - "source": "iana", - "extensions": ["gmx"] - }, - "application/vnd.gnu.taler.exchange+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.gnu.taler.merchant+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.google-apps.audio": {}, - "application/vnd.google-apps.document": { - "compressible": false, - "extensions": ["gdoc"] - }, - "application/vnd.google-apps.drawing": { - "compressible": false, - "extensions": ["gdraw"] - }, - "application/vnd.google-apps.drive-sdk": { - "compressible": false - }, - "application/vnd.google-apps.file": {}, - "application/vnd.google-apps.folder": { - "compressible": false - }, - "application/vnd.google-apps.form": { - "compressible": false, - "extensions": ["gform"] - }, - "application/vnd.google-apps.fusiontable": {}, - "application/vnd.google-apps.jam": { - "compressible": false, - "extensions": ["gjam"] - }, - "application/vnd.google-apps.mail-layout": {}, - "application/vnd.google-apps.map": { - "compressible": false, - "extensions": ["gmap"] - }, - "application/vnd.google-apps.photo": {}, - "application/vnd.google-apps.presentation": { - "compressible": false, - "extensions": ["gslides"] - }, - "application/vnd.google-apps.script": { - "compressible": false, - "extensions": ["gscript"] - }, - "application/vnd.google-apps.shortcut": {}, - "application/vnd.google-apps.site": { - "compressible": false, - "extensions": ["gsite"] - }, - "application/vnd.google-apps.spreadsheet": { - "compressible": false, - "extensions": ["gsheet"] - }, - "application/vnd.google-apps.unknown": {}, - "application/vnd.google-apps.video": {}, - "application/vnd.google-earth.kml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["kml"] - }, - "application/vnd.google-earth.kmz": { - "source": "iana", - "compressible": false, - "extensions": ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - "source": "apache", - "compressible": true - }, - "application/vnd.gov.sk.e-form+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdcf"] - }, - "application/vnd.gpxsee.map+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.grafeq": { - "source": "iana", - "extensions": ["gqf","gqs"] - }, - "application/vnd.gridmp": { - "source": "iana" - }, - "application/vnd.groove-account": { - "source": "iana", - "extensions": ["gac"] - }, - "application/vnd.groove-help": { - "source": "iana", - "extensions": ["ghf"] - }, - "application/vnd.groove-identity-message": { - "source": "iana", - "extensions": ["gim"] - }, - "application/vnd.groove-injector": { - "source": "iana", - "extensions": ["grv"] - }, - "application/vnd.groove-tool-message": { - "source": "iana", - "extensions": ["gtm"] - }, - "application/vnd.groove-tool-template": { - "source": "iana", - "extensions": ["tpl"] - }, - "application/vnd.groove-vcard": { - "source": "iana", - "extensions": ["vcg"] - }, - "application/vnd.hal+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hal+xml": { - "source": "iana", - "compressible": true, - "extensions": ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zmm"] - }, - "application/vnd.hbci": { - "source": "iana", - "extensions": ["hbci"] - }, - "application/vnd.hc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hcl-bireports": { - "source": "iana" - }, - "application/vnd.hdt": { - "source": "iana" - }, - "application/vnd.heroku+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hhe.lesson-player": { - "source": "iana", - "extensions": ["les"] - }, - "application/vnd.hp-hpgl": { - "source": "iana", - "extensions": ["hpgl"] - }, - "application/vnd.hp-hpid": { - "source": "iana", - "extensions": ["hpid"] - }, - "application/vnd.hp-hps": { - "source": "iana", - "extensions": ["hps"] - }, - "application/vnd.hp-jlyt": { - "source": "iana", - "extensions": ["jlt"] - }, - "application/vnd.hp-pcl": { - "source": "iana", - "extensions": ["pcl"] - }, - "application/vnd.hp-pclxl": { - "source": "iana", - "extensions": ["pclxl"] - }, - "application/vnd.hsl": { - "source": "iana" - }, - "application/vnd.httphone": { - "source": "iana" - }, - "application/vnd.hydrostatix.sof-data": { - "source": "iana", - "extensions": ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyper-item+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyperdrive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hzn-3d-crossword": { - "source": "iana" - }, - "application/vnd.ibm.afplinedata": { - "source": "apache" - }, - "application/vnd.ibm.electronic-media": { - "source": "iana" - }, - "application/vnd.ibm.minipay": { - "source": "iana", - "extensions": ["mpy"] - }, - "application/vnd.ibm.modcap": { - "source": "apache", - "extensions": ["afp","listafp","list3820"] - }, - "application/vnd.ibm.rights-management": { - "source": "iana", - "extensions": ["irm"] - }, - "application/vnd.ibm.secure-container": { - "source": "iana", - "extensions": ["sc"] - }, - "application/vnd.iccprofile": { - "source": "iana", - "extensions": ["icc","icm"] - }, - "application/vnd.ieee.1905": { - "source": "iana" - }, - "application/vnd.igloader": { - "source": "iana", - "extensions": ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.imagemeter.image+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.immervision-ivp": { - "source": "iana", - "extensions": ["ivp"] - }, - "application/vnd.immervision-ivu": { - "source": "iana", - "extensions": ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p2": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p3": { - "source": "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.informedcontrol.rms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.informix-visionary": { - "source": "apache" - }, - "application/vnd.infotech.project": { - "source": "iana" - }, - "application/vnd.infotech.project+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.innopath.wamp.notification": { - "source": "iana" - }, - "application/vnd.insors.igm": { - "source": "iana", - "extensions": ["igm"] - }, - "application/vnd.intercon.formnet": { - "source": "iana", - "extensions": ["xpw","xpx"] - }, - "application/vnd.intergeo": { - "source": "iana", - "extensions": ["i2g"] - }, - "application/vnd.intertrust.digibox": { - "source": "iana" - }, - "application/vnd.intertrust.nncp": { - "source": "iana" - }, - "application/vnd.intu.qbo": { - "source": "iana", - "extensions": ["qbo"] - }, - "application/vnd.intu.qfx": { - "source": "iana", - "extensions": ["qfx"] - }, - "application/vnd.ipfs.ipns-record": { - "source": "iana" - }, - "application/vnd.ipld.car": { - "source": "iana" - }, - "application/vnd.ipld.dag-cbor": { - "source": "iana" - }, - "application/vnd.ipld.dag-json": { - "source": "iana" - }, - "application/vnd.ipld.raw": { - "source": "iana" - }, - "application/vnd.iptc.g2.catalogitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.packageitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.planningitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ipunplugged.rcprofile": { - "source": "iana", - "extensions": ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["irp"] - }, - "application/vnd.is-xpr": { - "source": "iana", - "extensions": ["xpr"] - }, - "application/vnd.isac.fcs": { - "source": "iana", - "extensions": ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.jam": { - "source": "iana", - "extensions": ["jam"] - }, - "application/vnd.japannet-directory-service": { - "source": "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-payment-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-registration": { - "source": "iana" - }, - "application/vnd.japannet-registration-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-verification": { - "source": "iana" - }, - "application/vnd.japannet-verification-wakeup": { - "source": "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - "source": "iana", - "extensions": ["rms"] - }, - "application/vnd.jisp": { - "source": "iana", - "extensions": ["jisp"] - }, - "application/vnd.joost.joda-archive": { - "source": "iana", - "extensions": ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - "source": "iana" - }, - "application/vnd.kahootz": { - "source": "iana", - "extensions": ["ktz","ktr"] - }, - "application/vnd.kde.karbon": { - "source": "iana", - "extensions": ["karbon"] - }, - "application/vnd.kde.kchart": { - "source": "iana", - "extensions": ["chrt"] - }, - "application/vnd.kde.kformula": { - "source": "iana", - "extensions": ["kfo"] - }, - "application/vnd.kde.kivio": { - "source": "iana", - "extensions": ["flw"] - }, - "application/vnd.kde.kontour": { - "source": "iana", - "extensions": ["kon"] - }, - "application/vnd.kde.kpresenter": { - "source": "iana", - "extensions": ["kpr","kpt"] - }, - "application/vnd.kde.kspread": { - "source": "iana", - "extensions": ["ksp"] - }, - "application/vnd.kde.kword": { - "source": "iana", - "extensions": ["kwd","kwt"] - }, - "application/vnd.kdl": { - "source": "iana" - }, - "application/vnd.kenameaapp": { - "source": "iana", - "extensions": ["htke"] - }, - "application/vnd.keyman.kmp+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.keyman.kmx": { - "source": "iana" - }, - "application/vnd.kidspiration": { - "source": "iana", - "extensions": ["kia"] - }, - "application/vnd.kinar": { - "source": "iana", - "extensions": ["kne","knp"] - }, - "application/vnd.koan": { - "source": "iana", - "extensions": ["skp","skd","skt","skm"] - }, - "application/vnd.kodak-descriptor": { - "source": "iana", - "extensions": ["sse"] - }, - "application/vnd.las": { - "source": "iana" - }, - "application/vnd.las.las+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.las.las+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lasxml"] - }, - "application/vnd.laszip": { - "source": "iana" - }, - "application/vnd.ldev.productlicensing": { - "source": "iana" - }, - "application/vnd.leap+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.liberty-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - "source": "iana", - "extensions": ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.loom": { - "source": "iana" - }, - "application/vnd.lotus-1-2-3": { - "source": "iana", - "extensions": ["123"] - }, - "application/vnd.lotus-approach": { - "source": "iana", - "extensions": ["apr"] - }, - "application/vnd.lotus-freelance": { - "source": "iana", - "extensions": ["pre"] - }, - "application/vnd.lotus-notes": { - "source": "iana", - "extensions": ["nsf"] - }, - "application/vnd.lotus-organizer": { - "source": "iana", - "extensions": ["org"] - }, - "application/vnd.lotus-screencam": { - "source": "iana", - "extensions": ["scm"] - }, - "application/vnd.lotus-wordpro": { - "source": "iana", - "extensions": ["lwp"] - }, - "application/vnd.macports.portpkg": { - "source": "iana", - "extensions": ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - "source": "iana", - "extensions": ["mvt"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.conftoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.license+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.mdcf": { - "source": "iana" - }, - "application/vnd.mason+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.maxar.archive.3tz+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.maxmind.maxmind-db": { - "source": "iana" - }, - "application/vnd.mcd": { - "source": "iana", - "extensions": ["mcd"] - }, - "application/vnd.mdl": { - "source": "iana" - }, - "application/vnd.mdl-mbsdf": { - "source": "iana" - }, - "application/vnd.medcalcdata": { - "source": "iana", - "extensions": ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - "source": "iana", - "extensions": ["cdkey"] - }, - "application/vnd.medicalholodeck.recordxr": { - "source": "iana" - }, - "application/vnd.meridian-slingshot": { - "source": "iana" - }, - "application/vnd.mermaid": { - "source": "iana" - }, - "application/vnd.mfer": { - "source": "iana", - "extensions": ["mwf"] - }, - "application/vnd.mfmp": { - "source": "iana", - "extensions": ["mfm"] - }, - "application/vnd.micro+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.micrografx.flo": { - "source": "iana", - "extensions": ["flo"] - }, - "application/vnd.micrografx.igx": { - "source": "iana", - "extensions": ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - "source": "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - "source": "iana" - }, - "application/vnd.miele+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.mif": { - "source": "iana", - "extensions": ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - "source": "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - "source": "iana" - }, - "application/vnd.mobius.daf": { - "source": "iana", - "extensions": ["daf"] - }, - "application/vnd.mobius.dis": { - "source": "iana", - "extensions": ["dis"] - }, - "application/vnd.mobius.mbk": { - "source": "iana", - "extensions": ["mbk"] - }, - "application/vnd.mobius.mqy": { - "source": "iana", - "extensions": ["mqy"] - }, - "application/vnd.mobius.msl": { - "source": "iana", - "extensions": ["msl"] - }, - "application/vnd.mobius.plc": { - "source": "iana", - "extensions": ["plc"] - }, - "application/vnd.mobius.txf": { - "source": "iana", - "extensions": ["txf"] - }, - "application/vnd.modl": { - "source": "iana" - }, - "application/vnd.mophun.application": { - "source": "iana", - "extensions": ["mpn"] - }, - "application/vnd.mophun.certificate": { - "source": "iana", - "extensions": ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - "source": "iana" - }, - "application/vnd.motorola.iprm": { - "source": "iana" - }, - "application/vnd.mozilla.xul+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xul"] - }, - "application/vnd.ms-3mfdocument": { - "source": "iana" - }, - "application/vnd.ms-artgalry": { - "source": "iana", - "extensions": ["cil"] - }, - "application/vnd.ms-asf": { - "source": "iana" - }, - "application/vnd.ms-cab-compressed": { - "source": "iana", - "extensions": ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - "source": "apache" - }, - "application/vnd.ms-excel": { - "source": "iana", - "compressible": false, - "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - "source": "iana", - "extensions": ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - "source": "iana", - "extensions": ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - "source": "iana", - "extensions": ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - "source": "iana", - "extensions": ["xltm"] - }, - "application/vnd.ms-fontobject": { - "source": "iana", - "compressible": true, - "extensions": ["eot"] - }, - "application/vnd.ms-htmlhelp": { - "source": "iana", - "extensions": ["chm"] - }, - "application/vnd.ms-ims": { - "source": "iana", - "extensions": ["ims"] - }, - "application/vnd.ms-lrm": { - "source": "iana", - "extensions": ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-officetheme": { - "source": "iana", - "extensions": ["thmx"] - }, - "application/vnd.ms-opentype": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-outlook": { - "compressible": false, - "extensions": ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - "source": "apache" - }, - "application/vnd.ms-pki.seccat": { - "source": "apache", - "extensions": ["cat"] - }, - "application/vnd.ms-pki.stl": { - "source": "apache", - "extensions": ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-powerpoint": { - "source": "iana", - "compressible": false, - "extensions": ["ppt","pps","pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - "source": "iana", - "extensions": ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - "source": "iana", - "extensions": ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - "source": "iana", - "extensions": ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - "source": "iana", - "extensions": ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - "source": "iana", - "extensions": ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-printing.printticket+xml": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-printschematicket+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-project": { - "source": "iana", - "extensions": ["mpp","mpt"] - }, - "application/vnd.ms-tnef": { - "source": "iana" - }, - "application/vnd.ms-visio.viewer": { - "extensions": ["vdx"] - }, - "application/vnd.ms-windows.devicepairing": { - "source": "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - "source": "iana" - }, - "application/vnd.ms-windows.printerpairing": { - "source": "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - "source": "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - "source": "iana", - "extensions": ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - "source": "iana", - "extensions": ["dotm"] - }, - "application/vnd.ms-works": { - "source": "iana", - "extensions": ["wps","wks","wcm","wdb"] - }, - "application/vnd.ms-wpl": { - "source": "iana", - "extensions": ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - "source": "iana", - "compressible": false, - "extensions": ["xps"] - }, - "application/vnd.msa-disk-image": { - "source": "iana" - }, - "application/vnd.mseq": { - "source": "iana", - "extensions": ["mseq"] - }, - "application/vnd.msgpack": { - "source": "iana" - }, - "application/vnd.msign": { - "source": "iana" - }, - "application/vnd.multiad.creator": { - "source": "iana" - }, - "application/vnd.multiad.creator.cif": { - "source": "iana" - }, - "application/vnd.music-niff": { - "source": "iana" - }, - "application/vnd.musician": { - "source": "iana", - "extensions": ["mus"] - }, - "application/vnd.muvee.style": { - "source": "iana", - "extensions": ["msty"] - }, - "application/vnd.mynfc": { - "source": "iana", - "extensions": ["taglet"] - }, - "application/vnd.nacamar.ybrid+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.nato.bindingdataobject+cbor": { - "source": "iana" - }, - "application/vnd.nato.bindingdataobject+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.nato.bindingdataobject+xml": { - "source": "iana", - "compressible": true, - "extensions": ["bdo"] - }, - "application/vnd.nato.openxmlformats-package.iepd+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.ncd.control": { - "source": "iana" - }, - "application/vnd.ncd.reference": { - "source": "iana" - }, - "application/vnd.nearst.inv+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.nebumind.line": { - "source": "iana" - }, - "application/vnd.nervana": { - "source": "iana" - }, - "application/vnd.netfpx": { - "source": "iana" - }, - "application/vnd.neurolanguage.nlu": { - "source": "iana", - "extensions": ["nlu"] - }, - "application/vnd.nimn": { - "source": "iana" - }, - "application/vnd.nintendo.nitro.rom": { - "source": "iana" - }, - "application/vnd.nintendo.snes.rom": { - "source": "iana" - }, - "application/vnd.nitf": { - "source": "iana", - "extensions": ["ntf","nitf"] - }, - "application/vnd.noblenet-directory": { - "source": "iana", - "extensions": ["nnd"] - }, - "application/vnd.noblenet-sealer": { - "source": "iana", - "extensions": ["nns"] - }, - "application/vnd.noblenet-web": { - "source": "iana", - "extensions": ["nnw"] - }, - "application/vnd.nokia.catalogs": { - "source": "iana" - }, - "application/vnd.nokia.conml+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.conml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.iptv.config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.isds-radio-presets": { - "source": "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.landmark+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.landmarkcollection+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.n-gage.ac+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - "source": "iana", - "extensions": ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - "source": "apache", - "extensions": ["n-gage"] - }, - "application/vnd.nokia.ncd": { - "source": "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.pcd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.radio-preset": { - "source": "iana", - "extensions": ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - "source": "iana", - "extensions": ["rpss"] - }, - "application/vnd.novadigm.edm": { - "source": "iana", - "extensions": ["edm"] - }, - "application/vnd.novadigm.edx": { - "source": "iana", - "extensions": ["edx"] - }, - "application/vnd.novadigm.ext": { - "source": "iana", - "extensions": ["ext"] - }, - "application/vnd.ntt-local.content-share": { - "source": "iana" - }, - "application/vnd.ntt-local.file-transfer": { - "source": "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - "source": "iana" - }, - "application/vnd.oai.workflows": { - "source": "iana" - }, - "application/vnd.oai.workflows+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oai.workflows+yaml": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.base": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.chart": { - "source": "iana", - "extensions": ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - "source": "iana", - "extensions": ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - "source": "apache", - "extensions": ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - "source": "iana", - "extensions": ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - "source": "iana", - "extensions": ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - "source": "iana", - "compressible": false, - "extensions": ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - "source": "iana", - "extensions": ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - "source": "iana", - "extensions": ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - "source": "iana", - "extensions": ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - "source": "iana", - "extensions": ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - "source": "iana", - "compressible": false, - "extensions": ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - "source": "iana", - "extensions": ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - "source": "iana", - "compressible": false, - "extensions": ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - "source": "iana", - "extensions": ["odm"] - }, - "application/vnd.oasis.opendocument.text-master-template": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.text-template": { - "source": "iana", - "extensions": ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - "source": "iana", - "extensions": ["oth"] - }, - "application/vnd.obn": { - "source": "iana" - }, - "application/vnd.ocf+cbor": { - "source": "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oftn.l10n+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.cspg-hexbinary": { - "source": "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.dae.xhtml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.pae.gem": { - "source": "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.spdlist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.ueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.userprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.olpc-sugar": { - "source": "iana", - "extensions": ["xo"] - }, - "application/vnd.oma-scws-config": { - "source": "iana" - }, - "application/vnd.oma-scws-http-request": { - "source": "iana" - }, - "application/vnd.oma-scws-http-response": { - "source": "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - "source": "apache", - "compressible": true - }, - "application/vnd.oma.bcast.imd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.ltkm": { - "source": "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgboot": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.sgdu": { - "source": "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - "source": "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - "source": "apache", - "compressible": true - }, - "application/vnd.oma.bcast.sprov+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.stkm": { - "source": "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-feature-handler+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-pcc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-subs-invite+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-user-prefs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.dcd": { - "source": "iana" - }, - "application/vnd.oma.dcdc": { - "source": "iana" - }, - "application/vnd.oma.dd2+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.group-usage-list+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+cbor": { - "source": "iana" - }, - "application/vnd.oma.lwm2m+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+tlv": { - "source": "iana" - }, - "application/vnd.oma.pal+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.final-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.groups+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.push": { - "source": "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.xcap-directory+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.omads-email+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-file+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-folder+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omaloc-supl-init": { - "source": "iana" - }, - "application/vnd.onepager": { - "source": "iana" - }, - "application/vnd.onepagertamp": { - "source": "iana" - }, - "application/vnd.onepagertamx": { - "source": "iana" - }, - "application/vnd.onepagertat": { - "source": "iana" - }, - "application/vnd.onepagertatp": { - "source": "iana" - }, - "application/vnd.onepagertatx": { - "source": "iana" - }, - "application/vnd.onvif.metadata": { - "source": "iana" - }, - "application/vnd.openblox.game+xml": { - "source": "iana", - "compressible": true, - "extensions": ["obgx"] - }, - "application/vnd.openblox.game-binary": { - "source": "iana" - }, - "application/vnd.openeye.oeb": { - "source": "iana" - }, - "application/vnd.openofficeorg.extension": { - "source": "apache", - "extensions": ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osm"] - }, - "application/vnd.opentimestamps.ots": { - "source": "iana" - }, - "application/vnd.openvpi.dspx+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - "source": "iana", - "extensions": ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - "source": "iana", - "extensions": ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - "source": "iana", - "extensions": ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - "source": "iana", - "compressible": false, - "extensions": ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - "source": "iana", - "extensions": ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - "source": "iana", - "compressible": false, - "extensions": ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - "source": "iana", - "extensions": ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oracle.resource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.orange.indata": { - "source": "iana" - }, - "application/vnd.osa.netdeploy": { - "source": "iana" - }, - "application/vnd.osgeo.mapguide.package": { - "source": "iana", - "extensions": ["mgp"] - }, - "application/vnd.osgi.bundle": { - "source": "iana" - }, - "application/vnd.osgi.dp": { - "source": "iana", - "extensions": ["dp"] - }, - "application/vnd.osgi.subsystem": { - "source": "iana", - "extensions": ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oxli.countgraph": { - "source": "iana" - }, - "application/vnd.pagerduty+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.palm": { - "source": "iana", - "extensions": ["pdb","pqa","oprc"] - }, - "application/vnd.panoply": { - "source": "iana" - }, - "application/vnd.paos.xml": { - "source": "iana" - }, - "application/vnd.patentdive": { - "source": "iana" - }, - "application/vnd.patientecommsdoc": { - "source": "iana" - }, - "application/vnd.pawaafile": { - "source": "iana", - "extensions": ["paw"] - }, - "application/vnd.pcos": { - "source": "iana" - }, - "application/vnd.pg.format": { - "source": "iana", - "extensions": ["str"] - }, - "application/vnd.pg.osasli": { - "source": "iana", - "extensions": ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - "source": "iana" - }, - "application/vnd.picsel": { - "source": "iana", - "extensions": ["efif"] - }, - "application/vnd.pmi.widget": { - "source": "iana", - "extensions": ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.pocketlearn": { - "source": "iana", - "extensions": ["plf"] - }, - "application/vnd.powerbuilder6": { - "source": "iana", - "extensions": ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - "source": "iana" - }, - "application/vnd.powerbuilder7": { - "source": "iana" - }, - "application/vnd.powerbuilder7-s": { - "source": "iana" - }, - "application/vnd.powerbuilder75": { - "source": "iana" - }, - "application/vnd.powerbuilder75-s": { - "source": "iana" - }, - "application/vnd.preminet": { - "source": "iana" - }, - "application/vnd.previewsystems.box": { - "source": "iana", - "extensions": ["box"] - }, - "application/vnd.procrate.brushset": { - "extensions": ["brushset"] - }, - "application/vnd.procreate.brush": { - "extensions": ["brush"] - }, - "application/vnd.procreate.dream": { - "extensions": ["drm"] - }, - "application/vnd.proteus.magazine": { - "source": "iana", - "extensions": ["mgz"] - }, - "application/vnd.psfs": { - "source": "iana" - }, - "application/vnd.pt.mundusmundi": { - "source": "iana" - }, - "application/vnd.publishare-delta-tree": { - "source": "iana", - "extensions": ["qps"] - }, - "application/vnd.pvi.ptid1": { - "source": "iana", - "extensions": ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - "source": "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xhtm"] - }, - "application/vnd.qualcomm.brew-app-res": { - "source": "iana" - }, - "application/vnd.quarantainenet": { - "source": "iana" - }, - "application/vnd.quark.quarkxpress": { - "source": "iana", - "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] - }, - "application/vnd.quobject-quoxdocument": { - "source": "iana" - }, - "application/vnd.radisys.moml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.rainstor.data": { - "source": "iana" - }, - "application/vnd.rapid": { - "source": "iana" - }, - "application/vnd.rar": { - "source": "iana", - "extensions": ["rar"] - }, - "application/vnd.realvnc.bed": { - "source": "iana", - "extensions": ["bed"] - }, - "application/vnd.recordare.musicxml": { - "source": "iana", - "extensions": ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musicxml"] - }, - "application/vnd.relpipe": { - "source": "iana" - }, - "application/vnd.renlearn.rlprint": { - "source": "iana" - }, - "application/vnd.resilient.logic": { - "source": "iana" - }, - "application/vnd.restful+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.rig.cryptonote": { - "source": "iana", - "extensions": ["cryptonote"] - }, - "application/vnd.rim.cod": { - "source": "apache", - "extensions": ["cod"] - }, - "application/vnd.rn-realmedia": { - "source": "apache", - "extensions": ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - "source": "apache", - "extensions": ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - "source": "iana", - "compressible": true, - "extensions": ["link66"] - }, - "application/vnd.rs-274x": { - "source": "iana" - }, - "application/vnd.ruckus.download": { - "source": "iana" - }, - "application/vnd.s3sms": { - "source": "iana" - }, - "application/vnd.sailingtracker.track": { - "source": "iana", - "extensions": ["st"] - }, - "application/vnd.sar": { - "source": "iana" - }, - "application/vnd.sbm.cid": { - "source": "iana" - }, - "application/vnd.sbm.mid2": { - "source": "iana" - }, - "application/vnd.scribus": { - "source": "iana" - }, - "application/vnd.sealed.3df": { - "source": "iana" - }, - "application/vnd.sealed.csf": { - "source": "iana" - }, - "application/vnd.sealed.doc": { - "source": "iana" - }, - "application/vnd.sealed.eml": { - "source": "iana" - }, - "application/vnd.sealed.mht": { - "source": "iana" - }, - "application/vnd.sealed.net": { - "source": "iana" - }, - "application/vnd.sealed.ppt": { - "source": "iana" - }, - "application/vnd.sealed.tiff": { - "source": "iana" - }, - "application/vnd.sealed.xls": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - "source": "iana" - }, - "application/vnd.seemail": { - "source": "iana", - "extensions": ["see"] - }, - "application/vnd.seis+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.sema": { - "source": "iana", - "extensions": ["sema"] - }, - "application/vnd.semd": { - "source": "iana", - "extensions": ["semd"] - }, - "application/vnd.semf": { - "source": "iana", - "extensions": ["semf"] - }, - "application/vnd.shade-save-file": { - "source": "iana" - }, - "application/vnd.shana.informed.formdata": { - "source": "iana", - "extensions": ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - "source": "iana", - "extensions": ["itp"] - }, - "application/vnd.shana.informed.interchange": { - "source": "iana", - "extensions": ["iif"] - }, - "application/vnd.shana.informed.package": { - "source": "iana", - "extensions": ["ipk"] - }, - "application/vnd.shootproof+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shopkick+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shp": { - "source": "iana" - }, - "application/vnd.shx": { - "source": "iana" - }, - "application/vnd.sigrok.session": { - "source": "iana" - }, - "application/vnd.simtech-mindmapper": { - "source": "iana", - "extensions": ["twd","twds"] - }, - "application/vnd.siren+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.sketchometry": { - "source": "iana" - }, - "application/vnd.smaf": { - "source": "iana", - "extensions": ["mmf"] - }, - "application/vnd.smart.notebook": { - "source": "iana" - }, - "application/vnd.smart.teacher": { - "source": "iana", - "extensions": ["teacher"] - }, - "application/vnd.smintio.portals.archive": { - "source": "iana" - }, - "application/vnd.snesdev-page-table": { - "source": "iana" - }, - "application/vnd.software602.filler.form+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - "source": "iana" - }, - "application/vnd.solent.sdkm+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sdkm","sdkd"] - }, - "application/vnd.spotfire.dxp": { - "source": "iana", - "extensions": ["dxp"] - }, - "application/vnd.spotfire.sfs": { - "source": "iana", - "extensions": ["sfs"] - }, - "application/vnd.sqlite3": { - "source": "iana" - }, - "application/vnd.sss-cod": { - "source": "iana" - }, - "application/vnd.sss-dtf": { - "source": "iana" - }, - "application/vnd.sss-ntf": { - "source": "iana" - }, - "application/vnd.stardivision.calc": { - "source": "apache", - "extensions": ["sdc"] - }, - "application/vnd.stardivision.draw": { - "source": "apache", - "extensions": ["sda"] - }, - "application/vnd.stardivision.impress": { - "source": "apache", - "extensions": ["sdd"] - }, - "application/vnd.stardivision.math": { - "source": "apache", - "extensions": ["smf"] - }, - "application/vnd.stardivision.writer": { - "source": "apache", - "extensions": ["sdw","vor"] - }, - "application/vnd.stardivision.writer-global": { - "source": "apache", - "extensions": ["sgl"] - }, - "application/vnd.stepmania.package": { - "source": "iana", - "extensions": ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - "source": "iana", - "extensions": ["sm"] - }, - "application/vnd.street-stream": { - "source": "iana" - }, - "application/vnd.sun.wadl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wadl"] - }, - "application/vnd.sun.xml.calc": { - "source": "apache", - "extensions": ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - "source": "apache", - "extensions": ["stc"] - }, - "application/vnd.sun.xml.draw": { - "source": "apache", - "extensions": ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - "source": "apache", - "extensions": ["std"] - }, - "application/vnd.sun.xml.impress": { - "source": "apache", - "extensions": ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - "source": "apache", - "extensions": ["sti"] - }, - "application/vnd.sun.xml.math": { - "source": "apache", - "extensions": ["sxm"] - }, - "application/vnd.sun.xml.writer": { - "source": "apache", - "extensions": ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - "source": "apache", - "extensions": ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - "source": "apache", - "extensions": ["stw"] - }, - "application/vnd.sus-calendar": { - "source": "iana", - "extensions": ["sus","susp"] - }, - "application/vnd.svd": { - "source": "iana", - "extensions": ["svd"] - }, - "application/vnd.swiftview-ics": { - "source": "iana" - }, - "application/vnd.sybyl.mol2": { - "source": "iana" - }, - "application/vnd.sycle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.syft+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.symbian.install": { - "source": "apache", - "extensions": ["sis","sisx"] - }, - "application/vnd.syncml+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.syncml.ds.notification": { - "source": "iana" - }, - "application/vnd.tableschema+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tao.intent-module-archive": { - "source": "iana", - "extensions": ["tao"] - }, - "application/vnd.tcpdump.pcap": { - "source": "iana", - "extensions": ["pcap","cap","dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tmd.mediaflex.api+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.tml": { - "source": "iana" - }, - "application/vnd.tmobile-livetv": { - "source": "iana", - "extensions": ["tmo"] - }, - "application/vnd.tri.onesource": { - "source": "iana" - }, - "application/vnd.trid.tpt": { - "source": "iana", - "extensions": ["tpt"] - }, - "application/vnd.triscape.mxs": { - "source": "iana", - "extensions": ["mxs"] - }, - "application/vnd.trueapp": { - "source": "iana", - "extensions": ["tra"] - }, - "application/vnd.truedoc": { - "source": "iana" - }, - "application/vnd.ubisoft.webplayer": { - "source": "iana" - }, - "application/vnd.ufdl": { - "source": "iana", - "extensions": ["ufd","ufdl"] - }, - "application/vnd.uic.osdm+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.uiq.theme": { - "source": "iana", - "extensions": ["utz"] - }, - "application/vnd.umajin": { - "source": "iana", - "extensions": ["umj"] - }, - "application/vnd.unity": { - "source": "iana", - "extensions": ["unityweb"] - }, - "application/vnd.uoml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uoml","uo"] - }, - "application/vnd.uplanet.alert": { - "source": "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.channel": { - "source": "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.list": { - "source": "iana" - }, - "application/vnd.uplanet.list-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.signal": { - "source": "iana" - }, - "application/vnd.uri-map": { - "source": "iana" - }, - "application/vnd.valve.source.material": { - "source": "iana" - }, - "application/vnd.vcx": { - "source": "iana", - "extensions": ["vcx"] - }, - "application/vnd.vd-study": { - "source": "iana" - }, - "application/vnd.vectorworks": { - "source": "iana" - }, - "application/vnd.vel+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.veraison.tsm-report+cbor": { - "source": "iana" - }, - "application/vnd.veraison.tsm-report+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.verimatrix.vcas": { - "source": "iana" - }, - "application/vnd.veritone.aion+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.veryant.thin": { - "source": "iana" - }, - "application/vnd.ves.encrypted": { - "source": "iana" - }, - "application/vnd.vidsoft.vidconference": { - "source": "iana" - }, - "application/vnd.visio": { - "source": "iana", - "extensions": ["vsd","vst","vss","vsw","vsdx","vtx"] - }, - "application/vnd.visionary": { - "source": "iana", - "extensions": ["vis"] - }, - "application/vnd.vividence.scriptfile": { - "source": "iana" - }, - "application/vnd.vocalshaper.vsp4": { - "source": "iana" - }, - "application/vnd.vsf": { - "source": "iana", - "extensions": ["vsf"] - }, - "application/vnd.wap.sic": { - "source": "iana" - }, - "application/vnd.wap.slc": { - "source": "iana" - }, - "application/vnd.wap.wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["wbxml"] - }, - "application/vnd.wap.wmlc": { - "source": "iana", - "extensions": ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - "source": "iana", - "extensions": ["wmlsc"] - }, - "application/vnd.wasmflow.wafl": { - "source": "iana" - }, - "application/vnd.webturbo": { - "source": "iana", - "extensions": ["wtb"] - }, - "application/vnd.wfa.dpp": { - "source": "iana" - }, - "application/vnd.wfa.p2p": { - "source": "iana" - }, - "application/vnd.wfa.wsc": { - "source": "iana" - }, - "application/vnd.windows.devicepairing": { - "source": "iana" - }, - "application/vnd.wmc": { - "source": "iana" - }, - "application/vnd.wmf.bootstrap": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica.package": { - "source": "iana" - }, - "application/vnd.wolfram.player": { - "source": "iana", - "extensions": ["nbp"] - }, - "application/vnd.wordlift": { - "source": "iana" - }, - "application/vnd.wordperfect": { - "source": "iana", - "extensions": ["wpd"] - }, - "application/vnd.wqd": { - "source": "iana", - "extensions": ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - "source": "iana" - }, - "application/vnd.wt.stf": { - "source": "iana", - "extensions": ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - "source": "iana" - }, - "application/vnd.wv.csp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.wv.ssp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xacml+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.xara": { - "source": "iana", - "extensions": ["xar"] - }, - "application/vnd.xarin.cpj": { - "source": "iana" - }, - "application/vnd.xecrets-encrypted": { - "source": "iana" - }, - "application/vnd.xfdl": { - "source": "iana", - "extensions": ["xfdl"] - }, - "application/vnd.xfdl.webform": { - "source": "iana" - }, - "application/vnd.xmi+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xmpie.cpkg": { - "source": "iana" - }, - "application/vnd.xmpie.dpkg": { - "source": "iana" - }, - "application/vnd.xmpie.plan": { - "source": "iana" - }, - "application/vnd.xmpie.ppkg": { - "source": "iana" - }, - "application/vnd.xmpie.xlim": { - "source": "iana" - }, - "application/vnd.yamaha.hv-dic": { - "source": "iana", - "extensions": ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - "source": "iana", - "extensions": ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - "source": "iana", - "extensions": ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - "source": "iana", - "extensions": ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - "source": "iana" - }, - "application/vnd.yamaha.smaf-audio": { - "source": "iana", - "extensions": ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - "source": "iana", - "extensions": ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - "source": "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - "source": "iana" - }, - "application/vnd.yaoweme": { - "source": "iana" - }, - "application/vnd.yellowriver-custom-menu": { - "source": "iana", - "extensions": ["cmp"] - }, - "application/vnd.zul": { - "source": "iana", - "extensions": ["zir","zirz"] - }, - "application/vnd.zzazz.deck+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zaz"] - }, - "application/voicexml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["vxml"] - }, - "application/voucher-cms+json": { - "source": "iana", - "compressible": true - }, - "application/voucher-jws+json": { - "source": "iana", - "compressible": true - }, - "application/vp": { - "source": "iana" - }, - "application/vp+cose": { - "source": "iana" - }, - "application/vp+jwt": { - "source": "iana" - }, - "application/vq-rtcpxr": { - "source": "iana" - }, - "application/wasm": { - "source": "iana", - "compressible": true, - "extensions": ["wasm"] - }, - "application/watcherinfo+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wif"] - }, - "application/webpush-options+json": { - "source": "iana", - "compressible": true - }, - "application/whoispp-query": { - "source": "iana" - }, - "application/whoispp-response": { - "source": "iana" - }, - "application/widget": { - "source": "iana", - "extensions": ["wgt"] - }, - "application/winhlp": { - "source": "apache", - "extensions": ["hlp"] - }, - "application/wita": { - "source": "iana" - }, - "application/wordperfect5.1": { - "source": "iana" - }, - "application/wsdl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wsdl"] - }, - "application/wspolicy+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wspolicy"] - }, - "application/x-7z-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["7z"] - }, - "application/x-abiword": { - "source": "apache", - "extensions": ["abw"] - }, - "application/x-ace-compressed": { - "source": "apache", - "extensions": ["ace"] - }, - "application/x-amf": { - "source": "apache" - }, - "application/x-apple-diskimage": { - "source": "apache", - "extensions": ["dmg"] - }, - "application/x-arj": { - "compressible": false, - "extensions": ["arj"] - }, - "application/x-authorware-bin": { - "source": "apache", - "extensions": ["aab","x32","u32","vox"] - }, - "application/x-authorware-map": { - "source": "apache", - "extensions": ["aam"] - }, - "application/x-authorware-seg": { - "source": "apache", - "extensions": ["aas"] - }, - "application/x-bcpio": { - "source": "apache", - "extensions": ["bcpio"] - }, - "application/x-bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/x-bittorrent": { - "source": "apache", - "extensions": ["torrent"] - }, - "application/x-blender": { - "extensions": ["blend"] - }, - "application/x-blorb": { - "source": "apache", - "extensions": ["blb","blorb"] - }, - "application/x-bzip": { - "source": "apache", - "compressible": false, - "extensions": ["bz"] - }, - "application/x-bzip2": { - "source": "apache", - "compressible": false, - "extensions": ["bz2","boz"] - }, - "application/x-cbr": { - "source": "apache", - "extensions": ["cbr","cba","cbt","cbz","cb7"] - }, - "application/x-cdlink": { - "source": "apache", - "extensions": ["vcd"] - }, - "application/x-cfs-compressed": { - "source": "apache", - "extensions": ["cfs"] - }, - "application/x-chat": { - "source": "apache", - "extensions": ["chat"] - }, - "application/x-chess-pgn": { - "source": "apache", - "extensions": ["pgn"] - }, - "application/x-chrome-extension": { - "extensions": ["crx"] - }, - "application/x-cocoa": { - "source": "nginx", - "extensions": ["cco"] - }, - "application/x-compress": { - "source": "apache" - }, - "application/x-compressed": { - "extensions": ["rar"] - }, - "application/x-conference": { - "source": "apache", - "extensions": ["nsc"] - }, - "application/x-cpio": { - "source": "apache", - "extensions": ["cpio"] - }, - "application/x-csh": { - "source": "apache", - "extensions": ["csh"] - }, - "application/x-deb": { - "compressible": false - }, - "application/x-debian-package": { - "source": "apache", - "extensions": ["deb","udeb"] - }, - "application/x-dgc-compressed": { - "source": "apache", - "extensions": ["dgc"] - }, - "application/x-director": { - "source": "apache", - "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] - }, - "application/x-doom": { - "source": "apache", - "extensions": ["wad"] - }, - "application/x-dtbncx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ncx"] - }, - "application/x-dtbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dtb"] - }, - "application/x-dtbresource+xml": { - "source": "apache", - "compressible": true, - "extensions": ["res"] - }, - "application/x-dvi": { - "source": "apache", - "compressible": false, - "extensions": ["dvi"] - }, - "application/x-envoy": { - "source": "apache", - "extensions": ["evy"] - }, - "application/x-eva": { - "source": "apache", - "extensions": ["eva"] - }, - "application/x-font-bdf": { - "source": "apache", - "extensions": ["bdf"] - }, - "application/x-font-dos": { - "source": "apache" - }, - "application/x-font-framemaker": { - "source": "apache" - }, - "application/x-font-ghostscript": { - "source": "apache", - "extensions": ["gsf"] - }, - "application/x-font-libgrx": { - "source": "apache" - }, - "application/x-font-linux-psf": { - "source": "apache", - "extensions": ["psf"] - }, - "application/x-font-pcf": { - "source": "apache", - "extensions": ["pcf"] - }, - "application/x-font-snf": { - "source": "apache", - "extensions": ["snf"] - }, - "application/x-font-speedo": { - "source": "apache" - }, - "application/x-font-sunos-news": { - "source": "apache" - }, - "application/x-font-type1": { - "source": "apache", - "extensions": ["pfa","pfb","pfm","afm"] - }, - "application/x-font-vfont": { - "source": "apache" - }, - "application/x-freearc": { - "source": "apache", - "extensions": ["arc"] - }, - "application/x-futuresplash": { - "source": "apache", - "extensions": ["spl"] - }, - "application/x-gca-compressed": { - "source": "apache", - "extensions": ["gca"] - }, - "application/x-glulx": { - "source": "apache", - "extensions": ["ulx"] - }, - "application/x-gnumeric": { - "source": "apache", - "extensions": ["gnumeric"] - }, - "application/x-gramps-xml": { - "source": "apache", - "extensions": ["gramps"] - }, - "application/x-gtar": { - "source": "apache", - "extensions": ["gtar"] - }, - "application/x-gzip": { - "source": "apache" - }, - "application/x-hdf": { - "source": "apache", - "extensions": ["hdf"] - }, - "application/x-httpd-php": { - "compressible": true, - "extensions": ["php"] - }, - "application/x-install-instructions": { - "source": "apache", - "extensions": ["install"] - }, - "application/x-ipynb+json": { - "compressible": true, - "extensions": ["ipynb"] - }, - "application/x-iso9660-image": { - "source": "apache", - "extensions": ["iso"] - }, - "application/x-iwork-keynote-sffkey": { - "extensions": ["key"] - }, - "application/x-iwork-numbers-sffnumbers": { - "extensions": ["numbers"] - }, - "application/x-iwork-pages-sffpages": { - "extensions": ["pages"] - }, - "application/x-java-archive-diff": { - "source": "nginx", - "extensions": ["jardiff"] - }, - "application/x-java-jnlp-file": { - "source": "apache", - "compressible": false, - "extensions": ["jnlp"] - }, - "application/x-javascript": { - "compressible": true - }, - "application/x-keepass2": { - "extensions": ["kdbx"] - }, - "application/x-latex": { - "source": "apache", - "compressible": false, - "extensions": ["latex"] - }, - "application/x-lua-bytecode": { - "extensions": ["luac"] - }, - "application/x-lzh-compressed": { - "source": "apache", - "extensions": ["lzh","lha"] - }, - "application/x-makeself": { - "source": "nginx", - "extensions": ["run"] - }, - "application/x-mie": { - "source": "apache", - "extensions": ["mie"] - }, - "application/x-mobipocket-ebook": { - "source": "apache", - "extensions": ["prc","mobi"] - }, - "application/x-mpegurl": { - "compressible": false - }, - "application/x-ms-application": { - "source": "apache", - "extensions": ["application"] - }, - "application/x-ms-shortcut": { - "source": "apache", - "extensions": ["lnk"] - }, - "application/x-ms-wmd": { - "source": "apache", - "extensions": ["wmd"] - }, - "application/x-ms-wmz": { - "source": "apache", - "extensions": ["wmz"] - }, - "application/x-ms-xbap": { - "source": "apache", - "extensions": ["xbap"] - }, - "application/x-msaccess": { - "source": "apache", - "extensions": ["mdb"] - }, - "application/x-msbinder": { - "source": "apache", - "extensions": ["obd"] - }, - "application/x-mscardfile": { - "source": "apache", - "extensions": ["crd"] - }, - "application/x-msclip": { - "source": "apache", - "extensions": ["clp"] - }, - "application/x-msdos-program": { - "extensions": ["exe"] - }, - "application/x-msdownload": { - "source": "apache", - "extensions": ["exe","dll","com","bat","msi"] - }, - "application/x-msmediaview": { - "source": "apache", - "extensions": ["mvb","m13","m14"] - }, - "application/x-msmetafile": { - "source": "apache", - "extensions": ["wmf","wmz","emf","emz"] - }, - "application/x-msmoney": { - "source": "apache", - "extensions": ["mny"] - }, - "application/x-mspublisher": { - "source": "apache", - "extensions": ["pub"] - }, - "application/x-msschedule": { - "source": "apache", - "extensions": ["scd"] - }, - "application/x-msterminal": { - "source": "apache", - "extensions": ["trm"] - }, - "application/x-mswrite": { - "source": "apache", - "extensions": ["wri"] - }, - "application/x-netcdf": { - "source": "apache", - "extensions": ["nc","cdf"] - }, - "application/x-ns-proxy-autoconfig": { - "compressible": true, - "extensions": ["pac"] - }, - "application/x-nzb": { - "source": "apache", - "extensions": ["nzb"] - }, - "application/x-perl": { - "source": "nginx", - "extensions": ["pl","pm"] - }, - "application/x-pilot": { - "source": "nginx", - "extensions": ["prc","pdb"] - }, - "application/x-pkcs12": { - "source": "apache", - "compressible": false, - "extensions": ["p12","pfx"] - }, - "application/x-pkcs7-certificates": { - "source": "apache", - "extensions": ["p7b","spc"] - }, - "application/x-pkcs7-certreqresp": { - "source": "apache", - "extensions": ["p7r"] - }, - "application/x-pki-message": { - "source": "iana" - }, - "application/x-rar-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["rar"] - }, - "application/x-redhat-package-manager": { - "source": "nginx", - "extensions": ["rpm"] - }, - "application/x-research-info-systems": { - "source": "apache", - "extensions": ["ris"] - }, - "application/x-sea": { - "source": "nginx", - "extensions": ["sea"] - }, - "application/x-sh": { - "source": "apache", - "compressible": true, - "extensions": ["sh"] - }, - "application/x-shar": { - "source": "apache", - "extensions": ["shar"] - }, - "application/x-shockwave-flash": { - "source": "apache", - "compressible": false, - "extensions": ["swf"] - }, - "application/x-silverlight-app": { - "source": "apache", - "extensions": ["xap"] - }, - "application/x-sql": { - "source": "apache", - "extensions": ["sql"] - }, - "application/x-stuffit": { - "source": "apache", - "compressible": false, - "extensions": ["sit"] - }, - "application/x-stuffitx": { - "source": "apache", - "extensions": ["sitx"] - }, - "application/x-subrip": { - "source": "apache", - "extensions": ["srt"] - }, - "application/x-sv4cpio": { - "source": "apache", - "extensions": ["sv4cpio"] - }, - "application/x-sv4crc": { - "source": "apache", - "extensions": ["sv4crc"] - }, - "application/x-t3vm-image": { - "source": "apache", - "extensions": ["t3"] - }, - "application/x-tads": { - "source": "apache", - "extensions": ["gam"] - }, - "application/x-tar": { - "source": "apache", - "compressible": true, - "extensions": ["tar"] - }, - "application/x-tcl": { - "source": "apache", - "extensions": ["tcl","tk"] - }, - "application/x-tex": { - "source": "apache", - "extensions": ["tex"] - }, - "application/x-tex-tfm": { - "source": "apache", - "extensions": ["tfm"] - }, - "application/x-texinfo": { - "source": "apache", - "extensions": ["texinfo","texi"] - }, - "application/x-tgif": { - "source": "apache", - "extensions": ["obj"] - }, - "application/x-ustar": { - "source": "apache", - "extensions": ["ustar"] - }, - "application/x-virtualbox-hdd": { - "compressible": true, - "extensions": ["hdd"] - }, - "application/x-virtualbox-ova": { - "compressible": true, - "extensions": ["ova"] - }, - "application/x-virtualbox-ovf": { - "compressible": true, - "extensions": ["ovf"] - }, - "application/x-virtualbox-vbox": { - "compressible": true, - "extensions": ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - "compressible": false, - "extensions": ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - "compressible": true, - "extensions": ["vdi"] - }, - "application/x-virtualbox-vhd": { - "compressible": true, - "extensions": ["vhd"] - }, - "application/x-virtualbox-vmdk": { - "compressible": true, - "extensions": ["vmdk"] - }, - "application/x-wais-source": { - "source": "apache", - "extensions": ["src"] - }, - "application/x-web-app-manifest+json": { - "compressible": true, - "extensions": ["webapp"] - }, - "application/x-www-form-urlencoded": { - "source": "iana", - "compressible": true - }, - "application/x-x509-ca-cert": { - "source": "iana", - "extensions": ["der","crt","pem"] - }, - "application/x-x509-ca-ra-cert": { - "source": "iana" - }, - "application/x-x509-next-ca-cert": { - "source": "iana" - }, - "application/x-xfig": { - "source": "apache", - "extensions": ["fig"] - }, - "application/x-xliff+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xlf"] - }, - "application/x-xpinstall": { - "source": "apache", - "compressible": false, - "extensions": ["xpi"] - }, - "application/x-xz": { - "source": "apache", - "extensions": ["xz"] - }, - "application/x-zip-compressed": { - "extensions": ["zip"] - }, - "application/x-zmachine": { - "source": "apache", - "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] - }, - "application/x400-bp": { - "source": "iana" - }, - "application/xacml+xml": { - "source": "iana", - "compressible": true - }, - "application/xaml+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xaml"] - }, - "application/xcap-att+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xav"] - }, - "application/xcap-caps+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xca"] - }, - "application/xcap-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdf"] - }, - "application/xcap-el+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xel"] - }, - "application/xcap-error+xml": { - "source": "iana", - "compressible": true - }, - "application/xcap-ns+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xns"] - }, - "application/xcon-conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/xcon-conference-info-diff+xml": { - "source": "iana", - "compressible": true - }, - "application/xenc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xenc"] - }, - "application/xfdf": { - "source": "iana", - "extensions": ["xfdf"] - }, - "application/xhtml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xhtml","xht"] - }, - "application/xhtml-voice+xml": { - "source": "apache", - "compressible": true - }, - "application/xliff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xlf"] - }, - "application/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml","xsl","xsd","rng"] - }, - "application/xml-dtd": { - "source": "iana", - "compressible": true, - "extensions": ["dtd"] - }, - "application/xml-external-parsed-entity": { - "source": "iana" - }, - "application/xml-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/xmpp+xml": { - "source": "iana", - "compressible": true - }, - "application/xop+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xop"] - }, - "application/xproc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xpl"] - }, - "application/xslt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xsl","xslt"] - }, - "application/xspf+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xspf"] - }, - "application/xv+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mxml","xhvml","xvml","xvm"] - }, - "application/yaml": { - "source": "iana" - }, - "application/yang": { - "source": "iana", - "extensions": ["yang"] - }, - "application/yang-data+cbor": { - "source": "iana" - }, - "application/yang-data+json": { - "source": "iana", - "compressible": true - }, - "application/yang-data+xml": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+json": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/yang-sid+json": { - "source": "iana", - "compressible": true - }, - "application/yin+xml": { - "source": "iana", - "compressible": true, - "extensions": ["yin"] - }, - "application/zip": { - "source": "iana", - "compressible": false, - "extensions": ["zip"] - }, - "application/zip+dotlottie": { - "extensions": ["lottie"] - }, - "application/zlib": { - "source": "iana" - }, - "application/zstd": { - "source": "iana" - }, - "audio/1d-interleaved-parityfec": { - "source": "iana" - }, - "audio/32kadpcm": { - "source": "iana" - }, - "audio/3gpp": { - "source": "iana", - "compressible": false, - "extensions": ["3gpp"] - }, - "audio/3gpp2": { - "source": "iana" - }, - "audio/aac": { - "source": "iana", - "extensions": ["adts","aac"] - }, - "audio/ac3": { - "source": "iana" - }, - "audio/adpcm": { - "source": "apache", - "extensions": ["adp"] - }, - "audio/amr": { - "source": "iana", - "extensions": ["amr"] - }, - "audio/amr-wb": { - "source": "iana" - }, - "audio/amr-wb+": { - "source": "iana" - }, - "audio/aptx": { - "source": "iana" - }, - "audio/asc": { - "source": "iana" - }, - "audio/atrac-advanced-lossless": { - "source": "iana" - }, - "audio/atrac-x": { - "source": "iana" - }, - "audio/atrac3": { - "source": "iana" - }, - "audio/basic": { - "source": "iana", - "compressible": false, - "extensions": ["au","snd"] - }, - "audio/bv16": { - "source": "iana" - }, - "audio/bv32": { - "source": "iana" - }, - "audio/clearmode": { - "source": "iana" - }, - "audio/cn": { - "source": "iana" - }, - "audio/dat12": { - "source": "iana" - }, - "audio/dls": { - "source": "iana" - }, - "audio/dsr-es201108": { - "source": "iana" - }, - "audio/dsr-es202050": { - "source": "iana" - }, - "audio/dsr-es202211": { - "source": "iana" - }, - "audio/dsr-es202212": { - "source": "iana" - }, - "audio/dv": { - "source": "iana" - }, - "audio/dvi4": { - "source": "iana" - }, - "audio/eac3": { - "source": "iana" - }, - "audio/encaprtp": { - "source": "iana" - }, - "audio/evrc": { - "source": "iana" - }, - "audio/evrc-qcp": { - "source": "iana" - }, - "audio/evrc0": { - "source": "iana" - }, - "audio/evrc1": { - "source": "iana" - }, - "audio/evrcb": { - "source": "iana" - }, - "audio/evrcb0": { - "source": "iana" - }, - "audio/evrcb1": { - "source": "iana" - }, - "audio/evrcnw": { - "source": "iana" - }, - "audio/evrcnw0": { - "source": "iana" - }, - "audio/evrcnw1": { - "source": "iana" - }, - "audio/evrcwb": { - "source": "iana" - }, - "audio/evrcwb0": { - "source": "iana" - }, - "audio/evrcwb1": { - "source": "iana" - }, - "audio/evs": { - "source": "iana" - }, - "audio/flac": { - "source": "iana" - }, - "audio/flexfec": { - "source": "iana" - }, - "audio/fwdred": { - "source": "iana" - }, - "audio/g711-0": { - "source": "iana" - }, - "audio/g719": { - "source": "iana" - }, - "audio/g722": { - "source": "iana" - }, - "audio/g7221": { - "source": "iana" - }, - "audio/g723": { - "source": "iana" - }, - "audio/g726-16": { - "source": "iana" - }, - "audio/g726-24": { - "source": "iana" - }, - "audio/g726-32": { - "source": "iana" - }, - "audio/g726-40": { - "source": "iana" - }, - "audio/g728": { - "source": "iana" - }, - "audio/g729": { - "source": "iana" - }, - "audio/g7291": { - "source": "iana" - }, - "audio/g729d": { - "source": "iana" - }, - "audio/g729e": { - "source": "iana" - }, - "audio/gsm": { - "source": "iana" - }, - "audio/gsm-efr": { - "source": "iana" - }, - "audio/gsm-hr-08": { - "source": "iana" - }, - "audio/ilbc": { - "source": "iana" - }, - "audio/ip-mr_v2.5": { - "source": "iana" - }, - "audio/isac": { - "source": "apache" - }, - "audio/l16": { - "source": "iana" - }, - "audio/l20": { - "source": "iana" - }, - "audio/l24": { - "source": "iana", - "compressible": false - }, - "audio/l8": { - "source": "iana" - }, - "audio/lpc": { - "source": "iana" - }, - "audio/matroska": { - "source": "iana" - }, - "audio/melp": { - "source": "iana" - }, - "audio/melp1200": { - "source": "iana" - }, - "audio/melp2400": { - "source": "iana" - }, - "audio/melp600": { - "source": "iana" - }, - "audio/mhas": { - "source": "iana" - }, - "audio/midi": { - "source": "apache", - "extensions": ["mid","midi","kar","rmi"] - }, - "audio/midi-clip": { - "source": "iana" - }, - "audio/mobile-xmf": { - "source": "iana", - "extensions": ["mxmf"] - }, - "audio/mp3": { - "compressible": false, - "extensions": ["mp3"] - }, - "audio/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["m4a","mp4a","m4b"] - }, - "audio/mp4a-latm": { - "source": "iana" - }, - "audio/mpa": { - "source": "iana" - }, - "audio/mpa-robust": { - "source": "iana" - }, - "audio/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] - }, - "audio/mpeg4-generic": { - "source": "iana" - }, - "audio/musepack": { - "source": "apache" - }, - "audio/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["oga","ogg","spx","opus"] - }, - "audio/opus": { - "source": "iana" - }, - "audio/parityfec": { - "source": "iana" - }, - "audio/pcma": { - "source": "iana" - }, - "audio/pcma-wb": { - "source": "iana" - }, - "audio/pcmu": { - "source": "iana" - }, - "audio/pcmu-wb": { - "source": "iana" - }, - "audio/prs.sid": { - "source": "iana" - }, - "audio/qcelp": { - "source": "iana" - }, - "audio/raptorfec": { - "source": "iana" - }, - "audio/red": { - "source": "iana" - }, - "audio/rtp-enc-aescm128": { - "source": "iana" - }, - "audio/rtp-midi": { - "source": "iana" - }, - "audio/rtploopback": { - "source": "iana" - }, - "audio/rtx": { - "source": "iana" - }, - "audio/s3m": { - "source": "apache", - "extensions": ["s3m"] - }, - "audio/scip": { - "source": "iana" - }, - "audio/silk": { - "source": "apache", - "extensions": ["sil"] - }, - "audio/smv": { - "source": "iana" - }, - "audio/smv-qcp": { - "source": "iana" - }, - "audio/smv0": { - "source": "iana" - }, - "audio/sofa": { - "source": "iana" - }, - "audio/sp-midi": { - "source": "iana" - }, - "audio/speex": { - "source": "iana" - }, - "audio/t140c": { - "source": "iana" - }, - "audio/t38": { - "source": "iana" - }, - "audio/telephone-event": { - "source": "iana" - }, - "audio/tetra_acelp": { - "source": "iana" - }, - "audio/tetra_acelp_bb": { - "source": "iana" - }, - "audio/tone": { - "source": "iana" - }, - "audio/tsvcis": { - "source": "iana" - }, - "audio/uemclip": { - "source": "iana" - }, - "audio/ulpfec": { - "source": "iana" - }, - "audio/usac": { - "source": "iana" - }, - "audio/vdvi": { - "source": "iana" - }, - "audio/vmr-wb": { - "source": "iana" - }, - "audio/vnd.3gpp.iufp": { - "source": "iana" - }, - "audio/vnd.4sb": { - "source": "iana" - }, - "audio/vnd.audiokoz": { - "source": "iana" - }, - "audio/vnd.celp": { - "source": "iana" - }, - "audio/vnd.cisco.nse": { - "source": "iana" - }, - "audio/vnd.cmles.radio-events": { - "source": "iana" - }, - "audio/vnd.cns.anp1": { - "source": "iana" - }, - "audio/vnd.cns.inf1": { - "source": "iana" - }, - "audio/vnd.dece.audio": { - "source": "iana", - "extensions": ["uva","uvva"] - }, - "audio/vnd.digital-winds": { - "source": "iana", - "extensions": ["eol"] - }, - "audio/vnd.dlna.adts": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.1": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.2": { - "source": "iana" - }, - "audio/vnd.dolby.mlp": { - "source": "iana" - }, - "audio/vnd.dolby.mps": { - "source": "iana" - }, - "audio/vnd.dolby.pl2": { - "source": "iana" - }, - "audio/vnd.dolby.pl2x": { - "source": "iana" - }, - "audio/vnd.dolby.pl2z": { - "source": "iana" - }, - "audio/vnd.dolby.pulse.1": { - "source": "iana" - }, - "audio/vnd.dra": { - "source": "iana", - "extensions": ["dra"] - }, - "audio/vnd.dts": { - "source": "iana", - "extensions": ["dts"] - }, - "audio/vnd.dts.hd": { - "source": "iana", - "extensions": ["dtshd"] - }, - "audio/vnd.dts.uhd": { - "source": "iana" - }, - "audio/vnd.dvb.file": { - "source": "iana" - }, - "audio/vnd.everad.plj": { - "source": "iana" - }, - "audio/vnd.hns.audio": { - "source": "iana" - }, - "audio/vnd.lucent.voice": { - "source": "iana", - "extensions": ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - "source": "iana", - "extensions": ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - "source": "iana" - }, - "audio/vnd.nortel.vbk": { - "source": "iana" - }, - "audio/vnd.nuera.ecelp4800": { - "source": "iana", - "extensions": ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - "source": "iana", - "extensions": ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - "source": "iana", - "extensions": ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - "source": "iana" - }, - "audio/vnd.presonus.multitrack": { - "source": "iana" - }, - "audio/vnd.qcelp": { - "source": "apache" - }, - "audio/vnd.rhetorex.32kadpcm": { - "source": "iana" - }, - "audio/vnd.rip": { - "source": "iana", - "extensions": ["rip"] - }, - "audio/vnd.rn-realaudio": { - "compressible": false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - "source": "iana" - }, - "audio/vnd.vmx.cvsd": { - "source": "iana" - }, - "audio/vnd.wave": { - "compressible": false - }, - "audio/vorbis": { - "source": "iana", - "compressible": false - }, - "audio/vorbis-config": { - "source": "iana" - }, - "audio/wav": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/wave": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/webm": { - "source": "apache", - "compressible": false, - "extensions": ["weba"] - }, - "audio/x-aac": { - "source": "apache", - "compressible": false, - "extensions": ["aac"] - }, - "audio/x-aiff": { - "source": "apache", - "extensions": ["aif","aiff","aifc"] - }, - "audio/x-caf": { - "source": "apache", - "compressible": false, - "extensions": ["caf"] - }, - "audio/x-flac": { - "source": "apache", - "extensions": ["flac"] - }, - "audio/x-m4a": { - "source": "nginx", - "extensions": ["m4a"] - }, - "audio/x-matroska": { - "source": "apache", - "extensions": ["mka"] - }, - "audio/x-mpegurl": { - "source": "apache", - "extensions": ["m3u"] - }, - "audio/x-ms-wax": { - "source": "apache", - "extensions": ["wax"] - }, - "audio/x-ms-wma": { - "source": "apache", - "extensions": ["wma"] - }, - "audio/x-pn-realaudio": { - "source": "apache", - "extensions": ["ram","ra"] - }, - "audio/x-pn-realaudio-plugin": { - "source": "apache", - "extensions": ["rmp"] - }, - "audio/x-realaudio": { - "source": "nginx", - "extensions": ["ra"] - }, - "audio/x-tta": { - "source": "apache" - }, - "audio/x-wav": { - "source": "apache", - "extensions": ["wav"] - }, - "audio/xm": { - "source": "apache", - "extensions": ["xm"] - }, - "chemical/x-cdx": { - "source": "apache", - "extensions": ["cdx"] - }, - "chemical/x-cif": { - "source": "apache", - "extensions": ["cif"] - }, - "chemical/x-cmdf": { - "source": "apache", - "extensions": ["cmdf"] - }, - "chemical/x-cml": { - "source": "apache", - "extensions": ["cml"] - }, - "chemical/x-csml": { - "source": "apache", - "extensions": ["csml"] - }, - "chemical/x-pdb": { - "source": "apache" - }, - "chemical/x-xyz": { - "source": "apache", - "extensions": ["xyz"] - }, - "font/collection": { - "source": "iana", - "extensions": ["ttc"] - }, - "font/otf": { - "source": "iana", - "compressible": true, - "extensions": ["otf"] - }, - "font/sfnt": { - "source": "iana" - }, - "font/ttf": { - "source": "iana", - "compressible": true, - "extensions": ["ttf"] - }, - "font/woff": { - "source": "iana", - "extensions": ["woff"] - }, - "font/woff2": { - "source": "iana", - "extensions": ["woff2"] - }, - "image/aces": { - "source": "iana", - "extensions": ["exr"] - }, - "image/apng": { - "source": "iana", - "compressible": false, - "extensions": ["apng"] - }, - "image/avci": { - "source": "iana", - "extensions": ["avci"] - }, - "image/avcs": { - "source": "iana", - "extensions": ["avcs"] - }, - "image/avif": { - "source": "iana", - "compressible": false, - "extensions": ["avif"] - }, - "image/bmp": { - "source": "iana", - "compressible": true, - "extensions": ["bmp","dib"] - }, - "image/cgm": { - "source": "iana", - "extensions": ["cgm"] - }, - "image/dicom-rle": { - "source": "iana", - "extensions": ["drle"] - }, - "image/dpx": { - "source": "iana", - "extensions": ["dpx"] - }, - "image/emf": { - "source": "iana", - "extensions": ["emf"] - }, - "image/fits": { - "source": "iana", - "extensions": ["fits"] - }, - "image/g3fax": { - "source": "iana", - "extensions": ["g3"] - }, - "image/gif": { - "source": "iana", - "compressible": false, - "extensions": ["gif"] - }, - "image/heic": { - "source": "iana", - "extensions": ["heic"] - }, - "image/heic-sequence": { - "source": "iana", - "extensions": ["heics"] - }, - "image/heif": { - "source": "iana", - "extensions": ["heif"] - }, - "image/heif-sequence": { - "source": "iana", - "extensions": ["heifs"] - }, - "image/hej2k": { - "source": "iana", - "extensions": ["hej2"] - }, - "image/ief": { - "source": "iana", - "extensions": ["ief"] - }, - "image/j2c": { - "source": "iana" - }, - "image/jaii": { - "source": "iana", - "extensions": ["jaii"] - }, - "image/jais": { - "source": "iana", - "extensions": ["jais"] - }, - "image/jls": { - "source": "iana", - "extensions": ["jls"] - }, - "image/jp2": { - "source": "iana", - "compressible": false, - "extensions": ["jp2","jpg2"] - }, - "image/jpeg": { - "source": "iana", - "compressible": false, - "extensions": ["jpg","jpeg","jpe"] - }, - "image/jph": { - "source": "iana", - "extensions": ["jph"] - }, - "image/jphc": { - "source": "iana", - "extensions": ["jhc"] - }, - "image/jpm": { - "source": "iana", - "compressible": false, - "extensions": ["jpm","jpgm"] - }, - "image/jpx": { - "source": "iana", - "compressible": false, - "extensions": ["jpx","jpf"] - }, - "image/jxl": { - "source": "iana", - "extensions": ["jxl"] - }, - "image/jxr": { - "source": "iana", - "extensions": ["jxr"] - }, - "image/jxra": { - "source": "iana", - "extensions": ["jxra"] - }, - "image/jxrs": { - "source": "iana", - "extensions": ["jxrs"] - }, - "image/jxs": { - "source": "iana", - "extensions": ["jxs"] - }, - "image/jxsc": { - "source": "iana", - "extensions": ["jxsc"] - }, - "image/jxsi": { - "source": "iana", - "extensions": ["jxsi"] - }, - "image/jxss": { - "source": "iana", - "extensions": ["jxss"] - }, - "image/ktx": { - "source": "iana", - "extensions": ["ktx"] - }, - "image/ktx2": { - "source": "iana", - "extensions": ["ktx2"] - }, - "image/naplps": { - "source": "iana" - }, - "image/pjpeg": { - "compressible": false, - "extensions": ["jfif"] - }, - "image/png": { - "source": "iana", - "compressible": false, - "extensions": ["png"] - }, - "image/prs.btif": { - "source": "iana", - "extensions": ["btif","btf"] - }, - "image/prs.pti": { - "source": "iana", - "extensions": ["pti"] - }, - "image/pwg-raster": { - "source": "iana" - }, - "image/sgi": { - "source": "apache", - "extensions": ["sgi"] - }, - "image/svg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["svg","svgz"] - }, - "image/t38": { - "source": "iana", - "extensions": ["t38"] - }, - "image/tiff": { - "source": "iana", - "compressible": false, - "extensions": ["tif","tiff"] - }, - "image/tiff-fx": { - "source": "iana", - "extensions": ["tfx"] - }, - "image/vnd.adobe.photoshop": { - "source": "iana", - "compressible": true, - "extensions": ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - "source": "iana", - "extensions": ["azv"] - }, - "image/vnd.clip": { - "source": "iana" - }, - "image/vnd.cns.inf2": { - "source": "iana" - }, - "image/vnd.dece.graphic": { - "source": "iana", - "extensions": ["uvi","uvvi","uvg","uvvg"] - }, - "image/vnd.djvu": { - "source": "iana", - "extensions": ["djvu","djv"] - }, - "image/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "image/vnd.dwg": { - "source": "iana", - "extensions": ["dwg"] - }, - "image/vnd.dxf": { - "source": "iana", - "extensions": ["dxf"] - }, - "image/vnd.fastbidsheet": { - "source": "iana", - "extensions": ["fbs"] - }, - "image/vnd.fpx": { - "source": "iana", - "extensions": ["fpx"] - }, - "image/vnd.fst": { - "source": "iana", - "extensions": ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - "source": "iana", - "extensions": ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - "source": "iana", - "extensions": ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - "source": "iana" - }, - "image/vnd.microsoft.icon": { - "source": "iana", - "compressible": true, - "extensions": ["ico"] - }, - "image/vnd.mix": { - "source": "iana" - }, - "image/vnd.mozilla.apng": { - "source": "iana" - }, - "image/vnd.ms-dds": { - "compressible": true, - "extensions": ["dds"] - }, - "image/vnd.ms-modi": { - "source": "iana", - "extensions": ["mdi"] - }, - "image/vnd.ms-photo": { - "source": "apache", - "extensions": ["wdp"] - }, - "image/vnd.net-fpx": { - "source": "iana", - "extensions": ["npx"] - }, - "image/vnd.pco.b16": { - "source": "iana", - "extensions": ["b16"] - }, - "image/vnd.radiance": { - "source": "iana" - }, - "image/vnd.sealed.png": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - "source": "iana" - }, - "image/vnd.svf": { - "source": "iana" - }, - "image/vnd.tencent.tap": { - "source": "iana", - "extensions": ["tap"] - }, - "image/vnd.valve.source.texture": { - "source": "iana", - "extensions": ["vtf"] - }, - "image/vnd.wap.wbmp": { - "source": "iana", - "extensions": ["wbmp"] - }, - "image/vnd.xiff": { - "source": "iana", - "extensions": ["xif"] - }, - "image/vnd.zbrush.pcx": { - "source": "iana", - "extensions": ["pcx"] - }, - "image/webp": { - "source": "iana", - "extensions": ["webp"] - }, - "image/wmf": { - "source": "iana", - "extensions": ["wmf"] - }, - "image/x-3ds": { - "source": "apache", - "extensions": ["3ds"] - }, - "image/x-adobe-dng": { - "extensions": ["dng"] - }, - "image/x-cmu-raster": { - "source": "apache", - "extensions": ["ras"] - }, - "image/x-cmx": { - "source": "apache", - "extensions": ["cmx"] - }, - "image/x-emf": { - "source": "iana" - }, - "image/x-freehand": { - "source": "apache", - "extensions": ["fh","fhc","fh4","fh5","fh7"] - }, - "image/x-icon": { - "source": "apache", - "compressible": true, - "extensions": ["ico"] - }, - "image/x-jng": { - "source": "nginx", - "extensions": ["jng"] - }, - "image/x-mrsid-image": { - "source": "apache", - "extensions": ["sid"] - }, - "image/x-ms-bmp": { - "source": "nginx", - "compressible": true, - "extensions": ["bmp"] - }, - "image/x-pcx": { - "source": "apache", - "extensions": ["pcx"] - }, - "image/x-pict": { - "source": "apache", - "extensions": ["pic","pct"] - }, - "image/x-portable-anymap": { - "source": "apache", - "extensions": ["pnm"] - }, - "image/x-portable-bitmap": { - "source": "apache", - "extensions": ["pbm"] - }, - "image/x-portable-graymap": { - "source": "apache", - "extensions": ["pgm"] - }, - "image/x-portable-pixmap": { - "source": "apache", - "extensions": ["ppm"] - }, - "image/x-rgb": { - "source": "apache", - "extensions": ["rgb"] - }, - "image/x-tga": { - "source": "apache", - "extensions": ["tga"] - }, - "image/x-wmf": { - "source": "iana" - }, - "image/x-xbitmap": { - "source": "apache", - "extensions": ["xbm"] - }, - "image/x-xcf": { - "compressible": false - }, - "image/x-xpixmap": { - "source": "apache", - "extensions": ["xpm"] - }, - "image/x-xwindowdump": { - "source": "apache", - "extensions": ["xwd"] - }, - "message/bhttp": { - "source": "iana" - }, - "message/cpim": { - "source": "iana" - }, - "message/delivery-status": { - "source": "iana" - }, - "message/disposition-notification": { - "source": "iana", - "extensions": [ - "disposition-notification" - ] - }, - "message/external-body": { - "source": "iana" - }, - "message/feedback-report": { - "source": "iana" - }, - "message/global": { - "source": "iana", - "extensions": ["u8msg"] - }, - "message/global-delivery-status": { - "source": "iana", - "extensions": ["u8dsn"] - }, - "message/global-disposition-notification": { - "source": "iana", - "extensions": ["u8mdn"] - }, - "message/global-headers": { - "source": "iana", - "extensions": ["u8hdr"] - }, - "message/http": { - "source": "iana", - "compressible": false - }, - "message/imdn+xml": { - "source": "iana", - "compressible": true - }, - "message/mls": { - "source": "iana" - }, - "message/news": { - "source": "apache" - }, - "message/ohttp-req": { - "source": "iana" - }, - "message/ohttp-res": { - "source": "iana" - }, - "message/partial": { - "source": "iana", - "compressible": false - }, - "message/rfc822": { - "source": "iana", - "compressible": true, - "extensions": ["eml","mime","mht","mhtml"] - }, - "message/s-http": { - "source": "apache" - }, - "message/sip": { - "source": "iana" - }, - "message/sipfrag": { - "source": "iana" - }, - "message/tracking-status": { - "source": "iana" - }, - "message/vnd.si.simp": { - "source": "apache" - }, - "message/vnd.wfa.wsc": { - "source": "iana", - "extensions": ["wsc"] - }, - "model/3mf": { - "source": "iana", - "extensions": ["3mf"] - }, - "model/e57": { - "source": "iana" - }, - "model/gltf+json": { - "source": "iana", - "compressible": true, - "extensions": ["gltf"] - }, - "model/gltf-binary": { - "source": "iana", - "compressible": true, - "extensions": ["glb"] - }, - "model/iges": { - "source": "iana", - "compressible": false, - "extensions": ["igs","iges"] - }, - "model/jt": { - "source": "iana", - "extensions": ["jt"] - }, - "model/mesh": { - "source": "iana", - "compressible": false, - "extensions": ["msh","mesh","silo"] - }, - "model/mtl": { - "source": "iana", - "extensions": ["mtl"] - }, - "model/obj": { - "source": "iana", - "extensions": ["obj"] - }, - "model/prc": { - "source": "iana", - "extensions": ["prc"] - }, - "model/step": { - "source": "iana", - "extensions": ["step","stp","stpnc","p21","210"] - }, - "model/step+xml": { - "source": "iana", - "compressible": true, - "extensions": ["stpx"] - }, - "model/step+zip": { - "source": "iana", - "compressible": false, - "extensions": ["stpz"] - }, - "model/step-xml+zip": { - "source": "iana", - "compressible": false, - "extensions": ["stpxz"] - }, - "model/stl": { - "source": "iana", - "extensions": ["stl"] - }, - "model/u3d": { - "source": "iana", - "extensions": ["u3d"] - }, - "model/vnd.bary": { - "source": "iana", - "extensions": ["bary"] - }, - "model/vnd.cld": { - "source": "iana", - "extensions": ["cld"] - }, - "model/vnd.collada+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dae"] - }, - "model/vnd.dwf": { - "source": "iana", - "extensions": ["dwf"] - }, - "model/vnd.flatland.3dml": { - "source": "iana" - }, - "model/vnd.gdl": { - "source": "iana", - "extensions": ["gdl"] - }, - "model/vnd.gs-gdl": { - "source": "apache" - }, - "model/vnd.gs.gdl": { - "source": "iana" - }, - "model/vnd.gtw": { - "source": "iana", - "extensions": ["gtw"] - }, - "model/vnd.moml+xml": { - "source": "iana", - "compressible": true - }, - "model/vnd.mts": { - "source": "iana", - "extensions": ["mts"] - }, - "model/vnd.opengex": { - "source": "iana", - "extensions": ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - "source": "iana", - "extensions": ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - "source": "iana", - "extensions": ["x_t"] - }, - "model/vnd.pytha.pyox": { - "source": "iana", - "extensions": ["pyo","pyox"] - }, - "model/vnd.rosette.annotated-data-model": { - "source": "iana" - }, - "model/vnd.sap.vds": { - "source": "iana", - "extensions": ["vds"] - }, - "model/vnd.usda": { - "source": "iana", - "extensions": ["usda"] - }, - "model/vnd.usdz+zip": { - "source": "iana", - "compressible": false, - "extensions": ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - "source": "iana", - "extensions": ["bsp"] - }, - "model/vnd.vtu": { - "source": "iana", - "extensions": ["vtu"] - }, - "model/vrml": { - "source": "iana", - "compressible": false, - "extensions": ["wrl","vrml"] - }, - "model/x3d+binary": { - "source": "apache", - "compressible": false, - "extensions": ["x3db","x3dbz"] - }, - "model/x3d+fastinfoset": { - "source": "iana", - "extensions": ["x3db"] - }, - "model/x3d+vrml": { - "source": "apache", - "compressible": false, - "extensions": ["x3dv","x3dvz"] - }, - "model/x3d+xml": { - "source": "iana", - "compressible": true, - "extensions": ["x3d","x3dz"] - }, - "model/x3d-vrml": { - "source": "iana", - "extensions": ["x3dv"] - }, - "multipart/alternative": { - "source": "iana", - "compressible": false - }, - "multipart/appledouble": { - "source": "iana" - }, - "multipart/byteranges": { - "source": "iana" - }, - "multipart/digest": { - "source": "iana" - }, - "multipart/encrypted": { - "source": "iana", - "compressible": false - }, - "multipart/form-data": { - "source": "iana", - "compressible": false - }, - "multipart/header-set": { - "source": "iana" - }, - "multipart/mixed": { - "source": "iana" - }, - "multipart/multilingual": { - "source": "iana" - }, - "multipart/parallel": { - "source": "iana" - }, - "multipart/related": { - "source": "iana", - "compressible": false - }, - "multipart/report": { - "source": "iana" - }, - "multipart/signed": { - "source": "iana", - "compressible": false - }, - "multipart/vnd.bint.med-plus": { - "source": "iana" - }, - "multipart/voice-message": { - "source": "iana" - }, - "multipart/x-mixed-replace": { - "source": "iana" - }, - "text/1d-interleaved-parityfec": { - "source": "iana" - }, - "text/cache-manifest": { - "source": "iana", - "compressible": true, - "extensions": ["appcache","manifest"] - }, - "text/calendar": { - "source": "iana", - "extensions": ["ics","ifb"] - }, - "text/calender": { - "compressible": true - }, - "text/cmd": { - "compressible": true - }, - "text/coffeescript": { - "extensions": ["coffee","litcoffee"] - }, - "text/cql": { - "source": "iana" - }, - "text/cql-expression": { - "source": "iana" - }, - "text/cql-identifier": { - "source": "iana" - }, - "text/css": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["css"] - }, - "text/csv": { - "source": "iana", - "compressible": true, - "extensions": ["csv"] - }, - "text/csv-schema": { - "source": "iana" - }, - "text/directory": { - "source": "iana" - }, - "text/dns": { - "source": "iana" - }, - "text/ecmascript": { - "source": "apache" - }, - "text/encaprtp": { - "source": "iana" - }, - "text/enriched": { - "source": "iana" - }, - "text/fhirpath": { - "source": "iana" - }, - "text/flexfec": { - "source": "iana" - }, - "text/fwdred": { - "source": "iana" - }, - "text/gff3": { - "source": "iana" - }, - "text/grammar-ref-list": { - "source": "iana" - }, - "text/hl7v2": { - "source": "iana" - }, - "text/html": { - "source": "iana", - "compressible": true, - "extensions": ["html","htm","shtml"] - }, - "text/jade": { - "extensions": ["jade"] - }, - "text/javascript": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["js","mjs"] - }, - "text/jcr-cnd": { - "source": "iana" - }, - "text/jsx": { - "compressible": true, - "extensions": ["jsx"] - }, - "text/less": { - "compressible": true, - "extensions": ["less"] - }, - "text/markdown": { - "source": "iana", - "compressible": true, - "extensions": ["md","markdown"] - }, - "text/mathml": { - "source": "nginx", - "extensions": ["mml"] - }, - "text/mdx": { - "compressible": true, - "extensions": ["mdx"] - }, - "text/mizar": { - "source": "iana" - }, - "text/n3": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["n3"] - }, - "text/parameters": { - "source": "iana", - "charset": "UTF-8" - }, - "text/parityfec": { - "source": "iana" - }, - "text/plain": { - "source": "iana", - "compressible": true, - "extensions": ["txt","text","conf","def","list","log","in","ini"] - }, - "text/provenance-notation": { - "source": "iana", - "charset": "UTF-8" - }, - "text/prs.fallenstein.rst": { - "source": "iana" - }, - "text/prs.lines.tag": { - "source": "iana", - "extensions": ["dsc"] - }, - "text/prs.prop.logic": { - "source": "iana" - }, - "text/prs.texi": { - "source": "iana" - }, - "text/raptorfec": { - "source": "iana" - }, - "text/red": { - "source": "iana" - }, - "text/rfc822-headers": { - "source": "iana" - }, - "text/richtext": { - "source": "iana", - "compressible": true, - "extensions": ["rtx"] - }, - "text/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "text/rtp-enc-aescm128": { - "source": "iana" - }, - "text/rtploopback": { - "source": "iana" - }, - "text/rtx": { - "source": "iana" - }, - "text/sgml": { - "source": "iana", - "extensions": ["sgml","sgm"] - }, - "text/shaclc": { - "source": "iana" - }, - "text/shex": { - "source": "iana", - "extensions": ["shex"] - }, - "text/slim": { - "extensions": ["slim","slm"] - }, - "text/spdx": { - "source": "iana", - "extensions": ["spdx"] - }, - "text/strings": { - "source": "iana" - }, - "text/stylus": { - "extensions": ["stylus","styl"] - }, - "text/t140": { - "source": "iana" - }, - "text/tab-separated-values": { - "source": "iana", - "compressible": true, - "extensions": ["tsv"] - }, - "text/troff": { - "source": "iana", - "extensions": ["t","tr","roff","man","me","ms"] - }, - "text/turtle": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["ttl"] - }, - "text/ulpfec": { - "source": "iana" - }, - "text/uri-list": { - "source": "iana", - "compressible": true, - "extensions": ["uri","uris","urls"] - }, - "text/vcard": { - "source": "iana", - "compressible": true, - "extensions": ["vcard"] - }, - "text/vnd.a": { - "source": "iana" - }, - "text/vnd.abc": { - "source": "iana" - }, - "text/vnd.ascii-art": { - "source": "iana" - }, - "text/vnd.curl": { - "source": "iana", - "extensions": ["curl"] - }, - "text/vnd.curl.dcurl": { - "source": "apache", - "extensions": ["dcurl"] - }, - "text/vnd.curl.mcurl": { - "source": "apache", - "extensions": ["mcurl"] - }, - "text/vnd.curl.scurl": { - "source": "apache", - "extensions": ["scurl"] - }, - "text/vnd.debian.copyright": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.dmclientscript": { - "source": "iana" - }, - "text/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.exchangeable": { - "source": "iana" - }, - "text/vnd.familysearch.gedcom": { - "source": "iana", - "extensions": ["ged"] - }, - "text/vnd.ficlab.flt": { - "source": "iana" - }, - "text/vnd.fly": { - "source": "iana", - "extensions": ["fly"] - }, - "text/vnd.fmi.flexstor": { - "source": "iana", - "extensions": ["flx"] - }, - "text/vnd.gml": { - "source": "iana" - }, - "text/vnd.graphviz": { - "source": "iana", - "extensions": ["gv"] - }, - "text/vnd.hans": { - "source": "iana" - }, - "text/vnd.hgl": { - "source": "iana" - }, - "text/vnd.in3d.3dml": { - "source": "iana", - "extensions": ["3dml"] - }, - "text/vnd.in3d.spot": { - "source": "iana", - "extensions": ["spot"] - }, - "text/vnd.iptc.newsml": { - "source": "iana" - }, - "text/vnd.iptc.nitf": { - "source": "iana" - }, - "text/vnd.latex-z": { - "source": "iana" - }, - "text/vnd.motorola.reflex": { - "source": "iana" - }, - "text/vnd.ms-mediapackage": { - "source": "iana" - }, - "text/vnd.net2phone.commcenter.command": { - "source": "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - "source": "iana" - }, - "text/vnd.senx.warpscript": { - "source": "iana" - }, - "text/vnd.si.uricatalogue": { - "source": "apache" - }, - "text/vnd.sosi": { - "source": "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["jad"] - }, - "text/vnd.trolltech.linguist": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.vcf": { - "source": "iana" - }, - "text/vnd.wap.si": { - "source": "iana" - }, - "text/vnd.wap.sl": { - "source": "iana" - }, - "text/vnd.wap.wml": { - "source": "iana", - "extensions": ["wml"] - }, - "text/vnd.wap.wmlscript": { - "source": "iana", - "extensions": ["wmls"] - }, - "text/vnd.zoo.kcl": { - "source": "iana" - }, - "text/vtt": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["vtt"] - }, - "text/wgsl": { - "source": "iana", - "extensions": ["wgsl"] - }, - "text/x-asm": { - "source": "apache", - "extensions": ["s","asm"] - }, - "text/x-c": { - "source": "apache", - "extensions": ["c","cc","cxx","cpp","h","hh","dic"] - }, - "text/x-component": { - "source": "nginx", - "extensions": ["htc"] - }, - "text/x-fortran": { - "source": "apache", - "extensions": ["f","for","f77","f90"] - }, - "text/x-gwt-rpc": { - "compressible": true - }, - "text/x-handlebars-template": { - "extensions": ["hbs"] - }, - "text/x-java-source": { - "source": "apache", - "extensions": ["java"] - }, - "text/x-jquery-tmpl": { - "compressible": true - }, - "text/x-lua": { - "extensions": ["lua"] - }, - "text/x-markdown": { - "compressible": true, - "extensions": ["mkd"] - }, - "text/x-nfo": { - "source": "apache", - "extensions": ["nfo"] - }, - "text/x-opml": { - "source": "apache", - "extensions": ["opml"] - }, - "text/x-org": { - "compressible": true, - "extensions": ["org"] - }, - "text/x-pascal": { - "source": "apache", - "extensions": ["p","pas"] - }, - "text/x-processing": { - "compressible": true, - "extensions": ["pde"] - }, - "text/x-sass": { - "extensions": ["sass"] - }, - "text/x-scss": { - "extensions": ["scss"] - }, - "text/x-setext": { - "source": "apache", - "extensions": ["etx"] - }, - "text/x-sfv": { - "source": "apache", - "extensions": ["sfv"] - }, - "text/x-suse-ymp": { - "compressible": true, - "extensions": ["ymp"] - }, - "text/x-uuencode": { - "source": "apache", - "extensions": ["uu"] - }, - "text/x-vcalendar": { - "source": "apache", - "extensions": ["vcs"] - }, - "text/x-vcard": { - "source": "apache", - "extensions": ["vcf"] - }, - "text/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml"] - }, - "text/xml-external-parsed-entity": { - "source": "iana" - }, - "text/yaml": { - "compressible": true, - "extensions": ["yaml","yml"] - }, - "video/1d-interleaved-parityfec": { - "source": "iana" - }, - "video/3gpp": { - "source": "iana", - "extensions": ["3gp","3gpp"] - }, - "video/3gpp-tt": { - "source": "iana" - }, - "video/3gpp2": { - "source": "iana", - "extensions": ["3g2"] - }, - "video/av1": { - "source": "iana" - }, - "video/bmpeg": { - "source": "iana" - }, - "video/bt656": { - "source": "iana" - }, - "video/celb": { - "source": "iana" - }, - "video/dv": { - "source": "iana" - }, - "video/encaprtp": { - "source": "iana" - }, - "video/evc": { - "source": "iana" - }, - "video/ffv1": { - "source": "iana" - }, - "video/flexfec": { - "source": "iana" - }, - "video/h261": { - "source": "iana", - "extensions": ["h261"] - }, - "video/h263": { - "source": "iana", - "extensions": ["h263"] - }, - "video/h263-1998": { - "source": "iana" - }, - "video/h263-2000": { - "source": "iana" - }, - "video/h264": { - "source": "iana", - "extensions": ["h264"] - }, - "video/h264-rcdo": { - "source": "iana" - }, - "video/h264-svc": { - "source": "iana" - }, - "video/h265": { - "source": "iana" - }, - "video/h266": { - "source": "iana" - }, - "video/iso.segment": { - "source": "iana", - "extensions": ["m4s"] - }, - "video/jpeg": { - "source": "iana", - "extensions": ["jpgv"] - }, - "video/jpeg2000": { - "source": "iana" - }, - "video/jpm": { - "source": "apache", - "extensions": ["jpm","jpgm"] - }, - "video/jxsv": { - "source": "iana" - }, - "video/lottie+json": { - "source": "iana", - "compressible": true - }, - "video/matroska": { - "source": "iana" - }, - "video/matroska-3d": { - "source": "iana" - }, - "video/mj2": { - "source": "iana", - "extensions": ["mj2","mjp2"] - }, - "video/mp1s": { - "source": "iana" - }, - "video/mp2p": { - "source": "iana" - }, - "video/mp2t": { - "source": "iana", - "extensions": ["ts","m2t","m2ts","mts"] - }, - "video/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["mp4","mp4v","mpg4"] - }, - "video/mp4v-es": { - "source": "iana" - }, - "video/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpeg","mpg","mpe","m1v","m2v"] - }, - "video/mpeg4-generic": { - "source": "iana" - }, - "video/mpv": { - "source": "iana" - }, - "video/nv": { - "source": "iana" - }, - "video/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogv"] - }, - "video/parityfec": { - "source": "iana" - }, - "video/pointer": { - "source": "iana" - }, - "video/quicktime": { - "source": "iana", - "compressible": false, - "extensions": ["qt","mov"] - }, - "video/raptorfec": { - "source": "iana" - }, - "video/raw": { - "source": "iana" - }, - "video/rtp-enc-aescm128": { - "source": "iana" - }, - "video/rtploopback": { - "source": "iana" - }, - "video/rtx": { - "source": "iana" - }, - "video/scip": { - "source": "iana" - }, - "video/smpte291": { - "source": "iana" - }, - "video/smpte292m": { - "source": "iana" - }, - "video/ulpfec": { - "source": "iana" - }, - "video/vc1": { - "source": "iana" - }, - "video/vc2": { - "source": "iana" - }, - "video/vnd.cctv": { - "source": "iana" - }, - "video/vnd.dece.hd": { - "source": "iana", - "extensions": ["uvh","uvvh"] - }, - "video/vnd.dece.mobile": { - "source": "iana", - "extensions": ["uvm","uvvm"] - }, - "video/vnd.dece.mp4": { - "source": "iana" - }, - "video/vnd.dece.pd": { - "source": "iana", - "extensions": ["uvp","uvvp"] - }, - "video/vnd.dece.sd": { - "source": "iana", - "extensions": ["uvs","uvvs"] - }, - "video/vnd.dece.video": { - "source": "iana", - "extensions": ["uvv","uvvv"] - }, - "video/vnd.directv.mpeg": { - "source": "iana" - }, - "video/vnd.directv.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dlna.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dvb.file": { - "source": "iana", - "extensions": ["dvb"] - }, - "video/vnd.fvt": { - "source": "iana", - "extensions": ["fvt"] - }, - "video/vnd.hns.video": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsavc": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - "source": "iana" - }, - "video/vnd.motorola.video": { - "source": "iana" - }, - "video/vnd.motorola.videop": { - "source": "iana" - }, - "video/vnd.mpegurl": { - "source": "iana", - "extensions": ["mxu","m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - "source": "iana", - "extensions": ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - "source": "iana" - }, - "video/vnd.nokia.mp4vr": { - "source": "iana" - }, - "video/vnd.nokia.videovoip": { - "source": "iana" - }, - "video/vnd.objectvideo": { - "source": "iana" - }, - "video/vnd.planar": { - "source": "iana" - }, - "video/vnd.radgamettools.bink": { - "source": "iana" - }, - "video/vnd.radgamettools.smacker": { - "source": "apache" - }, - "video/vnd.sealed.mpeg1": { - "source": "iana" - }, - "video/vnd.sealed.mpeg4": { - "source": "iana" - }, - "video/vnd.sealed.swf": { - "source": "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - "source": "iana" - }, - "video/vnd.uvvu.mp4": { - "source": "iana", - "extensions": ["uvu","uvvu"] - }, - "video/vnd.vivo": { - "source": "iana", - "extensions": ["viv"] - }, - "video/vnd.youtube.yt": { - "source": "iana" - }, - "video/vp8": { - "source": "iana" - }, - "video/vp9": { - "source": "iana" - }, - "video/webm": { - "source": "apache", - "compressible": false, - "extensions": ["webm"] - }, - "video/x-f4v": { - "source": "apache", - "extensions": ["f4v"] - }, - "video/x-fli": { - "source": "apache", - "extensions": ["fli"] - }, - "video/x-flv": { - "source": "apache", - "compressible": false, - "extensions": ["flv"] - }, - "video/x-m4v": { - "source": "apache", - "extensions": ["m4v"] - }, - "video/x-matroska": { - "source": "apache", - "compressible": false, - "extensions": ["mkv","mk3d","mks"] - }, - "video/x-mng": { - "source": "apache", - "extensions": ["mng"] - }, - "video/x-ms-asf": { - "source": "apache", - "extensions": ["asf","asx"] - }, - "video/x-ms-vob": { - "source": "apache", - "extensions": ["vob"] - }, - "video/x-ms-wm": { - "source": "apache", - "extensions": ["wm"] - }, - "video/x-ms-wmv": { - "source": "apache", - "compressible": false, - "extensions": ["wmv"] - }, - "video/x-ms-wmx": { - "source": "apache", - "extensions": ["wmx"] - }, - "video/x-ms-wvx": { - "source": "apache", - "extensions": ["wvx"] - }, - "video/x-msvideo": { - "source": "apache", - "extensions": ["avi"] - }, - "video/x-sgi-movie": { - "source": "apache", - "extensions": ["movie"] - }, - "video/x-smv": { - "source": "apache", - "extensions": ["smv"] - }, - "x-conference/x-cooltalk": { - "source": "apache", - "extensions": ["ice"] - }, - "x-shader/x-fragment": { - "compressible": true - }, - "x-shader/x-vertex": { - "compressible": true - } -} diff --git a/node_modules/mime-db/index.js b/node_modules/mime-db/index.js deleted file mode 100644 index ec2be30..0000000 --- a/node_modules/mime-db/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = require('./db.json') diff --git a/node_modules/mime-db/package.json b/node_modules/mime-db/package.json deleted file mode 100644 index 289a370..0000000 --- a/node_modules/mime-db/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "mime-db", - "description": "Media Type Database", - "version": "1.54.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)", - "Robert Kieffer (http://github.com/broofa)" - ], - "license": "MIT", - "keywords": [ - "mime", - "db", - "type", - "types", - "database", - "charset", - "charsets" - ], - "repository": "jshttp/mime-db", - "devDependencies": { - "csv-parse": "4.16.3", - "eslint": "8.32.0", - "eslint-config-standard": "15.0.1", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-markdown": "3.0.0", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.1.1", - "eslint-plugin-standard": "4.1.0", - "media-typer": "1.1.0", - "mocha": "10.2.0", - "nyc": "15.1.0", - "stream-to-array": "2.3.0", - "undici": "7.1.0" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "db.json", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "build": "node scripts/build", - "fetch": "node scripts/fetch-apache && node scripts/fetch-iana && node scripts/fetch-nginx", - "lint": "eslint .", - "test": "mocha --reporter spec --check-leaks test/", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "update": "npm run fetch && npm run build", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/mime-types/HISTORY.md b/node_modules/mime-types/HISTORY.md deleted file mode 100644 index 9ba2dc0..0000000 --- a/node_modules/mime-types/HISTORY.md +++ /dev/null @@ -1,428 +0,0 @@ -3.0.2 / 2025-11-20 -=================== - -* Fix: update JSDoc to reflect that functions return only `false` or `string`, not `boolean|string`. -* Fix: refined mime-score logic so `.mp4` resolves correctly -* Fix:reflect the current Node.js version supported to ≥ 18 (See 3.0.0 for more details). - -3.0.1 / 2025-03-26 -=================== - -* deps: mime-db@1.54.0 - -3.0.0 / 2024-08-31 -=================== - -* Drop support for node <18 -* deps: mime-db@1.53.0 -* resolve extension conflicts with mime-score (#119) - * asc -> application/pgp-signature is now application/pgp-keys - * mpp -> application/vnd.ms-project is now application/dash-patch+xml - * ac -> application/vnd.nokia.n-gage.ac+xml is now application/pkix-attr-cert - * bdoc -> application/x-bdoc is now application/bdoc - * wmz -> application/x-msmetafile is now application/x-ms-wmz - * xsl -> application/xslt+xml is now application/xml - * wav -> audio/wave is now audio/wav - * rtf -> text/rtf is now application/rtf - * xml -> text/xml is now application/xml - * mp4 -> video/mp4 is now application/mp4 - * mpg4 -> video/mp4 is now application/mp4 - - -2.1.35 / 2022-03-12 -=================== - - * deps: mime-db@1.52.0 - - Add extensions from IANA for more `image/*` types - - Add extension `.asc` to `application/pgp-keys` - - Add extensions to various XML types - - Add new upstream MIME types - -2.1.34 / 2021-11-08 -=================== - - * deps: mime-db@1.51.0 - - Add new upstream MIME types - -2.1.33 / 2021-10-01 -=================== - - * deps: mime-db@1.50.0 - - Add deprecated iWorks mime types and extensions - - Add new upstream MIME types - -2.1.32 / 2021-07-27 -=================== - - * deps: mime-db@1.49.0 - - Add extension `.trig` to `application/trig` - - Add new upstream MIME types - -2.1.31 / 2021-06-01 -=================== - - * deps: mime-db@1.48.0 - - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` - - Add new upstream MIME types - -2.1.30 / 2021-04-02 -=================== - - * deps: mime-db@1.47.0 - - Add extension `.amr` to `audio/amr` - - Remove ambigious extensions from IANA for `application/*+xml` types - - Update primary extension to `.es` for `application/ecmascript` - -2.1.29 / 2021-02-17 -=================== - - * deps: mime-db@1.46.0 - - Add extension `.amr` to `audio/amr` - - Add extension `.m4s` to `video/iso.segment` - - Add extension `.opus` to `audio/ogg` - - Add new upstream MIME types - -2.1.28 / 2021-01-01 -=================== - - * deps: mime-db@1.45.0 - - Add `application/ubjson` with extension `.ubj` - - Add `image/avif` with extension `.avif` - - Add `image/ktx2` with extension `.ktx2` - - Add extension `.dbf` to `application/vnd.dbf` - - Add extension `.rar` to `application/vnd.rar` - - Add extension `.td` to `application/urc-targetdesc+xml` - - Add new upstream MIME types - - Fix extension of `application/vnd.apple.keynote` to be `.key` - -2.1.27 / 2020-04-23 -=================== - - * deps: mime-db@1.44.0 - - Add charsets from IANA - - Add extension `.cjs` to `application/node` - - Add new upstream MIME types - -2.1.26 / 2020-01-05 -=================== - - * deps: mime-db@1.43.0 - - Add `application/x-keepass2` with extension `.kdbx` - - Add extension `.mxmf` to `audio/mobile-xmf` - - Add extensions from IANA for `application/*+xml` types - - Add new upstream MIME types - -2.1.25 / 2019-11-12 -=================== - - * deps: mime-db@1.42.0 - - Add new upstream MIME types - - Add `application/toml` with extension `.toml` - - Add `image/vnd.ms-dds` with extension `.dds` - -2.1.24 / 2019-04-20 -=================== - - * deps: mime-db@1.40.0 - - Add extensions from IANA for `model/*` types - - Add `text/mdx` with extension `.mdx` - -2.1.23 / 2019-04-17 -=================== - - * deps: mime-db@~1.39.0 - - Add extensions `.siv` and `.sieve` to `application/sieve` - - Add new upstream MIME types - -2.1.22 / 2019-02-14 -=================== - - * deps: mime-db@~1.38.0 - - Add extension `.nq` to `application/n-quads` - - Add extension `.nt` to `application/n-triples` - - Add new upstream MIME types - -2.1.21 / 2018-10-19 -=================== - - * deps: mime-db@~1.37.0 - - Add extensions to HEIC image types - - Add new upstream MIME types - -2.1.20 / 2018-08-26 -=================== - - * deps: mime-db@~1.36.0 - - Add Apple file extensions from IANA - - Add extensions from IANA for `image/*` types - - Add new upstream MIME types - -2.1.19 / 2018-07-17 -=================== - - * deps: mime-db@~1.35.0 - - Add extension `.csl` to `application/vnd.citationstyles.style+xml` - - Add extension `.es` to `application/ecmascript` - - Add extension `.owl` to `application/rdf+xml` - - Add new upstream MIME types - - Add UTF-8 as default charset for `text/turtle` - -2.1.18 / 2018-02-16 -=================== - - * deps: mime-db@~1.33.0 - - Add `application/raml+yaml` with extension `.raml` - - Add `application/wasm` with extension `.wasm` - - Add `text/shex` with extension `.shex` - - Add extensions for JPEG-2000 images - - Add extensions from IANA for `message/*` types - - Add new upstream MIME types - - Update font MIME types - - Update `text/hjson` to registered `application/hjson` - -2.1.17 / 2017-09-01 -=================== - - * deps: mime-db@~1.30.0 - - Add `application/vnd.ms-outlook` - - Add `application/x-arj` - - Add extension `.mjs` to `application/javascript` - - Add glTF types and extensions - - Add new upstream MIME types - - Add `text/x-org` - - Add VirtualBox MIME types - - Fix `source` records for `video/*` types that are IANA - - Update `font/opentype` to registered `font/otf` - -2.1.16 / 2017-07-24 -=================== - - * deps: mime-db@~1.29.0 - - Add `application/fido.trusted-apps+json` - - Add extension `.wadl` to `application/vnd.sun.wadl+xml` - - Add extension `.gz` to `application/gzip` - - Add new upstream MIME types - - Update extensions `.md` and `.markdown` to be `text/markdown` - -2.1.15 / 2017-03-23 -=================== - - * deps: mime-db@~1.27.0 - - Add new mime types - - Add `image/apng` - -2.1.14 / 2017-01-14 -=================== - - * deps: mime-db@~1.26.0 - - Add new mime types - -2.1.13 / 2016-11-18 -=================== - - * deps: mime-db@~1.25.0 - - Add new mime types - -2.1.12 / 2016-09-18 -=================== - - * deps: mime-db@~1.24.0 - - Add new mime types - - Add `audio/mp3` - -2.1.11 / 2016-05-01 -=================== - - * deps: mime-db@~1.23.0 - - Add new mime types - -2.1.10 / 2016-02-15 -=================== - - * deps: mime-db@~1.22.0 - - Add new mime types - - Fix extension of `application/dash+xml` - - Update primary extension for `audio/mp4` - -2.1.9 / 2016-01-06 -================== - - * deps: mime-db@~1.21.0 - - Add new mime types - -2.1.8 / 2015-11-30 -================== - - * deps: mime-db@~1.20.0 - - Add new mime types - -2.1.7 / 2015-09-20 -================== - - * deps: mime-db@~1.19.0 - - Add new mime types - -2.1.6 / 2015-09-03 -================== - - * deps: mime-db@~1.18.0 - - Add new mime types - -2.1.5 / 2015-08-20 -================== - - * deps: mime-db@~1.17.0 - - Add new mime types - -2.1.4 / 2015-07-30 -================== - - * deps: mime-db@~1.16.0 - - Add new mime types - -2.1.3 / 2015-07-13 -================== - - * deps: mime-db@~1.15.0 - - Add new mime types - -2.1.2 / 2015-06-25 -================== - - * deps: mime-db@~1.14.0 - - Add new mime types - -2.1.1 / 2015-06-08 -================== - - * perf: fix deopt during mapping - -2.1.0 / 2015-06-07 -================== - - * Fix incorrectly treating extension-less file name as extension - - i.e. `'path/to/json'` will no longer return `application/json` - * Fix `.charset(type)` to accept parameters - * Fix `.charset(type)` to match case-insensitive - * Improve generation of extension to MIME mapping - * Refactor internals for readability and no argument reassignment - * Prefer `application/*` MIME types from the same source - * Prefer any type over `application/octet-stream` - * deps: mime-db@~1.13.0 - - Add nginx as a source - - Add new mime types - -2.0.14 / 2015-06-06 -=================== - - * deps: mime-db@~1.12.0 - - Add new mime types - -2.0.13 / 2015-05-31 -=================== - - * deps: mime-db@~1.11.0 - - Add new mime types - -2.0.12 / 2015-05-19 -=================== - - * deps: mime-db@~1.10.0 - - Add new mime types - -2.0.11 / 2015-05-05 -=================== - - * deps: mime-db@~1.9.1 - - Add new mime types - -2.0.10 / 2015-03-13 -=================== - - * deps: mime-db@~1.8.0 - - Add new mime types - -2.0.9 / 2015-02-09 -================== - - * deps: mime-db@~1.7.0 - - Add new mime types - - Community extensions ownership transferred from `node-mime` - -2.0.8 / 2015-01-29 -================== - - * deps: mime-db@~1.6.0 - - Add new mime types - -2.0.7 / 2014-12-30 -================== - - * deps: mime-db@~1.5.0 - - Add new mime types - - Fix various invalid MIME type entries - -2.0.6 / 2014-12-30 -================== - - * deps: mime-db@~1.4.0 - - Add new mime types - - Fix various invalid MIME type entries - - Remove example template MIME types - -2.0.5 / 2014-12-29 -================== - - * deps: mime-db@~1.3.1 - - Fix missing extensions - -2.0.4 / 2014-12-10 -================== - - * deps: mime-db@~1.3.0 - - Add new mime types - -2.0.3 / 2014-11-09 -================== - - * deps: mime-db@~1.2.0 - - Add new mime types - -2.0.2 / 2014-09-28 -================== - - * deps: mime-db@~1.1.0 - - Add new mime types - - Update charsets - -2.0.1 / 2014-09-07 -================== - - * Support Node.js 0.6 - -2.0.0 / 2014-09-02 -================== - - * Use `mime-db` - * Remove `.define()` - -1.0.2 / 2014-08-04 -================== - - * Set charset=utf-8 for `text/javascript` - -1.0.1 / 2014-06-24 -================== - - * Add `text/jsx` type - -1.0.0 / 2014-05-12 -================== - - * Return `false` for unknown types - * Set charset=utf-8 for `application/json` - -0.1.0 / 2014-05-02 -================== - - * Initial release diff --git a/node_modules/mime-types/LICENSE b/node_modules/mime-types/LICENSE deleted file mode 100644 index 0616607..0000000 --- a/node_modules/mime-types/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mime-types/README.md b/node_modules/mime-types/README.md deleted file mode 100644 index 222d2b5..0000000 --- a/node_modules/mime-types/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# mime-types - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -The ultimate javascript content-type utility. - -Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except: - -- __No fallbacks.__ Instead of naively returning the first available type, - `mime-types` simply returns `false`, so do - `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. -- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. -- No `.define()` functionality -- Bug fixes for `.lookup(path)` - -Otherwise, the API is compatible with `mime` 1.x. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install mime-types -``` - -## Note on MIME Type Data and Semver - -This package considers the programmatic api as the semver compatibility. Additionally, the package which provides the MIME data -for this package (`mime-db`) *also* considers it's programmatic api as the semver contract. This means the MIME type resolution is *not* considered -in the semver bumps. - -In the past the version of `mime-db` was pinned to give two decision points when adopting MIME data changes. This is no longer true. We still update the -`mime-db` package here as a `minor` release when necessary, but will use a `^` range going forward. This means that if you want to pin your `mime-db` data -you will need to do it in your application. While this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is -a breaking change. - -If you wish to pin your `mime-db` version you can do that with overrides via your package manager of choice. See their documentation for how to correctly configure that. - -## Adding Types - -All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), -so open a PR there if you'd like to add mime types. - -## API - -```js -var mime = require('mime-types') -``` - -All functions return `false` if input is invalid or not found. - -### mime.lookup(path) - -Lookup the content-type associated with a file. - -```js -mime.lookup('json') // 'application/json' -mime.lookup('.md') // 'text/markdown' -mime.lookup('file.html') // 'text/html' -mime.lookup('folder/file.js') // 'application/javascript' -mime.lookup('folder/.htaccess') // false - -mime.lookup('cats') // false -``` - -### mime.contentType(type) - -Create a full content-type header given a content-type or extension. -When given an extension, `mime.lookup` is used to get the matching -content-type, otherwise the given content-type is used. Then if the -content-type does not already have a `charset` parameter, `mime.charset` -is used to get the default charset and add to the returned content-type. - -```js -mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' -mime.contentType('file.json') // 'application/json; charset=utf-8' -mime.contentType('text/html') // 'text/html; charset=utf-8' -mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' - -// from a full path -mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' -``` - -### mime.extension(type) - -Get the default extension for a content-type. - -```js -mime.extension('application/octet-stream') // 'bin' -``` - -### mime.charset(type) - -Lookup the implied default charset of a content-type. - -```js -mime.charset('text/markdown') // 'UTF-8' -``` - -### var type = mime.types[extension] - -A map of content-types by extension. - -### [extensions...] = mime.extensions[type] - -A map of extensions by content-type. - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci -[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master -[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master -[node-version-image]: https://badgen.net/npm/node/mime-types -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/mime-types -[npm-url]: https://npmjs.org/package/mime-types -[npm-version-image]: https://badgen.net/npm/v/mime-types diff --git a/node_modules/mime-types/index.js b/node_modules/mime-types/index.js deleted file mode 100644 index 9725ddf..0000000 --- a/node_modules/mime-types/index.js +++ /dev/null @@ -1,211 +0,0 @@ -/*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var db = require('mime-db') -var extname = require('path').extname -var mimeScore = require('./mimeScore') - -/** - * Module variables. - * @private - */ - -var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ -var TEXT_TYPE_REGEXP = /^text\//i - -/** - * Module exports. - * @public - */ - -exports.charset = charset -exports.charsets = { lookup: charset } -exports.contentType = contentType -exports.extension = extension -exports.extensions = Object.create(null) -exports.lookup = lookup -exports.types = Object.create(null) -exports._extensionConflicts = [] - -// Populate the extensions/types maps -populateMaps(exports.extensions, exports.types) - -/** - * Get the default charset for a MIME type. - * - * @param {string} type - * @return {false|string} - */ - -function charset (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - var mime = match && db[match[1].toLowerCase()] - - if (mime && mime.charset) { - return mime.charset - } - - // default text/* to utf-8 - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return 'UTF-8' - } - - return false -} - -/** - * Create a full Content-Type header given a MIME type or extension. - * - * @param {string} str - * @return {false|string} - */ - -function contentType (str) { - // TODO: should this even be in this module? - if (!str || typeof str !== 'string') { - return false - } - - var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str - - if (!mime) { - return false - } - - // TODO: use content-type or other module - if (mime.indexOf('charset') === -1) { - var charset = exports.charset(mime) - if (charset) mime += '; charset=' + charset.toLowerCase() - } - - return mime -} - -/** - * Get the default extension for a MIME type. - * - * @param {string} type - * @return {false|string} - */ - -function extension (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - - // get extensions - var exts = match && exports.extensions[match[1].toLowerCase()] - - if (!exts || !exts.length) { - return false - } - - return exts[0] -} - -/** - * Lookup the MIME type for a file path/extension. - * - * @param {string} path - * @return {false|string} - */ - -function lookup (path) { - if (!path || typeof path !== 'string') { - return false - } - - // get the extension ("ext" or ".ext" or full path) - var extension = extname('x.' + path) - .toLowerCase() - .slice(1) - - if (!extension) { - return false - } - - return exports.types[extension] || false -} - -/** - * Populate the extensions and types maps. - * @private - */ - -function populateMaps (extensions, types) { - Object.keys(db).forEach(function forEachMimeType (type) { - var mime = db[type] - var exts = mime.extensions - - if (!exts || !exts.length) { - return - } - - // mime -> extensions - extensions[type] = exts - - // extension -> mime - for (var i = 0; i < exts.length; i++) { - var extension = exts[i] - types[extension] = _preferredType(extension, types[extension], type) - - // DELETE (eventually): Capture extension->type maps that change as a - // result of switching to mime-score. This is just to help make reviewing - // PR #119 easier, and can be removed once that PR is approved. - const legacyType = _preferredTypeLegacy( - extension, - types[extension], - type - ) - if (legacyType !== types[extension]) { - exports._extensionConflicts.push([extension, legacyType, types[extension]]) - } - } - }) -} - -// Resolve type conflict using mime-score -function _preferredType (ext, type0, type1) { - var score0 = type0 ? mimeScore(type0, db[type0].source) : 0 - var score1 = type1 ? mimeScore(type1, db[type1].source) : 0 - - return score0 > score1 ? type0 : type1 -} - -// Resolve type conflict using pre-mime-score logic -function _preferredTypeLegacy (ext, type0, type1) { - var SOURCE_RANK = ['nginx', 'apache', undefined, 'iana'] - - var score0 = type0 ? SOURCE_RANK.indexOf(db[type0].source) : 0 - var score1 = type1 ? SOURCE_RANK.indexOf(db[type1].source) : 0 - - if ( - exports.types[extension] !== 'application/octet-stream' && - (score0 > score1 || - (score0 === score1 && - exports.types[extension]?.slice(0, 12) === 'application/')) - ) { - return type0 - } - - return score0 > score1 ? type0 : type1 -} diff --git a/node_modules/mime-types/mimeScore.js b/node_modules/mime-types/mimeScore.js deleted file mode 100644 index fc2e665..0000000 --- a/node_modules/mime-types/mimeScore.js +++ /dev/null @@ -1,57 +0,0 @@ -// 'mime-score' back-ported to CommonJS - -// Score RFC facets (see https://tools.ietf.org/html/rfc6838#section-3) -var FACET_SCORES = { - 'prs.': 100, - 'x-': 200, - 'x.': 300, - 'vnd.': 400, - default: 900 -} - -// Score mime source (Logic originally from `jshttp/mime-types` module) -var SOURCE_SCORES = { - nginx: 10, - apache: 20, - iana: 40, - default: 30 // definitions added by `jshttp/mime-db` project? -} - -var TYPE_SCORES = { - // prefer application/xml over text/xml - // prefer application/rtf over text/rtf - application: 1, - - // prefer font/woff over application/font-woff - font: 2, - - // prefer video/mp4 over audio/mp4 over application/mp4 - // See https://www.rfc-editor.org/rfc/rfc4337.html#section-2 - audio: 2, - video: 3, - - default: 0 -} - -/** - * Get each component of the score for a mime type. The sum of these is the - * total score. The higher the score, the more "official" the type. - */ -module.exports = function mimeScore (mimeType, source = 'default') { - if (mimeType === 'application/octet-stream') { - return 0 - } - - const [type, subtype] = mimeType.split('/') - - const facet = subtype.replace(/(\.|x-).*/, '$1') - - const facetScore = FACET_SCORES[facet] || FACET_SCORES.default - const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default - const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default - - // All else being equal prefer shorter types - const lengthScore = 1 - mimeType.length / 100 - - return facetScore + sourceScore + typeScore + lengthScore -} diff --git a/node_modules/mime-types/package.json b/node_modules/mime-types/package.json deleted file mode 100644 index 6c58c27..0000000 --- a/node_modules/mime-types/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "mime-types", - "description": "The ultimate javascript content-type utility.", - "version": "3.0.2", - "contributors": [ - "Douglas Christopher Wilson ", - "Jeremiah Senkpiel (https://searchbeam.jit.su)", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "keywords": [ - "mime", - "types" - ], - "repository": "jshttp/mime-types", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, - "dependencies": { - "mime-db": "^1.54.0" - }, - "devDependencies": { - "eslint": "8.33.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.32.0", - "eslint-plugin-markdown": "3.0.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.6.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "10.8.2", - "nyc": "15.1.0" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js", - "mimeScore.js" - ], - "engines": { - "node": ">=18" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec test/test.js", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/node_modules/ms/index.js b/node_modules/ms/index.js deleted file mode 100644 index ea734fb..0000000 --- a/node_modules/ms/index.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function (val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} diff --git a/node_modules/ms/license.md b/node_modules/ms/license.md deleted file mode 100644 index fa5d39b..0000000 --- a/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020 Vercel, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json deleted file mode 100644 index 4997189..0000000 --- a/node_modules/ms/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "ms", - "version": "2.1.3", - "description": "Tiny millisecond conversion utility", - "repository": "vercel/ms", - "main": "./index", - "files": [ - "index.js" - ], - "scripts": { - "precommit": "lint-staged", - "lint": "eslint lib/* bin/*", - "test": "mocha tests.js" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - } - }, - "lint-staged": { - "*.js": [ - "npm run lint", - "prettier --single-quote --write", - "git add" - ] - }, - "license": "MIT", - "devDependencies": { - "eslint": "4.18.2", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1", - "prettier": "2.0.5" - } -} diff --git a/node_modules/ms/readme.md b/node_modules/ms/readme.md deleted file mode 100644 index 0fc1abb..0000000 --- a/node_modules/ms/readme.md +++ /dev/null @@ -1,59 +0,0 @@ -# ms - -![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('1y') // 31557600000 -ms('100') // 100 -ms('-3 days') // -259200000 -ms('-1h') // -3600000 -ms('-200') // -200 -``` - -### Convert from Milliseconds - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(-3 * 60000) // "-3m" -ms(ms('10 hours')) // "10h" -``` - -### Time Format Written-Out - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(-3 * 60000, { long: true }) // "-3 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -## Features - -- Works both in [Node.js](https://nodejs.org) and in the browser -- If a number is supplied to `ms`, a string with a unit is returned -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) -- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned - -## Related Packages - -- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. - -## Caught a Bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/node_modules/negotiator/HISTORY.md b/node_modules/negotiator/HISTORY.md deleted file mode 100644 index 63d537d..0000000 --- a/node_modules/negotiator/HISTORY.md +++ /dev/null @@ -1,114 +0,0 @@ -1.0.0 / 2024-08-31 -================== - - * Drop support for node <18 - * Added an option preferred encodings array #59 - -0.6.3 / 2022-01-22 -================== - - * Revert "Lazy-load modules from main entry point" - -0.6.2 / 2019-04-29 -================== - - * Fix sorting charset, encoding, and language with extra parameters - -0.6.1 / 2016-05-02 -================== - - * perf: improve `Accept` parsing speed - * perf: improve `Accept-Charset` parsing speed - * perf: improve `Accept-Encoding` parsing speed - * perf: improve `Accept-Language` parsing speed - -0.6.0 / 2015-09-29 -================== - - * Fix including type extensions in parameters in `Accept` parsing - * Fix parsing `Accept` parameters with quoted equals - * Fix parsing `Accept` parameters with quoted semicolons - * Lazy-load modules from main entry point - * perf: delay type concatenation until needed - * perf: enable strict mode - * perf: hoist regular expressions - * perf: remove closures getting spec properties - * perf: remove a closure from media type parsing - * perf: remove property delete from media type parsing - -0.5.3 / 2015-05-10 -================== - - * Fix media type parameter matching to be case-insensitive - -0.5.2 / 2015-05-06 -================== - - * Fix comparing media types with quoted values - * Fix splitting media types with quoted commas - -0.5.1 / 2015-02-14 -================== - - * Fix preference sorting to be stable for long acceptable lists - -0.5.0 / 2014-12-18 -================== - - * Fix list return order when large accepted list - * Fix missing identity encoding when q=0 exists - * Remove dynamic building of Negotiator class - -0.4.9 / 2014-10-14 -================== - - * Fix error when media type has invalid parameter - -0.4.8 / 2014-09-28 -================== - - * Fix all negotiations to be case-insensitive - * Stable sort preferences of same quality according to client order - * Support Node.js 0.6 - -0.4.7 / 2014-06-24 -================== - - * Handle invalid provided languages - * Handle invalid provided media types - -0.4.6 / 2014-06-11 -================== - - * Order by specificity when quality is the same - -0.4.5 / 2014-05-29 -================== - - * Fix regression in empty header handling - -0.4.4 / 2014-05-29 -================== - - * Fix behaviors when headers are not present - -0.4.3 / 2014-04-16 -================== - - * Handle slashes on media params correctly - -0.4.2 / 2014-02-28 -================== - - * Fix media type sorting - * Handle media types params strictly - -0.4.1 / 2014-01-16 -================== - - * Use most specific matches - -0.4.0 / 2014-01-09 -================== - - * Remove preferred prefix from methods diff --git a/node_modules/negotiator/LICENSE b/node_modules/negotiator/LICENSE deleted file mode 100644 index ea6b9e2..0000000 --- a/node_modules/negotiator/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2014 Federico Romero -Copyright (c) 2012-2014 Isaac Z. Schlueter -Copyright (c) 2014-2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/negotiator/README.md b/node_modules/negotiator/README.md deleted file mode 100644 index 6fb7f2d..0000000 --- a/node_modules/negotiator/README.md +++ /dev/null @@ -1,212 +0,0 @@ -# negotiator - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -An HTTP content negotiator for Node.js - -## Installation - -```sh -$ npm install negotiator -``` - -## API - -```js -var Negotiator = require('negotiator') -``` - -### Accept Negotiation - -```js -availableMediaTypes = ['text/html', 'text/plain', 'application/json'] - -// The negotiator constructor receives a request object -negotiator = new Negotiator(request) - -// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8' - -negotiator.mediaTypes() -// -> ['text/html', 'image/jpeg', 'application/*'] - -negotiator.mediaTypes(availableMediaTypes) -// -> ['text/html', 'application/json'] - -negotiator.mediaType(availableMediaTypes) -// -> 'text/html' -``` - -You can check a working example at `examples/accept.js`. - -#### Methods - -##### mediaType() - -Returns the most preferred media type from the client. - -##### mediaType(availableMediaType) - -Returns the most preferred media type from a list of available media types. - -##### mediaTypes() - -Returns an array of preferred media types ordered by the client preference. - -##### mediaTypes(availableMediaTypes) - -Returns an array of preferred media types ordered by priority from a list of -available media types. - -### Accept-Language Negotiation - -```js -negotiator = new Negotiator(request) - -availableLanguages = ['en', 'es', 'fr'] - -// Let's say Accept-Language header is 'en;q=0.8, es, pt' - -negotiator.languages() -// -> ['es', 'pt', 'en'] - -negotiator.languages(availableLanguages) -// -> ['es', 'en'] - -language = negotiator.language(availableLanguages) -// -> 'es' -``` - -You can check a working example at `examples/language.js`. - -#### Methods - -##### language() - -Returns the most preferred language from the client. - -##### language(availableLanguages) - -Returns the most preferred language from a list of available languages. - -##### languages() - -Returns an array of preferred languages ordered by the client preference. - -##### languages(availableLanguages) - -Returns an array of preferred languages ordered by priority from a list of -available languages. - -### Accept-Charset Negotiation - -```js -availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5'] - -negotiator = new Negotiator(request) - -// Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2' - -negotiator.charsets() -// -> ['utf-8', 'iso-8859-1', 'utf-7'] - -negotiator.charsets(availableCharsets) -// -> ['utf-8', 'iso-8859-1'] - -negotiator.charset(availableCharsets) -// -> 'utf-8' -``` - -You can check a working example at `examples/charset.js`. - -#### Methods - -##### charset() - -Returns the most preferred charset from the client. - -##### charset(availableCharsets) - -Returns the most preferred charset from a list of available charsets. - -##### charsets() - -Returns an array of preferred charsets ordered by the client preference. - -##### charsets(availableCharsets) - -Returns an array of preferred charsets ordered by priority from a list of -available charsets. - -### Accept-Encoding Negotiation - -```js -availableEncodings = ['identity', 'gzip'] - -negotiator = new Negotiator(request) - -// Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5' - -negotiator.encodings() -// -> ['gzip', 'identity', 'compress'] - -negotiator.encodings(availableEncodings) -// -> ['gzip', 'identity'] - -negotiator.encoding(availableEncodings) -// -> 'gzip' -``` - -You can check a working example at `examples/encoding.js`. - -#### Methods - -##### encoding() - -Returns the most preferred encoding from the client. - -##### encoding(availableEncodings) - -Returns the most preferred encoding from a list of available encodings. - -##### encoding(availableEncodings, { preferred }) - -Returns the most preferred encoding from a list of available encodings, while prioritizing based on `preferred` array between same-quality encodings. - -##### encodings() - -Returns an array of preferred encodings ordered by the client preference. - -##### encodings(availableEncodings) - -Returns an array of preferred encodings ordered by priority from a list of -available encodings. - -##### encodings(availableEncodings, { preferred }) - -Returns an array of preferred encodings ordered by priority from a list of -available encodings, while prioritizing based on `preferred` array between same-quality encodings. - -## See Also - -The [accepts](https://npmjs.org/package/accepts#readme) module builds on -this module and provides an alternative interface, mime type validation, -and more. - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/negotiator.svg -[npm-url]: https://npmjs.org/package/negotiator -[node-version-image]: https://img.shields.io/node/v/negotiator.svg -[node-version-url]: https://nodejs.org/en/download/ -[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master -[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg -[downloads-url]: https://npmjs.org/package/negotiator -[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/negotiator/ci/master?label=ci -[github-actions-ci-url]: https://github.com/jshttp/negotiator/actions/workflows/ci.yml diff --git a/node_modules/negotiator/index.js b/node_modules/negotiator/index.js deleted file mode 100644 index 4f51315..0000000 --- a/node_modules/negotiator/index.js +++ /dev/null @@ -1,83 +0,0 @@ -/*! - * negotiator - * Copyright(c) 2012 Federico Romero - * Copyright(c) 2012-2014 Isaac Z. Schlueter - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -var preferredCharsets = require('./lib/charset') -var preferredEncodings = require('./lib/encoding') -var preferredLanguages = require('./lib/language') -var preferredMediaTypes = require('./lib/mediaType') - -/** - * Module exports. - * @public - */ - -module.exports = Negotiator; -module.exports.Negotiator = Negotiator; - -/** - * Create a Negotiator instance from a request. - * @param {object} request - * @public - */ - -function Negotiator(request) { - if (!(this instanceof Negotiator)) { - return new Negotiator(request); - } - - this.request = request; -} - -Negotiator.prototype.charset = function charset(available) { - var set = this.charsets(available); - return set && set[0]; -}; - -Negotiator.prototype.charsets = function charsets(available) { - return preferredCharsets(this.request.headers['accept-charset'], available); -}; - -Negotiator.prototype.encoding = function encoding(available, opts) { - var set = this.encodings(available, opts); - return set && set[0]; -}; - -Negotiator.prototype.encodings = function encodings(available, options) { - var opts = options || {}; - return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred); -}; - -Negotiator.prototype.language = function language(available) { - var set = this.languages(available); - return set && set[0]; -}; - -Negotiator.prototype.languages = function languages(available) { - return preferredLanguages(this.request.headers['accept-language'], available); -}; - -Negotiator.prototype.mediaType = function mediaType(available) { - var set = this.mediaTypes(available); - return set && set[0]; -}; - -Negotiator.prototype.mediaTypes = function mediaTypes(available) { - return preferredMediaTypes(this.request.headers.accept, available); -}; - -// Backwards compatibility -Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; -Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; -Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; -Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; -Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; -Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; -Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; -Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; diff --git a/node_modules/negotiator/lib/charset.js b/node_modules/negotiator/lib/charset.js deleted file mode 100644 index cdd0148..0000000 --- a/node_modules/negotiator/lib/charset.js +++ /dev/null @@ -1,169 +0,0 @@ -/** - * negotiator - * Copyright(c) 2012 Isaac Z. Schlueter - * Copyright(c) 2014 Federico Romero - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -module.exports = preferredCharsets; -module.exports.preferredCharsets = preferredCharsets; - -/** - * Module variables. - * @private - */ - -var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; - -/** - * Parse the Accept-Charset header. - * @private - */ - -function parseAcceptCharset(accept) { - var accepts = accept.split(','); - - for (var i = 0, j = 0; i < accepts.length; i++) { - var charset = parseCharset(accepts[i].trim(), i); - - if (charset) { - accepts[j++] = charset; - } - } - - // trim accepts - accepts.length = j; - - return accepts; -} - -/** - * Parse a charset from the Accept-Charset header. - * @private - */ - -function parseCharset(str, i) { - var match = simpleCharsetRegExp.exec(str); - if (!match) return null; - - var charset = match[1]; - var q = 1; - if (match[2]) { - var params = match[2].split(';') - for (var j = 0; j < params.length; j++) { - var p = params[j].trim().split('='); - if (p[0] === 'q') { - q = parseFloat(p[1]); - break; - } - } - } - - return { - charset: charset, - q: q, - i: i - }; -} - -/** - * Get the priority of a charset. - * @private - */ - -function getCharsetPriority(charset, accepted, index) { - var priority = {o: -1, q: 0, s: 0}; - - for (var i = 0; i < accepted.length; i++) { - var spec = specify(charset, accepted[i], index); - - if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { - priority = spec; - } - } - - return priority; -} - -/** - * Get the specificity of the charset. - * @private - */ - -function specify(charset, spec, index) { - var s = 0; - if(spec.charset.toLowerCase() === charset.toLowerCase()){ - s |= 1; - } else if (spec.charset !== '*' ) { - return null - } - - return { - i: index, - o: spec.i, - q: spec.q, - s: s - } -} - -/** - * Get the preferred charsets from an Accept-Charset header. - * @public - */ - -function preferredCharsets(accept, provided) { - // RFC 2616 sec 14.2: no header = * - var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); - - if (!provided) { - // sorted list of all charsets - return accepts - .filter(isQuality) - .sort(compareSpecs) - .map(getFullCharset); - } - - var priorities = provided.map(function getPriority(type, index) { - return getCharsetPriority(type, accepts, index); - }); - - // sorted list of accepted charsets - return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { - return provided[priorities.indexOf(priority)]; - }); -} - -/** - * Compare two specs. - * @private - */ - -function compareSpecs(a, b) { - return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; -} - -/** - * Get full charset string. - * @private - */ - -function getFullCharset(spec) { - return spec.charset; -} - -/** - * Check if a spec has any quality. - * @private - */ - -function isQuality(spec) { - return spec.q > 0; -} diff --git a/node_modules/negotiator/lib/encoding.js b/node_modules/negotiator/lib/encoding.js deleted file mode 100644 index 9ebb633..0000000 --- a/node_modules/negotiator/lib/encoding.js +++ /dev/null @@ -1,205 +0,0 @@ -/** - * negotiator - * Copyright(c) 2012 Isaac Z. Schlueter - * Copyright(c) 2014 Federico Romero - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -module.exports = preferredEncodings; -module.exports.preferredEncodings = preferredEncodings; - -/** - * Module variables. - * @private - */ - -var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; - -/** - * Parse the Accept-Encoding header. - * @private - */ - -function parseAcceptEncoding(accept) { - var accepts = accept.split(','); - var hasIdentity = false; - var minQuality = 1; - - for (var i = 0, j = 0; i < accepts.length; i++) { - var encoding = parseEncoding(accepts[i].trim(), i); - - if (encoding) { - accepts[j++] = encoding; - hasIdentity = hasIdentity || specify('identity', encoding); - minQuality = Math.min(minQuality, encoding.q || 1); - } - } - - if (!hasIdentity) { - /* - * If identity doesn't explicitly appear in the accept-encoding header, - * it's added to the list of acceptable encoding with the lowest q - */ - accepts[j++] = { - encoding: 'identity', - q: minQuality, - i: i - }; - } - - // trim accepts - accepts.length = j; - - return accepts; -} - -/** - * Parse an encoding from the Accept-Encoding header. - * @private - */ - -function parseEncoding(str, i) { - var match = simpleEncodingRegExp.exec(str); - if (!match) return null; - - var encoding = match[1]; - var q = 1; - if (match[2]) { - var params = match[2].split(';'); - for (var j = 0; j < params.length; j++) { - var p = params[j].trim().split('='); - if (p[0] === 'q') { - q = parseFloat(p[1]); - break; - } - } - } - - return { - encoding: encoding, - q: q, - i: i - }; -} - -/** - * Get the priority of an encoding. - * @private - */ - -function getEncodingPriority(encoding, accepted, index) { - var priority = {encoding: encoding, o: -1, q: 0, s: 0}; - - for (var i = 0; i < accepted.length; i++) { - var spec = specify(encoding, accepted[i], index); - - if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { - priority = spec; - } - } - - return priority; -} - -/** - * Get the specificity of the encoding. - * @private - */ - -function specify(encoding, spec, index) { - var s = 0; - if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ - s |= 1; - } else if (spec.encoding !== '*' ) { - return null - } - - return { - encoding: encoding, - i: index, - o: spec.i, - q: spec.q, - s: s - } -}; - -/** - * Get the preferred encodings from an Accept-Encoding header. - * @public - */ - -function preferredEncodings(accept, provided, preferred) { - var accepts = parseAcceptEncoding(accept || ''); - - var comparator = preferred ? function comparator (a, b) { - if (a.q !== b.q) { - return b.q - a.q // higher quality first - } - - var aPreferred = preferred.indexOf(a.encoding) - var bPreferred = preferred.indexOf(b.encoding) - - if (aPreferred === -1 && bPreferred === -1) { - // consider the original specifity/order - return (b.s - a.s) || (a.o - b.o) || (a.i - b.i) - } - - if (aPreferred !== -1 && bPreferred !== -1) { - return aPreferred - bPreferred // consider the preferred order - } - - return aPreferred === -1 ? 1 : -1 // preferred first - } : compareSpecs; - - if (!provided) { - // sorted list of all encodings - return accepts - .filter(isQuality) - .sort(comparator) - .map(getFullEncoding); - } - - var priorities = provided.map(function getPriority(type, index) { - return getEncodingPriority(type, accepts, index); - }); - - // sorted list of accepted encodings - return priorities.filter(isQuality).sort(comparator).map(function getEncoding(priority) { - return provided[priorities.indexOf(priority)]; - }); -} - -/** - * Compare two specs. - * @private - */ - -function compareSpecs(a, b) { - return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i); -} - -/** - * Get full encoding string. - * @private - */ - -function getFullEncoding(spec) { - return spec.encoding; -} - -/** - * Check if a spec has any quality. - * @private - */ - -function isQuality(spec) { - return spec.q > 0; -} diff --git a/node_modules/negotiator/lib/language.js b/node_modules/negotiator/lib/language.js deleted file mode 100644 index a231672..0000000 --- a/node_modules/negotiator/lib/language.js +++ /dev/null @@ -1,179 +0,0 @@ -/** - * negotiator - * Copyright(c) 2012 Isaac Z. Schlueter - * Copyright(c) 2014 Federico Romero - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -module.exports = preferredLanguages; -module.exports.preferredLanguages = preferredLanguages; - -/** - * Module variables. - * @private - */ - -var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; - -/** - * Parse the Accept-Language header. - * @private - */ - -function parseAcceptLanguage(accept) { - var accepts = accept.split(','); - - for (var i = 0, j = 0; i < accepts.length; i++) { - var language = parseLanguage(accepts[i].trim(), i); - - if (language) { - accepts[j++] = language; - } - } - - // trim accepts - accepts.length = j; - - return accepts; -} - -/** - * Parse a language from the Accept-Language header. - * @private - */ - -function parseLanguage(str, i) { - var match = simpleLanguageRegExp.exec(str); - if (!match) return null; - - var prefix = match[1] - var suffix = match[2] - var full = prefix - - if (suffix) full += "-" + suffix; - - var q = 1; - if (match[3]) { - var params = match[3].split(';') - for (var j = 0; j < params.length; j++) { - var p = params[j].split('='); - if (p[0] === 'q') q = parseFloat(p[1]); - } - } - - return { - prefix: prefix, - suffix: suffix, - q: q, - i: i, - full: full - }; -} - -/** - * Get the priority of a language. - * @private - */ - -function getLanguagePriority(language, accepted, index) { - var priority = {o: -1, q: 0, s: 0}; - - for (var i = 0; i < accepted.length; i++) { - var spec = specify(language, accepted[i], index); - - if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { - priority = spec; - } - } - - return priority; -} - -/** - * Get the specificity of the language. - * @private - */ - -function specify(language, spec, index) { - var p = parseLanguage(language) - if (!p) return null; - var s = 0; - if(spec.full.toLowerCase() === p.full.toLowerCase()){ - s |= 4; - } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { - s |= 2; - } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) { - s |= 1; - } else if (spec.full !== '*' ) { - return null - } - - return { - i: index, - o: spec.i, - q: spec.q, - s: s - } -}; - -/** - * Get the preferred languages from an Accept-Language header. - * @public - */ - -function preferredLanguages(accept, provided) { - // RFC 2616 sec 14.4: no header = * - var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); - - if (!provided) { - // sorted list of all languages - return accepts - .filter(isQuality) - .sort(compareSpecs) - .map(getFullLanguage); - } - - var priorities = provided.map(function getPriority(type, index) { - return getLanguagePriority(type, accepts, index); - }); - - // sorted list of accepted languages - return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { - return provided[priorities.indexOf(priority)]; - }); -} - -/** - * Compare two specs. - * @private - */ - -function compareSpecs(a, b) { - return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; -} - -/** - * Get full language string. - * @private - */ - -function getFullLanguage(spec) { - return spec.full; -} - -/** - * Check if a spec has any quality. - * @private - */ - -function isQuality(spec) { - return spec.q > 0; -} diff --git a/node_modules/negotiator/lib/mediaType.js b/node_modules/negotiator/lib/mediaType.js deleted file mode 100644 index 8e402ea..0000000 --- a/node_modules/negotiator/lib/mediaType.js +++ /dev/null @@ -1,294 +0,0 @@ -/** - * negotiator - * Copyright(c) 2012 Isaac Z. Schlueter - * Copyright(c) 2014 Federico Romero - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -module.exports = preferredMediaTypes; -module.exports.preferredMediaTypes = preferredMediaTypes; - -/** - * Module variables. - * @private - */ - -var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; - -/** - * Parse the Accept header. - * @private - */ - -function parseAccept(accept) { - var accepts = splitMediaTypes(accept); - - for (var i = 0, j = 0; i < accepts.length; i++) { - var mediaType = parseMediaType(accepts[i].trim(), i); - - if (mediaType) { - accepts[j++] = mediaType; - } - } - - // trim accepts - accepts.length = j; - - return accepts; -} - -/** - * Parse a media type from the Accept header. - * @private - */ - -function parseMediaType(str, i) { - var match = simpleMediaTypeRegExp.exec(str); - if (!match) return null; - - var params = Object.create(null); - var q = 1; - var subtype = match[2]; - var type = match[1]; - - if (match[3]) { - var kvps = splitParameters(match[3]).map(splitKeyValuePair); - - for (var j = 0; j < kvps.length; j++) { - var pair = kvps[j]; - var key = pair[0].toLowerCase(); - var val = pair[1]; - - // get the value, unwrapping quotes - var value = val && val[0] === '"' && val[val.length - 1] === '"' - ? val.slice(1, -1) - : val; - - if (key === 'q') { - q = parseFloat(value); - break; - } - - // store parameter - params[key] = value; - } - } - - return { - type: type, - subtype: subtype, - params: params, - q: q, - i: i - }; -} - -/** - * Get the priority of a media type. - * @private - */ - -function getMediaTypePriority(type, accepted, index) { - var priority = {o: -1, q: 0, s: 0}; - - for (var i = 0; i < accepted.length; i++) { - var spec = specify(type, accepted[i], index); - - if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { - priority = spec; - } - } - - return priority; -} - -/** - * Get the specificity of the media type. - * @private - */ - -function specify(type, spec, index) { - var p = parseMediaType(type); - var s = 0; - - if (!p) { - return null; - } - - if(spec.type.toLowerCase() == p.type.toLowerCase()) { - s |= 4 - } else if(spec.type != '*') { - return null; - } - - if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { - s |= 2 - } else if(spec.subtype != '*') { - return null; - } - - var keys = Object.keys(spec.params); - if (keys.length > 0) { - if (keys.every(function (k) { - return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase(); - })) { - s |= 1 - } else { - return null - } - } - - return { - i: index, - o: spec.i, - q: spec.q, - s: s, - } -} - -/** - * Get the preferred media types from an Accept header. - * @public - */ - -function preferredMediaTypes(accept, provided) { - // RFC 2616 sec 14.2: no header = */* - var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); - - if (!provided) { - // sorted list of all types - return accepts - .filter(isQuality) - .sort(compareSpecs) - .map(getFullType); - } - - var priorities = provided.map(function getPriority(type, index) { - return getMediaTypePriority(type, accepts, index); - }); - - // sorted list of accepted types - return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { - return provided[priorities.indexOf(priority)]; - }); -} - -/** - * Compare two specs. - * @private - */ - -function compareSpecs(a, b) { - return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; -} - -/** - * Get full type string. - * @private - */ - -function getFullType(spec) { - return spec.type + '/' + spec.subtype; -} - -/** - * Check if a spec has any quality. - * @private - */ - -function isQuality(spec) { - return spec.q > 0; -} - -/** - * Count the number of quotes in a string. - * @private - */ - -function quoteCount(string) { - var count = 0; - var index = 0; - - while ((index = string.indexOf('"', index)) !== -1) { - count++; - index++; - } - - return count; -} - -/** - * Split a key value pair. - * @private - */ - -function splitKeyValuePair(str) { - var index = str.indexOf('='); - var key; - var val; - - if (index === -1) { - key = str; - } else { - key = str.slice(0, index); - val = str.slice(index + 1); - } - - return [key, val]; -} - -/** - * Split an Accept header into media types. - * @private - */ - -function splitMediaTypes(accept) { - var accepts = accept.split(','); - - for (var i = 1, j = 0; i < accepts.length; i++) { - if (quoteCount(accepts[j]) % 2 == 0) { - accepts[++j] = accepts[i]; - } else { - accepts[j] += ',' + accepts[i]; - } - } - - // trim accepts - accepts.length = j + 1; - - return accepts; -} - -/** - * Split a string of parameters. - * @private - */ - -function splitParameters(str) { - var parameters = str.split(';'); - - for (var i = 1, j = 0; i < parameters.length; i++) { - if (quoteCount(parameters[j]) % 2 == 0) { - parameters[++j] = parameters[i]; - } else { - parameters[j] += ';' + parameters[i]; - } - } - - // trim parameters - parameters.length = j + 1; - - for (var i = 0; i < parameters.length; i++) { - parameters[i] = parameters[i].trim(); - } - - return parameters; -} diff --git a/node_modules/negotiator/package.json b/node_modules/negotiator/package.json deleted file mode 100644 index e4bdc1e..0000000 --- a/node_modules/negotiator/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "negotiator", - "description": "HTTP content negotiation", - "version": "1.0.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Federico Romero ", - "Isaac Z. Schlueter (http://blog.izs.me/)" - ], - "license": "MIT", - "keywords": [ - "http", - "content negotiation", - "accept", - "accept-language", - "accept-encoding", - "accept-charset" - ], - "repository": "jshttp/negotiator", - "devDependencies": { - "eslint": "7.32.0", - "eslint-plugin-markdown": "2.2.1", - "mocha": "9.1.3", - "nyc": "15.1.0" - }, - "files": [ - "lib/", - "HISTORY.md", - "LICENSE", - "index.js", - "README.md" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --check-leaks --bail test/", - "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js deleted file mode 100644 index 0930cf8..0000000 --- a/node_modules/object-assign/index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/object-assign/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json deleted file mode 100644 index 503eb1e..0000000 --- a/node_modules/object-assign/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "object-assign", - "version": "4.1.1", - "description": "ES2015 `Object.assign()` ponyfill", - "license": "MIT", - "repository": "sindresorhus/object-assign", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && ava", - "bench": "matcha bench.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "devDependencies": { - "ava": "^0.16.0", - "lodash": "^4.16.4", - "matcha": "^0.7.0", - "xo": "^0.16.0" - } -} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md deleted file mode 100644 index 1be09d3..0000000 --- a/node_modules/object-assign/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) - - -## Use the built-in - -Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), -support `Object.assign()` :tada:. If you target only those environments, then by all -means, use `Object.assign()` instead of this package. - - -## Install - -``` -$ npm install --save object-assign -``` - - -## Usage - -```js -const objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## Related - -- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/object-inspect/.eslintrc b/node_modules/object-inspect/.eslintrc deleted file mode 100644 index 21f9039..0000000 --- a/node_modules/object-inspect/.eslintrc +++ /dev/null @@ -1,53 +0,0 @@ -{ - "root": true, - "extends": "@ljharb", - "rules": { - "complexity": 0, - "func-style": [2, "declaration"], - "indent": [2, 4], - "max-lines": 1, - "max-lines-per-function": 1, - "max-params": [2, 4], - "max-statements": 0, - "max-statements-per-line": [2, { "max": 2 }], - "no-magic-numbers": 0, - "no-param-reassign": 1, - "strict": 0, // TODO - }, - "overrides": [ - { - "files": ["test/**", "test-*", "example/**"], - "extends": "@ljharb/eslint-config/tests", - "rules": { - "id-length": 0, - }, - }, - { - "files": ["example/**"], - "rules": { - "no-console": 0, - }, - }, - { - "files": ["test/browser/**"], - "env": { - "browser": true, - }, - }, - { - "files": ["test/bigint*"], - "rules": { - "new-cap": [2, { "capIsNewExceptions": ["BigInt"] }], - }, - }, - { - "files": "index.js", - "globals": { - "HTMLElement": false, - }, - "rules": { - "no-use-before-define": 1, - }, - }, - ], -} diff --git a/node_modules/object-inspect/.github/FUNDING.yml b/node_modules/object-inspect/.github/FUNDING.yml deleted file mode 100644 index 730276b..0000000 --- a/node_modules/object-inspect/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/object-inspect -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/object-inspect/.nycrc b/node_modules/object-inspect/.nycrc deleted file mode 100644 index 58a5db7..0000000 --- a/node_modules/object-inspect/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "instrumentation": false, - "sourceMap": false, - "reporter": ["text-summary", "text", "html", "json"], - "exclude": [ - "coverage", - "example", - "test", - "test-core-js.js" - ] -} diff --git a/node_modules/object-inspect/CHANGELOG.md b/node_modules/object-inspect/CHANGELOG.md deleted file mode 100644 index bdf9002..0000000 --- a/node_modules/object-inspect/CHANGELOG.md +++ /dev/null @@ -1,424 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.13.4](https://github.com/inspect-js/object-inspect/compare/v1.13.3...v1.13.4) - 2025-02-04 - -### Commits - -- [Fix] avoid being fooled by a `Symbol.toStringTag` [`fa5870d`](https://github.com/inspect-js/object-inspect/commit/fa5870da468a525d2f20193700f70752f506cbf7) -- [Tests] fix tests in node v6.0 - v6.4 [`2abfe1b`](https://github.com/inspect-js/object-inspect/commit/2abfe1bc3c69f9293c07c5cd65a9d7d87a628b84) -- [Dev Deps] update `es-value-fixtures`, `for-each`, `has-symbols` [`3edfb01`](https://github.com/inspect-js/object-inspect/commit/3edfb01cc8cce220fba0dfdfe2dc8bc955758cdd) - -## [v1.13.3](https://github.com/inspect-js/object-inspect/compare/v1.13.2...v1.13.3) - 2024-11-09 - -### Commits - -- [actions] split out node 10-20, and 20+ [`44395a8`](https://github.com/inspect-js/object-inspect/commit/44395a8fc1deda6718a5e125e86b9ffcaa1c7580) -- [Fix] `quoteStyle`: properly escape only the containing quotes [`5137f8f`](https://github.com/inspect-js/object-inspect/commit/5137f8f7bea69a7fc671bb683fd35f244f38fc52) -- [Refactor] clean up `quoteStyle` code [`450680c`](https://github.com/inspect-js/object-inspect/commit/450680cd50de4e689ee3b8e1d6db3a1bcf3fc18c) -- [Tests] add `quoteStyle` escaping tests [`e997c59`](https://github.com/inspect-js/object-inspect/commit/e997c595aeaea84fd98ca35d7e1c3b5ab3ae26e0) -- [Dev Deps] update `auto-changelog`, `es-value-fixtures`, `tape` [`d5a469c`](https://github.com/inspect-js/object-inspect/commit/d5a469c99ec07ccaeafc36ac4b36a93285086d48) -- [Tests] replace `aud` with `npm audit` [`fb7815f`](https://github.com/inspect-js/object-inspect/commit/fb7815f9b72cae277a04f65bbb0543f85b88be62) -- [Dev Deps] update `mock-property` [`11c817b`](https://github.com/inspect-js/object-inspect/commit/11c817bf10392aa017755962ba6bc89d731359ee) - -## [v1.13.2](https://github.com/inspect-js/object-inspect/compare/v1.13.1...v1.13.2) - 2024-06-21 - -### Commits - -- [readme] update badges [`8a51e6b`](https://github.com/inspect-js/object-inspect/commit/8a51e6bedaf389ec40cc4659e9df53e8543d176e) -- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`ef05f58`](https://github.com/inspect-js/object-inspect/commit/ef05f58c9761a41416ab907299bf0fa79517014b) -- [Dev Deps] update `error-cause`, `has-tostringtag`, `tape` [`c0c6c26`](https://github.com/inspect-js/object-inspect/commit/c0c6c26c44cee6671f7c5d43d2b91d27c5c00d90) -- [Fix] Don't throw when `global` is not defined [`d4d0965`](https://github.com/inspect-js/object-inspect/commit/d4d096570f7dbd0e03266a96de11d05eb7b63e0f) -- [meta] add missing `engines.node` [`17a352a`](https://github.com/inspect-js/object-inspect/commit/17a352af6fe1ba6b70a19081674231eb1a50c940) -- [Dev Deps] update `globalthis` [`9c08884`](https://github.com/inspect-js/object-inspect/commit/9c08884aa662a149e2f11403f413927736b97da7) -- [Dev Deps] update `error-cause` [`6af352d`](https://github.com/inspect-js/object-inspect/commit/6af352d7c3929a4cc4c55768c27bf547a5e900f4) -- [Dev Deps] update `npmignore` [`94e617d`](https://github.com/inspect-js/object-inspect/commit/94e617d38831722562fa73dff4c895746861d267) -- [Dev Deps] update `mock-property` [`2ac24d7`](https://github.com/inspect-js/object-inspect/commit/2ac24d7e58cd388ad093c33249e413e05bbfd6c3) -- [Dev Deps] update `tape` [`46125e5`](https://github.com/inspect-js/object-inspect/commit/46125e58f1d1dcfb170ed3d1ea69da550ea8d77b) - -## [v1.13.1](https://github.com/inspect-js/object-inspect/compare/v1.13.0...v1.13.1) - 2023-10-19 - -### Commits - -- [Fix] in IE 8, global can !== window despite them being prototypes of each other [`30d0859`](https://github.com/inspect-js/object-inspect/commit/30d0859dc4606cf75c2410edcd5d5c6355f8d372) - -## [v1.13.0](https://github.com/inspect-js/object-inspect/compare/v1.12.3...v1.13.0) - 2023-10-14 - -### Commits - -- [New] add special handling for the global object [`431bab2`](https://github.com/inspect-js/object-inspect/commit/431bab21a490ee51d35395966a504501e8c685da) -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`fd4f619`](https://github.com/inspect-js/object-inspect/commit/fd4f6193562b4b0e95dcf5c0201b4e8cbbc4f58d) -- [Dev Deps] update `mock-property`, `tape` [`b453f6c`](https://github.com/inspect-js/object-inspect/commit/b453f6ceeebf8a1b738a1029754092e0367a4134) -- [Dev Deps] update `error-cause` [`e8ffc57`](https://github.com/inspect-js/object-inspect/commit/e8ffc577d73b92bb6a4b00c44f14e3319e374888) -- [Dev Deps] update `tape` [`054b8b9`](https://github.com/inspect-js/object-inspect/commit/054b8b9b98633284cf989e582450ebfbbe53503c) -- [Dev Deps] temporarily remove `aud` due to breaking change in transitive deps [`2476845`](https://github.com/inspect-js/object-inspect/commit/2476845e0678dd290c541c81cd3dec8420782c52) -- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` [`383fa5e`](https://github.com/inspect-js/object-inspect/commit/383fa5eebc0afd705cc778a4b49d8e26452e49a8) -- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 [`68c244c`](https://github.com/inspect-js/object-inspect/commit/68c244c5174cdd877e5dcb8ee90aa3f44b2f25be) - -## [v1.12.3](https://github.com/inspect-js/object-inspect/compare/v1.12.2...v1.12.3) - 2023-01-12 - -### Commits - -- [Fix] in eg FF 24, collections lack forEach [`75fc226`](https://github.com/inspect-js/object-inspect/commit/75fc22673c82d45f28322b1946bb0eb41b672b7f) -- [actions] update rebase action to use reusable workflow [`250a277`](https://github.com/inspect-js/object-inspect/commit/250a277a095e9dacc029ab8454dcfc15de549dcd) -- [Dev Deps] update `aud`, `es-value-fixtures`, `tape` [`66a19b3`](https://github.com/inspect-js/object-inspect/commit/66a19b3209ccc3c5ef4b34c3cb0160e65d1ce9d5) -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `error-cause` [`c43d332`](https://github.com/inspect-js/object-inspect/commit/c43d3324b48384a16fd3dc444e5fc589d785bef3) -- [Tests] add `@pkgjs/support` to `postlint` [`e2618d2`](https://github.com/inspect-js/object-inspect/commit/e2618d22a7a3fa361b6629b53c1752fddc9c4d80) - -## [v1.12.2](https://github.com/inspect-js/object-inspect/compare/v1.12.1...v1.12.2) - 2022-05-26 - -### Commits - -- [Fix] use `util.inspect` for a custom inspection symbol method [`e243bf2`](https://github.com/inspect-js/object-inspect/commit/e243bf2eda6c4403ac6f1146fddb14d12e9646c1) -- [meta] add support info [`ca20ba3`](https://github.com/inspect-js/object-inspect/commit/ca20ba35713c17068ca912a86c542f5e8acb656c) -- [Fix] ignore `cause` in node v16.9 and v16.10 where it has a bug [`86aa553`](https://github.com/inspect-js/object-inspect/commit/86aa553a4a455562c2c56f1540f0bf857b9d314b) - -## [v1.12.1](https://github.com/inspect-js/object-inspect/compare/v1.12.0...v1.12.1) - 2022-05-21 - -### Commits - -- [Tests] use `mock-property` [`4ec8893`](https://github.com/inspect-js/object-inspect/commit/4ec8893ea9bfd28065ca3638cf6762424bf44352) -- [meta] use `npmignore` to autogenerate an npmignore file [`07f868c`](https://github.com/inspect-js/object-inspect/commit/07f868c10bd25a9d18686528339bb749c211fc9a) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b05244b`](https://github.com/inspect-js/object-inspect/commit/b05244b4f331e00c43b3151bc498041be77ccc91) -- [Dev Deps] update `@ljharb/eslint-config`, `error-cause`, `es-value-fixtures`, `functions-have-names`, `tape` [`d037398`](https://github.com/inspect-js/object-inspect/commit/d037398dcc5d531532e4c19c4a711ed677f579c1) -- [Fix] properly handle callable regexes in older engines [`848fe48`](https://github.com/inspect-js/object-inspect/commit/848fe48bd6dd0064ba781ee6f3c5e54a94144c37) - -## [v1.12.0](https://github.com/inspect-js/object-inspect/compare/v1.11.1...v1.12.0) - 2021-12-18 - -### Commits - -- [New] add `numericSeparator` boolean option [`2d2d537`](https://github.com/inspect-js/object-inspect/commit/2d2d537f5359a4300ce1c10241369f8024f89e11) -- [Robustness] cache more prototype methods [`191533d`](https://github.com/inspect-js/object-inspect/commit/191533da8aec98a05eadd73a5a6e979c9c8653e8) -- [New] ensure an Error’s `cause` is displayed [`53bc2ce`](https://github.com/inspect-js/object-inspect/commit/53bc2cee4e5a9cc4986f3cafa22c0685f340715e) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`bc164b6`](https://github.com/inspect-js/object-inspect/commit/bc164b6e2e7d36b263970f16f54de63048b84a36) -- [Robustness] cache `RegExp.prototype.test` [`a314ab8`](https://github.com/inspect-js/object-inspect/commit/a314ab8271b905cbabc594c82914d2485a8daf12) -- [meta] fix auto-changelog settings [`5ed0983`](https://github.com/inspect-js/object-inspect/commit/5ed0983be72f73e32e2559997517a95525c7e20d) - -## [v1.11.1](https://github.com/inspect-js/object-inspect/compare/v1.11.0...v1.11.1) - 2021-12-05 - -### Commits - -- [meta] add `auto-changelog` [`7dbdd22`](https://github.com/inspect-js/object-inspect/commit/7dbdd228401d6025d8b7391476d88aee9ea9bbdf) -- [actions] reuse common workflows [`c8823bc`](https://github.com/inspect-js/object-inspect/commit/c8823bc0a8790729680709d45fb6e652432e91aa) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`7532b12`](https://github.com/inspect-js/object-inspect/commit/7532b120598307497b712890f75af8056f6d37a6) -- [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`94abb5d`](https://github.com/inspect-js/object-inspect/commit/94abb5d4e745bf33253942dea86b3e538d2ff6c6) -- [actions] update codecov uploader [`5ed5102`](https://github.com/inspect-js/object-inspect/commit/5ed51025267a00e53b1341357315490ac4eb0874) -- [Dev Deps] update `eslint`, `tape` [`37b2ad2`](https://github.com/inspect-js/object-inspect/commit/37b2ad26c08d94bfd01d5d07069a0b28ef4e2ad7) -- [meta] add `sideEffects` flag [`d341f90`](https://github.com/inspect-js/object-inspect/commit/d341f905ef8bffa6a694cda6ddc5ba343532cd4f) - -## [v1.11.0](https://github.com/inspect-js/object-inspect/compare/v1.10.3...v1.11.0) - 2021-07-12 - -### Commits - -- [New] `customInspect`: add `symbol` option, to mimic modern util.inspect behavior [`e973a6e`](https://github.com/inspect-js/object-inspect/commit/e973a6e21f8140c5837cf25e9d89bdde88dc3120) -- [Dev Deps] update `eslint` [`05f1cb3`](https://github.com/inspect-js/object-inspect/commit/05f1cb3cbcfe1f238e8b51cf9bc294305b7ed793) - -## [v1.10.3](https://github.com/inspect-js/object-inspect/compare/v1.10.2...v1.10.3) - 2021-05-07 - -### Commits - -- [Fix] handle core-js Symbol shams [`4acfc2c`](https://github.com/inspect-js/object-inspect/commit/4acfc2c4b503498759120eb517abad6d51c9c5d6) -- [readme] update badges [`95c323a`](https://github.com/inspect-js/object-inspect/commit/95c323ad909d6cbabb95dd6015c190ba6db9c1f2) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`cb38f48`](https://github.com/inspect-js/object-inspect/commit/cb38f485de6ec7a95109b5a9bbd0a1deba2f6611) - -## [v1.10.2](https://github.com/inspect-js/object-inspect/compare/v1.10.1...v1.10.2) - 2021-04-17 - -### Commits - -- [Fix] use a robust check for a boxed Symbol [`87f12d6`](https://github.com/inspect-js/object-inspect/commit/87f12d6e69ce530be04659c81a4cd502943acac5) - -## [v1.10.1](https://github.com/inspect-js/object-inspect/compare/v1.10.0...v1.10.1) - 2021-04-17 - -### Commits - -- [Fix] use a robust check for a boxed bigint [`d5ca829`](https://github.com/inspect-js/object-inspect/commit/d5ca8298b6d2e5c7b9334a5b21b96ed95d225c91) - -## [v1.10.0](https://github.com/inspect-js/object-inspect/compare/v1.9.0...v1.10.0) - 2021-04-17 - -### Commits - -- [Tests] increase coverage [`d8abb8a`](https://github.com/inspect-js/object-inspect/commit/d8abb8a62c2f084919df994a433b346e0d87a227) -- [actions] use `node/install` instead of `node/run`; use `codecov` action [`4bfec2e`](https://github.com/inspect-js/object-inspect/commit/4bfec2e30aaef6ddef6cbb1448306f9f8b9520b7) -- [New] respect `Symbol.toStringTag` on objects [`799b58f`](https://github.com/inspect-js/object-inspect/commit/799b58f536a45e4484633a8e9daeb0330835f175) -- [Fix] do not allow Symbol.toStringTag to masquerade as builtins [`d6c5b37`](https://github.com/inspect-js/object-inspect/commit/d6c5b37d7e94427796b82432fb0c8964f033a6ab) -- [New] add `WeakRef` support [`b6d898e`](https://github.com/inspect-js/object-inspect/commit/b6d898ee21868c780a7ee66b28532b5b34ed7f09) -- [meta] do not publish github action workflow files [`918cdfc`](https://github.com/inspect-js/object-inspect/commit/918cdfc4b6fe83f559ff6ef04fe66201e3ff5cbd) -- [meta] create `FUNDING.yml` [`0bb5fc5`](https://github.com/inspect-js/object-inspect/commit/0bb5fc516dbcd2cd728bd89cee0b580acc5ce301) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`22c8dc0`](https://github.com/inspect-js/object-inspect/commit/22c8dc0cac113d70f4781e49a950070923a671be) -- [meta] use `prepublishOnly` script for npm 7+ [`e52ee09`](https://github.com/inspect-js/object-inspect/commit/e52ee09e8050b8dbac94ef57f786675567728223) -- [Dev Deps] update `eslint` [`7c4e6fd`](https://github.com/inspect-js/object-inspect/commit/7c4e6fdedcd27cc980e13c9ad834d05a96f3d40c) - -## [v1.9.0](https://github.com/inspect-js/object-inspect/compare/v1.8.0...v1.9.0) - 2020-11-30 - -### Commits - -- [Tests] migrate tests to Github Actions [`d262251`](https://github.com/inspect-js/object-inspect/commit/d262251e13e16d3490b5473672f6b6d6ff86675d) -- [New] add enumerable own Symbols to plain object output [`ee60c03`](https://github.com/inspect-js/object-inspect/commit/ee60c033088cff9d33baa71e59a362a541b48284) -- [Tests] add passing tests [`01ac3e4`](https://github.com/inspect-js/object-inspect/commit/01ac3e4b5a30f97875a63dc9b1416b3bd626afc9) -- [actions] add "Require Allow Edits" action [`c2d7746`](https://github.com/inspect-js/object-inspect/commit/c2d774680cde4ca4af332d84d4121b26f798ba9e) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `core-js` [`70058de`](https://github.com/inspect-js/object-inspect/commit/70058de1579fc54d1d15ed6c2dbe246637ce70ff) -- [Fix] hex characters in strings should be uppercased, to match node `assert` [`6ab8faa`](https://github.com/inspect-js/object-inspect/commit/6ab8faaa0abc08fe7a8e2afd8b39c6f1f0e00113) -- [Tests] run `nyc` on all tests [`4c47372`](https://github.com/inspect-js/object-inspect/commit/4c473727879ddc8e28b599202551ddaaf07b6210) -- [Tests] node 0.8 has an unpredictable property order; fix `groups` test by removing property [`f192069`](https://github.com/inspect-js/object-inspect/commit/f192069a978a3b60e6f0e0d45ac7df260ab9a778) -- [New] add enumerable properties to Function inspect result, per node’s `assert` [`fd38e1b`](https://github.com/inspect-js/object-inspect/commit/fd38e1bc3e2a1dc82091ce3e021917462eee64fc) -- [Tests] fix tests for node < 10, due to regex match `groups` [`2ac6462`](https://github.com/inspect-js/object-inspect/commit/2ac6462cc4f72eaa0b63a8cfee9aabe3008b2330) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`44b59e2`](https://github.com/inspect-js/object-inspect/commit/44b59e2676a7f825ef530dfd19dafb599e3b9456) -- [Robustness] cache `Symbol.prototype.toString` [`f3c2074`](https://github.com/inspect-js/object-inspect/commit/f3c2074d8f32faf8292587c07c9678ea931703dd) -- [Dev Deps] update `eslint` [`9411294`](https://github.com/inspect-js/object-inspect/commit/94112944b9245e3302e25453277876402d207e7f) -- [meta] `require-allow-edits` no longer requires an explicit github token [`36c0220`](https://github.com/inspect-js/object-inspect/commit/36c02205de3c2b0e84d53777c5c9fd54a36c48ab) -- [actions] update rebase checkout action to v2 [`55a39a6`](https://github.com/inspect-js/object-inspect/commit/55a39a64e944f19c6a7d8efddf3df27700f20d14) -- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`f59fd3c`](https://github.com/inspect-js/object-inspect/commit/f59fd3cf406c3a7c7ece140904a80bbc6bacfcca) -- [Dev Deps] update `eslint` [`a492bec`](https://github.com/inspect-js/object-inspect/commit/a492becec644b0155c9c4bc1caf6f9fac11fb2c7) - -## [v1.8.0](https://github.com/inspect-js/object-inspect/compare/v1.7.0...v1.8.0) - 2020-06-18 - -### Fixed - -- [New] add `indent` option [`#27`](https://github.com/inspect-js/object-inspect/issues/27) - -### Commits - -- [Tests] add codecov [`4324cbb`](https://github.com/inspect-js/object-inspect/commit/4324cbb1a2bd7710822a4151ff373570db22453e) -- [New] add `maxStringLength` option [`b3995cb`](https://github.com/inspect-js/object-inspect/commit/b3995cb71e15b5ee127a3094c43994df9d973502) -- [New] add `customInspect` option, to disable custom inspect methods [`28b9179`](https://github.com/inspect-js/object-inspect/commit/28b9179ee802bb3b90810100c11637db90c2fb6d) -- [Tests] add Date and RegExp tests [`3b28eca`](https://github.com/inspect-js/object-inspect/commit/3b28eca57b0367aeadffac604ea09e8bdae7d97b) -- [actions] add automatic rebasing / merge commit blocking [`0d9c6c0`](https://github.com/inspect-js/object-inspect/commit/0d9c6c044e83475ff0bfffb9d35b149834c83a2e) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape`; add `aud` [`7c204f2`](https://github.com/inspect-js/object-inspect/commit/7c204f22b9e41bc97147f4d32d4cb045b17769a6) -- [readme] fix repo URLs, remove testling [`34ca9a0`](https://github.com/inspect-js/object-inspect/commit/34ca9a0dabfe75bd311f806a326fadad029909a3) -- [Fix] when truncating a deep array, note it as `[Array]` instead of just `[Object]` [`f74c82d`](https://github.com/inspect-js/object-inspect/commit/f74c82dd0b35386445510deb250f34c41be3ec0e) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`1a8a5ea`](https://github.com/inspect-js/object-inspect/commit/1a8a5ea069ea2bee89d77caedad83ffa23d35711) -- [Fix] do not be fooled by a function’s own `toString` method [`7cb5c65`](https://github.com/inspect-js/object-inspect/commit/7cb5c657a976f94715c19c10556a30f15bb7d5d7) -- [patch] indicate explicitly that anon functions are anonymous, to match node [`81ebdd4`](https://github.com/inspect-js/object-inspect/commit/81ebdd4215005144074bbdff3f6bafa01407910a) -- [Dev Deps] loosen the `core-js` dep [`e7472e8`](https://github.com/inspect-js/object-inspect/commit/e7472e8e242117670560bd995830c2a4d12080f5) -- [Dev Deps] update `tape` [`699827e`](https://github.com/inspect-js/object-inspect/commit/699827e6b37258b5203c33c78c009bf4b0e6a66d) -- [meta] add `safe-publish-latest` [`c5d2868`](https://github.com/inspect-js/object-inspect/commit/c5d2868d6eb33c472f37a20f89ceef2787046088) -- [Dev Deps] update `@ljharb/eslint-config` [`9199501`](https://github.com/inspect-js/object-inspect/commit/919950195d486114ccebacbdf9d74d7f382693b0) - -## [v1.7.0](https://github.com/inspect-js/object-inspect/compare/v1.6.0...v1.7.0) - 2019-11-10 - -### Commits - -- [Tests] use shared travis-ci configs [`19899ed`](https://github.com/inspect-js/object-inspect/commit/19899edbf31f4f8809acf745ce34ad1ce1bfa63b) -- [Tests] add linting [`a00f057`](https://github.com/inspect-js/object-inspect/commit/a00f057d917f66ea26dd37769c6b810ec4af97e8) -- [Tests] lint last file [`2698047`](https://github.com/inspect-js/object-inspect/commit/2698047b58af1e2e88061598ef37a75f228dddf6) -- [Tests] up to `node` `v12.7`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`589e87a`](https://github.com/inspect-js/object-inspect/commit/589e87a99cadcff4b600e6a303418e9d922836e8) -- [New] add support for `WeakMap` and `WeakSet` [`3ddb3e4`](https://github.com/inspect-js/object-inspect/commit/3ddb3e4e0c8287130c61a12e0ed9c104b1549306) -- [meta] clean up license so github can detect it properly [`27527bb`](https://github.com/inspect-js/object-inspect/commit/27527bb801520c9610c68cc3b55d6f20a2bee56d) -- [Tests] cover `util.inspect.custom` [`36d47b9`](https://github.com/inspect-js/object-inspect/commit/36d47b9c59056a57ef2f1491602c726359561800) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape` [`b614eaa`](https://github.com/inspect-js/object-inspect/commit/b614eaac901da0e5c69151f534671f990a94cace) -- [Tests] fix coverage thresholds [`7b7b176`](https://github.com/inspect-js/object-inspect/commit/7b7b176e15f8bd6e8b2f261ff5a493c2fe78d9c2) -- [Tests] bigint tests now can run on unflagged node [`063af31`](https://github.com/inspect-js/object-inspect/commit/063af31ce9cd13c202e3b67c07ba06dc9b7c0f81) -- [Refactor] add early bailout to `isMap` and `isSet` checks [`fc51047`](https://github.com/inspect-js/object-inspect/commit/fc5104714a3671d37e225813db79470d6335683b) -- [meta] add `funding` field [`7f9953a`](https://github.com/inspect-js/object-inspect/commit/7f9953a113eec7b064a6393cf9f90ba15f1d131b) -- [Tests] Fix invalid strict-mode syntax with hexadecimal [`a8b5425`](https://github.com/inspect-js/object-inspect/commit/a8b542503b4af1599a275209a1a99f5fdedb1ead) -- [Dev Deps] update `@ljharb/eslint-config` [`98df157`](https://github.com/inspect-js/object-inspect/commit/98df1577314d9188a3fc3f17fdcf2fba697ae1bd) -- add copyright to LICENSE [`bb69fd0`](https://github.com/inspect-js/object-inspect/commit/bb69fd017a062d299e44da1f9b2c7dcd67f621e6) -- [Tests] use `npx aud` in `posttest` [`4838353`](https://github.com/inspect-js/object-inspect/commit/4838353593974cf7f905b9ef04c03c094f0cdbe2) -- [Tests] move `0.6` to allowed failures, because it won‘t build on travis [`1bff32a`](https://github.com/inspect-js/object-inspect/commit/1bff32aa52e8aea687f0856b28ba754b3e43ebf7) - -## [v1.6.0](https://github.com/inspect-js/object-inspect/compare/v1.5.0...v1.6.0) - 2018-05-02 - -### Commits - -- [New] add support for boxed BigInt primitives [`356c66a`](https://github.com/inspect-js/object-inspect/commit/356c66a410e7aece7162c8319880a5ef647beaa9) -- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`c77b65b`](https://github.com/inspect-js/object-inspect/commit/c77b65bba593811b906b9ec57561c5cba92e2db3) -- [New] Add support for upcoming `BigInt` [`1ac548e`](https://github.com/inspect-js/object-inspect/commit/1ac548e4b27e26466c28c9a5e63e5d4e0591c31f) -- [Tests] run bigint tests in CI with --harmony-bigint flag [`d31b738`](https://github.com/inspect-js/object-inspect/commit/d31b73831880254b5c6cf5691cda9a149fbc5f04) -- [Dev Deps] update `core-js`, `tape` [`ff9eff6`](https://github.com/inspect-js/object-inspect/commit/ff9eff67113341ee1aaf80c1c22d683f43bfbccf) -- [Docs] fix example to use `safer-buffer` [`48cae12`](https://github.com/inspect-js/object-inspect/commit/48cae12a73ec6cacc955175bc56bbe6aee6a211f) - -## [v1.5.0](https://github.com/inspect-js/object-inspect/compare/v1.4.1...v1.5.0) - 2017-12-25 - -### Commits - -- [New] add `quoteStyle` option [`f5a72d2`](https://github.com/inspect-js/object-inspect/commit/f5a72d26edb3959b048f74c056ca7100a6b091e4) -- [Tests] add more test coverage [`30ebe4e`](https://github.com/inspect-js/object-inspect/commit/30ebe4e1fa943b99ecbb85be7614256d536e2759) -- [Tests] require 0.6 to pass [`99a008c`](https://github.com/inspect-js/object-inspect/commit/99a008ccace189a60fd7da18bf00e32c9572b980) - -## [v1.4.1](https://github.com/inspect-js/object-inspect/compare/v1.4.0...v1.4.1) - 2017-12-19 - -### Commits - -- [Tests] up to `node` `v9.3`, `v8.9`, `v6.12` [`6674476`](https://github.com/inspect-js/object-inspect/commit/6674476cc56acaac1bde96c84fed5ef631911906) -- [Fix] `inspect(Object(-0))` should be “Object(-0)”, not “Object(0)” [`d0a031f`](https://github.com/inspect-js/object-inspect/commit/d0a031f1cbb3024ee9982bfe364dd18a7e4d1bd3) - -## [v1.4.0](https://github.com/inspect-js/object-inspect/compare/v1.3.0...v1.4.0) - 2017-10-24 - -### Commits - -- [Tests] add `npm run coverage` [`3b48fb2`](https://github.com/inspect-js/object-inspect/commit/3b48fb25db037235eeb808f0b2830aad7aa36f70) -- [Tests] remove commented-out osx builds [`71e24db`](https://github.com/inspect-js/object-inspect/commit/71e24db8ad6ee3b9b381c5300b0475f2ba595a73) -- [New] add support for `util.inspect.custom`, in node only. [`20cca77`](https://github.com/inspect-js/object-inspect/commit/20cca7762d7e17f15b21a90793dff84acce155df) -- [Tests] up to `node` `v8.6`; use `nvm install-latest-npm` to ensure new npm doesn’t break old node [`252952d`](https://github.com/inspect-js/object-inspect/commit/252952d230d8065851dd3d4d5fe8398aae068529) -- [Tests] up to `node` `v8.8` [`4aa868d`](https://github.com/inspect-js/object-inspect/commit/4aa868d3a62914091d489dd6ec6eed194ee67cd3) -- [Dev Deps] update `core-js`, `tape` [`59483d1`](https://github.com/inspect-js/object-inspect/commit/59483d1df418f852f51fa0db7b24aa6b0209a27a) - -## [v1.3.0](https://github.com/inspect-js/object-inspect/compare/v1.2.2...v1.3.0) - 2017-07-31 - -### Fixed - -- [Fix] Map/Set: work around core-js bug < v2.5.0 [`#9`](https://github.com/inspect-js/object-inspect/issues/9) - -### Commits - -- [New] add support for arrays with additional object keys [`0d19937`](https://github.com/inspect-js/object-inspect/commit/0d199374ee37959e51539616666f420ccb29acb9) -- [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`; fix new npm breaking on older nodes [`e24784a`](https://github.com/inspect-js/object-inspect/commit/e24784a90c49117787157a12a63897c49cf89bbb) -- Only apps should have lockfiles [`c6faebc`](https://github.com/inspect-js/object-inspect/commit/c6faebcb2ee486a889a4a1c4d78c0776c7576185) -- [Dev Deps] update `tape` [`7345a0a`](https://github.com/inspect-js/object-inspect/commit/7345a0aeba7e91b888a079c10004d17696a7f586) - -## [v1.2.2](https://github.com/inspect-js/object-inspect/compare/v1.2.1...v1.2.2) - 2017-03-24 - -### Commits - -- [Tests] up to `node` `v7.7`, `v6.10`, `v4.8`; improve test matrix [`a2ddc15`](https://github.com/inspect-js/object-inspect/commit/a2ddc15a1f2c65af18076eea1c0eb9cbceb478a0) -- [Tests] up to `node` `v7.0`, `v6.9`, `v5.12`, `v4.6`, `io.js` `v3.3`; improve test matrix [`a48949f`](https://github.com/inspect-js/object-inspect/commit/a48949f6b574b2d4d2298109d8e8d0eb3e7a83e7) -- [Performance] check for primitive types as early as possible. [`3b8092a`](https://github.com/inspect-js/object-inspect/commit/3b8092a2a4deffd0575f94334f00194e2d48dad3) -- [Refactor] remove unneeded `else`s. [`7255034`](https://github.com/inspect-js/object-inspect/commit/725503402e08de4f96f6bf2d8edef44ac36f26b6) -- [Refactor] avoid recreating `lowbyte` function every time. [`81edd34`](https://github.com/inspect-js/object-inspect/commit/81edd3475bd15bdd18e84de7472033dcf5004aaa) -- [Fix] differentiate -0 from 0 [`521d345`](https://github.com/inspect-js/object-inspect/commit/521d3456b009da7bf1c5785c8a9df5a9f8718264) -- [Refactor] move object key gathering into separate function [`aca6265`](https://github.com/inspect-js/object-inspect/commit/aca626536eaeef697196c6e9db3e90e7e0355b6a) -- [Refactor] consolidate wrapping logic for boxed primitives into a function. [`4e440cd`](https://github.com/inspect-js/object-inspect/commit/4e440cd9065df04802a2a1dead03f48c353ca301) -- [Robustness] use `typeof` instead of comparing to literal `undefined` [`5ca6f60`](https://github.com/inspect-js/object-inspect/commit/5ca6f601937506daff8ed2fcf686363b55807b69) -- [Refactor] consolidate Map/Set notations. [`4e576e5`](https://github.com/inspect-js/object-inspect/commit/4e576e5d7ed2f9ec3fb7f37a0d16732eb10758a9) -- [Tests] ensure that this function remains anonymous, despite ES6 name inference. [`7540ae5`](https://github.com/inspect-js/object-inspect/commit/7540ae591278756db614fa4def55ca413150e1a3) -- [Refactor] explicitly coerce Error objects to strings. [`7f4ca84`](https://github.com/inspect-js/object-inspect/commit/7f4ca8424ee8dc2c0ca5a422d94f7fac40327261) -- [Refactor] split up `var` declarations for debuggability [`6f2c11e`](https://github.com/inspect-js/object-inspect/commit/6f2c11e6a85418586a00292dcec5e97683f89bc3) -- [Robustness] cache `Object.prototype.toString` [`df44a20`](https://github.com/inspect-js/object-inspect/commit/df44a20adfccf31529d60d1df2079bfc3c836e27) -- [Dev Deps] update `tape` [`3ec714e`](https://github.com/inspect-js/object-inspect/commit/3ec714eba57bc3f58a6eb4fca1376f49e70d300a) -- [Dev Deps] update `tape` [`beb72d9`](https://github.com/inspect-js/object-inspect/commit/beb72d969653747d7cde300393c28755375329b0) - -## [v1.2.1](https://github.com/inspect-js/object-inspect/compare/v1.2.0...v1.2.1) - 2016-04-09 - -### Fixed - -- [Fix] fix Boolean `false` object inspection. [`#7`](https://github.com/substack/object-inspect/pull/7) - -## [v1.2.0](https://github.com/inspect-js/object-inspect/compare/v1.1.0...v1.2.0) - 2016-04-09 - -### Fixed - -- [New] add support for inspecting String/Number/Boolean objects. [`#6`](https://github.com/inspect-js/object-inspect/issues/6) - -### Commits - -- [Dev Deps] update `tape` [`742caa2`](https://github.com/inspect-js/object-inspect/commit/742caa262cf7af4c815d4821c8bd0129c1446432) - -## [v1.1.0](https://github.com/inspect-js/object-inspect/compare/1.0.2...v1.1.0) - 2015-12-14 - -### Merged - -- [New] add ES6 Map/Set support. [`#4`](https://github.com/inspect-js/object-inspect/pull/4) - -### Fixed - -- [New] add ES6 Map/Set support. [`#3`](https://github.com/inspect-js/object-inspect/issues/3) - -### Commits - -- Update `travis.yml` to test on bunches of `iojs` and `node` versions. [`4c1fd65`](https://github.com/inspect-js/object-inspect/commit/4c1fd65cc3bd95307e854d114b90478324287fd2) -- [Dev Deps] update `tape` [`88a907e`](https://github.com/inspect-js/object-inspect/commit/88a907e33afbe408e4b5d6e4e42a33143f88848c) - -## [1.0.2](https://github.com/inspect-js/object-inspect/compare/1.0.1...1.0.2) - 2015-08-07 - -### Commits - -- [Fix] Cache `Object.prototype.hasOwnProperty` in case it's deleted later. [`1d0075d`](https://github.com/inspect-js/object-inspect/commit/1d0075d3091dc82246feeb1f9871cb2b8ed227b3) -- [Dev Deps] Update `tape` [`ca8d5d7`](https://github.com/inspect-js/object-inspect/commit/ca8d5d75635ddbf76f944e628267581e04958457) -- gitignore node_modules since this is a reusable modules. [`ed41407`](https://github.com/inspect-js/object-inspect/commit/ed41407811743ca530cdeb28f982beb96026af82) - -## [1.0.1](https://github.com/inspect-js/object-inspect/compare/1.0.0...1.0.1) - 2015-07-19 - -### Commits - -- Make `inspect` work with symbol primitives and objects, including in node 0.11 and 0.12. [`ddf1b94`](https://github.com/inspect-js/object-inspect/commit/ddf1b94475ab951f1e3bccdc0a48e9073cfbfef4) -- bump tape [`103d674`](https://github.com/inspect-js/object-inspect/commit/103d67496b504bdcfdd765d303a773f87ec106e2) -- use newer travis config [`d497276`](https://github.com/inspect-js/object-inspect/commit/d497276c1da14234bb5098a59cf20de75fbc316a) - -## [1.0.0](https://github.com/inspect-js/object-inspect/compare/0.4.0...1.0.0) - 2014-08-05 - -### Commits - -- error inspect works properly [`260a22d`](https://github.com/inspect-js/object-inspect/commit/260a22d134d3a8a482c67d52091c6040c34f4299) -- seen coverage [`57269e8`](https://github.com/inspect-js/object-inspect/commit/57269e8baa992a7439047f47325111fdcbcb8417) -- htmlelement instance coverage [`397ffe1`](https://github.com/inspect-js/object-inspect/commit/397ffe10a1980350868043ef9de65686d438979f) -- more element coverage [`6905cc2`](https://github.com/inspect-js/object-inspect/commit/6905cc2f7df35600177e613b0642b4df5efd3eca) -- failing test for type errors [`385b615`](https://github.com/inspect-js/object-inspect/commit/385b6152e49b51b68449a662f410b084ed7c601a) -- fn name coverage [`edc906d`](https://github.com/inspect-js/object-inspect/commit/edc906d40fca6b9194d304062c037ee8e398c4c2) -- server-side element test [`362d1d3`](https://github.com/inspect-js/object-inspect/commit/362d1d3e86f187651c29feeb8478110afada385b) -- custom inspect fn [`e89b0f6`](https://github.com/inspect-js/object-inspect/commit/e89b0f6fe6d5e03681282af83732a509160435a6) -- fixed browser test [`b530882`](https://github.com/inspect-js/object-inspect/commit/b5308824a1c8471c5617e394766a03a6977102a9) -- depth test, matches node [`1cfd9e0`](https://github.com/inspect-js/object-inspect/commit/1cfd9e0285a4ae1dff44101ad482915d9bf47e48) -- exercise hasOwnProperty path [`8d753fb`](https://github.com/inspect-js/object-inspect/commit/8d753fb362a534fa1106e4d80f2ee9bea06a66d9) -- more cases covered for errors [`c5c46a5`](https://github.com/inspect-js/object-inspect/commit/c5c46a569ec4606583497e8550f0d8c7ad39a4a4) -- \W obj key test case [`b0eceee`](https://github.com/inspect-js/object-inspect/commit/b0eceeea6e0eb94d686c1046e99b9e25e5005f75) -- coverage for explicit depth param [`e12b91c`](https://github.com/inspect-js/object-inspect/commit/e12b91cd59683362f3a0e80f46481a0211e26c15) - -## [0.4.0](https://github.com/inspect-js/object-inspect/compare/0.3.1...0.4.0) - 2014-03-21 - -### Commits - -- passing lowbyte interpolation test [`b847511`](https://github.com/inspect-js/object-inspect/commit/b8475114f5def7e7961c5353d48d3d8d9a520985) -- lowbyte test [`4a2b0e1`](https://github.com/inspect-js/object-inspect/commit/4a2b0e142667fc933f195472759385ac08f3946c) - -## [0.3.1](https://github.com/inspect-js/object-inspect/compare/0.3.0...0.3.1) - 2014-03-04 - -### Commits - -- sort keys [`a07b19c`](https://github.com/inspect-js/object-inspect/commit/a07b19cc3b1521a82d4fafb6368b7a9775428a05) - -## [0.3.0](https://github.com/inspect-js/object-inspect/compare/0.2.0...0.3.0) - 2014-03-04 - -### Commits - -- [] and {} instead of [ ] and { } [`654c44b`](https://github.com/inspect-js/object-inspect/commit/654c44b2865811f3519e57bb8526e0821caf5c6b) - -## [0.2.0](https://github.com/inspect-js/object-inspect/compare/0.1.3...0.2.0) - 2014-03-04 - -### Commits - -- failing holes test [`99cdfad`](https://github.com/inspect-js/object-inspect/commit/99cdfad03c6474740275a75636fe6ca86c77737a) -- regex already work [`e324033`](https://github.com/inspect-js/object-inspect/commit/e324033267025995ec97d32ed0a65737c99477a6) -- failing undef/null test [`1f88a00`](https://github.com/inspect-js/object-inspect/commit/1f88a00265d3209719dda8117b7e6360b4c20943) -- holes in the all example [`7d345f3`](https://github.com/inspect-js/object-inspect/commit/7d345f3676dcbe980cff89a4f6c243269ebbb709) -- check for .inspect(), fixes Buffer use-case [`c3f7546`](https://github.com/inspect-js/object-inspect/commit/c3f75466dbca125347d49847c05262c292f12b79) -- fixes for holes [`ce25f73`](https://github.com/inspect-js/object-inspect/commit/ce25f736683de4b92ff27dc5471218415e2d78d8) -- weird null behavior [`405c1ea`](https://github.com/inspect-js/object-inspect/commit/405c1ea72cd5a8cf3b498c3eaa903d01b9fbcab5) -- tape is actually a devDependency, upgrade [`703b0ce`](https://github.com/inspect-js/object-inspect/commit/703b0ce6c5817b4245a082564bccd877e0bb6990) -- put date in the example [`a342219`](https://github.com/inspect-js/object-inspect/commit/a3422190eeaa013215f46df2d0d37b48595ac058) -- passing the null test [`4ab737e`](https://github.com/inspect-js/object-inspect/commit/4ab737ebf862a75d247ebe51e79307a34d6380d4) - -## [0.1.3](https://github.com/inspect-js/object-inspect/compare/0.1.1...0.1.3) - 2013-07-26 - -### Commits - -- special isElement() check [`882768a`](https://github.com/inspect-js/object-inspect/commit/882768a54035d30747be9de1baf14e5aa0daa128) -- oh right old IEs don't have indexOf either [`36d1275`](https://github.com/inspect-js/object-inspect/commit/36d12756c38b08a74370b0bb696c809e529913a5) - -## [0.1.1](https://github.com/inspect-js/object-inspect/compare/0.1.0...0.1.1) - 2013-07-26 - -### Commits - -- tests! [`4422fd9`](https://github.com/inspect-js/object-inspect/commit/4422fd95532c2745aa6c4f786f35f1090be29998) -- fix for ie<9, doesn't have hasOwnProperty [`6b7d611`](https://github.com/inspect-js/object-inspect/commit/6b7d61183050f6da801ea04473211da226482613) -- fix for all IEs: no f.name [`4e0c2f6`](https://github.com/inspect-js/object-inspect/commit/4e0c2f6dfd01c306d067d7163319acc97c94ee50) -- badges [`5ed0d88`](https://github.com/inspect-js/object-inspect/commit/5ed0d88e4e407f9cb327fa4a146c17921f9680f3) - -## [0.1.0](https://github.com/inspect-js/object-inspect/compare/0.0.0...0.1.0) - 2013-07-26 - -### Commits - -- [Function] for functions [`ad5c485`](https://github.com/inspect-js/object-inspect/commit/ad5c485098fc83352cb540a60b2548ca56820e0b) - -## 0.0.0 - 2013-07-26 - -### Commits - -- working browser example [`34be6b6`](https://github.com/inspect-js/object-inspect/commit/34be6b6548f9ce92bdc3c27572857ba0c4a1218d) -- package.json etc [`cad51f2`](https://github.com/inspect-js/object-inspect/commit/cad51f23fc6bcf1a456ed6abe16088256c2f632f) -- docs complete [`b80cce2`](https://github.com/inspect-js/object-inspect/commit/b80cce2490c4e7183a9ee11ea89071f0abec4446) -- circular example [`4b4a7b9`](https://github.com/inspect-js/object-inspect/commit/4b4a7b92209e4e6b4630976cb6bcd17d14165a59) -- string rep [`7afb479`](https://github.com/inspect-js/object-inspect/commit/7afb479baa798d27f09e0a178b72ea327f60f5c8) diff --git a/node_modules/object-inspect/LICENSE b/node_modules/object-inspect/LICENSE deleted file mode 100644 index ca64cc1..0000000 --- a/node_modules/object-inspect/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 James Halliday - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/object-inspect/example/all.js b/node_modules/object-inspect/example/all.js deleted file mode 100644 index 2f3355c..0000000 --- a/node_modules/object-inspect/example/all.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var Buffer = require('safer-buffer').Buffer; - -var holes = ['a', 'b']; -holes[4] = 'e'; -holes[6] = 'g'; - -var obj = { - a: 1, - b: [3, 4, undefined, null], - c: undefined, - d: null, - e: { - regex: /^x/i, - buf: Buffer.from('abc'), - holes: holes - }, - now: new Date() -}; -obj.self = obj; -console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/circular.js b/node_modules/object-inspect/example/circular.js deleted file mode 100644 index 487a7c1..0000000 --- a/node_modules/object-inspect/example/circular.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var obj = { a: 1, b: [3, 4] }; -obj.c = obj; -console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/fn.js b/node_modules/object-inspect/example/fn.js deleted file mode 100644 index 9b5db8d..0000000 --- a/node_modules/object-inspect/example/fn.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var obj = [1, 2, function f(n) { return n + 5; }, 4]; -console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/inspect.js b/node_modules/object-inspect/example/inspect.js deleted file mode 100644 index e2df7c9..0000000 --- a/node_modules/object-inspect/example/inspect.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -/* eslint-env browser */ -var inspect = require('../'); - -var d = document.createElement('div'); -d.setAttribute('id', 'beep'); -d.innerHTML = 'woooiiiii'; - -console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }])); diff --git a/node_modules/object-inspect/index.js b/node_modules/object-inspect/index.js deleted file mode 100644 index a4b2d4c..0000000 --- a/node_modules/object-inspect/index.js +++ /dev/null @@ -1,544 +0,0 @@ -var hasMap = typeof Map === 'function' && Map.prototype; -var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; -var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; -var mapForEach = hasMap && Map.prototype.forEach; -var hasSet = typeof Set === 'function' && Set.prototype; -var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; -var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; -var setForEach = hasSet && Set.prototype.forEach; -var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; -var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; -var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; -var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; -var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; -var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; -var booleanValueOf = Boolean.prototype.valueOf; -var objectToString = Object.prototype.toString; -var functionToString = Function.prototype.toString; -var $match = String.prototype.match; -var $slice = String.prototype.slice; -var $replace = String.prototype.replace; -var $toUpperCase = String.prototype.toUpperCase; -var $toLowerCase = String.prototype.toLowerCase; -var $test = RegExp.prototype.test; -var $concat = Array.prototype.concat; -var $join = Array.prototype.join; -var $arrSlice = Array.prototype.slice; -var $floor = Math.floor; -var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; -var gOPS = Object.getOwnPropertySymbols; -var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; -var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; -// ie, `has-tostringtag/shams -var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') - ? Symbol.toStringTag - : null; -var isEnumerable = Object.prototype.propertyIsEnumerable; - -var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( - [].__proto__ === Array.prototype // eslint-disable-line no-proto - ? function (O) { - return O.__proto__; // eslint-disable-line no-proto - } - : null -); - -function addNumericSeparator(num, str) { - if ( - num === Infinity - || num === -Infinity - || num !== num - || (num && num > -1000 && num < 1000) - || $test.call(/e/, str) - ) { - return str; - } - var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; - if (typeof num === 'number') { - var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) - if (int !== num) { - var intStr = String(int); - var dec = $slice.call(str, intStr.length + 1); - return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); - } - } - return $replace.call(str, sepRegex, '$&_'); -} - -var utilInspect = require('./util.inspect'); -var inspectCustom = utilInspect.custom; -var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; - -var quotes = { - __proto__: null, - 'double': '"', - single: "'" -}; -var quoteREs = { - __proto__: null, - 'double': /(["\\])/g, - single: /(['\\])/g -}; - -module.exports = function inspect_(obj, options, depth, seen) { - var opts = options || {}; - - if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { - throw new TypeError('option "quoteStyle" must be "single" or "double"'); - } - if ( - has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' - ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity - : opts.maxStringLength !== null - ) - ) { - throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); - } - var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; - if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { - throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); - } - - if ( - has(opts, 'indent') - && opts.indent !== null - && opts.indent !== '\t' - && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) - ) { - throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); - } - if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { - throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); - } - var numericSeparator = opts.numericSeparator; - - if (typeof obj === 'undefined') { - return 'undefined'; - } - if (obj === null) { - return 'null'; - } - if (typeof obj === 'boolean') { - return obj ? 'true' : 'false'; - } - - if (typeof obj === 'string') { - return inspectString(obj, opts); - } - if (typeof obj === 'number') { - if (obj === 0) { - return Infinity / obj > 0 ? '0' : '-0'; - } - var str = String(obj); - return numericSeparator ? addNumericSeparator(obj, str) : str; - } - if (typeof obj === 'bigint') { - var bigIntStr = String(obj) + 'n'; - return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; - } - - var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; - if (typeof depth === 'undefined') { depth = 0; } - if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { - return isArray(obj) ? '[Array]' : '[Object]'; - } - - var indent = getIndent(opts, depth); - - if (typeof seen === 'undefined') { - seen = []; - } else if (indexOf(seen, obj) >= 0) { - return '[Circular]'; - } - - function inspect(value, from, noIndent) { - if (from) { - seen = $arrSlice.call(seen); - seen.push(from); - } - if (noIndent) { - var newOpts = { - depth: opts.depth - }; - if (has(opts, 'quoteStyle')) { - newOpts.quoteStyle = opts.quoteStyle; - } - return inspect_(value, newOpts, depth + 1, seen); - } - return inspect_(value, opts, depth + 1, seen); - } - - if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable - var name = nameOf(obj); - var keys = arrObjKeys(obj, inspect); - return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); - } - if (isSymbol(obj)) { - var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); - return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; - } - if (isElement(obj)) { - var s = '<' + $toLowerCase.call(String(obj.nodeName)); - var attrs = obj.attributes || []; - for (var i = 0; i < attrs.length; i++) { - s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); - } - s += '>'; - if (obj.childNodes && obj.childNodes.length) { s += '...'; } - s += ''; - return s; - } - if (isArray(obj)) { - if (obj.length === 0) { return '[]'; } - var xs = arrObjKeys(obj, inspect); - if (indent && !singleLineValues(xs)) { - return '[' + indentedJoin(xs, indent) + ']'; - } - return '[ ' + $join.call(xs, ', ') + ' ]'; - } - if (isError(obj)) { - var parts = arrObjKeys(obj, inspect); - if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { - return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; - } - if (parts.length === 0) { return '[' + String(obj) + ']'; } - return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; - } - if (typeof obj === 'object' && customInspect) { - if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { - return utilInspect(obj, { depth: maxDepth - depth }); - } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { - return obj.inspect(); - } - } - if (isMap(obj)) { - var mapParts = []; - if (mapForEach) { - mapForEach.call(obj, function (value, key) { - mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); - }); - } - return collectionOf('Map', mapSize.call(obj), mapParts, indent); - } - if (isSet(obj)) { - var setParts = []; - if (setForEach) { - setForEach.call(obj, function (value) { - setParts.push(inspect(value, obj)); - }); - } - return collectionOf('Set', setSize.call(obj), setParts, indent); - } - if (isWeakMap(obj)) { - return weakCollectionOf('WeakMap'); - } - if (isWeakSet(obj)) { - return weakCollectionOf('WeakSet'); - } - if (isWeakRef(obj)) { - return weakCollectionOf('WeakRef'); - } - if (isNumber(obj)) { - return markBoxed(inspect(Number(obj))); - } - if (isBigInt(obj)) { - return markBoxed(inspect(bigIntValueOf.call(obj))); - } - if (isBoolean(obj)) { - return markBoxed(booleanValueOf.call(obj)); - } - if (isString(obj)) { - return markBoxed(inspect(String(obj))); - } - // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other - /* eslint-env browser */ - if (typeof window !== 'undefined' && obj === window) { - return '{ [object Window] }'; - } - if ( - (typeof globalThis !== 'undefined' && obj === globalThis) - || (typeof global !== 'undefined' && obj === global) - ) { - return '{ [object globalThis] }'; - } - if (!isDate(obj) && !isRegExp(obj)) { - var ys = arrObjKeys(obj, inspect); - var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; - var protoTag = obj instanceof Object ? '' : 'null prototype'; - var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; - var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; - var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); - if (ys.length === 0) { return tag + '{}'; } - if (indent) { - return tag + '{' + indentedJoin(ys, indent) + '}'; - } - return tag + '{ ' + $join.call(ys, ', ') + ' }'; - } - return String(obj); -}; - -function wrapQuotes(s, defaultStyle, opts) { - var style = opts.quoteStyle || defaultStyle; - var quoteChar = quotes[style]; - return quoteChar + s + quoteChar; -} - -function quote(s) { - return $replace.call(String(s), /"/g, '"'); -} - -function canTrustToString(obj) { - return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); -} -function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); } -function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); } -function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); } -function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); } -function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); } -function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); } -function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); } - -// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives -function isSymbol(obj) { - if (hasShammedSymbols) { - return obj && typeof obj === 'object' && obj instanceof Symbol; - } - if (typeof obj === 'symbol') { - return true; - } - if (!obj || typeof obj !== 'object' || !symToString) { - return false; - } - try { - symToString.call(obj); - return true; - } catch (e) {} - return false; -} - -function isBigInt(obj) { - if (!obj || typeof obj !== 'object' || !bigIntValueOf) { - return false; - } - try { - bigIntValueOf.call(obj); - return true; - } catch (e) {} - return false; -} - -var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; -function has(obj, key) { - return hasOwn.call(obj, key); -} - -function toStr(obj) { - return objectToString.call(obj); -} - -function nameOf(f) { - if (f.name) { return f.name; } - var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); - if (m) { return m[1]; } - return null; -} - -function indexOf(xs, x) { - if (xs.indexOf) { return xs.indexOf(x); } - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) { return i; } - } - return -1; -} - -function isMap(x) { - if (!mapSize || !x || typeof x !== 'object') { - return false; - } - try { - mapSize.call(x); - try { - setSize.call(x); - } catch (s) { - return true; - } - return x instanceof Map; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakMap(x) { - if (!weakMapHas || !x || typeof x !== 'object') { - return false; - } - try { - weakMapHas.call(x, weakMapHas); - try { - weakSetHas.call(x, weakSetHas); - } catch (s) { - return true; - } - return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakRef(x) { - if (!weakRefDeref || !x || typeof x !== 'object') { - return false; - } - try { - weakRefDeref.call(x); - return true; - } catch (e) {} - return false; -} - -function isSet(x) { - if (!setSize || !x || typeof x !== 'object') { - return false; - } - try { - setSize.call(x); - try { - mapSize.call(x); - } catch (m) { - return true; - } - return x instanceof Set; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakSet(x) { - if (!weakSetHas || !x || typeof x !== 'object') { - return false; - } - try { - weakSetHas.call(x, weakSetHas); - try { - weakMapHas.call(x, weakMapHas); - } catch (s) { - return true; - } - return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isElement(x) { - if (!x || typeof x !== 'object') { return false; } - if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { - return true; - } - return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; -} - -function inspectString(str, opts) { - if (str.length > opts.maxStringLength) { - var remaining = str.length - opts.maxStringLength; - var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); - return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; - } - var quoteRE = quoteREs[opts.quoteStyle || 'single']; - quoteRE.lastIndex = 0; - // eslint-disable-next-line no-control-regex - var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); - return wrapQuotes(s, 'single', opts); -} - -function lowbyte(c) { - var n = c.charCodeAt(0); - var x = { - 8: 'b', - 9: 't', - 10: 'n', - 12: 'f', - 13: 'r' - }[n]; - if (x) { return '\\' + x; } - return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); -} - -function markBoxed(str) { - return 'Object(' + str + ')'; -} - -function weakCollectionOf(type) { - return type + ' { ? }'; -} - -function collectionOf(type, size, entries, indent) { - var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); - return type + ' (' + size + ') {' + joinedEntries + '}'; -} - -function singleLineValues(xs) { - for (var i = 0; i < xs.length; i++) { - if (indexOf(xs[i], '\n') >= 0) { - return false; - } - } - return true; -} - -function getIndent(opts, depth) { - var baseIndent; - if (opts.indent === '\t') { - baseIndent = '\t'; - } else if (typeof opts.indent === 'number' && opts.indent > 0) { - baseIndent = $join.call(Array(opts.indent + 1), ' '); - } else { - return null; - } - return { - base: baseIndent, - prev: $join.call(Array(depth + 1), baseIndent) - }; -} - -function indentedJoin(xs, indent) { - if (xs.length === 0) { return ''; } - var lineJoiner = '\n' + indent.prev + indent.base; - return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; -} - -function arrObjKeys(obj, inspect) { - var isArr = isArray(obj); - var xs = []; - if (isArr) { - xs.length = obj.length; - for (var i = 0; i < obj.length; i++) { - xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; - } - } - var syms = typeof gOPS === 'function' ? gOPS(obj) : []; - var symMap; - if (hasShammedSymbols) { - symMap = {}; - for (var k = 0; k < syms.length; k++) { - symMap['$' + syms[k]] = syms[k]; - } - } - - for (var key in obj) { // eslint-disable-line no-restricted-syntax - if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { - // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section - continue; // eslint-disable-line no-restricted-syntax, no-continue - } else if ($test.call(/[^\w$]/, key)) { - xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); - } else { - xs.push(key + ': ' + inspect(obj[key], obj)); - } - } - if (typeof gOPS === 'function') { - for (var j = 0; j < syms.length; j++) { - if (isEnumerable.call(obj, syms[j])) { - xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); - } - } - } - return xs; -} diff --git a/node_modules/object-inspect/package-support.json b/node_modules/object-inspect/package-support.json deleted file mode 100644 index 5cc12d0..0000000 --- a/node_modules/object-inspect/package-support.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "versions": [ - { - "version": "*", - "target": { - "node": "all" - }, - "response": { - "type": "time-permitting" - }, - "backing": { - "npm-funding": true, - "donations": [ - "https://github.com/ljharb", - "https://tidelift.com/funding/github/npm/object-inspect" - ] - } - } - ] -} diff --git a/node_modules/object-inspect/package.json b/node_modules/object-inspect/package.json deleted file mode 100644 index 9fd97ff..0000000 --- a/node_modules/object-inspect/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "name": "object-inspect", - "version": "1.13.4", - "description": "string representations of objects in node and the browser", - "main": "index.js", - "sideEffects": false, - "devDependencies": { - "@ljharb/eslint-config": "^21.1.1", - "@pkgjs/support": "^0.0.6", - "auto-changelog": "^2.5.0", - "core-js": "^2.6.12", - "error-cause": "^1.0.8", - "es-value-fixtures": "^1.7.1", - "eslint": "=8.8.0", - "for-each": "^0.3.4", - "functions-have-names": "^1.2.3", - "glob": "=10.3.7", - "globalthis": "^1.0.4", - "has-symbols": "^1.1.0", - "has-tostringtag": "^1.0.2", - "in-publish": "^2.0.1", - "jackspeak": "=2.1.1", - "make-arrow-function": "^1.2.0", - "mock-property": "^1.1.0", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "safer-buffer": "^2.1.2", - "semver": "^6.3.1", - "string.prototype.repeat": "^1.0.0", - "tape": "^5.9.0" - }, - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepublishOnly": "safe-publish-latest", - "pretest": "npm run lint", - "lint": "eslint --ext=js,mjs .", - "postlint": "npx @pkgjs/support validate", - "test": "npm run tests-only && npm run test:corejs", - "tests-only": "nyc tape 'test/*.js'", - "test:corejs": "nyc tape test-core-js.js 'test/*.js'", - "posttest": "npx npm@'>=10.2' audit --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "testling": { - "files": [ - "test/*.js", - "test/browser/*.js" - ], - "browsers": [ - "ie/6..latest", - "chrome/latest", - "firefox/latest", - "safari/latest", - "opera/latest", - "iphone/latest", - "ipad/latest", - "android/latest" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/inspect-js/object-inspect.git" - }, - "homepage": "https://github.com/inspect-js/object-inspect", - "keywords": [ - "inspect", - "util.inspect", - "object", - "stringify", - "pretty" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "browser": { - "./util.inspect.js": false - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows", - "./test-core-js.js" - ] - }, - "support": true, - "engines": { - "node": ">= 0.4" - } -} diff --git a/node_modules/object-inspect/readme.markdown b/node_modules/object-inspect/readme.markdown deleted file mode 100644 index f91617d..0000000 --- a/node_modules/object-inspect/readme.markdown +++ /dev/null @@ -1,84 +0,0 @@ -# object-inspect [![Version Badge][npm-version-svg]][package-url] - -string representations of objects in node and the browser - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -# example - -## circular - -``` js -var inspect = require('object-inspect'); -var obj = { a: 1, b: [3,4] }; -obj.c = obj; -console.log(inspect(obj)); -``` - -## dom element - -``` js -var inspect = require('object-inspect'); - -var d = document.createElement('div'); -d.setAttribute('id', 'beep'); -d.innerHTML = 'woooiiiii'; - -console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ])); -``` - -output: - -``` -[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ] -``` - -# methods - -``` js -var inspect = require('object-inspect') -``` - -## var s = inspect(obj, opts={}) - -Return a string `s` with the string representation of `obj` up to a depth of `opts.depth`. - -Additional options: - - `quoteStyle`: must be "single" or "double", if present. Default `'single'` for strings, `'double'` for HTML elements. - - `maxStringLength`: must be `0`, a positive integer, `Infinity`, or `null`, if present. Default `Infinity`. - - `customInspect`: When `true`, a custom inspect method function will be invoked (either undere the `util.inspect.custom` symbol, or the `inspect` property). When the string `'symbol'`, only the symbol method will be invoked. Default `true`. - - `indent`: must be "\t", `null`, or a positive integer. Default `null`. - - `numericSeparator`: must be a boolean, if present. Default `false`. If `true`, all numbers will be printed with numeric separators (eg, `1234.5678` will be printed as `'1_234.567_8'`) - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install object-inspect -``` - -# license - -MIT - -[package-url]: https://npmjs.org/package/object-inspect -[npm-version-svg]: https://versionbadg.es/inspect-js/object-inspect.svg -[deps-svg]: https://david-dm.org/inspect-js/object-inspect.svg -[deps-url]: https://david-dm.org/inspect-js/object-inspect -[dev-deps-svg]: https://david-dm.org/inspect-js/object-inspect/dev-status.svg -[dev-deps-url]: https://david-dm.org/inspect-js/object-inspect#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/object-inspect.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/object-inspect.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/object-inspect.svg -[downloads-url]: https://npm-stat.com/charts.html?package=object-inspect -[codecov-image]: https://codecov.io/gh/inspect-js/object-inspect/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/inspect-js/object-inspect/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/object-inspect -[actions-url]: https://github.com/inspect-js/object-inspect/actions diff --git a/node_modules/object-inspect/test-core-js.js b/node_modules/object-inspect/test-core-js.js deleted file mode 100644 index e53c400..0000000 --- a/node_modules/object-inspect/test-core-js.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -require('core-js'); - -var inspect = require('./'); -var test = require('tape'); - -test('Maps', function (t) { - t.equal(inspect(new Map([[1, 2]])), 'Map (1) {1 => 2}'); - t.end(); -}); - -test('WeakMaps', function (t) { - t.equal(inspect(new WeakMap([[{}, 2]])), 'WeakMap { ? }'); - t.end(); -}); - -test('Sets', function (t) { - t.equal(inspect(new Set([[1, 2]])), 'Set (1) {[ 1, 2 ]}'); - t.end(); -}); - -test('WeakSets', function (t) { - t.equal(inspect(new WeakSet([[1, 2]])), 'WeakSet { ? }'); - t.end(); -}); diff --git a/node_modules/object-inspect/test/bigint.js b/node_modules/object-inspect/test/bigint.js deleted file mode 100644 index 4ecc31d..0000000 --- a/node_modules/object-inspect/test/bigint.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var test = require('tape'); -var hasToStringTag = require('has-tostringtag/shams')(); - -test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) { - t.test('primitives', function (st) { - st.plan(3); - - st.equal(inspect(BigInt(-256)), '-256n'); - st.equal(inspect(BigInt(0)), '0n'); - st.equal(inspect(BigInt(256)), '256n'); - }); - - t.test('objects', function (st) { - st.plan(3); - - st.equal(inspect(Object(BigInt(-256))), 'Object(-256n)'); - st.equal(inspect(Object(BigInt(0))), 'Object(0n)'); - st.equal(inspect(Object(BigInt(256))), 'Object(256n)'); - }); - - t.test('syntactic primitives', function (st) { - st.plan(3); - - /* eslint-disable no-new-func */ - st.equal(inspect(Function('return -256n')()), '-256n'); - st.equal(inspect(Function('return 0n')()), '0n'); - st.equal(inspect(Function('return 256n')()), '256n'); - }); - - t.test('toStringTag', { skip: !hasToStringTag }, function (st) { - st.plan(1); - - var faker = {}; - faker[Symbol.toStringTag] = 'BigInt'; - st.equal( - inspect(faker), - '{ [Symbol(Symbol.toStringTag)]: \'BigInt\' }', - 'object lying about being a BigInt inspects as an object' - ); - }); - - t.test('numericSeparator', function (st) { - st.equal(inspect(BigInt(0), { numericSeparator: false }), '0n', '0n, numericSeparator false'); - st.equal(inspect(BigInt(0), { numericSeparator: true }), '0n', '0n, numericSeparator true'); - - st.equal(inspect(BigInt(1234), { numericSeparator: false }), '1234n', '1234n, numericSeparator false'); - st.equal(inspect(BigInt(1234), { numericSeparator: true }), '1_234n', '1234n, numericSeparator true'); - st.equal(inspect(BigInt(-1234), { numericSeparator: false }), '-1234n', '1234n, numericSeparator false'); - st.equal(inspect(BigInt(-1234), { numericSeparator: true }), '-1_234n', '1234n, numericSeparator true'); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/browser/dom.js b/node_modules/object-inspect/test/browser/dom.js deleted file mode 100644 index 210c0b2..0000000 --- a/node_modules/object-inspect/test/browser/dom.js +++ /dev/null @@ -1,15 +0,0 @@ -var inspect = require('../../'); -var test = require('tape'); - -test('dom element', function (t) { - t.plan(1); - - var d = document.createElement('div'); - d.setAttribute('id', 'beep'); - d.innerHTML = 'woooiiiii'; - - t.equal( - inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]), - '[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [Object] ] ] ] } ]' - ); -}); diff --git a/node_modules/object-inspect/test/circular.js b/node_modules/object-inspect/test/circular.js deleted file mode 100644 index 5df4233..0000000 --- a/node_modules/object-inspect/test/circular.js +++ /dev/null @@ -1,16 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); - -test('circular', function (t) { - t.plan(2); - var obj = { a: 1, b: [3, 4] }; - obj.c = obj; - t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }'); - - var double = {}; - double.a = [double]; - double.b = {}; - double.b.inner = double.b; - double.b.obj = double; - t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }'); -}); diff --git a/node_modules/object-inspect/test/deep.js b/node_modules/object-inspect/test/deep.js deleted file mode 100644 index 99ce32a..0000000 --- a/node_modules/object-inspect/test/deep.js +++ /dev/null @@ -1,12 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); - -test('deep', function (t) { - t.plan(4); - var obj = [[[[[[500]]]]]]; - t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]'); - t.equal(inspect(obj, { depth: 4 }), '[ [ [ [ [Array] ] ] ] ]'); - t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]'); - - t.equal(inspect([[[{ a: 1 }]]], { depth: 3 }), '[ [ [ [Object] ] ] ]'); -}); diff --git a/node_modules/object-inspect/test/element.js b/node_modules/object-inspect/test/element.js deleted file mode 100644 index 47fa9e2..0000000 --- a/node_modules/object-inspect/test/element.js +++ /dev/null @@ -1,53 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); - -test('element', function (t) { - t.plan(3); - var elem = { - nodeName: 'div', - attributes: [{ name: 'class', value: 'row' }], - getAttribute: function (key) { return key; }, - childNodes: [] - }; - var obj = [1, elem, 3]; - t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); - t.deepEqual(inspect(obj, { quoteStyle: 'single' }), "[ 1,
, 3 ]"); - t.deepEqual(inspect(obj, { quoteStyle: 'double' }), '[ 1,
, 3 ]'); -}); - -test('element no attr', function (t) { - t.plan(1); - var elem = { - nodeName: 'div', - getAttribute: function (key) { return key; }, - childNodes: [] - }; - var obj = [1, elem, 3]; - t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); -}); - -test('element with contents', function (t) { - t.plan(1); - var elem = { - nodeName: 'div', - getAttribute: function (key) { return key; }, - childNodes: [{ nodeName: 'b' }] - }; - var obj = [1, elem, 3]; - t.deepEqual(inspect(obj), '[ 1,
...
, 3 ]'); -}); - -test('element instance', function (t) { - t.plan(1); - var h = global.HTMLElement; - global.HTMLElement = function (name, attr) { - this.nodeName = name; - this.attributes = attr; - }; - global.HTMLElement.prototype.getAttribute = function () {}; - - var elem = new global.HTMLElement('div', []); - var obj = [1, elem, 3]; - t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); - global.HTMLElement = h; -}); diff --git a/node_modules/object-inspect/test/err.js b/node_modules/object-inspect/test/err.js deleted file mode 100644 index cc1d884..0000000 --- a/node_modules/object-inspect/test/err.js +++ /dev/null @@ -1,48 +0,0 @@ -var test = require('tape'); -var ErrorWithCause = require('error-cause/Error'); - -var inspect = require('../'); - -test('type error', function (t) { - t.plan(1); - var aerr = new TypeError(); - aerr.foo = 555; - aerr.bar = [1, 2, 3]; - - var berr = new TypeError('tuv'); - berr.baz = 555; - - var cerr = new SyntaxError(); - cerr.message = 'whoa'; - cerr['a-b'] = 5; - - var withCause = new ErrorWithCause('foo', { cause: 'bar' }); - var withCausePlus = new ErrorWithCause('foo', { cause: 'bar' }); - withCausePlus.foo = 'bar'; - var withUndefinedCause = new ErrorWithCause('foo', { cause: undefined }); - var withEnumerableCause = new Error('foo'); - withEnumerableCause.cause = 'bar'; - - var obj = [ - new TypeError(), - new TypeError('xxx'), - aerr, - berr, - cerr, - withCause, - withCausePlus, - withUndefinedCause, - withEnumerableCause - ]; - t.equal(inspect(obj), '[ ' + [ - '[TypeError]', - '[TypeError: xxx]', - '{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }', - '{ [TypeError: tuv] baz: 555 }', - '{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }', - 'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: \'bar\' }', - '{ [Error: foo] ' + ('cause' in Error.prototype ? '' : '[cause]: \'bar\', ') + 'foo: \'bar\' }', - 'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: undefined }', - '{ [Error: foo] cause: \'bar\' }' - ].join(', ') + ' ]'); -}); diff --git a/node_modules/object-inspect/test/fakes.js b/node_modules/object-inspect/test/fakes.js deleted file mode 100644 index a65c08c..0000000 --- a/node_modules/object-inspect/test/fakes.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var test = require('tape'); -var hasToStringTag = require('has-tostringtag/shams')(); -var forEach = require('for-each'); - -test('fakes', { skip: !hasToStringTag }, function (t) { - forEach([ - 'Array', - 'Boolean', - 'Date', - 'Error', - 'Number', - 'RegExp', - 'String' - ], function (expected) { - var faker = {}; - faker[Symbol.toStringTag] = expected; - - t.equal( - inspect(faker), - '{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }', - 'faker masquerading as ' + expected + ' is not shown as one' - ); - }); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/fn.js b/node_modules/object-inspect/test/fn.js deleted file mode 100644 index de3ca62..0000000 --- a/node_modules/object-inspect/test/fn.js +++ /dev/null @@ -1,76 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); -var arrow = require('make-arrow-function')(); -var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); - -test('function', function (t) { - t.plan(1); - var obj = [1, 2, function f(n) { return n; }, 4]; - t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]'); -}); - -test('function name', function (t) { - t.plan(1); - var f = (function () { - return function () {}; - }()); - f.toString = function toStr() { return 'function xxx () {}'; }; - var obj = [1, 2, f, 4]; - t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)] { toString: [Function: toStr] }, 4 ]'); -}); - -test('anon function', function (t) { - var f = (function () { - return function () {}; - }()); - var obj = [1, 2, f, 4]; - t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]'); - - t.end(); -}); - -test('arrow function', { skip: !arrow }, function (t) { - t.equal(inspect(arrow), '[Function (anonymous)]'); - - t.end(); -}); - -test('truly nameless function', { skip: !arrow || !functionsHaveConfigurableNames }, function (t) { - function f() {} - Object.defineProperty(f, 'name', { value: false }); - t.equal(f.name, false); - t.equal( - inspect(f), - '[Function: f]', - 'named function with falsy `.name` does not hide its original name' - ); - - function g() {} - Object.defineProperty(g, 'name', { value: true }); - t.equal(g.name, true); - t.equal( - inspect(g), - '[Function: true]', - 'named function with truthy `.name` hides its original name' - ); - - var anon = function () {}; // eslint-disable-line func-style - Object.defineProperty(anon, 'name', { value: null }); - t.equal(anon.name, null); - t.equal( - inspect(anon), - '[Function (anonymous)]', - 'anon function with falsy `.name` does not hide its anonymity' - ); - - var anon2 = function () {}; // eslint-disable-line func-style - Object.defineProperty(anon2, 'name', { value: 1 }); - t.equal(anon2.name, 1); - t.equal( - inspect(anon2), - '[Function: 1]', - 'anon function with truthy `.name` hides its anonymity' - ); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/global.js b/node_modules/object-inspect/test/global.js deleted file mode 100644 index c57216a..0000000 --- a/node_modules/object-inspect/test/global.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var inspect = require('../'); - -var test = require('tape'); -var globalThis = require('globalthis')(); - -test('global object', function (t) { - /* eslint-env browser */ - var expected = typeof window === 'undefined' ? 'globalThis' : 'Window'; - t.equal( - inspect([globalThis]), - '[ { [object ' + expected + '] } ]' - ); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/has.js b/node_modules/object-inspect/test/has.js deleted file mode 100644 index 01800de..0000000 --- a/node_modules/object-inspect/test/has.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var test = require('tape'); -var mockProperty = require('mock-property'); - -test('when Object#hasOwnProperty is deleted', function (t) { - t.plan(1); - var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays - - t.teardown(mockProperty(Array.prototype, 1, { value: 2 })); // this is needed to account for "in" vs "hasOwnProperty" - t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); - - t.equal(inspect(arr), '[ 1, , 3 ]'); -}); diff --git a/node_modules/object-inspect/test/holes.js b/node_modules/object-inspect/test/holes.js deleted file mode 100644 index 87fc8c8..0000000 --- a/node_modules/object-inspect/test/holes.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var inspect = require('../'); - -var xs = ['a', 'b']; -xs[5] = 'f'; -xs[7] = 'j'; -xs[8] = 'k'; - -test('holes', function (t) { - t.plan(1); - t.equal( - inspect(xs), - "[ 'a', 'b', , , , 'f', , 'j', 'k' ]" - ); -}); diff --git a/node_modules/object-inspect/test/indent-option.js b/node_modules/object-inspect/test/indent-option.js deleted file mode 100644 index 89d8fce..0000000 --- a/node_modules/object-inspect/test/indent-option.js +++ /dev/null @@ -1,271 +0,0 @@ -var test = require('tape'); -var forEach = require('for-each'); - -var inspect = require('../'); - -test('bad indent options', function (t) { - forEach([ - undefined, - true, - false, - -1, - 1.2, - Infinity, - -Infinity, - NaN - ], function (indent) { - t['throws']( - function () { inspect('', { indent: indent }); }, - TypeError, - inspect(indent) + ' is invalid' - ); - }); - - t.end(); -}); - -test('simple object with indent', function (t) { - t.plan(2); - - var obj = { a: 1, b: 2 }; - - var expectedSpaces = [ - '{', - ' a: 1,', - ' b: 2', - '}' - ].join('\n'); - var expectedTabs = [ - '{', - ' a: 1,', - ' b: 2', - '}' - ].join('\n'); - - t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); -}); - -test('two deep object with indent', function (t) { - t.plan(2); - - var obj = { a: 1, b: { c: 3, d: 4 } }; - - var expectedSpaces = [ - '{', - ' a: 1,', - ' b: {', - ' c: 3,', - ' d: 4', - ' }', - '}' - ].join('\n'); - var expectedTabs = [ - '{', - ' a: 1,', - ' b: {', - ' c: 3,', - ' d: 4', - ' }', - '}' - ].join('\n'); - - t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); -}); - -test('simple array with all single line elements', function (t) { - t.plan(2); - - var obj = [1, 2, 3, 'asdf\nsdf']; - - var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]'; - - t.equal(inspect(obj, { indent: 2 }), expected, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs'); -}); - -test('array with complex elements', function (t) { - t.plan(2); - - var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf']; - - var expectedSpaces = [ - '[', - ' 1,', - ' {', - ' a: 1,', - ' b: {', - ' c: 1', - ' }', - ' },', - ' \'asdf\\nsdf\'', - ']' - ].join('\n'); - var expectedTabs = [ - '[', - ' 1,', - ' {', - ' a: 1,', - ' b: {', - ' c: 1', - ' }', - ' },', - ' \'asdf\\nsdf\'', - ']' - ].join('\n'); - - t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); -}); - -test('values', function (t) { - t.plan(2); - var obj = [{}, [], { 'a-b': 5 }]; - - var expectedSpaces = [ - '[', - ' {},', - ' [],', - ' {', - ' \'a-b\': 5', - ' }', - ']' - ].join('\n'); - var expectedTabs = [ - '[', - ' {},', - ' [],', - ' {', - ' \'a-b\': 5', - ' }', - ']' - ].join('\n'); - - t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); -}); - -test('Map', { skip: typeof Map !== 'function' }, function (t) { - var map = new Map(); - map.set({ a: 1 }, ['b']); - map.set(3, NaN); - - var expectedStringSpaces = [ - 'Map (2) {', - ' { a: 1 } => [ \'b\' ],', - ' 3 => NaN', - '}' - ].join('\n'); - var expectedStringTabs = [ - 'Map (2) {', - ' { a: 1 } => [ \'b\' ],', - ' 3 => NaN', - '}' - ].join('\n'); - var expectedStringTabsDoubleQuotes = [ - 'Map (2) {', - ' { a: 1 } => [ "b" ],', - ' 3 => NaN', - '}' - ].join('\n'); - - t.equal( - inspect(map, { indent: 2 }), - expectedStringSpaces, - 'Map keys are not indented (two)' - ); - t.equal( - inspect(map, { indent: '\t' }), - expectedStringTabs, - 'Map keys are not indented (tabs)' - ); - t.equal( - inspect(map, { indent: '\t', quoteStyle: 'double' }), - expectedStringTabsDoubleQuotes, - 'Map keys are not indented (tabs + double quotes)' - ); - - t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)'); - t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)'); - - var nestedMap = new Map(); - nestedMap.set(nestedMap, map); - var expectedNestedSpaces = [ - 'Map (1) {', - ' [Circular] => Map (2) {', - ' { a: 1 } => [ \'b\' ],', - ' 3 => NaN', - ' }', - '}' - ].join('\n'); - var expectedNestedTabs = [ - 'Map (1) {', - ' [Circular] => Map (2) {', - ' { a: 1 } => [ \'b\' ],', - ' 3 => NaN', - ' }', - '}' - ].join('\n'); - t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)'); - t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)'); - - t.end(); -}); - -test('Set', { skip: typeof Set !== 'function' }, function (t) { - var set = new Set(); - set.add({ a: 1 }); - set.add(['b']); - var expectedStringSpaces = [ - 'Set (2) {', - ' {', - ' a: 1', - ' },', - ' [ \'b\' ]', - '}' - ].join('\n'); - var expectedStringTabs = [ - 'Set (2) {', - ' {', - ' a: 1', - ' },', - ' [ \'b\' ]', - '}' - ].join('\n'); - t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)'); - t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)'); - - t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)'); - t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)'); - - var nestedSet = new Set(); - nestedSet.add(set); - nestedSet.add(nestedSet); - var expectedNestedSpaces = [ - 'Set (2) {', - ' Set (2) {', - ' {', - ' a: 1', - ' },', - ' [ \'b\' ]', - ' },', - ' [Circular]', - '}' - ].join('\n'); - var expectedNestedTabs = [ - 'Set (2) {', - ' Set (2) {', - ' {', - ' a: 1', - ' },', - ' [ \'b\' ]', - ' },', - ' [Circular]', - '}' - ].join('\n'); - t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)'); - t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)'); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/inspect.js b/node_modules/object-inspect/test/inspect.js deleted file mode 100644 index 1abf81b..0000000 --- a/node_modules/object-inspect/test/inspect.js +++ /dev/null @@ -1,139 +0,0 @@ -var test = require('tape'); -var hasSymbols = require('has-symbols/shams')(); -var utilInspect = require('../util.inspect'); -var repeat = require('string.prototype.repeat'); - -var inspect = require('..'); - -test('inspect', function (t) { - t.plan(5); - - var obj = [{ inspect: function xyzInspect() { return '!XYZ¡'; } }, []]; - var stringResult = '[ !XYZ¡, [] ]'; - var falseResult = '[ { inspect: [Function: xyzInspect] }, [] ]'; - - t.equal(inspect(obj), stringResult); - t.equal(inspect(obj, { customInspect: true }), stringResult); - t.equal(inspect(obj, { customInspect: 'symbol' }), falseResult); - t.equal(inspect(obj, { customInspect: false }), falseResult); - t['throws']( - function () { inspect(obj, { customInspect: 'not a boolean or "symbol"' }); }, - TypeError, - '`customInspect` must be a boolean or the string "symbol"' - ); -}); - -test('inspect custom symbol', { skip: !hasSymbols || !utilInspect || !utilInspect.custom }, function (t) { - t.plan(4); - - var obj = { inspect: function stringInspect() { return 'string'; } }; - obj[utilInspect.custom] = function custom() { return 'symbol'; }; - - var symbolResult = '[ symbol, [] ]'; - var stringResult = '[ string, [] ]'; - var falseResult = '[ { inspect: [Function: stringInspect]' + (utilInspect.custom ? ', [' + inspect(utilInspect.custom) + ']: [Function: custom]' : '') + ' }, [] ]'; - - var symbolStringFallback = utilInspect.custom ? symbolResult : stringResult; - var symbolFalseFallback = utilInspect.custom ? symbolResult : falseResult; - - t.equal(inspect([obj, []]), symbolStringFallback); - t.equal(inspect([obj, []], { customInspect: true }), symbolStringFallback); - t.equal(inspect([obj, []], { customInspect: 'symbol' }), symbolFalseFallback); - t.equal(inspect([obj, []], { customInspect: false }), falseResult); -}); - -test('symbols', { skip: !hasSymbols }, function (t) { - t.plan(2); - - var obj = { a: 1 }; - obj[Symbol('test')] = 2; - obj[Symbol.iterator] = 3; - Object.defineProperty(obj, Symbol('non-enum'), { - enumerable: false, - value: 4 - }); - - if (typeof Symbol.iterator === 'symbol') { - t.equal(inspect(obj), '{ a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }', 'object with symbols'); - t.equal(inspect([obj, []]), '[ { a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }, [] ]', 'object with symbols in array'); - } else { - // symbol sham key ordering is unreliable - t.match( - inspect(obj), - /^(?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 })$/, - 'object with symbols (nondeterministic symbol sham key ordering)' - ); - t.match( - inspect([obj, []]), - /^\[ (?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 }), \[\] \]$/, - 'object with symbols in array (nondeterministic symbol sham key ordering)' - ); - } -}); - -test('maxStringLength', function (t) { - t['throws']( - function () { inspect('', { maxStringLength: -1 }); }, - TypeError, - 'maxStringLength must be >= 0, or Infinity, not negative' - ); - - var str = repeat('a', 1e8); - - t.equal( - inspect([str], { maxStringLength: 10 }), - '[ \'aaaaaaaaaa\'... 99999990 more characters ]', - 'maxStringLength option limits output' - ); - - t.equal( - inspect(['f'], { maxStringLength: null }), - '[ \'\'... 1 more character ]', - 'maxStringLength option accepts `null`' - ); - - t.equal( - inspect([str], { maxStringLength: Infinity }), - '[ \'' + str + '\' ]', - 'maxStringLength option accepts ∞' - ); - - t.end(); -}); - -test('inspect options', { skip: !utilInspect.custom }, function (t) { - var obj = {}; - obj[utilInspect.custom] = function () { - return JSON.stringify(arguments); - }; - t.equal( - inspect(obj), - utilInspect(obj, { depth: 5 }), - 'custom symbols will use node\'s inspect' - ); - t.equal( - inspect(obj, { depth: 2 }), - utilInspect(obj, { depth: 2 }), - 'a reduced depth will be passed to node\'s inspect' - ); - t.equal( - inspect({ d1: obj }, { depth: 3 }), - '{ d1: ' + utilInspect(obj, { depth: 2 }) + ' }', - 'deep objects will receive a reduced depth' - ); - t.equal( - inspect({ d1: obj }, { depth: 1 }), - '{ d1: [Object] }', - 'unlike nodejs inspect, customInspect will not be used once the depth is exceeded.' - ); - t.end(); -}); - -test('inspect URL', { skip: typeof URL === 'undefined' }, function (t) { - t.match( - inspect(new URL('https://nodejs.org')), - /nodejs\.org/, // Different environments stringify it differently - 'url can be inspected' - ); - t.end(); -}); diff --git a/node_modules/object-inspect/test/lowbyte.js b/node_modules/object-inspect/test/lowbyte.js deleted file mode 100644 index 68a345d..0000000 --- a/node_modules/object-inspect/test/lowbyte.js +++ /dev/null @@ -1,12 +0,0 @@ -var test = require('tape'); -var inspect = require('../'); - -var obj = { x: 'a\r\nb', y: '\x05! \x1f \x12' }; - -test('interpolate low bytes', function (t) { - t.plan(1); - t.equal( - inspect(obj), - "{ x: 'a\\r\\nb', y: '\\x05! \\x1F \\x12' }" - ); -}); diff --git a/node_modules/object-inspect/test/number.js b/node_modules/object-inspect/test/number.js deleted file mode 100644 index 8f287e8..0000000 --- a/node_modules/object-inspect/test/number.js +++ /dev/null @@ -1,58 +0,0 @@ -var test = require('tape'); -var v = require('es-value-fixtures'); -var forEach = require('for-each'); - -var inspect = require('../'); - -test('negative zero', function (t) { - t.equal(inspect(0), '0', 'inspect(0) === "0"'); - t.equal(inspect(Object(0)), 'Object(0)', 'inspect(Object(0)) === "Object(0)"'); - - t.equal(inspect(-0), '-0', 'inspect(-0) === "-0"'); - t.equal(inspect(Object(-0)), 'Object(-0)', 'inspect(Object(-0)) === "Object(-0)"'); - - t.end(); -}); - -test('numericSeparator', function (t) { - forEach(v.nonBooleans, function (nonBoolean) { - t['throws']( - function () { inspect(true, { numericSeparator: nonBoolean }); }, - TypeError, - inspect(nonBoolean) + ' is not a boolean' - ); - }); - - t.test('3 digit numbers', function (st) { - var failed = false; - for (var i = -999; i < 1000; i += 1) { - var actual = inspect(i); - var actualSepNo = inspect(i, { numericSeparator: false }); - var actualSepYes = inspect(i, { numericSeparator: true }); - var expected = String(i); - if (actual !== expected || actualSepNo !== expected || actualSepYes !== expected) { - failed = true; - t.equal(actual, expected); - t.equal(actualSepNo, expected); - t.equal(actualSepYes, expected); - } - } - - st.notOk(failed, 'all 3 digit numbers passed'); - - st.end(); - }); - - t.equal(inspect(1e3), '1000', '1000'); - t.equal(inspect(1e3, { numericSeparator: false }), '1000', '1000, numericSeparator false'); - t.equal(inspect(1e3, { numericSeparator: true }), '1_000', '1000, numericSeparator true'); - t.equal(inspect(-1e3), '-1000', '-1000'); - t.equal(inspect(-1e3, { numericSeparator: false }), '-1000', '-1000, numericSeparator false'); - t.equal(inspect(-1e3, { numericSeparator: true }), '-1_000', '-1000, numericSeparator true'); - - t.equal(inspect(1234.5678, { numericSeparator: true }), '1_234.567_8', 'fractional numbers get separators'); - t.equal(inspect(1234.56789, { numericSeparator: true }), '1_234.567_89', 'fractional numbers get separators'); - t.equal(inspect(1234.567891, { numericSeparator: true }), '1_234.567_891', 'fractional numbers get separators'); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/quoteStyle.js b/node_modules/object-inspect/test/quoteStyle.js deleted file mode 100644 index da23e63..0000000 --- a/node_modules/object-inspect/test/quoteStyle.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var test = require('tape'); - -test('quoteStyle option', function (t) { - t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value'); - - t.equal(inspect('"', { quoteStyle: 'single' }), '\'"\'', 'double quote, quoteStyle: "single"'); - t.equal(inspect('"', { quoteStyle: 'double' }), '"\\""', 'double quote, quoteStyle: "double"'); - - t.equal(inspect('\'', { quoteStyle: 'single' }), '\'\\\'\'', 'single quote, quoteStyle: "single"'); - t.equal(inspect('\'', { quoteStyle: 'double' }), '"\'"', 'single quote, quoteStyle: "double"'); - - t.equal(inspect('`', { quoteStyle: 'single' }), '\'`\'', 'backtick, quoteStyle: "single"'); - t.equal(inspect('`', { quoteStyle: 'double' }), '"`"', 'backtick, quoteStyle: "double"'); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/toStringTag.js b/node_modules/object-inspect/test/toStringTag.js deleted file mode 100644 index 95f8270..0000000 --- a/node_modules/object-inspect/test/toStringTag.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -var test = require('tape'); -var hasToStringTag = require('has-tostringtag/shams')(); - -var inspect = require('../'); - -test('Symbol.toStringTag', { skip: !hasToStringTag }, function (t) { - t.plan(4); - - var obj = { a: 1 }; - t.equal(inspect(obj), '{ a: 1 }', 'object, no Symbol.toStringTag'); - - obj[Symbol.toStringTag] = 'foo'; - t.equal(inspect(obj), '{ a: 1, [Symbol(Symbol.toStringTag)]: \'foo\' }', 'object with Symbol.toStringTag'); - - t.test('null objects', { skip: 'toString' in { __proto__: null } }, function (st) { - st.plan(2); - - var dict = { __proto__: null, a: 1 }; - st.equal(inspect(dict), '[Object: null prototype] { a: 1 }', 'null object with Symbol.toStringTag'); - - dict[Symbol.toStringTag] = 'Dict'; - st.equal(inspect(dict), '[Dict: null prototype] { a: 1, [Symbol(Symbol.toStringTag)]: \'Dict\' }', 'null object with Symbol.toStringTag'); - }); - - t.test('instances', function (st) { - st.plan(4); - - function C() { - this.a = 1; - } - st.equal(Object.prototype.toString.call(new C()), '[object Object]', 'instance, no toStringTag, Object.prototype.toString'); - st.equal(inspect(new C()), 'C { a: 1 }', 'instance, no toStringTag'); - - C.prototype[Symbol.toStringTag] = 'Class!'; - st.equal(Object.prototype.toString.call(new C()), '[object Class!]', 'instance, with toStringTag, Object.prototype.toString'); - st.equal(inspect(new C()), 'C [Class!] { a: 1 }', 'instance, with toStringTag'); - }); -}); diff --git a/node_modules/object-inspect/test/undef.js b/node_modules/object-inspect/test/undef.js deleted file mode 100644 index e3f4961..0000000 --- a/node_modules/object-inspect/test/undef.js +++ /dev/null @@ -1,12 +0,0 @@ -var test = require('tape'); -var inspect = require('../'); - -var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null }; - -test('undef and null', function (t) { - t.plan(1); - t.equal( - inspect(obj), - '{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }' - ); -}); diff --git a/node_modules/object-inspect/test/values.js b/node_modules/object-inspect/test/values.js deleted file mode 100644 index 15986cd..0000000 --- a/node_modules/object-inspect/test/values.js +++ /dev/null @@ -1,261 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var test = require('tape'); -var mockProperty = require('mock-property'); -var hasSymbols = require('has-symbols/shams')(); -var hasToStringTag = require('has-tostringtag/shams')(); -var forEach = require('for-each'); -var semver = require('semver'); - -test('values', function (t) { - t.plan(1); - var obj = [{}, [], { 'a-b': 5 }]; - t.equal(inspect(obj), '[ {}, [], { \'a-b\': 5 } ]'); -}); - -test('arrays with properties', function (t) { - t.plan(1); - var arr = [3]; - arr.foo = 'bar'; - var obj = [1, 2, arr]; - obj.baz = 'quux'; - obj.index = -1; - t.equal(inspect(obj), '[ 1, 2, [ 3, foo: \'bar\' ], baz: \'quux\', index: -1 ]'); -}); - -test('has', function (t) { - t.plan(1); - t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); - - t.equal(inspect({ a: 1, b: 2 }), '{ a: 1, b: 2 }'); -}); - -test('indexOf seen', function (t) { - t.plan(1); - var xs = [1, 2, 3, {}]; - xs.push(xs); - - var seen = []; - seen.indexOf = undefined; - - t.equal( - inspect(xs, {}, 0, seen), - '[ 1, 2, 3, {}, [Circular] ]' - ); -}); - -test('seen seen', function (t) { - t.plan(1); - var xs = [1, 2, 3]; - - var seen = [xs]; - seen.indexOf = undefined; - - t.equal( - inspect(xs, {}, 0, seen), - '[Circular]' - ); -}); - -test('seen seen seen', function (t) { - t.plan(1); - var xs = [1, 2, 3]; - - var seen = [5, xs]; - seen.indexOf = undefined; - - t.equal( - inspect(xs, {}, 0, seen), - '[Circular]' - ); -}); - -test('symbols', { skip: !hasSymbols }, function (t) { - var sym = Symbol('foo'); - t.equal(inspect(sym), 'Symbol(foo)', 'Symbol("foo") should be "Symbol(foo)"'); - if (typeof sym === 'symbol') { - // Symbol shams are incapable of differentiating boxed from unboxed symbols - t.equal(inspect(Object(sym)), 'Object(Symbol(foo))', 'Object(Symbol("foo")) should be "Object(Symbol(foo))"'); - } - - t.test('toStringTag', { skip: !hasToStringTag }, function (st) { - st.plan(1); - - var faker = {}; - faker[Symbol.toStringTag] = 'Symbol'; - st.equal( - inspect(faker), - '{ [Symbol(Symbol.toStringTag)]: \'Symbol\' }', - 'object lying about being a Symbol inspects as an object' - ); - }); - - t.end(); -}); - -test('Map', { skip: typeof Map !== 'function' }, function (t) { - var map = new Map(); - map.set({ a: 1 }, ['b']); - map.set(3, NaN); - var expectedString = 'Map (2) {' + inspect({ a: 1 }) + ' => ' + inspect(['b']) + ', 3 => NaN}'; - t.equal(inspect(map), expectedString, 'new Map([[{ a: 1 }, ["b"]], [3, NaN]]) should show size and contents'); - t.equal(inspect(new Map()), 'Map (0) {}', 'empty Map should show as empty'); - - var nestedMap = new Map(); - nestedMap.set(nestedMap, map); - t.equal(inspect(nestedMap), 'Map (1) {[Circular] => ' + expectedString + '}', 'Map containing a Map should work'); - - t.end(); -}); - -test('WeakMap', { skip: typeof WeakMap !== 'function' }, function (t) { - var map = new WeakMap(); - map.set({ a: 1 }, ['b']); - var expectedString = 'WeakMap { ? }'; - t.equal(inspect(map), expectedString, 'new WeakMap([[{ a: 1 }, ["b"]]]) should not show size or contents'); - t.equal(inspect(new WeakMap()), 'WeakMap { ? }', 'empty WeakMap should not show as empty'); - - t.end(); -}); - -test('Set', { skip: typeof Set !== 'function' }, function (t) { - var set = new Set(); - set.add({ a: 1 }); - set.add(['b']); - var expectedString = 'Set (2) {' + inspect({ a: 1 }) + ', ' + inspect(['b']) + '}'; - t.equal(inspect(set), expectedString, 'new Set([{ a: 1 }, ["b"]]) should show size and contents'); - t.equal(inspect(new Set()), 'Set (0) {}', 'empty Set should show as empty'); - - var nestedSet = new Set(); - nestedSet.add(set); - nestedSet.add(nestedSet); - t.equal(inspect(nestedSet), 'Set (2) {' + expectedString + ', [Circular]}', 'Set containing a Set should work'); - - t.end(); -}); - -test('WeakSet', { skip: typeof WeakSet !== 'function' }, function (t) { - var map = new WeakSet(); - map.add({ a: 1 }); - var expectedString = 'WeakSet { ? }'; - t.equal(inspect(map), expectedString, 'new WeakSet([{ a: 1 }]) should not show size or contents'); - t.equal(inspect(new WeakSet()), 'WeakSet { ? }', 'empty WeakSet should not show as empty'); - - t.end(); -}); - -test('WeakRef', { skip: typeof WeakRef !== 'function' }, function (t) { - var ref = new WeakRef({ a: 1 }); - var expectedString = 'WeakRef { ? }'; - t.equal(inspect(ref), expectedString, 'new WeakRef({ a: 1 }) should not show contents'); - - t.end(); -}); - -test('FinalizationRegistry', { skip: typeof FinalizationRegistry !== 'function' }, function (t) { - var registry = new FinalizationRegistry(function () {}); - var expectedString = 'FinalizationRegistry [FinalizationRegistry] {}'; - t.equal(inspect(registry), expectedString, 'new FinalizationRegistry(function () {}) should work normallys'); - - t.end(); -}); - -test('Strings', function (t) { - var str = 'abc'; - - t.equal(inspect(str), "'" + str + "'", 'primitive string shows as such'); - t.equal(inspect(str, { quoteStyle: 'single' }), "'" + str + "'", 'primitive string shows as such, single quoted'); - t.equal(inspect(str, { quoteStyle: 'double' }), '"' + str + '"', 'primitive string shows as such, double quoted'); - t.equal(inspect(Object(str)), 'Object(' + inspect(str) + ')', 'String object shows as such'); - t.equal(inspect(Object(str), { quoteStyle: 'single' }), 'Object(' + inspect(str, { quoteStyle: 'single' }) + ')', 'String object shows as such, single quoted'); - t.equal(inspect(Object(str), { quoteStyle: 'double' }), 'Object(' + inspect(str, { quoteStyle: 'double' }) + ')', 'String object shows as such, double quoted'); - - t.end(); -}); - -test('Numbers', function (t) { - var num = 42; - - t.equal(inspect(num), String(num), 'primitive number shows as such'); - t.equal(inspect(Object(num)), 'Object(' + inspect(num) + ')', 'Number object shows as such'); - - t.end(); -}); - -test('Booleans', function (t) { - t.equal(inspect(true), String(true), 'primitive true shows as such'); - t.equal(inspect(Object(true)), 'Object(' + inspect(true) + ')', 'Boolean object true shows as such'); - - t.equal(inspect(false), String(false), 'primitive false shows as such'); - t.equal(inspect(Object(false)), 'Object(' + inspect(false) + ')', 'Boolean false object shows as such'); - - t.end(); -}); - -test('Date', function (t) { - var now = new Date(); - t.equal(inspect(now), String(now), 'Date shows properly'); - t.equal(inspect(new Date(NaN)), 'Invalid Date', 'Invalid Date shows properly'); - - t.end(); -}); - -test('RegExps', function (t) { - t.equal(inspect(/a/g), '/a/g', 'regex shows properly'); - t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly'); - - var match = 'abc abc'.match(/[ab]+/); - delete match.groups; // for node < 10 - t.equal(inspect(match), '[ \'ab\', index: 0, input: \'abc abc\' ]', 'RegExp match object shows properly'); - - t.end(); -}); - -test('Proxies', { skip: typeof Proxy !== 'function' || !hasToStringTag }, function (t) { - var target = { proxy: true }; - var fake = new Proxy(target, { has: function () { return false; } }); - - // needed to work around a weird difference in node v6.0 - v6.4 where non-present properties are not logged - var isNode60 = semver.satisfies(process.version, '6.0 - 6.4'); - - forEach([ - 'Boolean', - 'Number', - 'String', - 'Symbol', - 'Date' - ], function (tag) { - target[Symbol.toStringTag] = tag; - - t.equal( - inspect(fake), - '{ ' + (isNode60 ? '' : 'proxy: true, ') + '[Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', - 'Proxy for + ' + tag + ' shows as the target, which has no slots' - ); - }); - - t.end(); -}); - -test('fakers', { skip: !hasToStringTag }, function (t) { - var target = { proxy: false }; - - forEach([ - 'Boolean', - 'Number', - 'String', - 'Symbol', - 'Date' - ], function (tag) { - target[Symbol.toStringTag] = tag; - - t.equal( - inspect(target), - '{ proxy: false, [Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', - 'Object pretending to be ' + tag + ' does not trick us' - ); - }); - - t.end(); -}); diff --git a/node_modules/object-inspect/util.inspect.js b/node_modules/object-inspect/util.inspect.js deleted file mode 100644 index 7784fab..0000000 --- a/node_modules/object-inspect/util.inspect.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inspect; diff --git a/node_modules/on-finished/HISTORY.md b/node_modules/on-finished/HISTORY.md deleted file mode 100644 index 1917595..0000000 --- a/node_modules/on-finished/HISTORY.md +++ /dev/null @@ -1,98 +0,0 @@ -2.4.1 / 2022-02-22 -================== - - * Fix error on early async hooks implementations - -2.4.0 / 2022-02-21 -================== - - * Prevent loss of async hooks context - -2.3.0 / 2015-05-26 -================== - - * Add defined behavior for HTTP `CONNECT` requests - * Add defined behavior for HTTP `Upgrade` requests - * deps: ee-first@1.1.1 - -2.2.1 / 2015-04-22 -================== - - * Fix `isFinished(req)` when data buffered - -2.2.0 / 2014-12-22 -================== - - * Add message object to callback arguments - -2.1.1 / 2014-10-22 -================== - - * Fix handling of pipelined requests - -2.1.0 / 2014-08-16 -================== - - * Check if `socket` is detached - * Return `undefined` for `isFinished` if state unknown - -2.0.0 / 2014-08-16 -================== - - * Add `isFinished` function - * Move to `jshttp` organization - * Remove support for plain socket argument - * Rename to `on-finished` - * Support both `req` and `res` as arguments - * deps: ee-first@1.0.5 - -1.2.2 / 2014-06-10 -================== - - * Reduce listeners added to emitters - - avoids "event emitter leak" warnings when used multiple times on same request - -1.2.1 / 2014-06-08 -================== - - * Fix returned value when already finished - -1.2.0 / 2014-06-05 -================== - - * Call callback when called on already-finished socket - -1.1.4 / 2014-05-27 -================== - - * Support node.js 0.8 - -1.1.3 / 2014-04-30 -================== - - * Make sure errors passed as instanceof `Error` - -1.1.2 / 2014-04-18 -================== - - * Default the `socket` to passed-in object - -1.1.1 / 2014-01-16 -================== - - * Rename module to `finished` - -1.1.0 / 2013-12-25 -================== - - * Call callback when called on already-errored socket - -1.0.1 / 2013-12-20 -================== - - * Actually pass the error to the callback - -1.0.0 / 2013-12-20 -================== - - * Initial release diff --git a/node_modules/on-finished/LICENSE b/node_modules/on-finished/LICENSE deleted file mode 100644 index 5931fd2..0000000 --- a/node_modules/on-finished/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Jonathan Ong -Copyright (c) 2014 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/on-finished/README.md b/node_modules/on-finished/README.md deleted file mode 100644 index 8973cde..0000000 --- a/node_modules/on-finished/README.md +++ /dev/null @@ -1,162 +0,0 @@ -# on-finished - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][ci-image]][ci-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -Execute a callback when a HTTP request closes, finishes, or errors. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install on-finished -``` - -## API - -```js -var onFinished = require('on-finished') -``` - -### onFinished(res, listener) - -Attach a listener to listen for the response to finish. The listener will -be invoked only once when the response finished. If the response finished -to an error, the first argument will contain the error. If the response -has already finished, the listener will be invoked. - -Listening to the end of a response would be used to close things associated -with the response, like open files. - -Listener is invoked as `listener(err, res)`. - - - -```js -onFinished(res, function (err, res) { - // clean up open fds, etc. - // err contains the error if request error'd -}) -``` - -### onFinished(req, listener) - -Attach a listener to listen for the request to finish. The listener will -be invoked only once when the request finished. If the request finished -to an error, the first argument will contain the error. If the request -has already finished, the listener will be invoked. - -Listening to the end of a request would be used to know when to continue -after reading the data. - -Listener is invoked as `listener(err, req)`. - - - -```js -var data = '' - -req.setEncoding('utf8') -req.on('data', function (str) { - data += str -}) - -onFinished(req, function (err, req) { - // data is read unless there is err -}) -``` - -### onFinished.isFinished(res) - -Determine if `res` is already finished. This would be useful to check and -not even start certain operations if the response has already finished. - -### onFinished.isFinished(req) - -Determine if `req` is already finished. This would be useful to check and -not even start certain operations if the request has already finished. - -## Special Node.js requests - -### HTTP CONNECT method - -The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: - -> The CONNECT method requests that the recipient establish a tunnel to -> the destination origin server identified by the request-target and, -> if successful, thereafter restrict its behavior to blind forwarding -> of packets, in both directions, until the tunnel is closed. Tunnels -> are commonly used to create an end-to-end virtual connection, through -> one or more proxies, which can then be secured using TLS (Transport -> Layer Security, [RFC5246]). - -In Node.js, these request objects come from the `'connect'` event on -the HTTP server. - -When this module is used on a HTTP `CONNECT` request, the request is -considered "finished" immediately, **due to limitations in the Node.js -interface**. This means if the `CONNECT` request contains a request entity, -the request will be considered "finished" even before it has been read. - -There is no such thing as a response object to a `CONNECT` request in -Node.js, so there is no support for one. - -### HTTP Upgrade request - -The meaning of the `Upgrade` header from RFC 7230, section 6.1: - -> The "Upgrade" header field is intended to provide a simple mechanism -> for transitioning from HTTP/1.1 to some other protocol on the same -> connection. - -In Node.js, these request objects come from the `'upgrade'` event on -the HTTP server. - -When this module is used on a HTTP request with an `Upgrade` header, the -request is considered "finished" immediately, **due to limitations in the -Node.js interface**. This means if the `Upgrade` request contains a request -entity, the request will be considered "finished" even before it has been -read. - -There is no such thing as a response object to a `Upgrade` request in -Node.js, so there is no support for one. - -## Example - -The following code ensures that file descriptors are always closed -once the response finishes. - -```js -var destroy = require('destroy') -var fs = require('fs') -var http = require('http') -var onFinished = require('on-finished') - -http.createServer(function onRequest (req, res) { - var stream = fs.createReadStream('package.json') - stream.pipe(res) - onFinished(res, function () { - destroy(stream) - }) -}) -``` - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/on-finished/master?label=ci -[ci-url]: https://github.com/jshttp/on-finished/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-finished/master -[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master -[node-image]: https://badgen.net/npm/node/on-finished -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/on-finished -[npm-url]: https://npmjs.org/package/on-finished -[npm-version-image]: https://badgen.net/npm/v/on-finished diff --git a/node_modules/on-finished/index.js b/node_modules/on-finished/index.js deleted file mode 100644 index e68df7b..0000000 --- a/node_modules/on-finished/index.js +++ /dev/null @@ -1,234 +0,0 @@ -/*! - * on-finished - * Copyright(c) 2013 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = onFinished -module.exports.isFinished = isFinished - -/** - * Module dependencies. - * @private - */ - -var asyncHooks = tryRequireAsyncHooks() -var first = require('ee-first') - -/** - * Variables. - * @private - */ - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) } - -/** - * Invoke callback when the response has finished, useful for - * cleaning up resources afterwards. - * - * @param {object} msg - * @param {function} listener - * @return {object} - * @public - */ - -function onFinished (msg, listener) { - if (isFinished(msg) !== false) { - defer(listener, null, msg) - return msg - } - - // attach the listener to the message - attachListener(msg, wrap(listener)) - - return msg -} - -/** - * Determine if message is already finished. - * - * @param {object} msg - * @return {boolean} - * @public - */ - -function isFinished (msg) { - var socket = msg.socket - - if (typeof msg.finished === 'boolean') { - // OutgoingMessage - return Boolean(msg.finished || (socket && !socket.writable)) - } - - if (typeof msg.complete === 'boolean') { - // IncomingMessage - return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) - } - - // don't know - return undefined -} - -/** - * Attach a finished listener to the message. - * - * @param {object} msg - * @param {function} callback - * @private - */ - -function attachFinishedListener (msg, callback) { - var eeMsg - var eeSocket - var finished = false - - function onFinish (error) { - eeMsg.cancel() - eeSocket.cancel() - - finished = true - callback(error) - } - - // finished on first message event - eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) - - function onSocket (socket) { - // remove listener - msg.removeListener('socket', onSocket) - - if (finished) return - if (eeMsg !== eeSocket) return - - // finished on first socket event - eeSocket = first([[socket, 'error', 'close']], onFinish) - } - - if (msg.socket) { - // socket already assigned - onSocket(msg.socket) - return - } - - // wait for socket to be assigned - msg.on('socket', onSocket) - - if (msg.socket === undefined) { - // istanbul ignore next: node.js 0.8 patch - patchAssignSocket(msg, onSocket) - } -} - -/** - * Attach the listener to the message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function attachListener (msg, listener) { - var attached = msg.__onFinished - - // create a private single listener with queue - if (!attached || !attached.queue) { - attached = msg.__onFinished = createListener(msg) - attachFinishedListener(msg, attached) - } - - attached.queue.push(listener) -} - -/** - * Create listener on message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function createListener (msg) { - function listener (err) { - if (msg.__onFinished === listener) msg.__onFinished = null - if (!listener.queue) return - - var queue = listener.queue - listener.queue = null - - for (var i = 0; i < queue.length; i++) { - queue[i](err, msg) - } - } - - listener.queue = [] - - return listener -} - -/** - * Patch ServerResponse.prototype.assignSocket for node.js 0.8. - * - * @param {ServerResponse} res - * @param {function} callback - * @private - */ - -// istanbul ignore next: node.js 0.8 patch -function patchAssignSocket (res, callback) { - var assignSocket = res.assignSocket - - if (typeof assignSocket !== 'function') return - - // res.on('socket', callback) is broken in 0.8 - res.assignSocket = function _assignSocket (socket) { - assignSocket.call(this, socket) - callback(socket) - } -} - -/** - * Try to require async_hooks - * @private - */ - -function tryRequireAsyncHooks () { - try { - return require('async_hooks') - } catch (e) { - return {} - } -} - -/** - * Wrap function with async resource, if possible. - * AsyncResource.bind static method backported. - * @private - */ - -function wrap (fn) { - var res - - // create anonymous resource - if (asyncHooks.AsyncResource) { - res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn') - } - - // incompatible node.js - if (!res || !res.runInAsyncScope) { - return fn - } - - // return bound function - return res.runInAsyncScope.bind(res, fn, null) -} diff --git a/node_modules/on-finished/package.json b/node_modules/on-finished/package.json deleted file mode 100644 index 644cd81..0000000 --- a/node_modules/on-finished/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "on-finished", - "description": "Execute a callback when a request closes, finishes, or errors", - "version": "2.4.1", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "jshttp/on-finished", - "dependencies": { - "ee-first": "1.1.1" - }, - "devDependencies": { - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.1", - "nyc": "15.1.0" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/node_modules/once/LICENSE b/node_modules/once/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/once/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/once/README.md b/node_modules/once/README.md deleted file mode 100644 index 1f1ffca..0000000 --- a/node_modules/once/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` - -## `once.strict(func)` - -Throw an error if the function is called twice. - -Some functions are expected to be called only once. Using `once` for them would -potentially hide logical errors. - -In the example below, the `greet` function has to call the callback only once: - -```javascript -function greet (name, cb) { - // return is missing from the if statement - // when no name is passed, the callback is called twice - if (!name) cb('Hello anonymous') - cb('Hello ' + name) -} - -function log (msg) { - console.log(msg) -} - -// this will print 'Hello anonymous' but the logical error will be missed -greet(null, once(msg)) - -// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time -greet(null, once.strict(msg)) -``` diff --git a/node_modules/once/once.js b/node_modules/once/once.js deleted file mode 100644 index 2354067..0000000 --- a/node_modules/once/once.js +++ /dev/null @@ -1,42 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} diff --git a/node_modules/once/package.json b/node_modules/once/package.json deleted file mode 100644 index 16815b2..0000000 --- a/node_modules/once/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "once", - "version": "1.4.0", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" - }, - "dependencies": { - "wrappy": "1" - }, - "devDependencies": { - "tap": "^7.0.1" - }, - "scripts": { - "test": "tap test/*.js" - }, - "files": [ - "once.js" - ], - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once" - }, - "keywords": [ - "once", - "function", - "one", - "single" - ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC" -} diff --git a/node_modules/parseurl/HISTORY.md b/node_modules/parseurl/HISTORY.md deleted file mode 100644 index 8e40954..0000000 --- a/node_modules/parseurl/HISTORY.md +++ /dev/null @@ -1,58 +0,0 @@ -1.3.3 / 2019-04-15 -================== - - * Fix Node.js 0.8 return value inconsistencies - -1.3.2 / 2017-09-09 -================== - - * perf: reduce overhead for full URLs - * perf: unroll the "fast-path" `RegExp` - -1.3.1 / 2016-01-17 -================== - - * perf: enable strict mode - -1.3.0 / 2014-08-09 -================== - - * Add `parseurl.original` for parsing `req.originalUrl` with fallback - * Return `undefined` if `req.url` is `undefined` - -1.2.0 / 2014-07-21 -================== - - * Cache URLs based on original value - * Remove no-longer-needed URL mis-parse work-around - * Simplify the "fast-path" `RegExp` - -1.1.3 / 2014-07-08 -================== - - * Fix typo - -1.1.2 / 2014-07-08 -================== - - * Seriously fix Node.js 0.8 compatibility - -1.1.1 / 2014-07-08 -================== - - * Fix Node.js 0.8 compatibility - -1.1.0 / 2014-07-08 -================== - - * Incorporate URL href-only parse fast-path - -1.0.1 / 2014-03-08 -================== - - * Add missing `require` - -1.0.0 / 2014-03-08 -================== - - * Genesis from `connect` diff --git a/node_modules/parseurl/LICENSE b/node_modules/parseurl/LICENSE deleted file mode 100644 index 27653d3..0000000 --- a/node_modules/parseurl/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ - -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2017 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/parseurl/README.md b/node_modules/parseurl/README.md deleted file mode 100644 index 443e716..0000000 --- a/node_modules/parseurl/README.md +++ /dev/null @@ -1,133 +0,0 @@ -# parseurl - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Parse a URL with memoization. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install parseurl -``` - -## API - -```js -var parseurl = require('parseurl') -``` - -### parseurl(req) - -Parse the URL of the given request object (looks at the `req.url` property) -and return the result. The result is the same as `url.parse` in Node.js core. -Calling this function multiple times on the same `req` where `req.url` does -not change will return a cached parsed object, rather than parsing again. - -### parseurl.original(req) - -Parse the original URL of the given request object and return the result. -This works by trying to parse `req.originalUrl` if it is a string, otherwise -parses `req.url`. The result is the same as `url.parse` in Node.js core. -Calling this function multiple times on the same `req` where `req.originalUrl` -does not change will return a cached parsed object, rather than parsing again. - -## Benchmark - -```bash -$ npm run-script bench - -> parseurl@1.3.3 bench nodejs-parseurl -> node benchmark/index.js - - http_parser@2.8.0 - node@10.6.0 - v8@6.7.288.46-node.13 - uv@1.21.0 - zlib@1.2.11 - ares@1.14.0 - modules@64 - nghttp2@1.32.0 - napi@3 - openssl@1.1.0h - icu@61.1 - unicode@10.0 - cldr@33.0 - tz@2018c - -> node benchmark/fullurl.js - - Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" - - 4 tests completed. - - fasturl x 2,207,842 ops/sec ±3.76% (184 runs sampled) - nativeurl - legacy x 507,180 ops/sec ±0.82% (191 runs sampled) - nativeurl - whatwg x 290,044 ops/sec ±1.96% (189 runs sampled) - parseurl x 488,907 ops/sec ±2.13% (192 runs sampled) - -> node benchmark/pathquery.js - - Parsing URL "/foo/bar?user=tj&pet=fluffy" - - 4 tests completed. - - fasturl x 3,812,564 ops/sec ±3.15% (188 runs sampled) - nativeurl - legacy x 2,651,631 ops/sec ±1.68% (189 runs sampled) - nativeurl - whatwg x 161,837 ops/sec ±2.26% (189 runs sampled) - parseurl x 4,166,338 ops/sec ±2.23% (184 runs sampled) - -> node benchmark/samerequest.js - - Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object - - 4 tests completed. - - fasturl x 3,821,651 ops/sec ±2.42% (185 runs sampled) - nativeurl - legacy x 2,651,162 ops/sec ±1.90% (187 runs sampled) - nativeurl - whatwg x 175,166 ops/sec ±1.44% (188 runs sampled) - parseurl x 14,912,606 ops/sec ±3.59% (183 runs sampled) - -> node benchmark/simplepath.js - - Parsing URL "/foo/bar" - - 4 tests completed. - - fasturl x 12,421,765 ops/sec ±2.04% (191 runs sampled) - nativeurl - legacy x 7,546,036 ops/sec ±1.41% (188 runs sampled) - nativeurl - whatwg x 198,843 ops/sec ±1.83% (189 runs sampled) - parseurl x 24,244,006 ops/sec ±0.51% (194 runs sampled) - -> node benchmark/slash.js - - Parsing URL "/" - - 4 tests completed. - - fasturl x 17,159,456 ops/sec ±3.25% (188 runs sampled) - nativeurl - legacy x 11,635,097 ops/sec ±3.79% (184 runs sampled) - nativeurl - whatwg x 240,693 ops/sec ±0.83% (189 runs sampled) - parseurl x 42,279,067 ops/sec ±0.55% (190 runs sampled) -``` - -## License - - [MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/parseurl/master -[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master -[node-image]: https://badgen.net/npm/node/parseurl -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/parseurl -[npm-url]: https://npmjs.org/package/parseurl -[npm-version-image]: https://badgen.net/npm/v/parseurl -[travis-image]: https://badgen.net/travis/pillarjs/parseurl/master -[travis-url]: https://travis-ci.org/pillarjs/parseurl diff --git a/node_modules/parseurl/index.js b/node_modules/parseurl/index.js deleted file mode 100644 index ece7223..0000000 --- a/node_modules/parseurl/index.js +++ /dev/null @@ -1,158 +0,0 @@ -/*! - * parseurl - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2017 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var url = require('url') -var parse = url.parse -var Url = url.Url - -/** - * Module exports. - * @public - */ - -module.exports = parseurl -module.exports.original = originalurl - -/** - * Parse the `req` url with memoization. - * - * @param {ServerRequest} req - * @return {Object} - * @public - */ - -function parseurl (req) { - var url = req.url - - if (url === undefined) { - // URL is undefined - return undefined - } - - var parsed = req._parsedUrl - - if (fresh(url, parsed)) { - // Return cached URL parse - return parsed - } - - // Parse the URL - parsed = fastparse(url) - parsed._raw = url - - return (req._parsedUrl = parsed) -}; - -/** - * Parse the `req` original url with fallback and memoization. - * - * @param {ServerRequest} req - * @return {Object} - * @public - */ - -function originalurl (req) { - var url = req.originalUrl - - if (typeof url !== 'string') { - // Fallback - return parseurl(req) - } - - var parsed = req._parsedOriginalUrl - - if (fresh(url, parsed)) { - // Return cached URL parse - return parsed - } - - // Parse the URL - parsed = fastparse(url) - parsed._raw = url - - return (req._parsedOriginalUrl = parsed) -}; - -/** - * Parse the `str` url with fast-path short-cut. - * - * @param {string} str - * @return {Object} - * @private - */ - -function fastparse (str) { - if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) { - return parse(str) - } - - var pathname = str - var query = null - var search = null - - // This takes the regexp from https://github.com/joyent/node/pull/7878 - // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/ - // And unrolls it into a for loop - for (var i = 1; i < str.length; i++) { - switch (str.charCodeAt(i)) { - case 0x3f: /* ? */ - if (search === null) { - pathname = str.substring(0, i) - query = str.substring(i + 1) - search = str.substring(i) - } - break - case 0x09: /* \t */ - case 0x0a: /* \n */ - case 0x0c: /* \f */ - case 0x0d: /* \r */ - case 0x20: /* */ - case 0x23: /* # */ - case 0xa0: - case 0xfeff: - return parse(str) - } - } - - var url = Url !== undefined - ? new Url() - : {} - - url.path = str - url.href = str - url.pathname = pathname - - if (search !== null) { - url.query = query - url.search = search - } - - return url -} - -/** - * Determine if parsed is still fresh for url. - * - * @param {string} url - * @param {object} parsedUrl - * @return {boolean} - * @private - */ - -function fresh (url, parsedUrl) { - return typeof parsedUrl === 'object' && - parsedUrl !== null && - (Url === undefined || parsedUrl instanceof Url) && - parsedUrl._raw === url -} diff --git a/node_modules/parseurl/package.json b/node_modules/parseurl/package.json deleted file mode 100644 index 6b443ca..0000000 --- a/node_modules/parseurl/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "parseurl", - "description": "parse a url with memoization", - "version": "1.3.3", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "repository": "pillarjs/parseurl", - "license": "MIT", - "devDependencies": { - "beautify-benchmark": "0.2.4", - "benchmark": "2.1.4", - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.17.1", - "eslint-plugin-node": "7.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", - "fast-url-parser": "1.1.3", - "istanbul": "0.4.5", - "mocha": "6.1.3" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint .", - "test": "mocha --check-leaks --bail --reporter spec test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" - } -} diff --git a/node_modules/path-key/index.d.ts b/node_modules/path-key/index.d.ts deleted file mode 100644 index 7c575d1..0000000 --- a/node_modules/path-key/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/// - -declare namespace pathKey { - interface Options { - /** - Use a custom environment variables object. Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env). - */ - readonly env?: {[key: string]: string | undefined}; - - /** - Get the PATH key for a specific platform. Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform). - */ - readonly platform?: NodeJS.Platform; - } -} - -declare const pathKey: { - /** - Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform. - - @example - ``` - import pathKey = require('path-key'); - - const key = pathKey(); - //=> 'PATH' - - const PATH = process.env[key]; - //=> '/usr/local/bin:/usr/bin:/bin' - ``` - */ - (options?: pathKey.Options): string; - - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function pathKey(options?: pathKey.Options): string; - // export = pathKey; - default: typeof pathKey; -}; - -export = pathKey; diff --git a/node_modules/path-key/index.js b/node_modules/path-key/index.js deleted file mode 100644 index 0cf6415..0000000 --- a/node_modules/path-key/index.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const pathKey = (options = {}) => { - const environment = options.env || process.env; - const platform = options.platform || process.platform; - - if (platform !== 'win32') { - return 'PATH'; - } - - return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; -}; - -module.exports = pathKey; -// TODO: Remove this for the next major release -module.exports.default = pathKey; diff --git a/node_modules/path-key/license b/node_modules/path-key/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/path-key/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-key/package.json b/node_modules/path-key/package.json deleted file mode 100644 index c8cbd38..0000000 --- a/node_modules/path-key/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "path-key", - "version": "3.1.1", - "description": "Get the PATH environment variable key cross-platform", - "license": "MIT", - "repository": "sindresorhus/path-key", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "path", - "key", - "environment", - "env", - "variable", - "var", - "get", - "cross-platform", - "windows" - ], - "devDependencies": { - "@types/node": "^11.13.0", - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/path-key/readme.md b/node_modules/path-key/readme.md deleted file mode 100644 index a9052d7..0000000 --- a/node_modules/path-key/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) - -> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform - -It's usually `PATH`, but on Windows it can be any casing like `Path`... - - -## Install - -``` -$ npm install path-key -``` - - -## Usage - -```js -const pathKey = require('path-key'); - -const key = pathKey(); -//=> 'PATH' - -const PATH = process.env[key]; -//=> '/usr/local/bin:/usr/bin:/bin' -``` - - -## API - -### pathKey(options?) - -#### options - -Type: `object` - -##### env - -Type: `object`
-Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) - -Use a custom environment variables object. - -#### platform - -Type: `string`
-Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) - -Get the PATH key for a specific platform. - - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/path-to-regexp/LICENSE b/node_modules/path-to-regexp/LICENSE deleted file mode 100644 index 983fbe8..0000000 --- a/node_modules/path-to-regexp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/path-to-regexp/Readme.md b/node_modules/path-to-regexp/Readme.md deleted file mode 100644 index f5df40a..0000000 --- a/node_modules/path-to-regexp/Readme.md +++ /dev/null @@ -1,224 +0,0 @@ -# Path-to-RegExp - -> Turn a path string such as `/user/:name` into a regular expression. - -[![NPM version][npm-image]][npm-url] -[![NPM downloads][downloads-image]][downloads-url] -[![Build status][build-image]][build-url] -[![Build coverage][coverage-image]][coverage-url] -[![License][license-image]][license-url] - -## Installation - -``` -npm install path-to-regexp --save -``` - -## Usage - -```js -const { - match, - pathToRegexp, - compile, - parse, - stringify, -} = require("path-to-regexp"); -``` - -### Parameters - -Parameters match arbitrary strings in a path by matching up to the end of the segment, or up to any proceeding tokens. They are defined by prefixing a colon to the parameter name (`:foo`). Parameter names can use any valid JavaScript identifier, or be double quoted to use other characters (`:"param-name"`). - -```js -const fn = match("/:foo/:bar"); - -fn("/test/route"); -//=> { path: '/test/route', params: { foo: 'test', bar: 'route' } } -``` - -### Wildcard - -Wildcard parameters match one or more characters across multiple segments. They are defined the same way as regular parameters, but are prefixed with an asterisk (`*foo`). - -```js -const fn = match("/*splat"); - -fn("/bar/baz"); -//=> { path: '/bar/baz', params: { splat: [ 'bar', 'baz' ] } } -``` - -### Optional - -Braces can be used to define parts of the path that are optional. - -```js -const fn = match("/users{/:id}/delete"); - -fn("/users/delete"); -//=> { path: '/users/delete', params: {} } - -fn("/users/123/delete"); -//=> { path: '/users/123/delete', params: { id: '123' } } -``` - -## Match - -The `match` function returns a function for matching strings against a path: - -- **path** String, `TokenData` object, or array of strings and `TokenData` objects. -- **options** _(optional)_ (Extends [pathToRegexp](#pathToRegexp) options) - - **decode** Function for decoding strings to params, or `false` to disable all processing. (default: `decodeURIComponent`) - -```js -const fn = match("/foo/:bar"); -``` - -**Please note:** `path-to-regexp` is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc). - -## PathToRegexp - -The `pathToRegexp` function returns the `regexp` for matching strings against paths, and an array of `keys` for understanding the `RegExp#exec` matches. - -- **path** String, `TokenData` object, or array of strings and `TokenData` objects. -- **options** _(optional)_ (See [parse](#parse) for more options) - - **sensitive** Regexp will be case sensitive. (default: `false`) - - **end** Validate the match reaches the end of the string. (default: `true`) - - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) - - **trailing** Allows optional trailing delimiter to match. (default: `true`) - -```js -const { regexp, keys } = pathToRegexp("/foo/:bar"); - -regexp.exec("/foo/123"); //=> ["/foo/123", "123"] -``` - -## Compile ("Reverse" Path-To-RegExp) - -The `compile` function will return a function for transforming parameters into a valid path: - -- **path** A string or `TokenData` object. -- **options** (See [parse](#parse) for more options) - - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) - - **encode** Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`) - -```js -const toPath = compile("/user/:id"); - -toPath({ id: "name" }); //=> "/user/name" -toPath({ id: "café" }); //=> "/user/caf%C3%A9" - -const toPathRepeated = compile("/*segment"); - -toPathRepeated({ segment: ["foo"] }); //=> "/foo" -toPathRepeated({ segment: ["a", "b", "c"] }); //=> "/a/b/c" - -// When disabling `encode`, you need to make sure inputs are encoded correctly. No arrays are accepted. -const toPathRaw = compile("/user/:id", { encode: false }); - -toPathRaw({ id: "%3A%2F" }); //=> "/user/%3A%2F" -``` - -## Stringify - -Transform a `TokenData` object to a Path-to-RegExp string. - -- **data** A `TokenData` object. - -```js -const data = { - tokens: [ - { type: "text", value: "/" }, - { type: "param", name: "foo" }, - ], -}; - -const path = stringify(data); //=> "/:foo" -``` - -## Developers - -- If you are rewriting paths with match and compile, consider using `encode: false` and `decode: false` to keep raw paths passed around. -- To ensure matches work on paths containing characters usually encoded, such as emoji, consider using [encodeurl](https://github.com/pillarjs/encodeurl) for `encodePath`. - -### Parse - -The `parse` function accepts a string and returns `TokenData`, which can be used with `match` and `compile`. - -- **path** A string. -- **options** _(optional)_ - - **encodePath** A function for encoding input strings. (default: `x => x`, recommended: [`encodeurl`](https://github.com/pillarjs/encodeurl)) - -### Tokens - -`TokenData` has two properties: - -- **tokens** A sequence of tokens, currently of types `text`, `parameter`, `wildcard`, or `group`. -- **originalPath** The original path used with `parse`, shown in error messages to assist debugging. - -### Custom path - -In some applications you may not be able to use the `path-to-regexp` syntax, but you still want to use this library for `match` and `compile`. For example: - -```js -import { match } from "path-to-regexp"; - -const tokens = [ - { type: "text", value: "/" }, - { type: "parameter", name: "foo" }, -]; -const originalPath = "/[foo]"; // To help debug error messages. -const path = { tokens, originalPath }; -const fn = match(path); - -fn("/test"); //=> { path: '/test', index: 0, params: { foo: 'test' } } -``` - -## Errors - -An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before. - -### Missing parameter name - -Parameter names must be provided after `:` or `*`, for example `/*path`. They can be valid JavaScript identifiers (e.g. `:myName`) or JSON strings (`:"my-name"`). - -### Unexpected `?` or `+` - -In past releases, `?`, `*`, and `+` were used to denote optional or repeating parameters. As an alternative, try these: - -- For optional (`?`), use braces: `/file{.:ext}`. -- For one or more (`+`), use a wildcard: `/*path`. -- For zero or more (`*`), use both: `/files{/*path}`. - -### Unexpected `(`, `)`, `[`, `]`, etc. - -Previous versions of Path-to-RegExp used these for RegExp features. This version no longer supports them so they've been reserved to avoid ambiguity. To match these characters literally, escape them with a backslash, e.g. `"\\("`. - -### Unterminated quote - -Parameter names can be wrapped in double quote characters, and this error means you forgot to close the quote character. For example, `:"foo`. - -### Express <= 4.x - -Path-To-RegExp breaks compatibility with Express <= `4.x` in the following ways: - -- The wildcard `*` must have a name and matches the behavior of parameters `:`. -- The optional character `?` is no longer supported, use braces instead: `/:file{.:ext}`. -- Regexp characters are not supported. -- Some characters have been reserved to avoid confusion during upgrade (`()[]?+!`). -- Parameter names now support valid JavaScript identifiers, or quoted like `:"this"`. - -## License - -MIT - -[npm-image]: https://img.shields.io/npm/v/path-to-regexp -[npm-url]: https://npmjs.org/package/path-to-regexp -[downloads-image]: https://img.shields.io/npm/dm/path-to-regexp -[downloads-url]: https://npmjs.org/package/path-to-regexp -[build-image]: https://img.shields.io/github/actions/workflow/status/pillarjs/path-to-regexp/ci.yml?branch=master -[build-url]: https://github.com/pillarjs/path-to-regexp/actions/workflows/ci.yml?query=branch%3Amaster -[coverage-image]: https://img.shields.io/codecov/c/gh/pillarjs/path-to-regexp -[coverage-url]: https://codecov.io/gh/pillarjs/path-to-regexp -[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat -[license-url]: LICENSE.md diff --git a/node_modules/path-to-regexp/dist/index.d.ts b/node_modules/path-to-regexp/dist/index.d.ts deleted file mode 100644 index b59dff0..0000000 --- a/node_modules/path-to-regexp/dist/index.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Encode a string into another string. - */ -export type Encode = (value: string) => string; -/** - * Decode a string into another string. - */ -export type Decode = (value: string) => string; -export interface ParseOptions { - /** - * A function for encoding input strings. - */ - encodePath?: Encode; -} -export interface PathToRegexpOptions { - /** - * Matches the path completely without trailing characters. (default: `true`) - */ - end?: boolean; - /** - * Allows optional trailing delimiter to match. (default: `true`) - */ - trailing?: boolean; - /** - * Match will be case sensitive. (default: `false`) - */ - sensitive?: boolean; - /** - * The default delimiter for segments. (default: `'/'`) - */ - delimiter?: string; -} -export interface MatchOptions extends PathToRegexpOptions { - /** - * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`) - */ - decode?: Decode | false; -} -export interface CompileOptions { - /** - * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`) - */ - encode?: Encode | false; - /** - * The default delimiter for segments. (default: `'/'`) - */ - delimiter?: string; -} -/** - * Plain text. - */ -export interface Text { - type: "text"; - value: string; -} -/** - * A parameter designed to match arbitrary text within a segment. - */ -export interface Parameter { - type: "param"; - name: string; -} -/** - * A wildcard parameter designed to match multiple segments. - */ -export interface Wildcard { - type: "wildcard"; - name: string; -} -/** - * A set of possible tokens to expand when matching. - */ -export interface Group { - type: "group"; - tokens: Token[]; -} -/** - * A token that corresponds with a regexp capture. - */ -export type Key = Parameter | Wildcard; -/** - * A sequence of `path-to-regexp` keys that match capturing groups. - */ -export type Keys = Array; -/** - * A sequence of path match characters. - */ -export type Token = Text | Parameter | Wildcard | Group; -/** - * Tokenized path instance. - */ -export declare class TokenData { - readonly tokens: Token[]; - readonly originalPath?: string | undefined; - constructor(tokens: Token[], originalPath?: string | undefined); -} -/** - * ParseError is thrown when there is an error processing the path. - */ -export declare class PathError extends TypeError { - readonly originalPath: string | undefined; - constructor(message: string, originalPath: string | undefined); -} -/** - * Parse a string for the raw tokens. - */ -export declare function parse(str: string, options?: ParseOptions): TokenData; -/** - * Compile a string to a template function for the path. - */ -export declare function compile

(path: Path, options?: CompileOptions & ParseOptions): (params?: P) => string; -export type ParamData = Partial>; -export type PathFunction

= (data?: P) => string; -/** - * A match result contains data about the path match. - */ -export interface MatchResult

{ - path: string; - params: P; -} -/** - * A match is either `false` (no match) or a match result. - */ -export type Match

= false | MatchResult

; -/** - * The match function takes a string and returns whether it matched the path. - */ -export type MatchFunction

= (path: string) => Match

; -/** - * Supported path types. - */ -export type Path = string | TokenData; -/** - * Transform a path into a match function. - */ -export declare function match

(path: Path | Path[], options?: MatchOptions & ParseOptions): MatchFunction

; -export declare function pathToRegexp(path: Path | Path[], options?: PathToRegexpOptions & ParseOptions): { - regexp: RegExp; - keys: Keys; -}; -/** - * Stringify token data into a path string. - */ -export declare function stringify(data: TokenData): string; diff --git a/node_modules/path-to-regexp/dist/index.js b/node_modules/path-to-regexp/dist/index.js deleted file mode 100644 index 9331ae0..0000000 --- a/node_modules/path-to-regexp/dist/index.js +++ /dev/null @@ -1,409 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PathError = exports.TokenData = void 0; -exports.parse = parse; -exports.compile = compile; -exports.match = match; -exports.pathToRegexp = pathToRegexp; -exports.stringify = stringify; -const DEFAULT_DELIMITER = "/"; -const NOOP_VALUE = (value) => value; -const ID_START = /^[$_\p{ID_Start}]$/u; -const ID_CONTINUE = /^[$\u200c\u200d\p{ID_Continue}]$/u; -const SIMPLE_TOKENS = { - // Groups. - "{": "{", - "}": "}", - // Reserved. - "(": "(", - ")": ")", - "[": "[", - "]": "]", - "+": "+", - "?": "?", - "!": "!", -}; -/** - * Escape text for stringify to path. - */ -function escapeText(str) { - return str.replace(/[{}()\[\]+?!:*\\]/g, "\\$&"); -} -/** - * Escape a regular expression string. - */ -function escape(str) { - return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&"); -} -/** - * Tokenized path instance. - */ -class TokenData { - constructor(tokens, originalPath) { - this.tokens = tokens; - this.originalPath = originalPath; - } -} -exports.TokenData = TokenData; -/** - * ParseError is thrown when there is an error processing the path. - */ -class PathError extends TypeError { - constructor(message, originalPath) { - let text = message; - if (originalPath) - text += `: ${originalPath}`; - text += `; visit https://git.new/pathToRegexpError for info`; - super(text); - this.originalPath = originalPath; - } -} -exports.PathError = PathError; -/** - * Parse a string for the raw tokens. - */ -function parse(str, options = {}) { - const { encodePath = NOOP_VALUE } = options; - const chars = [...str]; - const tokens = []; - let index = 0; - let pos = 0; - function name() { - let value = ""; - if (ID_START.test(chars[index])) { - do { - value += chars[index++]; - } while (ID_CONTINUE.test(chars[index])); - } - else if (chars[index] === '"') { - let quoteStart = index; - while (index++ < chars.length) { - if (chars[index] === '"') { - index++; - quoteStart = 0; - break; - } - // Increment over escape characters. - if (chars[index] === "\\") - index++; - value += chars[index]; - } - if (quoteStart) { - throw new PathError(`Unterminated quote at index ${quoteStart}`, str); - } - } - if (!value) { - throw new PathError(`Missing parameter name at index ${index}`, str); - } - return value; - } - while (index < chars.length) { - const value = chars[index]; - const type = SIMPLE_TOKENS[value]; - if (type) { - tokens.push({ type, index: index++, value }); - } - else if (value === "\\") { - tokens.push({ type: "escape", index: index++, value: chars[index++] }); - } - else if (value === ":") { - tokens.push({ type: "param", index: index++, value: name() }); - } - else if (value === "*") { - tokens.push({ type: "wildcard", index: index++, value: name() }); - } - else { - tokens.push({ type: "char", index: index++, value }); - } - } - tokens.push({ type: "end", index, value: "" }); - function consumeUntil(endType) { - const output = []; - while (true) { - const token = tokens[pos++]; - if (token.type === endType) - break; - if (token.type === "char" || token.type === "escape") { - let path = token.value; - let cur = tokens[pos]; - while (cur.type === "char" || cur.type === "escape") { - path += cur.value; - cur = tokens[++pos]; - } - output.push({ - type: "text", - value: encodePath(path), - }); - continue; - } - if (token.type === "param" || token.type === "wildcard") { - output.push({ - type: token.type, - name: token.value, - }); - continue; - } - if (token.type === "{") { - output.push({ - type: "group", - tokens: consumeUntil("}"), - }); - continue; - } - throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str); - } - return output; - } - return new TokenData(consumeUntil("end"), str); -} -/** - * Compile a string to a template function for the path. - */ -function compile(path, options = {}) { - const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options; - const data = typeof path === "object" ? path : parse(path, options); - const fn = tokensToFunction(data.tokens, delimiter, encode); - return function path(params = {}) { - const [path, ...missing] = fn(params); - if (missing.length) { - throw new TypeError(`Missing parameters: ${missing.join(", ")}`); - } - return path; - }; -} -function tokensToFunction(tokens, delimiter, encode) { - const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode)); - return (data) => { - const result = [""]; - for (const encoder of encoders) { - const [value, ...extras] = encoder(data); - result[0] += value; - result.push(...extras); - } - return result; - }; -} -/** - * Convert a single token into a path building function. - */ -function tokenToFunction(token, delimiter, encode) { - if (token.type === "text") - return () => [token.value]; - if (token.type === "group") { - const fn = tokensToFunction(token.tokens, delimiter, encode); - return (data) => { - const [value, ...missing] = fn(data); - if (!missing.length) - return [value]; - return [""]; - }; - } - const encodeValue = encode || NOOP_VALUE; - if (token.type === "wildcard" && encode !== false) { - return (data) => { - const value = data[token.name]; - if (value == null) - return ["", token.name]; - if (!Array.isArray(value) || value.length === 0) { - throw new TypeError(`Expected "${token.name}" to be a non-empty array`); - } - return [ - value - .map((value, index) => { - if (typeof value !== "string") { - throw new TypeError(`Expected "${token.name}/${index}" to be a string`); - } - return encodeValue(value); - }) - .join(delimiter), - ]; - }; - } - return (data) => { - const value = data[token.name]; - if (value == null) - return ["", token.name]; - if (typeof value !== "string") { - throw new TypeError(`Expected "${token.name}" to be a string`); - } - return [encodeValue(value)]; - }; -} -/** - * Transform a path into a match function. - */ -function match(path, options = {}) { - const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options; - const { regexp, keys } = pathToRegexp(path, options); - const decoders = keys.map((key) => { - if (decode === false) - return NOOP_VALUE; - if (key.type === "param") - return decode; - return (value) => value.split(delimiter).map(decode); - }); - return function match(input) { - const m = regexp.exec(input); - if (!m) - return false; - const path = m[0]; - const params = Object.create(null); - for (let i = 1; i < m.length; i++) { - if (m[i] === undefined) - continue; - const key = keys[i - 1]; - const decoder = decoders[i - 1]; - params[key.name] = decoder(m[i]); - } - return { path, params }; - }; -} -function pathToRegexp(path, options = {}) { - const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options; - const keys = []; - const flags = sensitive ? "" : "i"; - const sources = []; - for (const input of pathsToArray(path, [])) { - const data = typeof input === "object" ? input : parse(input, options); - for (const tokens of flatten(data.tokens, 0, [])) { - sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath)); - } - } - let pattern = `^(?:${sources.join("|")})`; - if (trailing) - pattern += `(?:${escape(delimiter)}$)?`; - pattern += end ? "$" : `(?=${escape(delimiter)}|$)`; - const regexp = new RegExp(pattern, flags); - return { regexp, keys }; -} -/** - * Convert a path or array of paths into a flat array. - */ -function pathsToArray(paths, init) { - if (Array.isArray(paths)) { - for (const p of paths) - pathsToArray(p, init); - } - else { - init.push(paths); - } - return init; -} -/** - * Generate a flat list of sequence tokens from the given tokens. - */ -function* flatten(tokens, index, init) { - if (index === tokens.length) { - return yield init; - } - const token = tokens[index]; - if (token.type === "group") { - for (const seq of flatten(token.tokens, 0, init.slice())) { - yield* flatten(tokens, index + 1, seq); - } - } - else { - init.push(token); - } - yield* flatten(tokens, index + 1, init); -} -/** - * Transform a flat sequence of tokens into a regular expression. - */ -function toRegExpSource(tokens, delimiter, keys, originalPath) { - let result = ""; - let backtrack = ""; - let isSafeSegmentParam = true; - for (const token of tokens) { - if (token.type === "text") { - result += escape(token.value); - backtrack += token.value; - isSafeSegmentParam || (isSafeSegmentParam = token.value.includes(delimiter)); - continue; - } - if (token.type === "param" || token.type === "wildcard") { - if (!isSafeSegmentParam && !backtrack) { - throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath); - } - if (token.type === "param") { - result += `(${negate(delimiter, isSafeSegmentParam ? "" : backtrack)}+)`; - } - else { - result += `([\\s\\S]+)`; - } - keys.push(token); - backtrack = ""; - isSafeSegmentParam = false; - continue; - } - } - return result; -} -/** - * Block backtracking on previous text and ignore delimiter string. - */ -function negate(delimiter, backtrack) { - if (backtrack.length < 2) { - if (delimiter.length < 2) - return `[^${escape(delimiter + backtrack)}]`; - return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`; - } - if (delimiter.length < 2) { - return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`; - } - return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\s\\S])`; -} -/** - * Stringify an array of tokens into a path string. - */ -function stringifyTokens(tokens) { - let value = ""; - let i = 0; - function name(value) { - const isSafe = isNameSafe(value) && isNextNameSafe(tokens[i]); - return isSafe ? value : JSON.stringify(value); - } - while (i < tokens.length) { - const token = tokens[i++]; - if (token.type === "text") { - value += escapeText(token.value); - continue; - } - if (token.type === "group") { - value += `{${stringifyTokens(token.tokens)}}`; - continue; - } - if (token.type === "param") { - value += `:${name(token.name)}`; - continue; - } - if (token.type === "wildcard") { - value += `*${name(token.name)}`; - continue; - } - throw new TypeError(`Unknown token type: ${token.type}`); - } - return value; -} -/** - * Stringify token data into a path string. - */ -function stringify(data) { - return stringifyTokens(data.tokens); -} -/** - * Validate the parameter name contains valid ID characters. - */ -function isNameSafe(name) { - const [first, ...rest] = name; - return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char)); -} -/** - * Validate the next token does not interfere with the current param name. - */ -function isNextNameSafe(token) { - if (token && token.type === "text") - return !ID_CONTINUE.test(token.value[0]); - return true; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/path-to-regexp/dist/index.js.map b/node_modules/path-to-regexp/dist/index.js.map deleted file mode 100644 index ec14c73..0000000 --- a/node_modules/path-to-regexp/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AA4LA,sBA8GC;AAKD,0BAgBC;AAgHD,sBA+BC;AAED,oCA2BC;AAmJD,8BAEC;AAhoBD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC;AAC5C,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AACvC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAkFxD,MAAM,aAAa,GAA8B;IAC/C,UAAU;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,YAAY;IACZ,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;CACT,CAAC;AAEF;;GAEG;AACH,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,SAAS,MAAM,CAAC,GAAW;IACzB,OAAO,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAiDD;;GAEG;AACH,MAAa,SAAS;IACpB,YACkB,MAAe,EACf,YAAqB;QADrB,WAAM,GAAN,MAAM,CAAS;QACf,iBAAY,GAAZ,YAAY,CAAS;IACpC,CAAC;CACL;AALD,8BAKC;AAED;;GAEG;AACH,MAAa,SAAU,SAAQ,SAAS;IACtC,YACE,OAAe,EACC,YAAgC;QAEhD,IAAI,IAAI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AE,CAAC;YAC9B,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,SAAS;QACX,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,uBAAwB,KAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,IAAe;IACvC,OAAO,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,KAAwB;IAC9C,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["const DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value: string) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\n\n/**\n * Encode a string into another string.\n */\nexport type Encode = (value: string) => string;\n\n/**\n * Decode a string into another string.\n */\nexport type Decode = (value: string) => string;\n\nexport interface ParseOptions {\n /**\n * A function for encoding input strings.\n */\n encodePath?: Encode;\n}\n\nexport interface PathToRegexpOptions {\n /**\n * Matches the path completely without trailing characters. (default: `true`)\n */\n end?: boolean;\n /**\n * Allows optional trailing delimiter to match. (default: `true`)\n */\n trailing?: boolean;\n /**\n * Match will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\nexport interface MatchOptions extends PathToRegexpOptions {\n /**\n * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`)\n */\n decode?: Decode | false;\n}\n\nexport interface CompileOptions {\n /**\n * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`)\n */\n encode?: Encode | false;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\ntype TokenType =\n | \"{\"\n | \"}\"\n | \"wildcard\"\n | \"param\"\n | \"char\"\n | \"escape\"\n | \"end\"\n // Reserved for use or ambiguous due to past use.\n | \"(\"\n | \")\"\n | \"[\"\n | \"]\"\n | \"+\"\n | \"?\"\n | \"!\";\n\n/**\n * Tokenizer results.\n */\ninterface LexToken {\n type: TokenType;\n index: number;\n value: string;\n}\n\nconst SIMPLE_TOKENS: Record = {\n // Groups.\n \"{\": \"{\",\n \"}\": \"}\",\n // Reserved.\n \"(\": \"(\",\n \")\": \")\",\n \"[\": \"[\",\n \"]\": \"]\",\n \"+\": \"+\",\n \"?\": \"?\",\n \"!\": \"!\",\n};\n\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str: string) {\n return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escape(str: string) {\n return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Plain text.\n */\nexport interface Text {\n type: \"text\";\n value: string;\n}\n\n/**\n * A parameter designed to match arbitrary text within a segment.\n */\nexport interface Parameter {\n type: \"param\";\n name: string;\n}\n\n/**\n * A wildcard parameter designed to match multiple segments.\n */\nexport interface Wildcard {\n type: \"wildcard\";\n name: string;\n}\n\n/**\n * A set of possible tokens to expand when matching.\n */\nexport interface Group {\n type: \"group\";\n tokens: Token[];\n}\n\n/**\n * A token that corresponds with a regexp capture.\n */\nexport type Key = Parameter | Wildcard;\n\n/**\n * A sequence of `path-to-regexp` keys that match capturing groups.\n */\nexport type Keys = Array;\n\n/**\n * A sequence of path match characters.\n */\nexport type Token = Text | Parameter | Wildcard | Group;\n\n/**\n * Tokenized path instance.\n */\nexport class TokenData {\n constructor(\n public readonly tokens: Token[],\n public readonly originalPath?: string,\n ) {}\n}\n\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nexport class PathError extends TypeError {\n constructor(\n message: string,\n public readonly originalPath: string | undefined,\n ) {\n let text = message;\n if (originalPath) text += `: ${originalPath}`;\n text += `; visit https://git.new/pathToRegexpError for info`;\n super(text);\n }\n}\n\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str: string, options: ParseOptions = {}): TokenData {\n const { encodePath = NOOP_VALUE } = options;\n const chars = [...str];\n const tokens: Array = [];\n let index = 0;\n let pos = 0;\n\n function name() {\n let value = \"\";\n\n if (ID_START.test(chars[index])) {\n do {\n value += chars[index++];\n } while (ID_CONTINUE.test(chars[index]));\n } else if (chars[index] === '\"') {\n let quoteStart = index;\n\n while (index++ < chars.length) {\n if (chars[index] === '\"') {\n index++;\n quoteStart = 0;\n break;\n }\n\n // Increment over escape characters.\n if (chars[index] === \"\\\\\") index++;\n\n value += chars[index];\n }\n\n if (quoteStart) {\n throw new PathError(`Unterminated quote at index ${quoteStart}`, str);\n }\n }\n\n if (!value) {\n throw new PathError(`Missing parameter name at index ${index}`, str);\n }\n\n return value;\n }\n\n while (index < chars.length) {\n const value = chars[index];\n const type = SIMPLE_TOKENS[value];\n\n if (type) {\n tokens.push({ type, index: index++, value });\n } else if (value === \"\\\\\") {\n tokens.push({ type: \"escape\", index: index++, value: chars[index++] });\n } else if (value === \":\") {\n tokens.push({ type: \"param\", index: index++, value: name() });\n } else if (value === \"*\") {\n tokens.push({ type: \"wildcard\", index: index++, value: name() });\n } else {\n tokens.push({ type: \"char\", index: index++, value });\n }\n }\n\n tokens.push({ type: \"end\", index, value: \"\" });\n\n function consumeUntil(endType: TokenType): Token[] {\n const output: Token[] = [];\n\n while (true) {\n const token = tokens[pos++];\n if (token.type === endType) break;\n\n if (token.type === \"char\" || token.type === \"escape\") {\n let path = token.value;\n let cur = tokens[pos];\n\n while (cur.type === \"char\" || cur.type === \"escape\") {\n path += cur.value;\n cur = tokens[++pos];\n }\n\n output.push({\n type: \"text\",\n value: encodePath(path),\n });\n continue;\n }\n\n if (token.type === \"param\" || token.type === \"wildcard\") {\n output.push({\n type: token.type,\n name: token.value,\n });\n continue;\n }\n\n if (token.type === \"{\") {\n output.push({\n type: \"group\",\n tokens: consumeUntil(\"}\"),\n });\n continue;\n }\n\n throw new PathError(\n `Unexpected ${token.type} at index ${token.index}, expected ${endType}`,\n str,\n );\n }\n\n return output;\n }\n\n return new TokenData(consumeUntil(\"end\"), str);\n}\n\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile

(\n path: Path,\n options: CompileOptions & ParseOptions = {},\n) {\n const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const data = typeof path === \"object\" ? path : parse(path, options);\n const fn = tokensToFunction(data.tokens, delimiter, encode);\n\n return function path(params: P = {} as P) {\n const [path, ...missing] = fn(params);\n if (missing.length) {\n throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n }\n return path;\n };\n}\n\nexport type ParamData = Partial>;\nexport type PathFunction

= (data?: P) => string;\n\nfunction tokensToFunction(\n tokens: Token[],\n delimiter: string,\n encode: Encode | false,\n) {\n const encoders = tokens.map((token) =>\n tokenToFunction(token, delimiter, encode),\n );\n\n return (data: ParamData) => {\n const result: string[] = [\"\"];\n\n for (const encoder of encoders) {\n const [value, ...extras] = encoder(data);\n result[0] += value;\n result.push(...extras);\n }\n\n return result;\n };\n}\n\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(\n token: Token,\n delimiter: string,\n encode: Encode | false,\n): (data: ParamData) => string[] {\n if (token.type === \"text\") return () => [token.value];\n\n if (token.type === \"group\") {\n const fn = tokensToFunction(token.tokens, delimiter, encode);\n\n return (data) => {\n const [value, ...missing] = fn(data);\n if (!missing.length) return [value];\n return [\"\"];\n };\n }\n\n const encodeValue = encode || NOOP_VALUE;\n\n if (token.type === \"wildcard\" && encode !== false) {\n return (data) => {\n const value = data[token.name];\n if (value == null) return [\"\", token.name];\n\n if (!Array.isArray(value) || value.length === 0) {\n throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n }\n\n return [\n value\n .map((value, index) => {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `Expected \"${token.name}/${index}\" to be a string`,\n );\n }\n\n return encodeValue(value);\n })\n .join(delimiter),\n ];\n };\n }\n\n return (data) => {\n const value = data[token.name];\n if (value == null) return [\"\", token.name];\n\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}\" to be a string`);\n }\n\n return [encodeValue(value)];\n };\n}\n\n/**\n * A match result contains data about the path match.\n */\nexport interface MatchResult

{\n path: string;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match

= false | MatchResult

;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction

= (path: string) => Match

;\n\n/**\n * Supported path types.\n */\nexport type Path = string | TokenData;\n\n/**\n * Transform a path into a match function.\n */\nexport function match

(\n path: Path | Path[],\n options: MatchOptions & ParseOptions = {},\n): MatchFunction

{\n const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const { regexp, keys } = pathToRegexp(path, options);\n\n const decoders = keys.map((key) => {\n if (decode === false) return NOOP_VALUE;\n if (key.type === \"param\") return decode;\n return (value: string) => value.split(delimiter).map(decode);\n });\n\n return function match(input: string) {\n const m = regexp.exec(input);\n if (!m) return false;\n\n const path = m[0];\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n const decoder = decoders[i - 1];\n params[key.name] = decoder(m[i]);\n }\n\n return { path, params };\n };\n}\n\nexport function pathToRegexp(\n path: Path | Path[],\n options: PathToRegexpOptions & ParseOptions = {},\n) {\n const {\n delimiter = DEFAULT_DELIMITER,\n end = true,\n sensitive = false,\n trailing = true,\n } = options;\n const keys: Keys = [];\n const flags = sensitive ? \"\" : \"i\";\n const sources: string[] = [];\n\n for (const input of pathsToArray(path, [])) {\n const data = typeof input === \"object\" ? input : parse(input, options);\n for (const tokens of flatten(data.tokens, 0, [])) {\n sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));\n }\n }\n\n let pattern = `^(?:${sources.join(\"|\")})`;\n if (trailing) pattern += `(?:${escape(delimiter)}$)?`;\n pattern += end ? \"$\" : `(?=${escape(delimiter)}|$)`;\n\n const regexp = new RegExp(pattern, flags);\n return { regexp, keys };\n}\n\n/**\n * Convert a path or array of paths into a flat array.\n */\nfunction pathsToArray(paths: Path | Path[], init: Path[]): Path[] {\n if (Array.isArray(paths)) {\n for (const p of paths) pathsToArray(p, init);\n } else {\n init.push(paths);\n }\n return init;\n}\n\n/**\n * Flattened token set.\n */\ntype FlatToken = Text | Parameter | Wildcard;\n\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction* flatten(\n tokens: Token[],\n index: number,\n init: FlatToken[],\n): Generator {\n if (index === tokens.length) {\n return yield init;\n }\n\n const token = tokens[index];\n\n if (token.type === \"group\") {\n for (const seq of flatten(token.tokens, 0, init.slice())) {\n yield* flatten(tokens, index + 1, seq);\n }\n } else {\n init.push(token);\n }\n\n yield* flatten(tokens, index + 1, init);\n}\n\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(\n tokens: FlatToken[],\n delimiter: string,\n keys: Keys,\n originalPath: string | undefined,\n): string {\n let result = \"\";\n let backtrack = \"\";\n let isSafeSegmentParam = true;\n\n for (const token of tokens) {\n if (token.type === \"text\") {\n result += escape(token.value);\n backtrack += token.value;\n isSafeSegmentParam ||= token.value.includes(delimiter);\n continue;\n }\n\n if (token.type === \"param\" || token.type === \"wildcard\") {\n if (!isSafeSegmentParam && !backtrack) {\n throw new PathError(\n `Missing text before \"${token.name}\" ${token.type}`,\n originalPath,\n );\n }\n\n if (token.type === \"param\") {\n result += `(${negate(delimiter, isSafeSegmentParam ? \"\" : backtrack)}+)`;\n } else {\n result += `([\\\\s\\\\S]+)`;\n }\n\n keys.push(token);\n backtrack = \"\";\n isSafeSegmentParam = false;\n continue;\n }\n }\n\n return result;\n}\n\n/**\n * Block backtracking on previous text and ignore delimiter string.\n */\nfunction negate(delimiter: string, backtrack: string): string {\n if (backtrack.length < 2) {\n if (delimiter.length < 2) return `[^${escape(delimiter + backtrack)}]`;\n return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`;\n }\n if (delimiter.length < 2) {\n return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`;\n }\n return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\\\s\\\\S])`;\n}\n\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens: Token[]): string {\n let value = \"\";\n let i = 0;\n\n function name(value: string) {\n const isSafe = isNameSafe(value) && isNextNameSafe(tokens[i]);\n return isSafe ? value : JSON.stringify(value);\n }\n\n while (i < tokens.length) {\n const token = tokens[i++];\n\n if (token.type === \"text\") {\n value += escapeText(token.value);\n continue;\n }\n\n if (token.type === \"group\") {\n value += `{${stringifyTokens(token.tokens)}}`;\n continue;\n }\n\n if (token.type === \"param\") {\n value += `:${name(token.name)}`;\n continue;\n }\n\n if (token.type === \"wildcard\") {\n value += `*${name(token.name)}`;\n continue;\n }\n\n throw new TypeError(`Unknown token type: ${(token as any).type}`);\n }\n\n return value;\n}\n\n/**\n * Stringify token data into a path string.\n */\nexport function stringify(data: TokenData): string {\n return stringifyTokens(data.tokens);\n}\n\n/**\n * Validate the parameter name contains valid ID characters.\n */\nfunction isNameSafe(name: string): boolean {\n const [first, ...rest] = name;\n return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char));\n}\n\n/**\n * Validate the next token does not interfere with the current param name.\n */\nfunction isNextNameSafe(token: Token | undefined): boolean {\n if (token && token.type === \"text\") return !ID_CONTINUE.test(token.value[0]);\n return true;\n}\n"]} \ No newline at end of file diff --git a/node_modules/path-to-regexp/package.json b/node_modules/path-to-regexp/package.json deleted file mode 100644 index 7ae266e..0000000 --- a/node_modules/path-to-regexp/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "path-to-regexp", - "version": "8.3.0", - "description": "Express style path to RegExp utility", - "keywords": [ - "express", - "regexp", - "route", - "routing" - ], - "repository": { - "type": "git", - "url": "https://github.com/pillarjs/path-to-regexp.git" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, - "license": "MIT", - "exports": "./dist/index.js", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "files": [ - "dist/" - ], - "scripts": { - "bench": "vitest bench", - "build": "ts-scripts build", - "format": "ts-scripts format", - "lint": "ts-scripts lint", - "prepare": "ts-scripts install && npm run build", - "size": "size-limit", - "specs": "ts-scripts specs", - "test": "ts-scripts test && npm run size" - }, - "devDependencies": { - "@borderless/ts-scripts": "^0.15.0", - "@size-limit/preset-small-lib": "^11.1.2", - "@types/node": "^22.7.2", - "@types/semver": "^7.3.1", - "@vitest/coverage-v8": "^3.0.5", - "recheck": "^4.4.5", - "size-limit": "^11.1.2", - "typescript": "^5.7.3", - "vitest": "^3.0.5" - }, - "publishConfig": { - "access": "public" - }, - "size-limit": [ - { - "path": "dist/index.js", - "limit": "2 kB" - } - ], - "ts-scripts": { - "dist": [ - "dist" - ], - "project": [ - "tsconfig.build.json" - ] - } -} diff --git a/node_modules/pkce-challenge/CHANGELOG.md b/node_modules/pkce-challenge/CHANGELOG.md deleted file mode 100644 index 09e31b8..0000000 --- a/node_modules/pkce-challenge/CHANGELOG.md +++ /dev/null @@ -1,114 +0,0 @@ -# Changelog - -## [5.0.1](https://github.com/crouchcd/pkce-challenge/releases/tag/5.0.1) - 2025-11-22 - -## What's Changed -* Use even distribution by @RobinVdBroeck in https://github.com/crouchcd/pkce-challenge/pull/38 - -## New Contributors -* @RobinVdBroeck made their first contribution in https://github.com/crouchcd/pkce-challenge/pull/38 - -**Full Changelog**: https://github.com/crouchcd/pkce-challenge/compare/5.0.0...5.0.1 - -## [5.0.0](https://github.com/crouchcd/pkce-challenge/releases/tag/5.0.0) - 2025-03-30 - -## What's Changed -* fix: add support for commonjs module by @li-yechao in https://github.com/crouchcd/pkce-challenge/pull/32 - -## New Contributors -* @li-yechao made their first contribution in https://github.com/crouchcd/pkce-challenge/pull/32 - -**Full Changelog**: https://github.com/crouchcd/pkce-challenge/compare/4.1.0...5.0.0 - -## [4.1.0](https://github.com/crouchcd/pkce-challenge/releases/tag/4.1.0) - 2024-01-25 - -## What's Changed -* Separate entrypoints for node and browser by @mdarocha in https://github.com/crouchcd/pkce-challenge/pull/25 - -## New Contributors -* @mdarocha made their first contribution in https://github.com/crouchcd/pkce-challenge/pull/25 - -**Full Changelog**: https://github.com/crouchcd/pkce-challenge/compare/4.0.1...4.1.0 - -## [4.0.1](https://github.com/crouchcd/pkce-challenge/releases/tag/4.0.1) - 2023-05-11 - -- chore: update README (dc76443a502c25ce98258cea3f25fd78a22cb2a8) -- chore: specify node engines >= 16.20.0 (5e7fc5edbcd0e19f99fc11a9705e5e708a100be8) - -## [4.0.0](https://github.com/crouchcd/pkce-challenge/releases/tag/4.0.0) - 2023-05-11 - -- BREAKING CHANGE: Use Web Cryptography API (#20), closes #21, #18 - -### Contributors - -- [saschanaz](https://github.com/saschanaz) - -## [3.1.0] - 2023-03-29 - -- chore: Use ES6 imports for crypto-js to reduce bundle size - -### Contributors - -- [gretchenfitze] - -## [3.0.0] - 2022-03-28 - -- feat!: depend on crypto-js for node/browser compatibility. Using Typescript with Parcel. - -```js -// commonjs -const pkceChallenge = require("pkce-challenge").default; - -// es modules -import pkceChallenge from "pkce-challenge"; -``` - -## [2.2.0] - 2021-05-19 - -### Added - -- `generateChallenge` exported from index - -### Contributors - -- [SeyyedKhandon] - -## [2.1.0] - 2019-12-20 - -### Added - -- `verifyChallenge` exported from index - -### Changed - -- code/comment formatting -- refactored `random` function - -## [2.0.0] - 2019-10-18 - -### Added - -- CHANGELOG -- typescript definition -- Cryptographically secured method for generating code verifier -- Method for base64 url encoding - -### Removed - -- `generateVerifier` export from index -- `generateChallenge` export from index -- `base64url` npm dependency -- `randomatic` npm dependency - -### Contributors - -- [lordnox] - -[gretchenfitze]: https://github.com/gretchenfitze -[seyyedkhandon]: https://github.com/SeyyedKhandon -[lordnox]: https://github.com/lordnox -[3.1.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/3.1.0 -[3.0.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/3.0.0 -[2.2.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/2.2.0 -[2.1.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/2.1.0 -[2.0.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/2.0.0 diff --git a/node_modules/pkce-challenge/LICENSE b/node_modules/pkce-challenge/LICENSE deleted file mode 100644 index 8b23445..0000000 --- a/node_modules/pkce-challenge/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/pkce-challenge/README.md b/node_modules/pkce-challenge/README.md deleted file mode 100644 index e2218b6..0000000 --- a/node_modules/pkce-challenge/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# pkce-challenge - -Generate or verify a Proof Key for Code Exchange (PKCE) challenge pair. - -Read more about [PKCE](https://www.oauth.com/oauth2-servers/pkce/authorization-request/). - -## Installation - -```bash -npm install pkce-challenge -``` - -## Usage - -Default length for the verifier is 43 - -```js -import pkceChallenge from "pkce-challenge"; - -await pkceChallenge(); -``` - -gives something like: - -```js -{ - code_verifier: 'u1ta-MQ0e7TcpHjgz33M2DcBnOQu~aMGxuiZt0QMD1C', - code_challenge: 'CUZX5qE8Wvye6kS_SasIsa8MMxacJftmWdsIA_iKp3I' -} -``` - -### Specify a verifier length - -```js -const challenge = await pkceChallenge(128); - -challenge.code_verifier.length === 128; // true -``` - -### Challenge verification - -```js -import { verifyChallenge } from "pkce-challenge"; - -(await verifyChallenge(challenge.code_verifier, challenge.code_challenge)) === - true; // true -``` - -### Challenge generation from existing code verifier - -```js -import { generateChallenge } from "pkce-challenge"; - -(await generateChallenge(challenge.code_verifier)) === challenge.code_challenge; // true -``` diff --git a/node_modules/pkce-challenge/dist/index.browser.d.ts b/node_modules/pkce-challenge/dist/index.browser.d.ts deleted file mode 100644 index 602e32e..0000000 --- a/node_modules/pkce-challenge/dist/index.browser.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** Generate a PKCE code challenge from a code verifier - * @param code_verifier - * @returns The base64 url encoded code challenge - */ -export declare function generateChallenge(code_verifier: string): Promise; -/** Generate a PKCE challenge pair - * @param length Length of the verifer (between 43-128). Defaults to 43. - * @returns PKCE challenge pair - */ -export default function pkceChallenge(length?: number): Promise<{ - code_verifier: string; - code_challenge: string; -}>; -/** Verify that a code_verifier produces the expected code challenge - * @param code_verifier - * @param expectedChallenge The code challenge to verify - * @returns True if challenges are equal. False otherwise. - */ -export declare function verifyChallenge(code_verifier: string, expectedChallenge: string): Promise; diff --git a/node_modules/pkce-challenge/dist/index.browser.js b/node_modules/pkce-challenge/dist/index.browser.js deleted file mode 100644 index f40d7f7..0000000 --- a/node_modules/pkce-challenge/dist/index.browser.js +++ /dev/null @@ -1,75 +0,0 @@ -let crypto; -crypto = globalThis.crypto; // web browsers -/** - * Creates an array of length `size` of random bytes - * @param size - * @returns Array of random ints (0 to 255) - */ -async function getRandomValues(size) { - return (await crypto).getRandomValues(new Uint8Array(size)); -} -/** Generate cryptographically strong random string - * @param size The desired length of the string - * @returns The random string - */ -async function random(size) { - const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~"; - const evenDistCutoff = Math.pow(2, 8) - Math.pow(2, 8) % mask.length; - let result = ""; - while (result.length < size) { - const randomBytes = await getRandomValues(size - result.length); - for (const randomByte of randomBytes) { - if (randomByte < evenDistCutoff) { - result += mask[randomByte % mask.length]; - } - } - } - return result; -} -/** Generate a PKCE challenge verifier - * @param length Length of the verifier - * @returns A random verifier `length` characters long - */ -async function generateVerifier(length) { - return await random(length); -} -/** Generate a PKCE code challenge from a code verifier - * @param code_verifier - * @returns The base64 url encoded code challenge - */ -export async function generateChallenge(code_verifier) { - const buffer = await (await crypto).subtle.digest("SHA-256", new TextEncoder().encode(code_verifier)); - // Generate base64url string - // btoa is deprecated in Node.js but is used here for web browser compatibility - // (which has no good replacement yet, see also https://github.com/whatwg/html/issues/6811) - return btoa(String.fromCharCode(...new Uint8Array(buffer))) - .replace(/\//g, '_') - .replace(/\+/g, '-') - .replace(/=/g, ''); -} -/** Generate a PKCE challenge pair - * @param length Length of the verifer (between 43-128). Defaults to 43. - * @returns PKCE challenge pair - */ -export default async function pkceChallenge(length) { - if (!length) - length = 43; - if (length < 43 || length > 128) { - throw `Expected a length between 43 and 128. Received ${length}.`; - } - const verifier = await generateVerifier(length); - const challenge = await generateChallenge(verifier); - return { - code_verifier: verifier, - code_challenge: challenge, - }; -} -/** Verify that a code_verifier produces the expected code challenge - * @param code_verifier - * @param expectedChallenge The code challenge to verify - * @returns True if challenges are equal. False otherwise. - */ -export async function verifyChallenge(code_verifier, expectedChallenge) { - const actualChallenge = await generateChallenge(code_verifier); - return actualChallenge === expectedChallenge; -} diff --git a/node_modules/pkce-challenge/dist/index.node.cjs b/node_modules/pkce-challenge/dist/index.node.cjs deleted file mode 100644 index 774ae40..0000000 --- a/node_modules/pkce-challenge/dist/index.node.cjs +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateChallenge = generateChallenge; -exports.default = pkceChallenge; -exports.verifyChallenge = verifyChallenge; -let crypto; -crypto = - globalThis.crypto?.webcrypto ?? // Node.js [18-16] REPL - globalThis.crypto ?? // Node.js >18 - import("node:crypto").then(m => m.webcrypto); // Node.js <18 Non-REPL -/** - * Creates an array of length `size` of random bytes - * @param size - * @returns Array of random ints (0 to 255) - */ -async function getRandomValues(size) { - return (await crypto).getRandomValues(new Uint8Array(size)); -} -/** Generate cryptographically strong random string - * @param size The desired length of the string - * @returns The random string - */ -async function random(size) { - const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~"; - const evenDistCutoff = Math.pow(2, 8) - Math.pow(2, 8) % mask.length; - let result = ""; - while (result.length < size) { - const randomBytes = await getRandomValues(size - result.length); - for (const randomByte of randomBytes) { - if (randomByte < evenDistCutoff) { - result += mask[randomByte % mask.length]; - } - } - } - return result; -} -/** Generate a PKCE challenge verifier - * @param length Length of the verifier - * @returns A random verifier `length` characters long - */ -async function generateVerifier(length) { - return await random(length); -} -/** Generate a PKCE code challenge from a code verifier - * @param code_verifier - * @returns The base64 url encoded code challenge - */ -async function generateChallenge(code_verifier) { - const buffer = await (await crypto).subtle.digest("SHA-256", new TextEncoder().encode(code_verifier)); - // Generate base64url string - // btoa is deprecated in Node.js but is used here for web browser compatibility - // (which has no good replacement yet, see also https://github.com/whatwg/html/issues/6811) - return btoa(String.fromCharCode(...new Uint8Array(buffer))) - .replace(/\//g, '_') - .replace(/\+/g, '-') - .replace(/=/g, ''); -} -/** Generate a PKCE challenge pair - * @param length Length of the verifer (between 43-128). Defaults to 43. - * @returns PKCE challenge pair - */ -async function pkceChallenge(length) { - if (!length) - length = 43; - if (length < 43 || length > 128) { - throw `Expected a length between 43 and 128. Received ${length}.`; - } - const verifier = await generateVerifier(length); - const challenge = await generateChallenge(verifier); - return { - code_verifier: verifier, - code_challenge: challenge, - }; -} -/** Verify that a code_verifier produces the expected code challenge - * @param code_verifier - * @param expectedChallenge The code challenge to verify - * @returns True if challenges are equal. False otherwise. - */ -async function verifyChallenge(code_verifier, expectedChallenge) { - const actualChallenge = await generateChallenge(code_verifier); - return actualChallenge === expectedChallenge; -} diff --git a/node_modules/pkce-challenge/dist/index.node.d.cts b/node_modules/pkce-challenge/dist/index.node.d.cts deleted file mode 100644 index 602e32e..0000000 --- a/node_modules/pkce-challenge/dist/index.node.d.cts +++ /dev/null @@ -1,19 +0,0 @@ -/** Generate a PKCE code challenge from a code verifier - * @param code_verifier - * @returns The base64 url encoded code challenge - */ -export declare function generateChallenge(code_verifier: string): Promise; -/** Generate a PKCE challenge pair - * @param length Length of the verifer (between 43-128). Defaults to 43. - * @returns PKCE challenge pair - */ -export default function pkceChallenge(length?: number): Promise<{ - code_verifier: string; - code_challenge: string; -}>; -/** Verify that a code_verifier produces the expected code challenge - * @param code_verifier - * @param expectedChallenge The code challenge to verify - * @returns True if challenges are equal. False otherwise. - */ -export declare function verifyChallenge(code_verifier: string, expectedChallenge: string): Promise; diff --git a/node_modules/pkce-challenge/dist/index.node.d.ts b/node_modules/pkce-challenge/dist/index.node.d.ts deleted file mode 100644 index 602e32e..0000000 --- a/node_modules/pkce-challenge/dist/index.node.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** Generate a PKCE code challenge from a code verifier - * @param code_verifier - * @returns The base64 url encoded code challenge - */ -export declare function generateChallenge(code_verifier: string): Promise; -/** Generate a PKCE challenge pair - * @param length Length of the verifer (between 43-128). Defaults to 43. - * @returns PKCE challenge pair - */ -export default function pkceChallenge(length?: number): Promise<{ - code_verifier: string; - code_challenge: string; -}>; -/** Verify that a code_verifier produces the expected code challenge - * @param code_verifier - * @param expectedChallenge The code challenge to verify - * @returns True if challenges are equal. False otherwise. - */ -export declare function verifyChallenge(code_verifier: string, expectedChallenge: string): Promise; diff --git a/node_modules/pkce-challenge/dist/index.node.js b/node_modules/pkce-challenge/dist/index.node.js deleted file mode 100644 index 56b47db..0000000 --- a/node_modules/pkce-challenge/dist/index.node.js +++ /dev/null @@ -1,78 +0,0 @@ -let crypto; -crypto = - globalThis.crypto?.webcrypto ?? // Node.js [18-16] REPL - globalThis.crypto ?? // Node.js >18 - import("node:crypto").then(m => m.webcrypto); // Node.js <18 Non-REPL -/** - * Creates an array of length `size` of random bytes - * @param size - * @returns Array of random ints (0 to 255) - */ -async function getRandomValues(size) { - return (await crypto).getRandomValues(new Uint8Array(size)); -} -/** Generate cryptographically strong random string - * @param size The desired length of the string - * @returns The random string - */ -async function random(size) { - const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~"; - const evenDistCutoff = Math.pow(2, 8) - Math.pow(2, 8) % mask.length; - let result = ""; - while (result.length < size) { - const randomBytes = await getRandomValues(size - result.length); - for (const randomByte of randomBytes) { - if (randomByte < evenDistCutoff) { - result += mask[randomByte % mask.length]; - } - } - } - return result; -} -/** Generate a PKCE challenge verifier - * @param length Length of the verifier - * @returns A random verifier `length` characters long - */ -async function generateVerifier(length) { - return await random(length); -} -/** Generate a PKCE code challenge from a code verifier - * @param code_verifier - * @returns The base64 url encoded code challenge - */ -export async function generateChallenge(code_verifier) { - const buffer = await (await crypto).subtle.digest("SHA-256", new TextEncoder().encode(code_verifier)); - // Generate base64url string - // btoa is deprecated in Node.js but is used here for web browser compatibility - // (which has no good replacement yet, see also https://github.com/whatwg/html/issues/6811) - return btoa(String.fromCharCode(...new Uint8Array(buffer))) - .replace(/\//g, '_') - .replace(/\+/g, '-') - .replace(/=/g, ''); -} -/** Generate a PKCE challenge pair - * @param length Length of the verifer (between 43-128). Defaults to 43. - * @returns PKCE challenge pair - */ -export default async function pkceChallenge(length) { - if (!length) - length = 43; - if (length < 43 || length > 128) { - throw `Expected a length between 43 and 128. Received ${length}.`; - } - const verifier = await generateVerifier(length); - const challenge = await generateChallenge(verifier); - return { - code_verifier: verifier, - code_challenge: challenge, - }; -} -/** Verify that a code_verifier produces the expected code challenge - * @param code_verifier - * @param expectedChallenge The code challenge to verify - * @returns True if challenges are equal. False otherwise. - */ -export async function verifyChallenge(code_verifier, expectedChallenge) { - const actualChallenge = await generateChallenge(code_verifier); - return actualChallenge === expectedChallenge; -} diff --git a/node_modules/pkce-challenge/package.json b/node_modules/pkce-challenge/package.json deleted file mode 100644 index 3d23158..0000000 --- a/node_modules/pkce-challenge/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "pkce-challenge", - "version": "5.0.1", - "description": "Generate or verify a Proof Key for Code Exchange (PKCE) challenge pair", - "browser": "dist/index.browser.js", - "type": "module", - "exports": { - ".": { - "types": { - "require": "./dist/index.node.d.cts", - "import": "./dist/index.node.d.ts" - }, - "browser": { - "types": "./dist/index.browser.d.ts", - "default": "./dist/index.browser.js" - }, - "node": { - "import": "./dist/index.node.js", - "require": "./dist/index.node.cjs" - } - } - }, - "files": [ - "dist/", - "CHANGELOG.md" - ], - "scripts": { - "watch": "tsc --watch --declaration", - "preprocess": "env=browser diverge -f src/index.ts src/index.browser.ts && env=node diverge -f src/index.ts src/index.node.ts && env=node diverge -f src/index.ts src/index.node.cts", - "build": "npm run preprocess && tsc --declaration", - "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", - "test:bundle": "npm run --prefix browser-test build" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/crouchcd/pkce-challenge.git" - }, - "keywords": [ - "PKCE", - "oauth2" - ], - "author": "crouchcd", - "license": "MIT", - "bugs": { - "url": "https://github.com/crouchcd/pkce-challenge/issues" - }, - "homepage": "https://github.com/crouchcd/pkce-challenge#readme", - "engines": { - "node": ">=16.20.0" - }, - "devDependencies": { - "@types/jest": "^29.5.0", - "@types/node": "^18.15.11", - "diverge": "^1.0.2", - "esbuild": "^0.25.2", - "jest": "^29.5.0", - "typescript": "^5.0.3" - } -} diff --git a/node_modules/proxy-addr/HISTORY.md b/node_modules/proxy-addr/HISTORY.md deleted file mode 100644 index 8480242..0000000 --- a/node_modules/proxy-addr/HISTORY.md +++ /dev/null @@ -1,161 +0,0 @@ -2.0.7 / 2021-05-31 -================== - - * deps: forwarded@0.2.0 - - Use `req.socket` over deprecated `req.connection` - -2.0.6 / 2020-02-24 -================== - - * deps: ipaddr.js@1.9.1 - -2.0.5 / 2019-04-16 -================== - - * deps: ipaddr.js@1.9.0 - -2.0.4 / 2018-07-26 -================== - - * deps: ipaddr.js@1.8.0 - -2.0.3 / 2018-02-19 -================== - - * deps: ipaddr.js@1.6.0 - -2.0.2 / 2017-09-24 -================== - - * deps: forwarded@~0.1.2 - - perf: improve header parsing - - perf: reduce overhead when no `X-Forwarded-For` header - -2.0.1 / 2017-09-10 -================== - - * deps: forwarded@~0.1.1 - - Fix trimming leading / trailing OWS - - perf: hoist regular expression - * deps: ipaddr.js@1.5.2 - -2.0.0 / 2017-08-08 -================== - - * Drop support for Node.js below 0.10 - -1.1.5 / 2017-07-25 -================== - - * Fix array argument being altered - * deps: ipaddr.js@1.4.0 - -1.1.4 / 2017-03-24 -================== - - * deps: ipaddr.js@1.3.0 - -1.1.3 / 2017-01-14 -================== - - * deps: ipaddr.js@1.2.0 - -1.1.2 / 2016-05-29 -================== - - * deps: ipaddr.js@1.1.1 - - Fix IPv6-mapped IPv4 validation edge cases - -1.1.1 / 2016-05-03 -================== - - * Fix regression matching mixed versions against multiple subnets - -1.1.0 / 2016-05-01 -================== - - * Fix accepting various invalid netmasks - - IPv4 netmasks must be contingous - - IPv6 addresses cannot be used as a netmask - * deps: ipaddr.js@1.1.0 - -1.0.10 / 2015-12-09 -=================== - - * deps: ipaddr.js@1.0.5 - - Fix regression in `isValid` with non-string arguments - -1.0.9 / 2015-12-01 -================== - - * deps: ipaddr.js@1.0.4 - - Fix accepting some invalid IPv6 addresses - - Reject CIDRs with negative or overlong masks - * perf: enable strict mode - -1.0.8 / 2015-05-10 -================== - - * deps: ipaddr.js@1.0.1 - -1.0.7 / 2015-03-16 -================== - - * deps: ipaddr.js@0.1.9 - - Fix OOM on certain inputs to `isValid` - -1.0.6 / 2015-02-01 -================== - - * deps: ipaddr.js@0.1.8 - -1.0.5 / 2015-01-08 -================== - - * deps: ipaddr.js@0.1.6 - -1.0.4 / 2014-11-23 -================== - - * deps: ipaddr.js@0.1.5 - - Fix edge cases with `isValid` - -1.0.3 / 2014-09-21 -================== - - * Use `forwarded` npm module - -1.0.2 / 2014-09-18 -================== - - * Fix a global leak when multiple subnets are trusted - * Support Node.js 0.6 - * deps: ipaddr.js@0.1.3 - -1.0.1 / 2014-06-03 -================== - - * Fix links in npm package - -1.0.0 / 2014-05-08 -================== - - * Add `trust` argument to determine proxy trust on - * Accepts custom function - * Accepts IPv4/IPv6 address(es) - * Accepts subnets - * Accepts pre-defined names - * Add optional `trust` argument to `proxyaddr.all` to - stop at first untrusted - * Add `proxyaddr.compile` to pre-compile `trust` function - to make subsequent calls faster - -0.0.1 / 2014-05-04 -================== - - * Fix bad npm publish - -0.0.0 / 2014-05-04 -================== - - * Initial release diff --git a/node_modules/proxy-addr/LICENSE b/node_modules/proxy-addr/LICENSE deleted file mode 100644 index cab251c..0000000 --- a/node_modules/proxy-addr/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2016 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/proxy-addr/README.md b/node_modules/proxy-addr/README.md deleted file mode 100644 index 69c0b63..0000000 --- a/node_modules/proxy-addr/README.md +++ /dev/null @@ -1,139 +0,0 @@ -# proxy-addr - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Determine address of proxied request - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install proxy-addr -``` - -## API - -```js -var proxyaddr = require('proxy-addr') -``` - -### proxyaddr(req, trust) - -Return the address of the request, using the given `trust` parameter. - -The `trust` argument is a function that returns `true` if you trust -the address, `false` if you don't. The closest untrusted address is -returned. - -```js -proxyaddr(req, function (addr) { return addr === '127.0.0.1' }) -proxyaddr(req, function (addr, i) { return i < 1 }) -``` - -The `trust` arugment may also be a single IP address string or an -array of trusted addresses, as plain IP addresses, CIDR-formatted -strings, or IP/netmask strings. - -```js -proxyaddr(req, '127.0.0.1') -proxyaddr(req, ['127.0.0.0/8', '10.0.0.0/8']) -proxyaddr(req, ['127.0.0.0/255.0.0.0', '192.168.0.0/255.255.0.0']) -``` - -This module also supports IPv6. Your IPv6 addresses will be normalized -automatically (i.e. `fe80::00ed:1` equals `fe80:0:0:0:0:0:ed:1`). - -```js -proxyaddr(req, '::1') -proxyaddr(req, ['::1/128', 'fe80::/10']) -``` - -This module will automatically work with IPv4-mapped IPv6 addresses -as well to support node.js in IPv6-only mode. This means that you do -not have to specify both `::ffff:a00:1` and `10.0.0.1`. - -As a convenience, this module also takes certain pre-defined names -in addition to IP addresses, which expand into IP addresses: - -```js -proxyaddr(req, 'loopback') -proxyaddr(req, ['loopback', 'fc00:ac:1ab5:fff::1/64']) -``` - - * `loopback`: IPv4 and IPv6 loopback addresses (like `::1` and - `127.0.0.1`). - * `linklocal`: IPv4 and IPv6 link-local addresses (like - `fe80::1:1:1:1` and `169.254.0.1`). - * `uniquelocal`: IPv4 private addresses and IPv6 unique-local - addresses (like `fc00:ac:1ab5:fff::1` and `192.168.0.1`). - -When `trust` is specified as a function, it will be called for each -address to determine if it is a trusted address. The function is -given two arguments: `addr` and `i`, where `addr` is a string of -the address to check and `i` is a number that represents the distance -from the socket address. - -### proxyaddr.all(req, [trust]) - -Return all the addresses of the request, optionally stopping at the -first untrusted. This array is ordered from closest to furthest -(i.e. `arr[0] === req.connection.remoteAddress`). - -```js -proxyaddr.all(req) -``` - -The optional `trust` argument takes the same arguments as `trust` -does in `proxyaddr(req, trust)`. - -```js -proxyaddr.all(req, 'loopback') -``` - -### proxyaddr.compile(val) - -Compiles argument `val` into a `trust` function. This function takes -the same arguments as `trust` does in `proxyaddr(req, trust)` and -returns a function suitable for `proxyaddr(req, trust)`. - -```js -var trust = proxyaddr.compile('loopback') -var addr = proxyaddr(req, trust) -``` - -This function is meant to be optimized for use against every request. -It is recommend to compile a trust function up-front for the trusted -configuration and pass that to `proxyaddr(req, trust)` for each request. - -## Testing - -```sh -$ npm test -``` - -## Benchmarks - -```sh -$ npm run-script bench -``` - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/proxy-addr/master?label=ci -[ci-url]: https://github.com/jshttp/proxy-addr/actions?query=workflow%3Aci -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/proxy-addr/master -[coveralls-url]: https://coveralls.io/r/jshttp/proxy-addr?branch=master -[node-image]: https://badgen.net/npm/node/proxy-addr -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/proxy-addr -[npm-url]: https://npmjs.org/package/proxy-addr -[npm-version-image]: https://badgen.net/npm/v/proxy-addr diff --git a/node_modules/proxy-addr/index.js b/node_modules/proxy-addr/index.js deleted file mode 100644 index a909b05..0000000 --- a/node_modules/proxy-addr/index.js +++ /dev/null @@ -1,327 +0,0 @@ -/*! - * proxy-addr - * Copyright(c) 2014-2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = proxyaddr -module.exports.all = alladdrs -module.exports.compile = compile - -/** - * Module dependencies. - * @private - */ - -var forwarded = require('forwarded') -var ipaddr = require('ipaddr.js') - -/** - * Variables. - * @private - */ - -var DIGIT_REGEXP = /^[0-9]+$/ -var isip = ipaddr.isValid -var parseip = ipaddr.parse - -/** - * Pre-defined IP ranges. - * @private - */ - -var IP_RANGES = { - linklocal: ['169.254.0.0/16', 'fe80::/10'], - loopback: ['127.0.0.1/8', '::1/128'], - uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7'] -} - -/** - * Get all addresses in the request, optionally stopping - * at the first untrusted. - * - * @param {Object} request - * @param {Function|Array|String} [trust] - * @public - */ - -function alladdrs (req, trust) { - // get addresses - var addrs = forwarded(req) - - if (!trust) { - // Return all addresses - return addrs - } - - if (typeof trust !== 'function') { - trust = compile(trust) - } - - for (var i = 0; i < addrs.length - 1; i++) { - if (trust(addrs[i], i)) continue - - addrs.length = i + 1 - } - - return addrs -} - -/** - * Compile argument into trust function. - * - * @param {Array|String} val - * @private - */ - -function compile (val) { - if (!val) { - throw new TypeError('argument is required') - } - - var trust - - if (typeof val === 'string') { - trust = [val] - } else if (Array.isArray(val)) { - trust = val.slice() - } else { - throw new TypeError('unsupported trust argument') - } - - for (var i = 0; i < trust.length; i++) { - val = trust[i] - - if (!Object.prototype.hasOwnProperty.call(IP_RANGES, val)) { - continue - } - - // Splice in pre-defined range - val = IP_RANGES[val] - trust.splice.apply(trust, [i, 1].concat(val)) - i += val.length - 1 - } - - return compileTrust(compileRangeSubnets(trust)) -} - -/** - * Compile `arr` elements into range subnets. - * - * @param {Array} arr - * @private - */ - -function compileRangeSubnets (arr) { - var rangeSubnets = new Array(arr.length) - - for (var i = 0; i < arr.length; i++) { - rangeSubnets[i] = parseipNotation(arr[i]) - } - - return rangeSubnets -} - -/** - * Compile range subnet array into trust function. - * - * @param {Array} rangeSubnets - * @private - */ - -function compileTrust (rangeSubnets) { - // Return optimized function based on length - var len = rangeSubnets.length - return len === 0 - ? trustNone - : len === 1 - ? trustSingle(rangeSubnets[0]) - : trustMulti(rangeSubnets) -} - -/** - * Parse IP notation string into range subnet. - * - * @param {String} note - * @private - */ - -function parseipNotation (note) { - var pos = note.lastIndexOf('/') - var str = pos !== -1 - ? note.substring(0, pos) - : note - - if (!isip(str)) { - throw new TypeError('invalid IP address: ' + str) - } - - var ip = parseip(str) - - if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) { - // Store as IPv4 - ip = ip.toIPv4Address() - } - - var max = ip.kind() === 'ipv6' - ? 128 - : 32 - - var range = pos !== -1 - ? note.substring(pos + 1, note.length) - : null - - if (range === null) { - range = max - } else if (DIGIT_REGEXP.test(range)) { - range = parseInt(range, 10) - } else if (ip.kind() === 'ipv4' && isip(range)) { - range = parseNetmask(range) - } else { - range = null - } - - if (range <= 0 || range > max) { - throw new TypeError('invalid range on address: ' + note) - } - - return [ip, range] -} - -/** - * Parse netmask string into CIDR range. - * - * @param {String} netmask - * @private - */ - -function parseNetmask (netmask) { - var ip = parseip(netmask) - var kind = ip.kind() - - return kind === 'ipv4' - ? ip.prefixLengthFromSubnetMask() - : null -} - -/** - * Determine address of proxied request. - * - * @param {Object} request - * @param {Function|Array|String} trust - * @public - */ - -function proxyaddr (req, trust) { - if (!req) { - throw new TypeError('req argument is required') - } - - if (!trust) { - throw new TypeError('trust argument is required') - } - - var addrs = alladdrs(req, trust) - var addr = addrs[addrs.length - 1] - - return addr -} - -/** - * Static trust function to trust nothing. - * - * @private - */ - -function trustNone () { - return false -} - -/** - * Compile trust function for multiple subnets. - * - * @param {Array} subnets - * @private - */ - -function trustMulti (subnets) { - return function trust (addr) { - if (!isip(addr)) return false - - var ip = parseip(addr) - var ipconv - var kind = ip.kind() - - for (var i = 0; i < subnets.length; i++) { - var subnet = subnets[i] - var subnetip = subnet[0] - var subnetkind = subnetip.kind() - var subnetrange = subnet[1] - var trusted = ip - - if (kind !== subnetkind) { - if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) { - // Incompatible IP addresses - continue - } - - if (!ipconv) { - // Convert IP to match subnet IP kind - ipconv = subnetkind === 'ipv4' - ? ip.toIPv4Address() - : ip.toIPv4MappedAddress() - } - - trusted = ipconv - } - - if (trusted.match(subnetip, subnetrange)) { - return true - } - } - - return false - } -} - -/** - * Compile trust function for single subnet. - * - * @param {Object} subnet - * @private - */ - -function trustSingle (subnet) { - var subnetip = subnet[0] - var subnetkind = subnetip.kind() - var subnetisipv4 = subnetkind === 'ipv4' - var subnetrange = subnet[1] - - return function trust (addr) { - if (!isip(addr)) return false - - var ip = parseip(addr) - var kind = ip.kind() - - if (kind !== subnetkind) { - if (subnetisipv4 && !ip.isIPv4MappedAddress()) { - // Incompatible IP addresses - return false - } - - // Convert IP to match subnet IP kind - ip = subnetisipv4 - ? ip.toIPv4Address() - : ip.toIPv4MappedAddress() - } - - return ip.match(subnetip, subnetrange) - } -} diff --git a/node_modules/proxy-addr/package.json b/node_modules/proxy-addr/package.json deleted file mode 100644 index 24ba8f7..0000000 --- a/node_modules/proxy-addr/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "proxy-addr", - "description": "Determine address of proxied request", - "version": "2.0.7", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "keywords": [ - "ip", - "proxy", - "x-forwarded-for" - ], - "repository": "jshttp/proxy-addr", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "devDependencies": { - "benchmark": "2.1.4", - "beautify-benchmark": "0.2.4", - "deep-equal": "1.0.1", - "eslint": "7.26.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.23.4", - "eslint-plugin-markdown": "2.2.0", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.3.1", - "eslint-plugin-standard": "4.1.0", - "mocha": "8.4.0", - "nyc": "15.1.0" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "engines": { - "node": ">= 0.10" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/node_modules/qs/.editorconfig b/node_modules/qs/.editorconfig deleted file mode 100644 index 6adecfb..0000000 --- a/node_modules/qs/.editorconfig +++ /dev/null @@ -1,46 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 160 -quote_type = single - -[test/*] -max_line_length = off - -[LICENSE.md] -indent_size = off - -[*.md] -max_line_length = off - -[*.json] -max_line_length = off - -[Makefile] -max_line_length = off - -[CHANGELOG.md] -indent_style = space -indent_size = 2 - -[LICENSE] -indent_size = 2 -max_line_length = off - -[coverage/**/*] -indent_size = off -indent_style = off -indent = off -max_line_length = off - -[.nycrc] -indent_style = tab - -[tea.yaml] -indent_size = 2 diff --git a/node_modules/qs/.github/FUNDING.yml b/node_modules/qs/.github/FUNDING.yml deleted file mode 100644 index 0355f4f..0000000 --- a/node_modules/qs/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/qs -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/qs/.github/SECURITY.md b/node_modules/qs/.github/SECURITY.md deleted file mode 100644 index b499cb6..0000000 --- a/node_modules/qs/.github/SECURITY.md +++ /dev/null @@ -1,11 +0,0 @@ -# Security - -Please file a private vulnerability report via GitHub, email [@ljharb](https://github.com/ljharb), or see https://tidelift.com/security if you have a potential security vulnerability to report. - -## Incident Response Plan - -Please see our [Incident Response Plan](https://github.com/ljharb/.github/blob/main/INCIDENT_RESPONSE_PLAN.md). - -## Threat Model - -Please see [THREAT_MODEL.md](./THREAT_MODEL.md). diff --git a/node_modules/qs/.github/THREAT_MODEL.md b/node_modules/qs/.github/THREAT_MODEL.md deleted file mode 100644 index 7e6fef1..0000000 --- a/node_modules/qs/.github/THREAT_MODEL.md +++ /dev/null @@ -1,78 +0,0 @@ -## Threat Model for qs (querystring parsing library) - -### 1. Library Overview - -- **Library Name:** qs -- **Brief Description:** A JavaScript library for parsing and stringifying URL query strings, supporting nested objects and arrays. It is widely used in Node.js and web applications for processing query parameters[2][6][8]. -- **Key Public APIs/Functions:** `qs.parse()`, `qs.stringify()` - -### 2. Define Scope - -This threat model focuses on the core parsing and stringifying functionality, specifically the handling of nested objects and arrays, option validation, and cycle management in stringification. - -### 3. Conceptual System Diagram - -``` -Caller Application → qs.parse(input, options) → Parsing Engine → Output Object - │ - └→ Options Handling - -Caller Application → qs.stringify(obj, options) → Stringifying Engine → Output String - │ - └→ Options Handling - └→ Cycle Tracking -``` - -**Trust Boundaries:** -- **Input string (parse):** May come from untrusted sources (e.g., user input, network requests) -- **Input object (stringify):** May contain cycles, which can lead to infinite loops during stringification -- **Options:** Provided by the caller -- **Cycle Tracking:** Used only during stringification to detect and handle circular references - -### 4. Identify Assets - -- **Integrity of parsed output:** Prevent malicious manipulation of the output object structure, especially ensuring builtins/globals are not modified as a result of parse[3][4][8]. -- **Confidentiality of processed data:** Avoid leaking sensitive information through errors or output. -- **Availability/performance for host application:** Prevent crashes or resource exhaustion in the consuming application. -- **Security of host application:** Prevent the library from being a vector for attacks (e.g., prototype pollution, DoS). -- **Reputation of library:** Maintain trust by avoiding supply chain attacks and vulnerabilities[1]. - -### 5. Identify Threats - -| Component / API / Interaction | S | T | R | I | D | E | -|---------------------------------------|----|----|----|----|----|----| -| Public API Call (`parse`) | – | ✓ | – | ✓ | ✓ | ✓ | -| Public API Call (`stringify`) | – | ✓ | – | ✓ | ✓ | – | -| Options Handling | ✓ | ✓ | – | ✓ | – | ✓ | -| Dependency Interaction | – | – | – | – | ✓ | – | - -**Key Threats:** -- **Tampering:** Malicious input can, if not prevented, alter parsed output (e.g., prototype pollution via `__proto__`, modification of builtins/globals)[3][4][8]. -- **Information Disclosure:** Error messages may expose internal details or sensitive data. -- **Denial of Service:** Large or malformed input can exhaust memory or CPU. -- **Elevation of Privilege:** Prototype pollution can lead to unintended privilege escalation in the host application[3][4][8]. - -### 6. Mitigation/Countermeasures - -| Threat Identified | Proposed Mitigation | -|---------------------------------------------------|---------------------| -| Tampering (malicious input, prototype pollution) | Strict input validation; keep `allowPrototypes: false` by default; use `plainObjects` for output; ensure builtins/globals are never modified by parse[4][8]. | -| Information Disclosure (error messages) | Generic error messages without stack traces or internal paths. | -| Denial of Service (memory/CPU exhaustion) | Enforce `arrayLimit` and `parameterLimit` with safe defaults; enable `throwOnLimitExceeded`; limit nesting depth[7]. | -| Elevation of Privilege (prototype pollution) | Keep `allowPrototypes: false`; validate options against allowlist; use `plainObjects` to avoid prototype pollution[4][8]. | - -### 7. Risk Ranking - -- **High:** Denial of Service via array parsing or malformed input (historical vulnerability) -- **Medium:** Prototype pollution via options or input (if `allowPrototypes` enabled) -- **Low:** Information disclosure in errors - -### 8. Next Steps & Review - -1. **Audit option validation logic.** -2. **Add depth limiting to nested parsing and stringification.** -3. **Implement fuzz testing for parser and stringifier edge cases.** -4. **Regularly review dependencies for vulnerabilities.** -5. **Keep documentation and threat model up to date.** -6. **Ensure builtins/globals are never modified as a result of parse.** -7. **Support round-trip consistency between parse and stringify as a non-security goal, with the right options[5][9].** diff --git a/node_modules/qs/.nycrc b/node_modules/qs/.nycrc deleted file mode 100644 index 1d57cab..0000000 --- a/node_modules/qs/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "dist" - ] -} diff --git a/node_modules/qs/CHANGELOG.md b/node_modules/qs/CHANGELOG.md deleted file mode 100644 index 35828d5..0000000 --- a/node_modules/qs/CHANGELOG.md +++ /dev/null @@ -1,631 +0,0 @@ -## **6.14.1** -- [Fix] ensure arrayLength applies to `[]` notation as well -- [Fix] `parse`: when a custom decoder returns `null` for a key, ignore that key -- [Refactor] `parse`: extract key segment splitting helper -- [meta] add threat model -- [actions] add workflow permissions -- [Tests] `stringify`: increase coverage -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `npmignore`, `es-value-fixtures`, `for-each`, `object-inspect` - -## **6.14.0** -- [New] `parse`: add `throwOnParameterLimitExceeded` option (#517) -- [Refactor] `parse`: use `utils.combine` more -- [patch] `parse`: add explicit `throwOnLimitExceeded` default -- [actions] use shared action; re-add finishers -- [meta] Fix changelog formatting bug -- [Deps] update `side-channel` -- [Dev Deps] update `es-value-fixtures`, `has-bigints`, `has-proto`, `has-symbols` -- [Tests] increase coverage - -## **6.13.1** -- [Fix] `stringify`: avoid a crash when a `filter` key is `null` -- [Fix] `utils.merge`: functions should not be stringified into keys -- [Fix] `parse`: avoid a crash with interpretNumericEntities: true, comma: true, and iso charset -- [Fix] `stringify`: ensure a non-string `filter` does not crash -- [Refactor] use `__proto__` syntax instead of `Object.create` for null objects -- [Refactor] misc cleanup -- [Tests] `utils.merge`: add some coverage -- [Tests] fix a test case -- [actions] split out node 10-20, and 20+ -- [Dev Deps] update `es-value-fixtures`, `mock-property`, `object-inspect`, `tape` - -## **6.13.0** -- [New] `parse`: add `strictDepth` option (#511) -- [Tests] use `npm audit` instead of `aud` - -## **6.12.3** -- [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays` -- [meta] fix changelog indentation - -## **6.12.2** -- [Fix] `parse`: parse encoded square brackets (#506) -- [readme] add CII best practices badge - -## **6.12.1** -- [Fix] `parse`: Disable `decodeDotInKeys` by default to restore previous behavior (#501) -- [Performance] `utils`: Optimize performance under large data volumes, reduce memory usage, and speed up processing (#502) -- [Refactor] `utils`: use `+=` -- [Tests] increase coverage - -## **6.12.0** - -- [New] `parse`/`stringify`: add `decodeDotInKeys`/`encodeDotKeys` options (#488) -- [New] `parse`: add `duplicates` option -- [New] `parse`/`stringify`: add `allowEmptyArrays` option to allow [] in object values (#487) -- [Refactor] `parse`/`stringify`: move allowDots config logic to its own variable -- [Refactor] `stringify`: move option-handling code into `normalizeStringifyOptions` -- [readme] update readme, add logos (#484) -- [readme] `stringify`: clarify default `arrayFormat` behavior -- [readme] fix line wrapping -- [readme] remove dead badges -- [Deps] update `side-channel` -- [meta] make the dist build 50% smaller -- [meta] add `sideEffects` flag -- [meta] run build in prepack, not prepublish -- [Tests] `parse`: remove useless tests; add coverage -- [Tests] `stringify`: increase coverage -- [Tests] use `mock-property` -- [Tests] `stringify`: improve coverage -- [Dev Deps] update `@ljharb/eslint-config `, `aud`, `has-override-mistake`, `has-property-descriptors`, `mock-property`, `npmignore`, `object-inspect`, `tape` -- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` -- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 - -## **6.11.2** -- [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473) -- [Tests] add passing test cases with empty keys (#473) - -## **6.11.1** -- [Fix] `stringify`: encode comma values more consistently (#463) -- [readme] add usage of `filter` option for injecting custom serialization, i.e. of custom types (#447) -- [meta] remove extraneous code backticks (#457) -- [meta] fix changelog markdown -- [actions] update checkout action -- [actions] restrict action permissions -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` - -## **6.11.0** -- [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442) -- [readme] fix version badge - -## **6.10.5** -- [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434) - -## **6.10.4** -- [Fix] `stringify`: with `arrayFormat: comma`, include an explicit `[]` on a single-item array (#441) -- [meta] use `npmignore` to autogenerate an npmignore file -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbol`, `object-inspect`, `tape` - -## **6.10.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [actions] reuse common workflows -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape` - -## **6.10.2** -- [Fix] `stringify`: actually fix cyclic references (#426) -- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] add note and links for coercing primitive values (#408) -- [actions] update codecov uploader -- [actions] update workflows -- [Tests] clean up stringify tests slightly -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `safe-publish-latest`, `tape` - -## **6.10.1** -- [Fix] `stringify`: avoid exception on repeated object values (#402) - -## **6.10.0** -- [New] `stringify`: throw on cycles, instead of an infinite loop (#395, #394, #393) -- [New] `parse`: add `allowSparse` option for collapsing arrays with missing indices (#312) -- [meta] fix README.md (#399) -- [meta] only run `npm run dist` in publish, not install -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape` -- [Tests] fix tests on node v0.6 -- [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run` -- [Tests] Revert "[meta] ignore eclint transitive audit warning" - -## **6.9.7** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] add note and links for coercing primitive values (#408) -- [Tests] clean up stringify tests slightly -- [meta] fix README.md (#399) -- Revert "[meta] ignore eclint transitive audit warning" -- [actions] backport actions from main -- [Dev Deps] backport updates from main - -## **6.9.6** -- [Fix] restore `dist` dir; mistakenly removed in d4f6c32 - -## **6.9.5** -- [Fix] `stringify`: do not encode parens for RFC1738 -- [Fix] `stringify`: fix arrayFormat comma with empty array/objects (#350) -- [Refactor] `format`: remove `util.assign` call -- [meta] add "Allow Edits" workflow; update rebase workflow -- [actions] switch Automatic Rebase workflow to `pull_request_target` event -- [Tests] `stringify`: add tests for #378 -- [Tests] migrate tests to Github Actions -- [Tests] run `nyc` on all tests; use `tape` runner -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `mkdirp`, `object-inspect`, `tape`; add `aud` - -## **6.9.4** -- [Fix] `stringify`: when `arrayFormat` is `comma`, respect `serializeDate` (#364) -- [Refactor] `stringify`: reduce branching (part of #350) -- [Refactor] move `maybeMap` to `utils` -- [Dev Deps] update `browserify`, `tape` - -## **6.9.3** -- [Fix] proper comma parsing of URL-encoded commas (#361) -- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) - -## **6.9.2** -- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) -- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) -- [meta] ignore eclint transitive audit warning -- [meta] fix indentation in package.json -- [meta] add tidelift marketing copy -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `has-symbols`, `tape`, `mkdirp`, `iconv-lite` -- [actions] add automatic rebasing / merge commit blocking - -## **6.9.1** -- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) -- [Fix] `parse`: with comma true, do not split non-string values (#334) -- [meta] add `funding` field -- [Dev Deps] update `eslint`, `@ljharb/eslint-config` -- [Tests] use shared travis-ci config - -## **6.9.0** -- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd` -- [Tests] `parse`: add passing `arrayFormat` tests -- [Tests] add `posttest` using `npx aud` to run `npm audit` without a lockfile -- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16` -- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray - -## **6.8.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Tests] clean up stringify tests slightly -- [Docs] add note and links for coercing primitive values (#408) -- [meta] fix README.md (#399) -- [actions] backport actions from main -- [Dev Deps] backport updates from main -- [Refactor] `stringify`: reduce branching -- [meta] do not publish workflow files - -## **6.8.2** -- [Fix] proper comma parsing of URL-encoded commas (#361) -- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) - -## **6.8.1** -- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) -- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) -- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) -- [fix] `parse`: with comma true, do not split non-string values (#334) -- [meta] add tidelift marketing copy -- [meta] add `funding` field -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `has-symbols`, `iconv-lite`, `mkdirp`, `object-inspect` -- [Tests] `parse`: add passing `arrayFormat` tests -- [Tests] use shared travis-ci configs -- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray -- [actions] add automatic rebasing / merge commit blocking - -## **6.8.0** -- [New] add `depth=false` to preserve the original key; [Fix] `depth=0` should preserve the original key (#326) -- [New] [Fix] stringify symbols and bigints -- [Fix] ensure node 0.12 can stringify Symbols -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Refactor] `formats`: tiny bit of cleanup. -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `safe-publish-latest`, `iconv-lite`, `tape` -- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended (#326) -- [Tests] use `eclint` instead of `editorconfig-tools` -- [docs] readme: add security note -- [meta] add github sponsorship -- [meta] add FUNDING.yml -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause - -## **6.7.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] add note and links for coercing primitive values (#408) -- [meta] fix README.md (#399) -- [meta] do not publish workflow files -- [actions] backport actions from main -- [Dev Deps] backport updates from main -- [Tests] use `nyc` for coverage -- [Tests] clean up stringify tests slightly - -## **6.7.2** -- [Fix] proper comma parsing of URL-encoded commas (#361) -- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) - -## **6.7.1** -- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) -- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) -- [fix] `parse`: with comma true, do not split non-string values (#334) -- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Refactor] `formats`: tiny bit of cleanup. -- readme: add security note -- [meta] add tidelift marketing copy -- [meta] add `funding` field -- [meta] add FUNDING.yml -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `iconv-lite`, `mkdirp`, `object-inspect`, `browserify` -- [Tests] `parse`: add passing `arrayFormat` tests -- [Tests] use shared travis-ci configs -- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray -- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended -- [Tests] use `eclint` instead of `editorconfig-tools` -- [actions] add automatic rebasing / merge commit blocking - -## **6.7.0** -- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219) -- [Fix] correctly parse nested arrays (#212) -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source -- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` -- [Refactor] `utils`: `isBuffer`: small tweak; add tests -- [Refactor] use cached `Array.isArray` -- [Refactor] `parse`/`stringify`: make a function to normalize the options -- [Refactor] `utils`: reduce observable [[Get]]s -- [Refactor] `stringify`/`utils`: cache `Array.isArray` -- [Tests] always use `String(x)` over `x.toString()` -- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 -- [Tests] temporarily allow coverage to fail - -## **6.6.1** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] correctly parse nested arrays -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` -- [Refactor] `formats`: tiny bit of cleanup. -- [Refactor] `utils`: `isBuffer`: small tweak; add tests -- [Refactor]: `stringify`/`utils`: cache `Array.isArray` -- [Refactor] `utils`: reduce observable [[Get]]s -- [Refactor] use cached `Array.isArray` -- [Refactor] `parse`/`stringify`: make a function to normalize the options -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] do not publish workflow files -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [meta] add FUNDING.yml -- [meta] Fixes typo in CHANGELOG.md -- [actions] backport actions from main -- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 -- [Tests] always use `String(x)` over `x.toString()` -- [Dev Deps] backport from main - -## **6.6.0** -- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268) -- [New] move two-value combine to a `utils` function (#189) -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260) -- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1` -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [Refactor] `parse`: only need to reassign the var once -- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults -- [Refactor] add missing defaults -- [Refactor] `parse`: one less `concat` call -- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting -- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape` -- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS - -## **6.5.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] correctly parse nested arrays -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Refactor] `utils`: reduce observable [[Get]]s -- [Refactor] use cached `Array.isArray` -- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [Refactor] `parse`: only need to reassign the var once -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] Clean up license text so it’s properly detected as BSD-3-Clause -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] add FUNDING.yml -- [actions] backport actions from main -- [Tests] always use `String(x)` over `x.toString()` -- [Tests] remove nonexistent tape option -- [Dev Deps] backport from main - -## **6.5.2** -- [Fix] use `safer-buffer` instead of `Buffer` constructor -- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230) -- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify` - -## **6.5.1** -- [Fix] Fix parsing & compacting very deep objects (#224) -- [Refactor] name utils functions -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` -- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node -- [Tests] Use precise dist for Node.js 0.6 runtime (#225) -- [Tests] make 0.6 required, now that it’s passing -- [Tests] on `node` `v8.2`; fix npm on node 0.6 - -## **6.5.0** -- [New] add `utils.assign` -- [New] pass default encoder/decoder to custom encoder/decoder functions (#206) -- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213) -- [Fix] Handle stringifying empty objects with addQueryPrefix (#217) -- [Fix] do not mutate `options` argument (#207) -- [Refactor] `parse`: cache index to reuse in else statement (#182) -- [Docs] add various badges to readme (#208) -- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape` -- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4 -- [Tests] add `editorconfig-tools` - -## **6.4.1** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Fix] use `safer-buffer` instead of `Buffer` constructor -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Refactor] use cached `Array.isArray` -- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [meta] add FUNDING.yml -- [actions] backport actions from main -- [Tests] remove nonexistent tape option -- [Dev Deps] backport from main - -## **6.4.0** -- [New] `qs.stringify`: add `encodeValuesOnly` option -- [Fix] follow `allowPrototypes` option during merge (#201, #201) -- [Fix] support keys starting with brackets (#202, #200) -- [Fix] chmod a-x -- [Dev Deps] update `eslint` -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds -- [eslint] reduce warnings - -## **6.3.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Refactor] use cached `Array.isArray` -- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [meta] add FUNDING.yml -- [actions] backport actions from main -- [Tests] use `safer-buffer` instead of `Buffer` constructor -- [Tests] remove nonexistent tape option -- [Dev Deps] backport from main - -## **6.3.2** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Dev Deps] update `eslint` -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.3.1** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape` -- [Tests] on all node minors; improve test matrix -- [Docs] document stringify option `allowDots` (#195) -- [Docs] add empty object and array values example (#195) -- [Docs] Fix minor inconsistency/typo (#192) -- [Docs] document stringify option `sort` (#191) -- [Refactor] `stringify`: throw faster with an invalid encoder -- [Refactor] remove unnecessary escapes (#184) -- Remove contributing.md, since `qs` is no longer part of `hapi` (#183) - -## **6.3.0** -- [New] Add support for RFC 1738 (#174, #173) -- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159) -- [Fix] ensure `utils.merge` handles merging two arrays -- [Refactor] only constructors should be capitalized -- [Refactor] capitalized var names are for constructors only -- [Refactor] avoid using a sparse array -- [Robustness] `formats`: cache `String#replace` -- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` -- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix -- [Tests] flesh out arrayLimit/arrayFormat tests (#107) -- [Tests] skip Object.create tests when null objects are not available -- [Tests] Turn on eslint for test files (#175) - -## **6.2.4** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Refactor] use cached `Array.isArray` -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [meta] add FUNDING.yml -- [actions] backport actions from main -- [Tests] use `safer-buffer` instead of `Buffer` constructor -- [Tests] remove nonexistent tape option -- [Dev Deps] backport from main - -## **6.2.3** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.2.2** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties - -## **6.2.1** -- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values -- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` -- [Tests] remove `parallelshell` since it does not reliably report failures -- [Tests] up to `node` `v6.3`, `v5.12` -- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` - -## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) -- [New] pass Buffers to the encoder/decoder directly (#161) -- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) -- [Fix] fix compacting of nested sparse arrays (#150) - -## **6.1.2** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.1.1** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties - -## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) -- [New] allowDots option for `stringify` (#151) -- [Fix] "sort" option should work at a depth of 3 or more (#151) -- [Fix] Restore `dist` directory; will be removed in v7 (#148) - -## **6.0.4** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.0.3** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties -- [Fix] Restore `dist` directory; will be removed in v7 (#148) - -## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) -- Revert ES6 requirement and restore support for node down to v0.8. - -## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) -- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json - -## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) -- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 - -## **5.2.1** -- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values - -## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) -- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string - -## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) -- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional -- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify - -## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) -- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false -- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm - -## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) -- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional - -## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) -- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" - -## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) -- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties -- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost -- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing -- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object -- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option -- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. -- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 -- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 -- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign -- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute - -## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) -- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function - -## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) -- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option - -## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) -- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 -- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader - -## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) -- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object - -## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) -- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". - -## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) -- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 - -## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) -- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? -- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 -- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 - -## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) -- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number - -## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) -- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array -- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x - -## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) -- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value -- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty -- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? - -## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) -- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 -- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects - -## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) -- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present -- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays -- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge -- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? - -## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) -- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter - -## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) -- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? -- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit -- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 - -## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) -- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values - -## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) -- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters -- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block - -## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) -- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument -- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed - -## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) -- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted -- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null -- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README - -## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) -- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/node_modules/qs/LICENSE.md b/node_modules/qs/LICENSE.md deleted file mode 100644 index fecf6b6..0000000 --- a/node_modules/qs/LICENSE.md +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/qs/README.md b/node_modules/qs/README.md deleted file mode 100644 index 22c411d..0000000 --- a/node_modules/qs/README.md +++ /dev/null @@ -1,733 +0,0 @@ -

- qs -

- -# qs [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9058/badge)](https://bestpractices.coreinfrastructure.org/projects/9058) - -[![npm badge][npm-badge-png]][package-url] - -A querystring parsing and stringifying library with some added security. - -Lead Maintainer: [Jordan Harband](https://github.com/ljharb) - -The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). - -## Usage - -```javascript -var qs = require('qs'); -var assert = require('assert'); - -var obj = qs.parse('a=c'); -assert.deepEqual(obj, { a: 'c' }); - -var str = qs.stringify(obj); -assert.equal(str, 'a=c'); -``` - -### Parsing Objects - -[](#preventEval) -```javascript -qs.parse(string, [options]); -``` - -**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. -For example, the string `'foo[bar]=baz'` converts to: - -```javascript -assert.deepEqual(qs.parse('foo[bar]=baz'), { - foo: { - bar: 'baz' - } -}); -``` - -When using the `plainObjects` option the parsed value is returned as a null object, created via `{ __proto__: null }` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: - -```javascript -var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); -assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } }); -``` - -By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. -*WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. -Always be careful with this option. - -```javascript -var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); -assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); -``` - -URI encoded strings work too: - -```javascript -assert.deepEqual(qs.parse('a%5Bb%5D=c'), { - a: { b: 'c' } -}); -``` - -You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: - -```javascript -assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { - foo: { - bar: { - baz: 'foobarbaz' - } - } -}); -``` - -By default, when nesting objects **qs** will only parse up to 5 children deep. -This means if you attempt to parse a string like `'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: - -```javascript -var expected = { - a: { - b: { - c: { - d: { - e: { - f: { - '[g][h][i]': 'j' - } - } - } - } - } - } -}; -var string = 'a[b][c][d][e][f][g][h][i]=j'; -assert.deepEqual(qs.parse(string), expected); -``` - -This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: - -```javascript -var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); -assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); -``` - -You can configure **qs** to throw an error when parsing nested input beyond this depth using the `strictDepth` option (defaulted to false): - -```javascript -try { - qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); -} catch (err) { - assert(err instanceof RangeError); - assert.strictEqual(err.message, 'Input depth exceeded depth option of 1 and strictDepth is true'); -} -``` - -The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. The strictDepth option adds a layer of protection by throwing an error when the limit is exceeded, allowing you to catch and handle such cases. - -For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: - -```javascript -var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); -assert.deepEqual(limited, { a: 'b' }); -``` - -If you want an error to be thrown whenever the a limit is exceeded (eg, `parameterLimit`, `arrayLimit`), set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds a configured limit. -```javascript -try { - qs.parse('a=1&b=2&c=3&d=4', { parameterLimit: 3, throwOnLimitExceeded: true }); -} catch (err) { - assert(err instanceof Error); - assert.strictEqual(err.message, 'Parameter limit exceeded. Only 3 parameters allowed.'); -} -``` - -When `throwOnLimitExceeded` is set to `false` (default), **qs** will parse up to the specified `parameterLimit` and ignore the rest without throwing an error. - -To bypass the leading question mark, use `ignoreQueryPrefix`: - -```javascript -var prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true }); -assert.deepEqual(prefixed, { a: 'b', c: 'd' }); -``` - -An optional delimiter can also be passed: - -```javascript -var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); -assert.deepEqual(delimited, { a: 'b', c: 'd' }); -``` - -Delimiters can be a regular expression too: - -```javascript -var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); -assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); -``` - -Option `allowDots` can be used to enable dot notation: - -```javascript -var withDots = qs.parse('a.b=c', { allowDots: true }); -assert.deepEqual(withDots, { a: { b: 'c' } }); -``` - -Option `decodeDotInKeys` can be used to decode dots in keys -Note: it implies `allowDots`, so `parse` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. - -```javascript -var withDots = qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { decodeDotInKeys: true }); -assert.deepEqual(withDots, { 'name.obj': { first: 'John', last: 'Doe' }}); -``` - -Option `allowEmptyArrays` can be used to allowing empty array values in object -```javascript -var withEmptyArrays = qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }); -assert.deepEqual(withEmptyArrays, { foo: [], bar: 'baz' }); -``` - -Option `duplicates` can be used to change the behavior when duplicate keys are encountered -```javascript -assert.deepEqual(qs.parse('foo=bar&foo=baz'), { foo: ['bar', 'baz'] }); -assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), { foo: ['bar', 'baz'] }); -assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'bar' }); -assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' }); -``` - -If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1: - -```javascript -var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' }); -assert.deepEqual(oldCharset, { a: '§' }); -``` - -Some services add an initial `utf8=✓` value to forms so that old Internet Explorer versions are more likely to submit the form as utf-8. -Additionally, the server can check the value against wrong encodings of the checkmark character and detect that a query string or `application/x-www-form-urlencoded` body was *not* sent as utf-8, eg. if the form had an `accept-charset` parameter or the containing page had a different character set. - -**qs** supports this mechanism via the `charsetSentinel` option. -If specified, the `utf8` parameter will be omitted from the returned object. -It will be used to switch to `iso-8859-1`/`utf-8` mode depending on how the checkmark is encoded. - -**Important**: When you specify both the `charset` option and the `charsetSentinel` option, the `charset` will be overridden when the request contains a `utf8` parameter from which the actual charset can be deduced. -In that sense the `charset` will behave as the default charset rather than the authoritative charset. - -```javascript -var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', { - charset: 'iso-8859-1', - charsetSentinel: true -}); -assert.deepEqual(detectedAsUtf8, { a: 'ø' }); - -// Browsers encode the checkmark as ✓ when submitting as iso-8859-1: -var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', { - charset: 'utf-8', - charsetSentinel: true -}); -assert.deepEqual(detectedAsIso8859_1, { a: 'ø' }); -``` - -If you want to decode the `&#...;` syntax to the actual character, you can specify the `interpretNumericEntities` option as well: - -```javascript -var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { - charset: 'iso-8859-1', - interpretNumericEntities: true -}); -assert.deepEqual(detectedAsIso8859_1, { a: '☺' }); -``` - -It also works when the charset has been detected in `charsetSentinel` mode. - -### Parsing Arrays - -**qs** can also parse arrays using a similar `[]` notation: - -```javascript -var withArray = qs.parse('a[]=b&a[]=c'); -assert.deepEqual(withArray, { a: ['b', 'c'] }); -``` - -You may specify an index as well: - -```javascript -var withIndexes = qs.parse('a[1]=c&a[0]=b'); -assert.deepEqual(withIndexes, { a: ['b', 'c'] }); -``` - -Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number to create an array. -When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving their order: - -```javascript -var noSparse = qs.parse('a[1]=b&a[15]=c'); -assert.deepEqual(noSparse, { a: ['b', 'c'] }); -``` - -You may also use `allowSparse` option to parse sparse arrays: - -```javascript -var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true }); -assert.deepEqual(sparseArray, { a: [, '2', , '5'] }); -``` - -Note that an empty string is also a value, and will be preserved: - -```javascript -var withEmptyString = qs.parse('a[]=&a[]=b'); -assert.deepEqual(withEmptyString, { a: ['', 'b'] }); - -var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); -assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); -``` - -**qs** will also limit specifying indices in an array to a maximum index of `20`. -Any array members with an index of greater than `20` will instead be converted to an object with the index as the key. -This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. - -```javascript -var withMaxIndex = qs.parse('a[100]=b'); -assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); -``` - -This limit can be overridden by passing an `arrayLimit` option: - -```javascript -var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); -assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); -``` - -If you want to throw an error whenever the array limit is exceeded, set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds a configured limit. -```javascript -try { - qs.parse('a[1]=b', { arrayLimit: 0, throwOnLimitExceeded: true }); -} catch (err) { - assert(err instanceof Error); - assert.strictEqual(err.message, 'Array limit exceeded. Only 0 elements allowed in an array.'); -} -``` - -When `throwOnLimitExceeded` is set to `false` (default), **qs** will parse up to the specified `arrayLimit` and if the limit is exceeded, the array will instead be converted to an object with the index as the key - -To disable array parsing entirely, set `parseArrays` to `false`. - -```javascript -var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); -assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); -``` - -If you mix notations, **qs** will merge the two items into an object: - -```javascript -var mixedNotation = qs.parse('a[0]=b&a[b]=c'); -assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); -``` - -You can also create arrays of objects: - -```javascript -var arraysOfObjects = qs.parse('a[][b]=c'); -assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); -``` - -Some people use comma to join array, **qs** can parse it: -```javascript -var arraysOfObjects = qs.parse('a=b,c', { comma: true }) -assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] }) -``` -(_this cannot convert nested objects, such as `a={b:1},{c:d}`_) - -### Parsing primitive/scalar values (numbers, booleans, null, etc) - -By default, all values are parsed as strings. -This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91). - -```javascript -var primitiveValues = qs.parse('a=15&b=true&c=null'); -assert.deepEqual(primitiveValues, { a: '15', b: 'true', c: 'null' }); -``` - -If you wish to auto-convert values which look like numbers, booleans, and other values into their primitive counterparts, you can use the [query-types Express JS middleware](https://github.com/xpepermint/query-types) which will auto-convert all request query parameters. - -### Stringifying - -[](#preventEval) -```javascript -qs.stringify(object, [options]); -``` - -When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: - -```javascript -assert.equal(qs.stringify({ a: 'b' }), 'a=b'); -assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); -``` - -This encoding can be disabled by setting the `encode` option to `false`: - -```javascript -var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); -assert.equal(unencoded, 'a[b]=c'); -``` - -Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`: -```javascript -var encodedValues = qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true } -); -assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); -``` - -This encoding can also be replaced by a custom encoding method set as `encoder` option: - -```javascript -var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { - // Passed in values `a`, `b`, `c` - return // Return encoded string -}}) -``` - -_(Note: the `encoder` option does not apply if `encode` is `false`)_ - -Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: - -```javascript -var decoded = qs.parse('x=z', { decoder: function (str) { - // Passed in values `x`, `z` - return // Return decoded string -}}) -``` - -You can encode keys and values using different logic by using the type argument provided to the encoder: - -```javascript -var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultEncoder, charset, type) { - if (type === 'key') { - return // Encoded key - } else if (type === 'value') { - return // Encoded value - } -}}) -``` - -The type argument is also provided to the decoder: - -```javascript -var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, type) { - if (type === 'key') { - return // Decoded key - } else if (type === 'value') { - return // Decoded value - } -}}) -``` - -Examples beyond this point will be shown as though the output is not URI encoded for clarity. -Please note that the return values in these cases *will* be URI encoded during real usage. - -When arrays are stringified, they follow the `arrayFormat` option, which defaults to `indices`: - -```javascript -qs.stringify({ a: ['b', 'c', 'd'] }); -// 'a[0]=b&a[1]=c&a[2]=d' -``` - -You may override this by setting the `indices` option to `false`, or to be more explicit, the `arrayFormat` option to `repeat`: - -```javascript -qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); -// 'a=b&a=c&a=d' -``` - -You may use the `arrayFormat` option to specify the format of the output array: - -```javascript -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) -// 'a[0]=b&a[1]=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) -// 'a[]=b&a[]=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) -// 'a=b&a=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' }) -// 'a=b,c' -``` - -Note: when using `arrayFormat` set to `'comma'`, you can also pass the `commaRoundTrip` option set to `true` or `false`, to append `[]` on single-item arrays, so that they can round trip through a parse. - -When objects are stringified, by default they use bracket notation: - -```javascript -qs.stringify({ a: { b: { c: 'd', e: 'f' } } }); -// 'a[b][c]=d&a[b][e]=f' -``` - -You may override this to use dot notation by setting the `allowDots` option to `true`: - -```javascript -qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true }); -// 'a.b.c=d&a.b.e=f' -``` - -You may encode the dot notation in the keys of object with option `encodeDotInKeys` by setting it to `true`: -Note: it implies `allowDots`, so `stringify` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. -Caveat: when `encodeValuesOnly` is `true` as well as `encodeDotInKeys`, only dots in keys and nothing else will be encoded. -```javascript -qs.stringify({ "name.obj": { "first": "John", "last": "Doe" } }, { allowDots: true, encodeDotInKeys: true }) -// 'name%252Eobj.first=John&name%252Eobj.last=Doe' -``` - -You may allow empty array values by setting the `allowEmptyArrays` option to `true`: -```javascript -qs.stringify({ foo: [], bar: 'baz' }, { allowEmptyArrays: true }); -// 'foo[]&bar=baz' -``` - -Empty strings and null values will omit the value, but the equals sign (=) remains in place: - -```javascript -assert.equal(qs.stringify({ a: '' }), 'a='); -``` - -Key with no values (such as an empty object or array) will return nothing: - -```javascript -assert.equal(qs.stringify({ a: [] }), ''); -assert.equal(qs.stringify({ a: {} }), ''); -assert.equal(qs.stringify({ a: [{}] }), ''); -assert.equal(qs.stringify({ a: { b: []} }), ''); -assert.equal(qs.stringify({ a: { b: {}} }), ''); -``` - -Properties that are set to `undefined` will be omitted entirely: - -```javascript -assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); -``` - -The query string may optionally be prepended with a question mark: - -```javascript -assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d'); -``` - -The delimiter may be overridden with stringify as well: - -```javascript -assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); -``` - -If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option: - -```javascript -var date = new Date(7); -assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A')); -assert.equal( - qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }), - 'a=7' -); -``` - -You may use the `sort` option to affect the order of parameter keys: - -```javascript -function alphabeticalSort(a, b) { - return a.localeCompare(b); -} -assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y'); -``` - -Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. -If you pass a function, it will be called for each key to obtain the replacement value. -Otherwise, if you pass an array, it will be used to select properties and array indices for stringification: - -```javascript -function filterFunc(prefix, value) { - if (prefix == 'b') { - // Return an `undefined` value to omit a property. - return; - } - if (prefix == 'e[f]') { - return value.getTime(); - } - if (prefix == 'e[g][0]') { - return value * 2; - } - return value; -} -qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); -// 'a=b&c=d&e[f]=123&e[g][0]=4' -qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); -// 'a=b&e=f' -qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); -// 'a[0]=b&a[2]=d' -``` - -You could also use `filter` to inject custom serialization for user defined types. -Consider you're working with some api that expects query strings of the format for ranges: - -``` -https://domain.com/endpoint?range=30...70 -``` - -For which you model as: - -```javascript -class Range { - constructor(from, to) { - this.from = from; - this.to = to; - } -} -``` - -You could _inject_ a custom serializer to handle values of this type: - -```javascript -qs.stringify( - { - range: new Range(30, 70), - }, - { - filter: (prefix, value) => { - if (value instanceof Range) { - return `${value.from}...${value.to}`; - } - // serialize the usual way - return value; - }, - } -); -// range=30...70 -``` - -### Handling of `null` values - -By default, `null` values are treated like empty strings: - -```javascript -var withNull = qs.stringify({ a: null, b: '' }); -assert.equal(withNull, 'a=&b='); -``` - -Parsing does not distinguish between parameters with and without equal signs. -Both are converted to empty strings. - -```javascript -var equalsInsensitive = qs.parse('a&b='); -assert.deepEqual(equalsInsensitive, { a: '', b: '' }); -``` - -To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` -values have no `=` sign: - -```javascript -var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); -assert.equal(strictNull, 'a&b='); -``` - -To parse values without `=` back to `null` use the `strictNullHandling` flag: - -```javascript -var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); -assert.deepEqual(parsedStrictNull, { a: null, b: '' }); -``` - -To completely skip rendering keys with `null` values, use the `skipNulls` flag: - -```javascript -var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); -assert.equal(nullsSkipped, 'a=b'); -``` - -If you're communicating with legacy systems, you can switch to `iso-8859-1` using the `charset` option: - -```javascript -var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }); -assert.equal(iso, '%E6=%E6'); -``` - -Characters that don't exist in `iso-8859-1` will be converted to numeric entities, similar to what browsers do: - -```javascript -var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }); -assert.equal(numeric, 'a=%26%239786%3B'); -``` - -You can use the `charsetSentinel` option to announce the character by including an `utf8=✓` parameter with the proper encoding if the checkmark, similar to what Ruby on Rails and others do when submitting forms. - -```javascript -var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true }); -assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA'); - -var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }); -assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6'); -``` - -### Dealing with special character sets - -By default the encoding and decoding of characters is done in `utf-8`, and `iso-8859-1` support is also built in via the `charset` parameter. - -If you wish to encode querystrings to a different character set (i.e. -[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the -[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: - -```javascript -var encoder = require('qs-iconv/encoder')('shift_jis'); -var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); -assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); -``` - -This also works for decoding of query strings: - -```javascript -var decoder = require('qs-iconv/decoder')('shift_jis'); -var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); -assert.deepEqual(obj, { a: 'こんにちは!' }); -``` - -### RFC 3986 and RFC 1738 space encoding - -RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible. -In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'. - -``` -assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); -assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c'); -assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c'); -``` - -## Security - -Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. - -## qs for enterprise - -Available as part of the Tidelift Subscription - -The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. -Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. -[Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -[package-url]: https://npmjs.org/package/qs -[npm-version-svg]: https://versionbadg.es/ljharb/qs.svg -[deps-svg]: https://david-dm.org/ljharb/qs.svg -[deps-url]: https://david-dm.org/ljharb/qs -[dev-deps-svg]: https://david-dm.org/ljharb/qs/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/qs#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/qs.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/qs.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/qs.svg -[downloads-url]: https://npm-stat.com/charts.html?package=qs -[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/qs/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/qs -[actions-url]: https://github.com/ljharb/qs/actions - -## Acknowledgements - -qs logo by [NUMI](https://github.com/numi-hq/open-design): - -[NUMI Logo](https://numi.tech/?ref=qs) diff --git a/node_modules/qs/dist/qs.js b/node_modules/qs/dist/qs.js deleted file mode 100644 index 2cee370..0000000 --- a/node_modules/qs/dist/qs.js +++ /dev/null @@ -1,141 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,t.throwOnLimitExceeded?a+1:a);if(t.throwOnLimitExceeded&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var l,n=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(d=isArray(d)?[d]:d),null!==p){var f=has.call(r,p);f&&"combine"===t.duplicates?r[p]=utils.combine(r[p],d,t.arrayLimit,t.plainObjects):f&&"last"!==t.duplicates||(r[p]=d)}}return r},parseObject=function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var l=i?t:parseArrayValue(t,r,a),n=e.length-1;n>=0;--n){var s,p=e[n];if("[]"===p&&r.parseArrays)s=utils.isOverflow(l)?l:r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:utils.combine([],l,r.arrayLimit,r.plainObjects);else{s=r.plainObjects?{__proto__:null}:{};var d="["===p.charAt(0)&&"]"===p.charAt(p.length-1)?p.slice(1,-1):p,c=r.decodeDotInKeys?d.replace(/%2E/g,"."):d,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&p!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[])[u]=l:"__proto__"!==c&&(s[c]=l):s={0:l}}l=s}return l},splitKeyIntoSegments=function splitKeyIntoSegments(e,t){var r=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0){if(!t.plainObjects&&has.call(Object.prototype,r)&&!t.allowPrototypes)return;return[r]}var i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),o=a?r.slice(0,a.index):r,l=[];if(o){if(!t.plainObjects&&has.call(Object.prototype,o)&&!t.allowPrototypes)return;l.push(o)}for(var n=0;null!==(a=i.exec(r))&&n0?g.join(",")||null:void 0}];else if(isArray(f))S=f;else{var N=Object.keys(g);S=u?N.sort(u):N}var T=l?String(r).replace(/\./g,"%2E"):String(r),O=o&&isArray(g)&&1===g.length?T+"[]":T;if(a&&isArray(g)&&0===g.length)return O+"[]";for(var k=0;k0?c+y:""}; - -},{"1":1,"46":46,"5":5}],5:[function(require,module,exports){ -"use strict";var formats=require(1),getSideChannel=require(46),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,overflowChannel=getSideChannel(),markOverflow=function markOverflow(e,r){return overflowChannel.set(e,r),e},isOverflow=function isOverflow(e){return overflowChannel.has(e)},getMaxIndex=function getMaxIndex(e){return overflowChannel.get(e)},setMaxIndex=function setMaxIndex(e,r){overflowChannel.set(e,r)},hexTable=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var o=[],n=0;n=limit?a.slice(i,i+limit):a,f=[],s=0;s=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||n===formats.RFC1738&&(40===u||41===u)?f[f.length]=l.charAt(s):u<128?f[f.length]=hexTable[u]:u<2048?f[f.length]=hexTable[192|u>>6]+hexTable[128|63&u]:u<55296||u>=57344?f[f.length]=hexTable[224|u>>12]+hexTable[128|u>>6&63]+hexTable[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(s)),f[f.length]=hexTable[240|u>>18]+hexTable[128|u>>12&63]+hexTable[128|u>>6&63]+hexTable[128|63&u])}c+=f.join("")}return c},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],o=0;ot?markOverflow(arrayToObject(a,{plainObjects:o}),a.length-1):a},maybeMap=function maybeMap(e,r){if(isArray(e)){for(var t=[],o=0;o-1?callBindBasic([t]):t}; - -},{"10":10,"25":25}],25:[function(require,module,exports){ -"use strict";var undefined,$Object=require(22),$Error=require(16),$EvalError=require(15),$RangeError=require(17),$ReferenceError=require(18),$SyntaxError=require(19),$TypeError=require(20),$URIError=require(21),abs=require(34),floor=require(35),max=require(37),min=require(38),pow=require(39),round=require(40),sign=require(41),$Function=Function,getEvalledConstructor=function(r){try{return $Function('"use strict"; return ('+r+").constructor;")()}catch(r){}},$gOPD=require(30),$defineProperty=require(14),throwTypeError=function(){throw new $TypeError},ThrowTypeError=$gOPD?function(){try{return throwTypeError}catch(r){try{return $gOPD(arguments,"callee").get}catch(r){return throwTypeError}}}():throwTypeError,hasSymbols=require(31)(),getProto=require(28),$ObjectGPO=require(26),$ReflectGPO=require(27),$apply=require(8),$call=require(9),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float16Array%":"undefined"==typeof Float16Array?undefined:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined,"%Symbol%":hasSymbols?Symbol:undefined,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply,"%Object.defineProperty%":$defineProperty,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max,"%Math.min%":min,"%Math.pow%":pow,"%Math.round%":round,"%Math.sign%":sign,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function doEval(r){var e;if("%AsyncFunction%"===r)e=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===r)e=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===r){var t=doEval("%AsyncGeneratorFunction%");t&&(e=t.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=doEval("%AsyncGenerator%");o&&getProto&&(e=getProto(o.prototype))}return INTRINSICS[r]=e,e},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require(24),hasOwn=require(33),$concat=bind.call($call,Array.prototype.concat),$spliceApply=bind.call($apply,Array.prototype.splice),$replace=bind.call($call,String.prototype.replace),$strSlice=bind.call($call,String.prototype.slice),$exec=bind.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function stringToPath(r){var e=$strSlice(r,0,1),t=$strSlice(r,-1);if("%"===e&&"%"!==t)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==e)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(r,rePropName,function(r,e,t,n){o[o.length]=t?$replace(n,reEscapeChar,"$1"):e||r}),o},getBaseIntrinsic=function getBaseIntrinsic(r,e){var t,o=r;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(t=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var n=INTRINSICS[o];if(n===needsEval&&(n=doEval(o)),void 0===n&&!e)throw new $TypeError("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:t,name:o,value:n}}throw new $SyntaxError("intrinsic "+r+" does not exist!")};module.exports=function GetIntrinsic(r,e){if("string"!=typeof r||0===r.length)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new $TypeError('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,r))throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=stringToPath(r),o=t.length>0?t[0]:"",n=getBaseIntrinsic("%"+o+"%",e),a=n.name,i=n.value,y=!1,p=n.alias;p&&(o=p[0],$spliceApply(t,$concat([0,1],p)));for(var d=1,s=!0;d=t.length){var c=$gOPD(i,f);i=(s=!!c)&&"get"in c&&!("originalValue"in c.get)?c.get:i[f]}else s=hasOwn(i,f),i=i[f];s&&!y&&(INTRINSICS[a]=i)}}return i}; - -},{"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"24":24,"26":26,"27":27,"28":28,"30":30,"31":31,"33":33,"34":34,"35":35,"37":37,"38":38,"39":39,"40":40,"41":41,"8":8,"9":9}],13:[function(require,module,exports){ -"use strict";var hasProtoAccessor,callBind=require(10),gOPD=require(30);try{hasProtoAccessor=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var desc=!!hasProtoAccessor&&gOPD&&gOPD(Object.prototype,"__proto__"),$Object=Object,$getPrototypeOf=$Object.getPrototypeOf;module.exports=desc&&"function"==typeof desc.get?callBind([desc.get]):"function"==typeof $getPrototypeOf&&function getDunder(t){return $getPrototypeOf(null==t?t:$Object(t))}; - -},{"10":10,"30":30}],30:[function(require,module,exports){ -"use strict";var $gOPD=require(29);if($gOPD)try{$gOPD([],"length")}catch(g){$gOPD=null}module.exports=$gOPD; - -},{"29":29}],14:[function(require,module,exports){ -"use strict";var $defineProperty=Object.defineProperty||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=!1}module.exports=$defineProperty; - -},{}],15:[function(require,module,exports){ -"use strict";module.exports=EvalError; - -},{}],16:[function(require,module,exports){ -"use strict";module.exports=Error; - -},{}],17:[function(require,module,exports){ -"use strict";module.exports=RangeError; - -},{}],18:[function(require,module,exports){ -"use strict";module.exports=ReferenceError; - -},{}],19:[function(require,module,exports){ -"use strict";module.exports=SyntaxError; - -},{}],21:[function(require,module,exports){ -"use strict";module.exports=URIError; - -},{}],22:[function(require,module,exports){ -"use strict";module.exports=Object; - -},{}],23:[function(require,module,exports){ -"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function concatty(t,n){for(var r=[],o=0;o-1e3&&t<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-$floor(-t):$floor(t);if(n!==t){var o=String(n),i=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var utilInspect=require(6),inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,quotes={__proto__:null,double:'"',single:"'"},quoteREs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function wrapQuotes(t,e,r){var n=r.quoteStyle||e,o=quotes[n];return o+t+o}function quote(t){return $replace.call(String(t),/"/g,""")}function canTrustToString(t){return!toStringTag||!("object"==typeof t&&(toStringTag in t||void 0!==t[toStringTag]))}function isArray(t){return"[object Array]"===toStr(t)&&canTrustToString(t)}function isDate(t){return"[object Date]"===toStr(t)&&canTrustToString(t)}function isRegExp(t){return"[object RegExp]"===toStr(t)&&canTrustToString(t)}function isError(t){return"[object Error]"===toStr(t)&&canTrustToString(t)}function isString(t){return"[object String]"===toStr(t)&&canTrustToString(t)}function isNumber(t){return"[object Number]"===toStr(t)&&canTrustToString(t)}function isBoolean(t){return"[object Boolean]"===toStr(t)&&canTrustToString(t)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(t){}return!1}function isBigInt(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(t){}return!1}module.exports=function inspect_(t,e,r,n){var o=e||{};if(has(o,"quoteStyle")&&!has(quotes,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!has(o,"customInspect")||o.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return inspectString(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?addNumericSeparator(t,c):c}if("bigint"==typeof t){var l=String(t)+"n";return a?addNumericSeparator(t,l):l}var u=void 0===o.depth?5:o.depth;if(void 0===r&&(r=0),r>=u&&u>0&&"object"==typeof t)return isArray(t)?"[Array]":"[Object]";var p=getIndent(o,r);if(void 0===n)n=[];else if(indexOf(n,t)>=0)return"[Circular]";function inspect(t,e,i){if(e&&(n=$arrSlice.call(n)).push(e),i){var a={depth:o.depth};return has(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),inspect_(t,a,r+1,n)}return inspect_(t,o,r+1,n)}if("function"==typeof t&&!isRegExp(t)){var s=nameOf(t),f=arrObjKeys(t,inspect);return"[Function"+(s?": "+s:" (anonymous)")+"]"+(f.length>0?" { "+$join.call(f,", ")+" }":"")}if(isSymbol(t)){var y=hasShammedSymbols?$replace.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(t);return"object"!=typeof t||hasShammedSymbols?y:markBoxed(y)}if(isElement(t)){for(var S="<"+$toLowerCase.call(String(t.nodeName)),g=t.attributes||[],m=0;m"}if(isArray(t)){if(0===t.length)return"[]";var b=arrObjKeys(t,inspect);return p&&!singleLineValues(b)?"["+indentedJoin(b,p)+"]":"[ "+$join.call(b,", ")+" ]"}if(isError(t)){var h=arrObjKeys(t,inspect);return"cause"in Error.prototype||!("cause"in t)||isEnumerable.call(t,"cause")?0===h.length?"["+String(t)+"]":"{ ["+String(t)+"] "+$join.call(h,", ")+" }":"{ ["+String(t)+"] "+$join.call($concat.call("[cause]: "+inspect(t.cause),h),", ")+" }"}if("object"==typeof t&&i){if(inspectSymbol&&"function"==typeof t[inspectSymbol]&&utilInspect)return utilInspect(t,{depth:u-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(isMap(t)){var d=[];return mapForEach&&mapForEach.call(t,function(e,r){d.push(inspect(r,t,!0)+" => "+inspect(e,t))}),collectionOf("Map",mapSize.call(t),d,p)}if(isSet(t)){var O=[];return setForEach&&setForEach.call(t,function(e){O.push(inspect(e,t))}),collectionOf("Set",setSize.call(t),O,p)}if(isWeakMap(t))return weakCollectionOf("WeakMap");if(isWeakSet(t))return weakCollectionOf("WeakSet");if(isWeakRef(t))return weakCollectionOf("WeakRef");if(isNumber(t))return markBoxed(inspect(Number(t)));if(isBigInt(t))return markBoxed(inspect(bigIntValueOf.call(t)));if(isBoolean(t))return markBoxed(booleanValueOf.call(t));if(isString(t))return markBoxed(inspect(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof global&&t===global)return"{ [object globalThis] }";if(!isDate(t)&&!isRegExp(t)){var j=arrObjKeys(t,inspect),w=gPO?gPO(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",v=!w&&toStringTag&&Object(t)===t&&toStringTag in t?$slice.call(toStr(t),8,-1):$?"Object":"",k=(w||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(v||$?"["+$join.call($concat.call([],v||[],$||[]),": ")+"] ":"");return 0===j.length?k+"{}":p?k+"{"+indentedJoin(j,p)+"}":k+"{ "+$join.call(j,", ")+" }"}return String(t)};var hasOwn=Object.prototype.hasOwnProperty||function(t){return t in this};function has(t,e){return hasOwn.call(t,e)}function toStr(t){return objectToString.call(t)}function nameOf(t){if(t.name)return t.name;var e=$match.call(functionToString.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(t,0,e.maxStringLength),e)+n}var o=quoteREs[e.quoteStyle||"single"];return o.lastIndex=0,wrapQuotes($replace.call($replace.call(t,o,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",e)}function lowbyte(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(t){return"Object("+t+")"}function weakCollectionOf(t){return t+" { ? }"}function collectionOf(t,e,r,n){return t+" ("+e+") {"+(n?indentedJoin(r,n):$join.call(r,", "))+"}"}function singleLineValues(t){for(var e=0;e=0)return!1;return!0}function getIndent(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=$join.call(Array(t.indent+1)," ")}return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+$join.call(t,","+r)+"\n"+e.prev}function arrObjKeys(t,e){var r=isArray(t),n=[];if(r){n.length=t.length;for(var o=0;o -1) { - return val.split(','); - } - - if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { - throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); - } - - return val; -}; - -// This is what browsers will submit when the ✓ character occurs in an -// application/x-www-form-urlencoded body and the encoding of the page containing -// the form is iso-8859-1, or when the submitted form has an accept-charset -// attribute of iso-8859-1. Presumably also with other charsets that do not contain -// the ✓ character, such as us-ascii. -var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') - -// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. -var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') - -var parseValues = function parseQueryStringValues(str, options) { - var obj = { __proto__: null }; - - var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; - cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); - - var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; - var parts = cleanStr.split( - options.delimiter, - options.throwOnLimitExceeded ? limit + 1 : limit - ); - - if (options.throwOnLimitExceeded && parts.length > limit) { - throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); - } - - var skipIndex = -1; // Keep track of where the utf8 sentinel was found - var i; - - var charset = options.charset; - if (options.charsetSentinel) { - for (i = 0; i < parts.length; ++i) { - if (parts[i].indexOf('utf8=') === 0) { - if (parts[i] === charsetSentinel) { - charset = 'utf-8'; - } else if (parts[i] === isoSentinel) { - charset = 'iso-8859-1'; - } - skipIndex = i; - i = parts.length; // The eslint settings do not allow break; - } - } - } - - for (i = 0; i < parts.length; ++i) { - if (i === skipIndex) { - continue; - } - var part = parts[i]; - - var bracketEqualsPos = part.indexOf(']='); - var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; - - var key; - var val; - if (pos === -1) { - key = options.decoder(part, defaults.decoder, charset, 'key'); - val = options.strictNullHandling ? null : ''; - } else { - key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); - - if (key !== null) { - val = utils.maybeMap( - parseArrayValue( - part.slice(pos + 1), - options, - isArray(obj[key]) ? obj[key].length : 0 - ), - function (encodedVal) { - return options.decoder(encodedVal, defaults.decoder, charset, 'value'); - } - ); - } - } - - if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { - val = interpretNumericEntities(String(val)); - } - - if (part.indexOf('[]=') > -1) { - val = isArray(val) ? [val] : val; - } - - if (key !== null) { - var existing = has.call(obj, key); - if (existing && options.duplicates === 'combine') { - obj[key] = utils.combine( - obj[key], - val, - options.arrayLimit, - options.plainObjects - ); - } else if (!existing || options.duplicates === 'last') { - obj[key] = val; - } - } - } - - return obj; -}; - -var parseObject = function (chain, val, options, valuesParsed) { - var currentArrayLength = 0; - if (chain.length > 0 && chain[chain.length - 1] === '[]') { - var parentKey = chain.slice(0, -1).join(''); - currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; - } - - var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); - - for (var i = chain.length - 1; i >= 0; --i) { - var obj; - var root = chain[i]; - - if (root === '[]' && options.parseArrays) { - if (utils.isOverflow(leaf)) { - // leaf is already an overflow object, preserve it - obj = leaf; - } else { - obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) - ? [] - : utils.combine( - [], - leaf, - options.arrayLimit, - options.plainObjects - ); - } - } else { - obj = options.plainObjects ? { __proto__: null } : {}; - var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; - var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; - var index = parseInt(decodedRoot, 10); - if (!options.parseArrays && decodedRoot === '') { - obj = { 0: leaf }; - } else if ( - !isNaN(index) - && root !== decodedRoot - && String(index) === decodedRoot - && index >= 0 - && (options.parseArrays && index <= options.arrayLimit) - ) { - obj = []; - obj[index] = leaf; - } else if (decodedRoot !== '__proto__') { - obj[decodedRoot] = leaf; - } - } - - leaf = obj; - } - - return leaf; -}; - -var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) { - var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; - - if (options.depth <= 0) { - if (!options.plainObjects && has.call(Object.prototype, key)) { - if (!options.allowPrototypes) { - return; - } - } - - return [key]; - } - - var brackets = /(\[[^[\]]*])/; - var child = /(\[[^[\]]*])/g; - - var segment = brackets.exec(key); - var parent = segment ? key.slice(0, segment.index) : key; - - var keys = []; - - if (parent) { - if (!options.plainObjects && has.call(Object.prototype, parent)) { - if (!options.allowPrototypes) { - return; - } - } - - keys.push(parent); - } - - var i = 0; - while ((segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - - var segmentContent = segment[1].slice(1, -1); - if (!options.plainObjects && has.call(Object.prototype, segmentContent)) { - if (!options.allowPrototypes) { - return; - } - } - - keys.push(segment[1]); - } - - if (segment) { - if (options.strictDepth === true) { - throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); - } - - keys.push('[' + key.slice(segment.index) + ']'); - } - - return keys; -}; - -var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { - if (!givenKey) { - return; - } - - var keys = splitKeyIntoSegments(givenKey, options); - - if (!keys) { - return; - } - - return parseObject(keys, val, options, valuesParsed); -}; - -var normalizeParseOptions = function normalizeParseOptions(opts) { - if (!opts) { - return defaults; - } - - if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { - throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); - } - - if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { - throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); - } - - if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { - throw new TypeError('Decoder has to be a function.'); - } - - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { - throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); - } - - var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; - - var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; - - if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { - throw new TypeError('The duplicates option must be either combine, first, or last'); - } - - var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; - - return { - allowDots: allowDots, - allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, - allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, - allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, - arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, - decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, - decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, - delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, - // eslint-disable-next-line no-implicit-coercion, no-extra-parens - depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, - duplicates: duplicates, - ignoreQueryPrefix: opts.ignoreQueryPrefix === true, - interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, - parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, - parseArrays: opts.parseArrays !== false, - plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, - strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, - throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false - }; -}; - -module.exports = function (str, opts) { - var options = normalizeParseOptions(opts); - - if (str === '' || str === null || typeof str === 'undefined') { - return options.plainObjects ? { __proto__: null } : {}; - } - - var tempObj = typeof str === 'string' ? parseValues(str, options) : str; - var obj = options.plainObjects ? { __proto__: null } : {}; - - // Iterate over the keys and setup the new object - - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); - obj = utils.merge(obj, newObj, options); - } - - if (options.allowSparse === true) { - return obj; - } - - return utils.compact(obj); -}; diff --git a/node_modules/qs/lib/stringify.js b/node_modules/qs/lib/stringify.js deleted file mode 100644 index 2666eaf..0000000 --- a/node_modules/qs/lib/stringify.js +++ /dev/null @@ -1,356 +0,0 @@ -'use strict'; - -var getSideChannel = require('side-channel'); -var utils = require('./utils'); -var formats = require('./formats'); -var has = Object.prototype.hasOwnProperty; - -var arrayPrefixGenerators = { - brackets: function brackets(prefix) { - return prefix + '[]'; - }, - comma: 'comma', - indices: function indices(prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function repeat(prefix) { - return prefix; - } -}; - -var isArray = Array.isArray; -var push = Array.prototype.push; -var pushToArray = function (arr, valueOrArray) { - push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); -}; - -var toISO = Date.prototype.toISOString; - -var defaultFormat = formats['default']; -var defaults = { - addQueryPrefix: false, - allowDots: false, - allowEmptyArrays: false, - arrayFormat: 'indices', - charset: 'utf-8', - charsetSentinel: false, - commaRoundTrip: false, - delimiter: '&', - encode: true, - encodeDotInKeys: false, - encoder: utils.encode, - encodeValuesOnly: false, - filter: void undefined, - format: defaultFormat, - formatter: formats.formatters[defaultFormat], - // deprecated - indices: false, - serializeDate: function serializeDate(date) { - return toISO.call(date); - }, - skipNulls: false, - strictNullHandling: false -}; - -var isNonNullishPrimitive = function isNonNullishPrimitive(v) { - return typeof v === 'string' - || typeof v === 'number' - || typeof v === 'boolean' - || typeof v === 'symbol' - || typeof v === 'bigint'; -}; - -var sentinel = {}; - -var stringify = function stringify( - object, - prefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - sideChannel -) { - var obj = object; - - var tmpSc = sideChannel; - var step = 0; - var findFlag = false; - while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { - // Where object last appeared in the ref tree - var pos = tmpSc.get(object); - step += 1; - if (typeof pos !== 'undefined') { - if (pos === step) { - throw new RangeError('Cyclic object value'); - } else { - findFlag = true; // Break while - } - } - if (typeof tmpSc.get(sentinel) === 'undefined') { - step = 0; - } - } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = utils.maybeMap(obj, function (value) { - if (value instanceof Date) { - return serializeDate(value); - } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; - } - - obj = ''; - } - - if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { - if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); - return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; - } - return [formatter(prefix) + '=' + formatter(String(obj))]; - } - - var values = []; - - if (typeof obj === 'undefined') { - return values; - } - - var objKeys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - if (encodeValuesOnly && encoder) { - obj = utils.maybeMap(obj, encoder); - } - objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; - } else if (isArray(filter)) { - objKeys = filter; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; - } - - var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); - - var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; - - if (allowEmptyArrays && isArray(obj) && obj.length === 0) { - return adjustedPrefix + '[]'; - } - - for (var j = 0; j < objKeys.length; ++j) { - var key = objKeys[j]; - var value = typeof key === 'object' && key && typeof key.value !== 'undefined' - ? key.value - : obj[key]; - - if (skipNulls && value === null) { - continue; - } - - var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); - var keyPrefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix - : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); - - sideChannel.set(object, step); - var valueSideChannel = getSideChannel(); - valueSideChannel.set(sentinel, sideChannel); - pushToArray(values, stringify( - value, - keyPrefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel - )); - } - - return values; -}; - -var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { - if (!opts) { - return defaults; - } - - if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { - throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); - } - - if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { - throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); - } - - if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - var charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - var format = formats['default']; - if (typeof opts.format !== 'undefined') { - if (!has.call(formats.formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - var formatter = formats.formatters[format]; - - var filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - var arrayFormat; - if (opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if ('indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = defaults.arrayFormat; - } - - if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); - } - - var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: allowDots, - allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, - arrayFormat: arrayFormat, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - commaRoundTrip: !!opts.commaRoundTrip, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = normalizeStringifyOptions(opts); - - var objKeys; - var filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - objKeys = filter; - } - - var keys = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; - var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; - - if (!objKeys) { - objKeys = Object.keys(obj); - } - - if (options.sort) { - objKeys.sort(options.sort); - } - - var sideChannel = getSideChannel(); - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - var value = obj[key]; - - if (options.skipNulls && value === null) { - continue; - } - pushToArray(keys, stringify( - value, - key, - generateArrayPrefix, - commaRoundTrip, - options.allowEmptyArrays, - options.strictNullHandling, - options.skipNulls, - options.encodeDotInKeys, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel - )); - } - - var joined = keys.join(options.delimiter); - var prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - - return joined.length > 0 ? prefix + joined : ''; -}; diff --git a/node_modules/qs/lib/utils.js b/node_modules/qs/lib/utils.js deleted file mode 100644 index 91f555e..0000000 --- a/node_modules/qs/lib/utils.js +++ /dev/null @@ -1,320 +0,0 @@ -'use strict'; - -var formats = require('./formats'); -var getSideChannel = require('side-channel'); - -var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; - -// Track objects created from arrayLimit overflow using side-channel -// Stores the current max numeric index for O(1) lookup -var overflowChannel = getSideChannel(); - -var markOverflow = function markOverflow(obj, maxIndex) { - overflowChannel.set(obj, maxIndex); - return obj; -}; - -var isOverflow = function isOverflow(obj) { - return overflowChannel.has(obj); -}; - -var getMaxIndex = function getMaxIndex(obj) { - return overflowChannel.get(obj); -}; - -var setMaxIndex = function setMaxIndex(obj, maxIndex) { - overflowChannel.set(obj, maxIndex); -}; - -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -}()); - -var compactQueue = function compactQueue(queue) { - while (queue.length > 1) { - var item = queue.pop(); - var obj = item.obj[item.prop]; - - if (isArray(obj)) { - var compacted = []; - - for (var j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - item.obj[item.prop] = compacted; - } - } -}; - -var arrayToObject = function arrayToObject(source, options) { - var obj = options && options.plainObjects ? { __proto__: null } : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -}; - -var merge = function merge(target, source, options) { - /* eslint no-param-reassign: 0 */ - if (!source) { - return target; - } - - if (typeof source !== 'object' && typeof source !== 'function') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if (isOverflow(target)) { - // Add at next numeric index for overflow objects - var newIndex = getMaxIndex(target) + 1; - target[newIndex] = source; - setMaxIndex(target, newIndex); - } else if ( - (options && (options.plainObjects || options.allowPrototypes)) - || !has.call(Object.prototype, source) - ) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (!target || typeof target !== 'object') { - if (isOverflow(source)) { - // Create new object with target at 0, source values shifted by 1 - var sourceKeys = Object.keys(source); - var result = options && options.plainObjects - ? { __proto__: null, 0: target } - : { 0: target }; - for (var m = 0; m < sourceKeys.length; m++) { - var oldKey = parseInt(sourceKeys[m], 10); - result[oldKey + 1] = source[sourceKeys[m]]; - } - return markOverflow(result, getMaxIndex(source) + 1); - } - return [target].concat(source); - } - - var mergeTarget = target; - if (isArray(target) && !isArray(source)) { - mergeTarget = arrayToObject(target, options); - } - - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - var targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; - - if (has.call(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; - -var assign = function assignSingleSource(target, source) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -}; - -var decode = function (str, defaultDecoder, charset) { - var strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } -}; - -var limit = 1024; - -/* eslint operator-linebreak: [2, "before"] */ - -var encode = function encode(str, defaultEncoder, charset, kind, format) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - var string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); - } - - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - - var out = ''; - for (var j = 0; j < string.length; j += limit) { - var segment = string.length >= limit ? string.slice(j, j + limit) : string; - var arr = []; - - for (var i = 0; i < segment.length; ++i) { - var c = segment.charCodeAt(i); - if ( - c === 0x2D // - - || c === 0x2E // . - || c === 0x5F // _ - || c === 0x7E // ~ - || (c >= 0x30 && c <= 0x39) // 0-9 - || (c >= 0x41 && c <= 0x5A) // a-z - || (c >= 0x61 && c <= 0x7A) // A-Z - || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - arr[arr.length] = segment.charAt(i); - continue; - } - - if (c < 0x80) { - arr[arr.length] = hexTable[c]; - continue; - } - - if (c < 0x800) { - arr[arr.length] = hexTable[0xC0 | (c >> 6)] - + hexTable[0x80 | (c & 0x3F)]; - continue; - } - - if (c < 0xD800 || c >= 0xE000) { - arr[arr.length] = hexTable[0xE0 | (c >> 12)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); - - arr[arr.length] = hexTable[0xF0 | (c >> 18)] - + hexTable[0x80 | ((c >> 12) & 0x3F)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; - } - - out += arr.join(''); - } - - return out; -}; - -var compact = function compact(value) { - var queue = [{ obj: { o: value }, prop: 'o' }]; - var refs = []; - - for (var i = 0; i < queue.length; ++i) { - var item = queue[i]; - var obj = item.obj[item.prop]; - - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - var val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - compactQueue(queue); - - return value; -}; - -var isRegExp = function isRegExp(obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - -var isBuffer = function isBuffer(obj) { - if (!obj || typeof obj !== 'object') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -}; - -var combine = function combine(a, b, arrayLimit, plainObjects) { - // If 'a' is already an overflow object, add to it - if (isOverflow(a)) { - var newIndex = getMaxIndex(a) + 1; - a[newIndex] = b; - setMaxIndex(a, newIndex); - return a; - } - - var result = [].concat(a, b); - if (result.length > arrayLimit) { - return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1); - } - return result; -}; - -var maybeMap = function maybeMap(val, fn) { - if (isArray(val)) { - var mapped = []; - for (var i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i])); - } - return mapped; - } - return fn(val); -}; - -module.exports = { - arrayToObject: arrayToObject, - assign: assign, - combine: combine, - compact: compact, - decode: decode, - encode: encode, - isBuffer: isBuffer, - isOverflow: isOverflow, - isRegExp: isRegExp, - maybeMap: maybeMap, - merge: merge -}; diff --git a/node_modules/qs/package.json b/node_modules/qs/package.json deleted file mode 100644 index e4875e4..0000000 --- a/node_modules/qs/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "qs", - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "homepage": "https://github.com/ljharb/qs", - "version": "6.14.1", - "repository": { - "type": "git", - "url": "https://github.com/ljharb/qs.git" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "main": "lib/index.js", - "sideEffects": false, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "keywords": [ - "querystring", - "qs", - "query", - "url", - "parse", - "stringify" - ], - "engines": { - "node": ">=0.6" - }, - "dependencies": { - "side-channel": "^1.1.0" - }, - "devDependencies": { - "@browserify/envify": "^6.0.0", - "@browserify/uglifyify": "^6.0.0", - "@ljharb/eslint-config": "^22.1.3", - "browserify": "^16.5.2", - "bundle-collapser": "^1.4.0", - "common-shakeify": "~1.0.0", - "eclint": "^2.8.1", - "es-value-fixtures": "^1.7.1", - "eslint": "^9.39.2", - "evalmd": "^0.0.19", - "for-each": "^0.3.5", - "glob": "=10.3.7", - "has-bigints": "^1.1.0", - "has-override-mistake": "^1.0.1", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.2.0", - "has-symbols": "^1.1.0", - "iconv-lite": "^0.5.1", - "in-publish": "^2.0.1", - "jackspeak": "=2.1.1", - "jiti": "^0.0.0", - "mkdirp": "^0.5.5", - "mock-property": "^1.1.0", - "module-deps": "^6.2.3", - "npmignore": "^0.3.5", - "nyc": "^10.3.2", - "object-inspect": "^1.13.4", - "qs-iconv": "^1.0.4", - "safe-publish-latest": "^2.0.0", - "safer-buffer": "^2.1.2", - "tape": "^5.9.0", - "unassertify": "^3.0.1" - }, - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated && npm run dist", - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "pretest": "npm run --silent readme && npm run --silent lint", - "test": "npm run tests-only", - "tests-only": "nyc tape 'test/**/*.js'", - "posttest": "npx npm@'>=10.2' audit --production", - "readme": "evalmd README.md", - "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", - "lint": "eslint .", - "dist": "mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js" - }, - "license": "BSD-3-Clause", - "publishConfig": { - "ignore": [ - "!dist/*", - "bower.json", - "component.json", - ".github/workflows", - "logos", - "tea.yaml" - ] - } -} diff --git a/node_modules/qs/test/empty-keys-cases.js b/node_modules/qs/test/empty-keys-cases.js deleted file mode 100644 index 2b1190e..0000000 --- a/node_modules/qs/test/empty-keys-cases.js +++ /dev/null @@ -1,267 +0,0 @@ -'use strict'; - -module.exports = { - emptyTestCases: [ - { - input: '&', - withEmptyKeys: {}, - stringifyOutput: { - brackets: '', - indices: '', - repeat: '' - }, - noEmptyKeys: {} - }, - { - input: '&&', - withEmptyKeys: {}, - stringifyOutput: { - brackets: '', - indices: '', - repeat: '' - }, - noEmptyKeys: {} - }, - { - input: '&=', - withEmptyKeys: { '': '' }, - stringifyOutput: { - brackets: '=', - indices: '=', - repeat: '=' - }, - noEmptyKeys: {} - }, - { - input: '&=&', - withEmptyKeys: { '': '' }, - stringifyOutput: { - brackets: '=', - indices: '=', - repeat: '=' - }, - noEmptyKeys: {} - }, - { - input: '&=&=', - withEmptyKeys: { '': ['', ''] }, - stringifyOutput: { - brackets: '[]=&[]=', - indices: '[0]=&[1]=', - repeat: '=&=' - }, - noEmptyKeys: {} - }, - { - input: '&=&=&', - withEmptyKeys: { '': ['', ''] }, - stringifyOutput: { - brackets: '[]=&[]=', - indices: '[0]=&[1]=', - repeat: '=&=' - }, - noEmptyKeys: {} - }, - { - input: '=', - withEmptyKeys: { '': '' }, - noEmptyKeys: {}, - stringifyOutput: { - brackets: '=', - indices: '=', - repeat: '=' - } - }, - { - input: '=&', - withEmptyKeys: { '': '' }, - stringifyOutput: { - brackets: '=', - indices: '=', - repeat: '=' - }, - noEmptyKeys: {} - }, - { - input: '=&&&', - withEmptyKeys: { '': '' }, - stringifyOutput: { - brackets: '=', - indices: '=', - repeat: '=' - }, - noEmptyKeys: {} - }, - { - input: '=&=&=&', - withEmptyKeys: { '': ['', '', ''] }, - stringifyOutput: { - brackets: '[]=&[]=&[]=', - indices: '[0]=&[1]=&[2]=', - repeat: '=&=&=' - }, - noEmptyKeys: {} - }, - { - input: '=&a[]=b&a[1]=c', - withEmptyKeys: { '': '', a: ['b', 'c'] }, - stringifyOutput: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c' - }, - noEmptyKeys: { a: ['b', 'c'] } - }, - { - input: '=a', - withEmptyKeys: { '': 'a' }, - noEmptyKeys: {}, - stringifyOutput: { - brackets: '=a', - indices: '=a', - repeat: '=a' - } - }, - { - input: 'a==a', - withEmptyKeys: { a: '=a' }, - noEmptyKeys: { a: '=a' }, - stringifyOutput: { - brackets: 'a==a', - indices: 'a==a', - repeat: 'a==a' - } - }, - { - input: '=&a[]=b', - withEmptyKeys: { '': '', a: ['b'] }, - stringifyOutput: { - brackets: '=&a[]=b', - indices: '=&a[0]=b', - repeat: '=&a=b' - }, - noEmptyKeys: { a: ['b'] } - }, - { - input: '=&a[]=b&a[]=c&a[2]=d', - withEmptyKeys: { '': '', a: ['b', 'c', 'd'] }, - stringifyOutput: { - brackets: '=&a[]=b&a[]=c&a[]=d', - indices: '=&a[0]=b&a[1]=c&a[2]=d', - repeat: '=&a=b&a=c&a=d' - }, - noEmptyKeys: { a: ['b', 'c', 'd'] } - }, - { - input: '=a&=b', - withEmptyKeys: { '': ['a', 'b'] }, - stringifyOutput: { - brackets: '[]=a&[]=b', - indices: '[0]=a&[1]=b', - repeat: '=a&=b' - }, - noEmptyKeys: {} - }, - { - input: '=a&foo=b', - withEmptyKeys: { '': 'a', foo: 'b' }, - noEmptyKeys: { foo: 'b' }, - stringifyOutput: { - brackets: '=a&foo=b', - indices: '=a&foo=b', - repeat: '=a&foo=b' - } - }, - { - input: 'a[]=b&a=c&=', - withEmptyKeys: { '': '', a: ['b', 'c'] }, - stringifyOutput: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c' - }, - noEmptyKeys: { a: ['b', 'c'] } - }, - { - input: 'a[]=b&a=c&=', - withEmptyKeys: { '': '', a: ['b', 'c'] }, - stringifyOutput: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c' - }, - noEmptyKeys: { a: ['b', 'c'] } - }, - { - input: 'a[0]=b&a=c&=', - withEmptyKeys: { '': '', a: ['b', 'c'] }, - stringifyOutput: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c' - }, - noEmptyKeys: { a: ['b', 'c'] } - }, - { - input: 'a=b&a[]=c&=', - withEmptyKeys: { '': '', a: ['b', 'c'] }, - stringifyOutput: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c' - }, - noEmptyKeys: { a: ['b', 'c'] } - }, - { - input: 'a=b&a[0]=c&=', - withEmptyKeys: { '': '', a: ['b', 'c'] }, - stringifyOutput: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c' - }, - noEmptyKeys: { a: ['b', 'c'] } - }, - { - input: '[]=a&[]=b& []=1', - withEmptyKeys: { '': ['a', 'b'], ' ': ['1'] }, - stringifyOutput: { - brackets: '[]=a&[]=b& []=1', - indices: '[0]=a&[1]=b& [0]=1', - repeat: '=a&=b& =1' - }, - noEmptyKeys: { 0: 'a', 1: 'b', ' ': ['1'] } - }, - { - input: '[0]=a&[1]=b&a[0]=1&a[1]=2', - withEmptyKeys: { '': ['a', 'b'], a: ['1', '2'] }, - noEmptyKeys: { 0: 'a', 1: 'b', a: ['1', '2'] }, - stringifyOutput: { - brackets: '[]=a&[]=b&a[]=1&a[]=2', - indices: '[0]=a&[1]=b&a[0]=1&a[1]=2', - repeat: '=a&=b&a=1&a=2' - } - }, - { - input: '[deep]=a&[deep]=2', - withEmptyKeys: { '': { deep: ['a', '2'] } - }, - stringifyOutput: { - brackets: '[deep][]=a&[deep][]=2', - indices: '[deep][0]=a&[deep][1]=2', - repeat: '[deep]=a&[deep]=2' - }, - noEmptyKeys: { deep: ['a', '2'] } - }, - { - input: '%5B0%5D=a&%5B1%5D=b', - withEmptyKeys: { '': ['a', 'b'] }, - stringifyOutput: { - brackets: '[]=a&[]=b', - indices: '[0]=a&[1]=b', - repeat: '=a&=b' - }, - noEmptyKeys: { 0: 'a', 1: 'b' } - } - ] -}; diff --git a/node_modules/qs/test/parse.js b/node_modules/qs/test/parse.js deleted file mode 100644 index 7b353ff..0000000 --- a/node_modules/qs/test/parse.js +++ /dev/null @@ -1,1396 +0,0 @@ -'use strict'; - -var test = require('tape'); -var hasPropertyDescriptors = require('has-property-descriptors')(); -var iconv = require('iconv-lite'); -var mockProperty = require('mock-property'); -var hasOverrideMistake = require('has-override-mistake')(); -var SaferBuffer = require('safer-buffer').Buffer; -var v = require('es-value-fixtures'); -var inspect = require('object-inspect'); -var emptyTestCases = require('./empty-keys-cases').emptyTestCases; -var hasProto = require('has-proto')(); - -var qs = require('../'); -var utils = require('../lib/utils'); - -test('parse()', function (t) { - t.test('parses a simple string', function (st) { - st.deepEqual(qs.parse('0=foo'), { 0: 'foo' }); - st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); - st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); - st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); - st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); - st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); - st.deepEqual(qs.parse('foo'), { foo: '' }); - st.deepEqual(qs.parse('foo='), { foo: '' }); - st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); - st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); - st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); - st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); - st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); - st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); - st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); - st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { - cht: 'p3', - chd: 't:60,40', - chs: '250x100', - chl: 'Hello|World' - }); - st.end(); - }); - - t.test('comma: false', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c'), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }); - st.end(); - }); - - t.test('comma: true', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { comma: true }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { comma: true }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { comma: true }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a=c', { comma: true }), { a: ['b', 'c'] }); - st.end(); - }); - - t.test('allows enabling dot notation', function (st) { - st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); - st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); - - st.end(); - }); - - t.test('decode dot keys correctly', function (st) { - st.deepEqual( - qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: false, decodeDotInKeys: false }), - { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, - 'with allowDots false and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse('name.obj.first=John&name.obj.last=Doe', { allowDots: true, decodeDotInKeys: false }), - { name: { obj: { first: 'John', last: 'Doe' } } }, - 'with allowDots false and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: false }), - { 'name%2Eobj': { first: 'John', last: 'Doe' } }, - 'with allowDots true and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: true }), - { 'name.obj': { first: 'John', last: 'Doe' } }, - 'with allowDots true and decodeDotInKeys true' - ); - - st.deepEqual( - qs.parse( - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - { allowDots: false, decodeDotInKeys: false } - ), - { 'name%2Eobj%2Esubobject.first%2Egodly%2Ename': 'John', 'name%2Eobj%2Esubobject.last': 'Doe' }, - 'with allowDots false and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse( - 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', - { allowDots: true, decodeDotInKeys: false } - ), - { name: { obj: { subobject: { first: { godly: { name: 'John' } }, last: 'Doe' } } } }, - 'with allowDots true and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse( - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - { allowDots: true, decodeDotInKeys: true } - ), - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - 'with allowDots true and decodeDotInKeys true' - ); - st.deepEqual( - qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'), - { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, - 'with allowDots and decodeDotInKeys undefined' - ); - - st.end(); - }); - - t.test('decodes dot in key of object, and allow enabling dot notation when decodeDotInKeys is set to true and allowDots is undefined', function (st) { - st.deepEqual( - qs.parse( - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - { decodeDotInKeys: true } - ), - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - 'with allowDots undefined and decodeDotInKeys true' - ); - - st.end(); - }); - - t.test('throws when decodeDotInKeys is not of type boolean', function (st) { - st['throws']( - function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 'foobar' }); }, - TypeError - ); - - st['throws']( - function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 0 }); }, - TypeError - ); - st['throws']( - function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: NaN }); }, - TypeError - ); - - st['throws']( - function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: null }); }, - TypeError - ); - - st.end(); - }); - - t.test('allows empty arrays in obj values', function (st) { - st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }), { foo: [], bar: 'baz' }); - st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: false }), { foo: [''], bar: 'baz' }); - - st.end(); - }); - - t.test('throws when allowEmptyArrays is not of type boolean', function (st) { - st['throws']( - function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 'foobar' }); }, - TypeError - ); - - st['throws']( - function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 0 }); }, - TypeError - ); - st['throws']( - function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: NaN }); }, - TypeError - ); - - st['throws']( - function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: null }); }, - TypeError - ); - - st.end(); - }); - - t.test('allowEmptyArrays + strictNullHandling', function (st) { - st.deepEqual( - qs.parse('testEmptyArray[]', { strictNullHandling: true, allowEmptyArrays: true }), - { testEmptyArray: [] } - ); - - st.end(); - }); - - t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); - t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); - t.deepEqual( - qs.parse('a[b][c][d][e][f][g][h]=i'), - { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, - 'defaults to a depth of 5' - ); - - t.test('only parses one level when depth = 1', function (st) { - st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); - st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); - st.end(); - }); - - t.test('uses original key when depth = 0', function (st) { - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' }); - st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); - st.end(); - }); - - t.test('uses original key when depth = false', function (st) { - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' }); - st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); - st.end(); - }); - - t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); - - t.test('parses an explicit array', function (st) { - st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); - st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); - st.end(); - }); - - t.test('parses a mix of simple and explicit arrays', function (st) { - st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); - - st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); - st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); - - st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); - st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); - - st.end(); - }); - - t.test('parses a nested array', function (st) { - st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); - st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); - st.end(); - }); - - t.test('allows to specify array indices', function (st) { - st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); - st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] }); - st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } }); - st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); - st.end(); - }); - - t.test('limits specific array indices to arrayLimit', function (st) { - st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] }); - st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } }); - - st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] }); - st.deepEqual(qs.parse('a[21]=a'), { a: { 21: 'a' } }); - st.end(); - }); - - t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); - - t.test('supports encoded = signs', function (st) { - st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); - st.end(); - }); - - t.test('is ok with url encoded strings', function (st) { - st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); - st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); - st.end(); - }); - - t.test('allows brackets in the value', function (st) { - st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); - st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); - st.end(); - }); - - t.test('allows empty values', function (st) { - st.deepEqual(qs.parse(''), {}); - st.deepEqual(qs.parse(null), {}); - st.deepEqual(qs.parse(undefined), {}); - st.end(); - }); - - t.test('transforms arrays to objects', function (st) { - st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); - st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); - st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); - st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - - st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } }); - st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } }); - st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } }); - st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } }); - st.end(); - }); - - t.test('transforms arrays to objects (dot notation)', function (st) { - st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); - st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); - st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); - st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); - st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); - st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } }); - st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); - st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - st.end(); - }); - - t.test('correctly prunes undefined values when converting an array to an object', function (st) { - st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } }); - st.end(); - }); - - t.test('supports malformed uri characters', function (st) { - st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); - st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); - st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); - st.end(); - }); - - t.test('doesn\'t produce empty keys', function (st) { - st.deepEqual(qs.parse('_r=1&'), { _r: '1' }); - st.end(); - }); - - t.test('cannot access Object prototype', function (st) { - qs.parse('constructor[prototype][bad]=bad'); - qs.parse('bad[constructor][prototype][bad]=bad'); - st.equal(typeof Object.prototype.bad, 'undefined'); - st.end(); - }); - - t.test('parses arrays of objects', function (st) { - st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); - st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); - st.end(); - }); - - t.test('allows for empty strings in arrays', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); - - st.deepEqual( - qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), - { a: ['b', null, 'c', ''] }, - 'with arrayLimit 20 + array indices: null then empty string works' - ); - st.deepEqual( - qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), - { a: { 0: 'b', 1: null, 2: 'c', 3: '' } }, - 'with arrayLimit 0 + array brackets: null then empty string works' - ); - - st.deepEqual( - qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), - { a: ['b', '', 'c', null] }, - 'with arrayLimit 20 + array indices: empty string then null works' - ); - st.deepEqual( - qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), - { a: { 0: 'b', 1: '', 2: 'c', 3: null } }, - 'with arrayLimit 0 + array brackets: empty string then null works' - ); - - st.deepEqual( - qs.parse('a[]=&a[]=b&a[]=c'), - { a: ['', 'b', 'c'] }, - 'array brackets: empty strings work' - ); - st.end(); - }); - - t.test('compacts sparse arrays', function (st) { - st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] }); - st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] }); - st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] }); - st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] }); - st.end(); - }); - - t.test('parses sparse arrays', function (st) { - /* eslint no-sparse-arrays: 0 */ - st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] }); - st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] }); - st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] }); - st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] }); - st.end(); - }); - - t.test('parses semi-parsed strings', function (st) { - st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); - st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); - st.end(); - }); - - t.test('parses buffers correctly', function (st) { - var b = SaferBuffer.from('test'); - st.deepEqual(qs.parse({ a: b }), { a: b }); - st.end(); - }); - - t.test('parses jquery-param strings', function (st) { - // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8' - var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8'; - var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] }; - st.deepEqual(qs.parse(encoded), expected); - st.end(); - }); - - t.test('continues parsing when no parent is found', function (st) { - st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); - st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); - st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); - st.end(); - }); - - t.test('does not error when parsing a very long array', function (st) { - var str = 'a[]=a'; - while (Buffer.byteLength(str) < 128 * 1024) { - str = str + '&' + str; - } - - st.doesNotThrow(function () { - qs.parse(str); - }); - - st.end(); - }); - - t.test('does not throw when a native prototype has an enumerable property', function (st) { - st.intercept(Object.prototype, 'crash', { value: '' }); - st.intercept(Array.prototype, 'crash', { value: '' }); - - st.doesNotThrow(qs.parse.bind(null, 'a=b')); - st.deepEqual(qs.parse('a=b'), { a: 'b' }); - st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); - st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); - - st.end(); - }); - - t.test('parses a string with an alternative string delimiter', function (st) { - st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('parses a string with an alternative RegExp delimiter', function (st) { - st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('does not use non-splittable objects as delimiters', function (st) { - st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('allows overriding parameter limit', function (st) { - st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); - st.end(); - }); - - t.test('allows setting the parameter limit to Infinity', function (st) { - st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('allows overriding array limit', function (st) { - st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); - st.deepEqual(qs.parse('a[0]=b', { arrayLimit: 0 }), { a: ['b'] }); - - st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); - st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: 0 }), { a: { '-1': 'b' } }); - - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: -1 }), { a: { 0: 'b', 1: 'c' } }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); - - st.end(); - }); - - t.test('allows disabling array parsing', function (st) { - var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false }); - st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } }); - st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array'); - - var emptyBrackets = qs.parse('a[]=b', { parseArrays: false }); - st.deepEqual(emptyBrackets, { a: { 0: 'b' } }); - st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array'); - - st.end(); - }); - - t.test('allows for query string prefix', function (st) { - st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); - st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); - st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' }); - - st.end(); - }); - - t.test('parses an object', function (st) { - var input = { - 'user[name]': { 'pop[bob]': 3 }, - 'user[email]': null - }; - - var expected = { - user: { - name: { 'pop[bob]': 3 }, - email: null - } - }; - - var result = qs.parse(input); - - st.deepEqual(result, expected); - st.end(); - }); - - t.test('parses string with comma as array divider', function (st) { - st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] }); - st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } }); - st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' }); - st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' }); - st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null }); - - // test cases inversed from from stringify tests - st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] }); - st.deepEqual(qs.parse('a[]=c'), { a: ['c'] }); - st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] }); - - st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] }); - st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] }); - st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] }); - - st.end(); - }); - - t.test('parses values with comma as array divider', function (st) { - st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' }); - st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] }); - st.end(); - }); - - t.test('use number decoder, parses string that has one number with comma option enabled', function (st) { - var decoder = function (str, defaultDecoder, charset, type) { - if (!isNaN(Number(str))) { - return parseFloat(str); - } - return defaultDecoder(str, defaultDecoder, charset, type); - }; - - st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 }); - st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 }); - - st.end(); - }); - - t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] }); - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); - - st.end(); - }); - - t.test('parses url-encoded brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { - st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); - st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=', { comma: true }), { foo: [['1', '2', '3'], ''] }); - st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); - st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); - - st.end(); - }); - - t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) { - st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' }); - st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] }); - st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] }); - - st.end(); - }); - - t.test('parses an object in dot notation', function (st) { - var input = { - 'user.name': { 'pop[bob]': 3 }, - 'user.email.': null - }; - - var expected = { - user: { - name: { 'pop[bob]': 3 }, - email: null - } - }; - - var result = qs.parse(input, { allowDots: true }); - - st.deepEqual(result, expected); - st.end(); - }); - - t.test('parses an object and not child values', function (st) { - var input = { - 'user[name]': { 'pop[bob]': { test: 3 } }, - 'user[email]': null - }; - - var expected = { - user: { - name: { 'pop[bob]': { test: 3 } }, - email: null - } - }; - - var result = qs.parse(input); - - st.deepEqual(result, expected); - st.end(); - }); - - t.test('does not blow up when Buffer global is missing', function (st) { - var restore = mockProperty(global, 'Buffer', { 'delete': true }); - - var result = qs.parse('a=b&c=d'); - - restore(); - - st.deepEqual(result, { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('does not crash when parsing circular references', function (st) { - var a = {}; - a.b = a; - - var parsed; - - st.doesNotThrow(function () { - parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); - }); - - st.equal('foo' in parsed, true, 'parsed has "foo" property'); - st.equal('bar' in parsed.foo, true); - st.equal('baz' in parsed.foo, true); - st.equal(parsed.foo.bar, 'baz'); - st.deepEqual(parsed.foo.baz, a); - st.end(); - }); - - t.test('does not crash when parsing deep objects', function (st) { - var parsed; - var str = 'foo'; - - for (var i = 0; i < 5000; i++) { - str += '[p]'; - } - - str += '=bar'; - - st.doesNotThrow(function () { - parsed = qs.parse(str, { depth: 5000 }); - }); - - st.equal('foo' in parsed, true, 'parsed has "foo" property'); - - var depth = 0; - var ref = parsed.foo; - while ((ref = ref.p)) { - depth += 1; - } - - st.equal(depth, 5000, 'parsed is 5000 properties deep'); - - st.end(); - }); - - t.test('parses null objects correctly', { skip: !hasProto }, function (st) { - var a = { __proto__: null, b: 'c' }; - - st.deepEqual(qs.parse(a), { b: 'c' }); - var result = qs.parse({ a: a }); - st.equal('a' in result, true, 'result has "a" property'); - st.deepEqual(result.a, a); - st.end(); - }); - - t.test('parses dates correctly', function (st) { - var now = new Date(); - st.deepEqual(qs.parse({ a: now }), { a: now }); - st.end(); - }); - - t.test('parses regular expressions correctly', function (st) { - var re = /^test$/; - st.deepEqual(qs.parse({ a: re }), { a: re }); - st.end(); - }); - - t.test('does not allow overwriting prototype properties', function (st) { - st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {}); - st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {}); - - st.deepEqual( - qs.parse('toString', { allowPrototypes: false }), - {}, - 'bare "toString" results in {}' - ); - - st.end(); - }); - - t.test('can allow overwriting prototype properties', function (st) { - st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }); - st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }); - - st.deepEqual( - qs.parse('toString', { allowPrototypes: true }), - { toString: '' }, - 'bare "toString" results in { toString: "" }' - ); - - st.end(); - }); - - t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) { - // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it - // can't be unfrozen. Instead, we add a new non-writable property to simulate this. - st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true })); - - st['throws']( - function () { - var obj = {}; - obj.frozenProp = 'bar'; - }, - // node < 6 has a different error message - /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#'|#)/, - 'regular assignment of an inherited non-writable property throws' - ); - - var parsed; - st.doesNotThrow( - function () { - parsed = qs.parse('frozenProp', { allowPrototypes: false }); - }, - 'parsing a nonwritable Object.prototype property does not throw' - ); - - st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}'); - - st.end(); - }); - - t.test('params starting with a closing bracket', function (st) { - st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); - st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); - st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' }); - st.end(); - }); - - t.test('params starting with a starting bracket', function (st) { - st.deepEqual(qs.parse('[=toString'), { '[': 'toString' }); - st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' }); - st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' }); - st.end(); - }); - - t.test('add keys to objects', function (st) { - st.deepEqual( - qs.parse('a[b]=c&a=d'), - { a: { b: 'c', d: true } }, - 'can add keys to objects' - ); - - st.deepEqual( - qs.parse('a[b]=c&a=toString'), - { a: { b: 'c' } }, - 'can not overwrite prototype' - ); - - st.deepEqual( - qs.parse('a[b]=c&a=toString', { allowPrototypes: true }), - { a: { b: 'c', toString: true } }, - 'can overwrite prototype with allowPrototypes true' - ); - - st.deepEqual( - qs.parse('a[b]=c&a=toString', { plainObjects: true }), - { __proto__: null, a: { __proto__: null, b: 'c', toString: true } }, - 'can overwrite prototype with plainObjects true' - ); - - st.end(); - }); - - t.test('dunder proto is ignored', function (st) { - var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42'; - var result = qs.parse(payload, { allowPrototypes: true }); - - st.deepEqual( - result, - { - categories: { - length: '42' - } - }, - 'silent [[Prototype]] payload' - ); - - var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true }); - - st.deepEqual( - plainResult, - { - __proto__: null, - categories: { - __proto__: null, - length: '42' - } - }, - 'silent [[Prototype]] payload: plain objects' - ); - - var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true }); - - st.notOk(Array.isArray(query.categories), 'is not an array'); - st.notOk(query.categories instanceof Array, 'is not instanceof an array'); - st.deepEqual(query.categories, { some: { json: 'toInject' } }); - st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array'); - - st.deepEqual( - qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }), - { - foo: { - bar: 'stuffs' - } - }, - 'hidden values' - ); - - st.deepEqual( - qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }), - { - __proto__: null, - foo: { - __proto__: null, - bar: 'stuffs' - } - }, - 'hidden values: plain objects' - ); - - st.end(); - }); - - t.test('can return null objects', { skip: !hasProto }, function (st) { - var expected = { - __proto__: null, - a: { - __proto__: null, - b: 'c', - hasOwnProperty: 'd' - } - }; - st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); - st.deepEqual(qs.parse(null, { plainObjects: true }), { __proto__: null }); - var expectedArray = { - __proto__: null, - a: { - __proto__: null, - 0: 'b', - c: 'd' - } - }; - st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); - st.end(); - }); - - t.test('can parse with custom encoding', function (st) { - st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { - decoder: function (str) { - var reg = /%([0-9A-F]{2})/ig; - var result = []; - var parts = reg.exec(str); - while (parts) { - result.push(parseInt(parts[1], 16)); - parts = reg.exec(str); - } - return String(iconv.decode(SaferBuffer.from(result), 'shift_jis')); - } - }), { 県: '大阪府' }); - st.end(); - }); - - t.test('receives the default decoder as a second argument', function (st) { - st.plan(1); - qs.parse('a', { - decoder: function (str, defaultDecoder) { - st.equal(defaultDecoder, utils.decode); - } - }); - st.end(); - }); - - t.test('throws error with wrong decoder', function (st) { - st['throws'](function () { - qs.parse({}, { decoder: 'string' }); - }, new TypeError('Decoder has to be a function.')); - st.end(); - }); - - t.test('does not mutate the options argument', function (st) { - var options = {}; - qs.parse('a[b]=true', options); - st.deepEqual(options, {}); - st.end(); - }); - - t.test('throws if an invalid charset is specified', function (st) { - st['throws'](function () { - qs.parse('a=b', { charset: 'foobar' }); - }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - st.end(); - }); - - t.test('parses an iso-8859-1 string if asked to', function (st) { - st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' }); - st.end(); - }); - - var urlEncodedCheckmarkInUtf8 = '%E2%9C%93'; - var urlEncodedOSlashInUtf8 = '%C3%B8'; - var urlEncodedNumCheckmark = '%26%2310003%3B'; - var urlEncodedNumSmiley = '%26%239786%3B'; - - t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' }); - st.end(); - }); - - t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' }); - st.end(); - }); - - t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) { - st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' }); - st.end(); - }); - - t.test('ignores an utf8 sentinel with an unknown value', function (st) { - st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' }); - st.end(); - }); - - t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' }); - st.end(); - }); - - t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' }); - st.end(); - }); - - t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' }); - st.end(); - }); - - t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, { - charset: 'iso-8859-1', - decoder: function (str, defaultDecoder, charset) { - return str ? defaultDecoder(str, defaultDecoder, charset) : null; - }, - interpretNumericEntities: true - }), { foo: null, bar: '☺' }); - st.end(); - }); - - t.test('handles a custom decoder returning `null`, with a string key of `null`', function (st) { - st.deepEqual( - qs.parse('null=1&ToNull=2', { - decoder: function (str, defaultDecoder, charset) { - return str === 'ToNull' ? null : defaultDecoder(str, defaultDecoder, charset); - } - }), - { 'null': '1' }, - '"null" key is not overridden by `null` decoder result' - ); - - st.end(); - }); - - t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' }); - st.end(); - }); - - t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' }); - st.end(); - }); - - t.test('interpretNumericEntities with comma:true and iso charset does not crash', function (st) { - st.deepEqual( - qs.parse('b&a[]=1,' + urlEncodedNumSmiley, { comma: true, charset: 'iso-8859-1', interpretNumericEntities: true }), - { b: '', a: ['1,☺'] } - ); - - st.end(); - }); - - t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) { - st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' }); - st.end(); - }); - - t.test('allows for decoding keys and values differently', function (st) { - var decoder = function (str, defaultDecoder, charset, type) { - if (type === 'key') { - return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase(); - } - if (type === 'value') { - return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase(); - } - throw 'this should never happen! type: ' + type; - }; - - st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' }); - st.end(); - }); - - t.test('parameter limit tests', function (st) { - st.test('does not throw error when within parameter limit', function (sst) { - var result = qs.parse('a=1&b=2&c=3', { parameterLimit: 5, throwOnLimitExceeded: true }); - sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses without errors'); - sst.end(); - }); - - st.test('throws error when throwOnLimitExceeded is present but not boolean', function (sst) { - sst['throws']( - function () { - qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: 'true' }); - }, - new TypeError('`throwOnLimitExceeded` option must be a boolean'), - 'throws error when throwOnLimitExceeded is present and not boolean' - ); - sst.end(); - }); - - st.test('throws error when parameter limit exceeded', function (sst) { - sst['throws']( - function () { - qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: true }); - }, - new RangeError('Parameter limit exceeded. Only 3 parameters allowed.'), - 'throws error when parameter limit is exceeded' - ); - sst.end(); - }); - - st.test('silently truncates when throwOnLimitExceeded is not given', function (sst) { - var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3 }); - sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); - sst.end(); - }); - - st.test('silently truncates when parameter limit exceeded without error', function (sst) { - var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3, throwOnLimitExceeded: false }); - sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); - sst.end(); - }); - - st.test('allows unlimited parameters when parameterLimit set to Infinity', function (sst) { - var result = qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: Infinity }); - sst.deepEqual(result, { a: '1', b: '2', c: '3', d: '4', e: '5', f: '6' }, 'parses all parameters without truncation'); - sst.end(); - }); - - st.end(); - }); - - t.test('array limit tests', function (st) { - st.test('does not throw error when array is within limit', function (sst) { - var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 5, throwOnLimitExceeded: true }); - sst.deepEqual(result, { a: ['1', '2', '3'] }, 'parses array without errors'); - sst.end(); - }); - - st.test('throws error when throwOnLimitExceeded is present but not boolean for array limit', function (sst) { - sst['throws']( - function () { - qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: 'true' }); - }, - new TypeError('`throwOnLimitExceeded` option must be a boolean'), - 'throws error when throwOnLimitExceeded is present and not boolean for array limit' - ); - sst.end(); - }); - - st.test('throws error when array limit exceeded', function (sst) { - sst['throws']( - function () { - qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: true }); - }, - new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), - 'throws error when array limit is exceeded' - ); - sst.end(); - }); - - st.test('converts array to object if length is greater than limit', function (sst) { - var result = qs.parse('a[1]=1&a[2]=2&a[3]=3&a[4]=4&a[5]=5&a[6]=6', { arrayLimit: 5 }); - - sst.deepEqual(result, { a: { 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6' } }, 'parses into object if array length is greater than limit'); - sst.end(); - }); - - st.end(); - }); - - t.end(); -}); - -test('parses empty keys', function (t) { - emptyTestCases.forEach(function (testCase) { - t.test('skips empty string key with ' + testCase.input, function (st) { - st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys); - - st.end(); - }); - }); -}); - -test('`duplicates` option', function (t) { - v.nonStrings.concat('not a valid option').forEach(function (invalidOption) { - if (typeof invalidOption !== 'undefined') { - t['throws']( - function () { qs.parse('', { duplicates: invalidOption }); }, - TypeError, - 'throws on invalid option: ' + inspect(invalidOption) - ); - } - }); - - t.deepEqual( - qs.parse('foo=bar&foo=baz'), - { foo: ['bar', 'baz'] }, - 'duplicates: default, combine' - ); - - t.deepEqual( - qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), - { foo: ['bar', 'baz'] }, - 'duplicates: combine' - ); - - t.deepEqual( - qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), - { foo: 'bar' }, - 'duplicates: first' - ); - - t.deepEqual( - qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), - { foo: 'baz' }, - 'duplicates: last' - ); - - t.end(); -}); - -test('qs strictDepth option - throw cases', function (t) { - t.test('throws an exception when depth exceeds the limit with strictDepth: true', function (st) { - st['throws']( - function () { - qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); - }, - RangeError, - 'throws RangeError' - ); - st.end(); - }); - - t.test('throws an exception for multiple nested arrays with strictDepth: true', function (st) { - st['throws']( - function () { - qs.parse('a[0][1][2][3][4]=b', { depth: 3, strictDepth: true }); - }, - RangeError, - 'throws RangeError' - ); - st.end(); - }); - - t.test('throws an exception for nested objects and arrays with strictDepth: true', function (st) { - st['throws']( - function () { - qs.parse('a[b][c][0][d][e]=f', { depth: 3, strictDepth: true }); - }, - RangeError, - 'throws RangeError' - ); - st.end(); - }); - - t.test('throws an exception for different types of values with strictDepth: true', function (st) { - st['throws']( - function () { - qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 3, strictDepth: true }); - }, - RangeError, - 'throws RangeError' - ); - st.end(); - }); - -}); - -test('qs strictDepth option - non-throw cases', function (t) { - t.test('when depth is 0 and strictDepth true, do not throw', function (st) { - st.doesNotThrow( - function () { - qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 0, strictDepth: true }); - }, - RangeError, - 'does not throw RangeError' - ); - st.end(); - }); - - t.test('parses successfully when depth is within the limit with strictDepth: true', function (st) { - st.doesNotThrow( - function () { - var result = qs.parse('a[b]=c', { depth: 1, strictDepth: true }); - st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); - } - ); - st.end(); - }); - - t.test('does not throw an exception when depth exceeds the limit with strictDepth: false', function (st) { - st.doesNotThrow( - function () { - var result = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); - st.deepEqual(result, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }, 'parses with depth limit'); - } - ); - st.end(); - }); - - t.test('parses successfully when depth is within the limit with strictDepth: false', function (st) { - st.doesNotThrow( - function () { - var result = qs.parse('a[b]=c', { depth: 1 }); - st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); - } - ); - st.end(); - }); - - t.test('does not throw when depth is exactly at the limit with strictDepth: true', function (st) { - st.doesNotThrow( - function () { - var result = qs.parse('a[b][c]=d', { depth: 2, strictDepth: true }); - st.deepEqual(result, { a: { b: { c: 'd' } } }, 'parses correctly'); - } - ); - st.end(); - }); -}); - -test('DOS', function (t) { - var arr = []; - for (var i = 0; i < 105; i++) { - arr[arr.length] = 'x'; - } - var attack = 'a[]=' + arr.join('&a[]='); - var result = qs.parse(attack, { arrayLimit: 100 }); - - t.notOk(Array.isArray(result.a), 'arrayLimit is respected: result is an object, not an array'); - t.equal(Object.keys(result.a).length, 105, 'all values are preserved'); - - t.end(); -}); - -test('arrayLimit boundary conditions', function (t) { - t.test('exactly at the limit stays as array', function (st) { - var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 3 }); - st.ok(Array.isArray(result.a), 'result is an array when exactly at limit'); - st.deepEqual(result.a, ['1', '2', '3'], 'all values present'); - st.end(); - }); - - t.test('one over the limit converts to object', function (st) { - var result = qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3 }); - st.notOk(Array.isArray(result.a), 'result is not an array when over limit'); - st.deepEqual(result.a, { 0: '1', 1: '2', 2: '3', 3: '4' }, 'all values preserved as object'); - st.end(); - }); - - t.test('arrayLimit 1 with two values', function (st) { - var result = qs.parse('a[]=1&a[]=2', { arrayLimit: 1 }); - st.notOk(Array.isArray(result.a), 'result is not an array'); - st.deepEqual(result.a, { 0: '1', 1: '2' }, 'both values preserved'); - st.end(); - }); - - t.end(); -}); - -test('mixed array and object notation', function (t) { - t.test('array brackets with object key - under limit', function (st) { - st.deepEqual( - qs.parse('a[]=b&a[c]=d'), - { a: { 0: 'b', c: 'd' } }, - 'mixing [] and [key] converts to object' - ); - st.end(); - }); - - t.test('array index with object key - under limit', function (st) { - st.deepEqual( - qs.parse('a[0]=b&a[c]=d'), - { a: { 0: 'b', c: 'd' } }, - 'mixing [0] and [key] produces object' - ); - st.end(); - }); - - t.test('plain value with array brackets - under limit', function (st) { - st.deepEqual( - qs.parse('a=b&a[]=c', { arrayLimit: 20 }), - { a: ['b', 'c'] }, - 'plain value combined with [] stays as array under limit' - ); - st.end(); - }); - - t.test('array brackets with plain value - under limit', function (st) { - st.deepEqual( - qs.parse('a[]=b&a=c', { arrayLimit: 20 }), - { a: ['b', 'c'] }, - '[] combined with plain value stays as array under limit' - ); - st.end(); - }); - - t.test('plain value with array index - under limit', function (st) { - st.deepEqual( - qs.parse('a=b&a[0]=c', { arrayLimit: 20 }), - { a: ['b', 'c'] }, - 'plain value combined with [0] stays as array under limit' - ); - st.end(); - }); - - t.test('multiple plain values with duplicates combine', function (st) { - st.deepEqual( - qs.parse('a=b&a=c&a=d', { arrayLimit: 20 }), - { a: ['b', 'c', 'd'] }, - 'duplicate plain keys combine into array' - ); - st.end(); - }); - - t.test('multiple plain values exceeding limit', function (st) { - st.deepEqual( - qs.parse('a=b&a=c&a=d', { arrayLimit: 2 }), - { a: { 0: 'b', 1: 'c', 2: 'd' } }, - 'duplicate plain keys convert to object when exceeding limit' - ); - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/qs/test/stringify.js b/node_modules/qs/test/stringify.js deleted file mode 100644 index 4d77694..0000000 --- a/node_modules/qs/test/stringify.js +++ /dev/null @@ -1,1310 +0,0 @@ -'use strict'; - -var test = require('tape'); -var qs = require('../'); -var utils = require('../lib/utils'); -var iconv = require('iconv-lite'); -var SaferBuffer = require('safer-buffer').Buffer; -var hasSymbols = require('has-symbols'); -var mockProperty = require('mock-property'); -var emptyTestCases = require('./empty-keys-cases').emptyTestCases; -var hasProto = require('has-proto')(); -var hasBigInt = require('has-bigints')(); - -test('stringify()', function (t) { - t.test('stringifies a querystring object', function (st) { - st.equal(qs.stringify({ a: 'b' }), 'a=b'); - st.equal(qs.stringify({ a: 1 }), 'a=1'); - st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); - st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); - st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); - st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); - st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); - st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); - st.end(); - }); - - t.test('stringifies falsy values', function (st) { - st.equal(qs.stringify(undefined), ''); - st.equal(qs.stringify(null), ''); - st.equal(qs.stringify(null, { strictNullHandling: true }), ''); - st.equal(qs.stringify(false), ''); - st.equal(qs.stringify(0), ''); - st.end(); - }); - - t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) { - st.equal(qs.stringify(Symbol.iterator), ''); - st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29'); - st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29'); - st.equal( - qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'a[]=Symbol%28Symbol.iterator%29' - ); - st.end(); - }); - - t.test('stringifies bigints', { skip: !hasBigInt }, function (st) { - var three = BigInt(3); - var encodeWithN = function (value, defaultEncoder, charset) { - var result = defaultEncoder(value, defaultEncoder, charset); - return typeof value === 'bigint' ? result + 'n' : result; - }; - st.equal(qs.stringify(three), ''); - st.equal(qs.stringify([three]), '0=3'); - st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n'); - st.equal(qs.stringify({ a: three }), 'a=3'); - st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n'); - st.equal( - qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'a[]=3' - ); - st.equal( - qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), - 'a[]=3n' - ); - st.end(); - }); - - t.test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function (st) { - st.equal( - qs.stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: false } - ), - 'name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe', - 'with allowDots false and encodeDotInKeys false' - ); - st.equal( - qs.stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: false } - ), - 'name.obj.first=John&name.obj.last=Doe', - 'with allowDots true and encodeDotInKeys false' - ); - st.equal( - qs.stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: true } - ), - 'name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe', - 'with allowDots false and encodeDotInKeys true' - ); - st.equal( - qs.stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: true } - ), - 'name%252Eobj.first=John&name%252Eobj.last=Doe', - 'with allowDots true and encodeDotInKeys true' - ); - - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: false } - ), - 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', - 'with allowDots false and encodeDotInKeys false' - ); - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: false } - ), - 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', - 'with allowDots false and encodeDotInKeys false' - ); - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: true } - ), - 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', - 'with allowDots false and encodeDotInKeys true' - ); - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: true } - ), - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - 'with allowDots true and encodeDotInKeys true' - ); - - st.end(); - }); - - t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) { - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { encodeDotInKeys: true } - ), - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - 'with allowDots undefined and encodeDotInKeys true' - ); - st.end(); - }); - - t.test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function (st) { - st.equal( - qs.stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { - encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true - }), - 'name%2Eobj.first=John&name%2Eobj.last=Doe' - ); - - st.equal( - qs.stringify({ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }), - 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe' - ); - - st.end(); - }); - - t.test('throws when `commaRoundTrip` is not a boolean', function (st) { - st['throws']( - function () { qs.stringify({}, { commaRoundTrip: 'not a boolean' }); }, - TypeError, - 'throws when `commaRoundTrip` is not a boolean' - ); - - st.end(); - }); - - t.test('throws when `encodeDotInKeys` is not a boolean', function (st) { - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); }, - TypeError - ); - - st.end(); - }); - - t.test('adds query prefix', function (st) { - st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); - st.end(); - }); - - t.test('with query prefix, outputs blank string given an empty object', function (st) { - st.equal(qs.stringify({}, { addQueryPrefix: true }), ''); - st.end(); - }); - - t.test('stringifies nested falsy values', function (st) { - st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); - st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D'); - st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); - st.end(); - }); - - t.test('stringifies a nested object', function (st) { - st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - st.end(); - }); - - t.test('`allowDots` option: stringifies a nested object with dots notation', function (st) { - st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); - st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); - st.end(); - }); - - t.test('stringifies an array value', function (st) { - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), - 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), - 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), - 'a=b%2Cc%2Cd', - 'comma => comma' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), - 'a=b%2Cc%2Cd', - 'comma round trip => comma' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }), - 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - 'default => indices' - ); - st.end(); - }); - - t.test('`skipNulls` option', function (st) { - st.equal( - qs.stringify({ a: 'b', c: null }, { skipNulls: true }), - 'a=b', - 'omits nulls when asked' - ); - - st.equal( - qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), - 'a%5Bb%5D=c', - 'omits nested nulls when asked' - ); - - st.end(); - }); - - t.test('omits array indices when asked', function (st) { - st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); - - st.end(); - }); - - t.test('omits object key/value pair when value is empty array', function (st) { - st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); - - st.end(); - }); - - t.test('should not omit object key/value pair when value is empty array and when asked', function (st) { - st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); - st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); - st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); - - st.end(); - }); - - t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); }, - TypeError - ); - - st.end(); - }); - - t.test('allowEmptyArrays + strictNullHandling', function (st) { - st.equal( - qs.stringify( - { testEmptyArray: [] }, - { strictNullHandling: true, allowEmptyArrays: true } - ), - 'testEmptyArray[]' - ); - - st.end(); - }); - - t.test('stringifies an array value with one item vs multiple items', function (st) { - st.test('non-array item', function (s2t) { - s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c'); - s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c'); - s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); - s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c'); - - s2t.end(); - }); - - st.test('array with a single item', function (s2t) { - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c'); - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c'); - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c'); - - s2t.end(); - }); - - st.test('array with multiple items', function (s2t) { - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d'); - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d'); - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d'); - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c,d'); - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); - - s2t.end(); - }); - - st.test('array with multiple items with a comma inside', function (s2t) { - s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c%2Cd,e'); - s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); - - s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd,e'); - s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd%2Ce'); - - s2t.end(); - }); - - st.end(); - }); - - t.test('stringifies a nested array value', function (st) { - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d'); - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d'); - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d'); - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d'); - st.end(); - }); - - t.test('stringifies comma and empty array values', function (st) { - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), 'a[0]=,&a[1]=&a[2]=c,d%'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), 'a[]=,&a[]=&a[]=c,d%'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), 'a=,,,c,d%'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), 'a=,&a=&a=c,d%'); - - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=%2C&a[]=&a[]=c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C,,c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); - - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C%2C%2Cc%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); - - st.end(); - }); - - t.test('stringifies comma and empty non-array values', function (st) { - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), 'a=,&b=&c=c,d%'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), 'a=,&b=&c=c,d%'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), 'a=,&b=&c=c,d%'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), 'a=,&b=&c=c,d%'); - - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); - - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); - - st.end(); - }); - - t.test('stringifies a nested array value with dots notation', function (st) { - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' } - ), - 'a.b[0]=c&a.b[1]=d', - 'indices: stringifies with dots + indices' - ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' } - ), - 'a.b[]=c&a.b[]=d', - 'brackets: stringifies with dots + brackets' - ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' } - ), - 'a.b=c,d', - 'comma: stringifies with dots + comma' - ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true } - ), - 'a.b[0]=c&a.b[1]=d', - 'default: stringifies with dots + indices' - ); - st.end(); - }); - - t.test('stringifies an object inside an array', function (st) { - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), - 'a[0][b]=c', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), - 'a[b]=c', - 'repeat => repeat' - ); - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), - 'a[][b]=c', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), - 'a[0][b]=c', - 'default => indices' - ); - - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), - 'a[0][b][c][0]=1', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), - 'a[b][c]=1', - 'repeat => repeat' - ); - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), - 'a[][b][c][]=1', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), - 'a[0][b][c][0]=1', - 'default => indices' - ); - - st.end(); - }); - - t.test('stringifies an array with mixed objects and primitives', function (st) { - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - 'a[0][b]=1&a[1]=2&a[2]=3', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'a[][b]=1&a[]=2&a[]=3', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - '???', - 'brackets => brackets', - { skip: 'TODO: figure out what this should do' } - ); - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }), - 'a[0][b]=1&a[1]=2&a[2]=3', - 'default => indices' - ); - - st.end(); - }); - - t.test('stringifies an object inside an array with dots notation', function (st) { - st.equal( - qs.stringify( - { a: [{ b: 'c' }] }, - { allowDots: true, encode: false, arrayFormat: 'indices' } - ), - 'a[0].b=c', - 'indices => indices' - ); - st.equal( - qs.stringify( - { a: [{ b: 'c' }] }, - { allowDots: true, encode: false, arrayFormat: 'brackets' } - ), - 'a[].b=c', - 'brackets => brackets' - ); - st.equal( - qs.stringify( - { a: [{ b: 'c' }] }, - { allowDots: true, encode: false } - ), - 'a[0].b=c', - 'default => indices' - ); - - st.equal( - qs.stringify( - { a: [{ b: { c: [1] } }] }, - { allowDots: true, encode: false, arrayFormat: 'indices' } - ), - 'a[0].b.c[0]=1', - 'indices => indices' - ); - st.equal( - qs.stringify( - { a: [{ b: { c: [1] } }] }, - { allowDots: true, encode: false, arrayFormat: 'brackets' } - ), - 'a[].b.c[]=1', - 'brackets => brackets' - ); - st.equal( - qs.stringify( - { a: [{ b: { c: [1] } }] }, - { allowDots: true, encode: false } - ), - 'a[0].b.c[0]=1', - 'default => indices' - ); - - st.end(); - }); - - t.test('does not omit object keys when indices = false', function (st) { - st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); - st.end(); - }); - - t.test('uses indices notation for arrays when indices=true', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); - st.end(); - }); - - t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); - st.end(); - }); - - t.test('uses indices notation for arrays when arrayFormat=indices', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); - st.end(); - }); - - t.test('uses repeat notation for arrays when arrayFormat=repeat', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); - st.end(); - }); - - t.test('uses brackets notation for arrays when arrayFormat=brackets', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); - st.end(); - }); - - t.test('stringifies a complicated object', function (st) { - st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); - st.end(); - }); - - t.test('stringifies an empty value', function (st) { - st.equal(qs.stringify({ a: '' }), 'a='); - st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); - - st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); - st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); - - st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); - st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); - st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); - - st.end(); - }); - - t.test('stringifies an empty array in different arrayFormat', function (st) { - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); - // arrayFormat default - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c'); - // with strictNullHandling - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c'); - // with skipNulls - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c'); - - st.end(); - }); - - t.test('stringifies a null object', { skip: !hasProto }, function (st) { - st.equal(qs.stringify({ __proto__: null, a: 'b' }), 'a=b'); - st.end(); - }); - - t.test('returns an empty string for invalid input', function (st) { - st.equal(qs.stringify(undefined), ''); - st.equal(qs.stringify(false), ''); - st.equal(qs.stringify(null), ''); - st.equal(qs.stringify(''), ''); - st.end(); - }); - - t.test('stringifies an object with a null object as a child', { skip: !hasProto }, function (st) { - st.equal(qs.stringify({ a: { __proto__: null, b: 'c' } }), 'a%5Bb%5D=c'); - st.end(); - }); - - t.test('drops keys with a value of undefined', function (st) { - st.equal(qs.stringify({ a: undefined }), ''); - - st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); - st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); - st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); - st.end(); - }); - - t.test('url encodes values', function (st) { - st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); - st.end(); - }); - - t.test('stringifies a date', function (st) { - var now = new Date(); - var str = 'a=' + encodeURIComponent(now.toISOString()); - st.equal(qs.stringify({ a: now }), str); - st.end(); - }); - - t.test('stringifies the weird object from qs', function (st) { - st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); - st.end(); - }); - - t.test('skips properties that are part of the object prototype', function (st) { - st.intercept(Object.prototype, 'crash', { value: 'test' }); - - st.equal(qs.stringify({ a: 'b' }), 'a=b'); - st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - - st.end(); - }); - - t.test('stringifies boolean values', function (st) { - st.equal(qs.stringify({ a: true }), 'a=true'); - st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); - st.equal(qs.stringify({ b: false }), 'b=false'); - st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); - st.end(); - }); - - t.test('stringifies buffer values', function (st) { - st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test'); - st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test'); - st.end(); - }); - - t.test('stringifies an object using an alternative delimiter', function (st) { - st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); - st.end(); - }); - - t.test('does not blow up when Buffer global is missing', function (st) { - var restore = mockProperty(global, 'Buffer', { 'delete': true }); - - var result = qs.stringify({ a: 'b', c: 'd' }); - - restore(); - - st.equal(result, 'a=b&c=d'); - st.end(); - }); - - t.test('does not crash when parsing circular references', function (st) { - var a = {}; - a.b = a; - - st['throws']( - function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); }, - /RangeError: Cyclic object value/, - 'cyclic values throw' - ); - - var circular = { - a: 'value' - }; - circular.a = circular; - st['throws']( - function () { qs.stringify(circular); }, - /RangeError: Cyclic object value/, - 'cyclic values throw' - ); - - var arr = ['a']; - st.doesNotThrow( - function () { qs.stringify({ x: arr, y: arr }); }, - 'non-cyclic values do not throw' - ); - - st.end(); - }); - - t.test('non-circular duplicated references can still work', function (st) { - var hourOfDay = { - 'function': 'hour_of_day' - }; - - var p1 = { - 'function': 'gte', - arguments: [hourOfDay, 0] - }; - var p2 = { - 'function': 'lte', - arguments: [hourOfDay, 23] - }; - - st.equal( - qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23' - ); - st.equal( - qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23' - ); - st.equal( - qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23' - ); - - st.end(); - }); - - t.test('selects properties when filter=array', function (st) { - st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); - st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); - - st.equal( - qs.stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' } - ), - 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - 'indices => indices' - ); - st.equal( - qs.stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' } - ), - 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', - 'brackets => brackets' - ); - st.equal( - qs.stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2] } - ), - 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - 'default => indices' - ); - - st.end(); - }); - - t.test('supports custom representations when filter=function', function (st) { - var calls = 0; - var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; - var filterFunc = function (prefix, value) { - calls += 1; - if (calls === 1) { - st.equal(prefix, '', 'prefix is empty'); - st.equal(value, obj); - } else if (prefix === 'c') { - return void 0; - } else if (value instanceof Date) { - st.equal(prefix, 'e[f]'); - return value.getTime(); - } - return value; - }; - - st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); - st.equal(calls, 5); - st.end(); - }); - - t.test('can disable uri encoding', function (st) { - st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); - st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); - st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); - st.end(); - }); - - t.test('can sort the keys', function (st) { - var sort = function (a, b) { - return a.localeCompare(b); - }; - st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); - st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); - st.end(); - }); - - t.test('can sort the keys at depth 3 or more too', function (st) { - var sort = function (a, b) { - return a.localeCompare(b); - }; - st.equal( - qs.stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: sort, encode: false } - ), - 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb' - ); - st.equal( - qs.stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: null, encode: false } - ), - 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b' - ); - st.end(); - }); - - t.test('can stringify with custom encoding', function (st) { - st.equal(qs.stringify({ 県: '大阪府', '': '' }, { - encoder: function (str) { - if (str.length === 0) { - return ''; - } - var buf = iconv.encode(str, 'shiftjis'); - var result = []; - for (var i = 0; i < buf.length; ++i) { - result.push(buf.readUInt8(i).toString(16)); - } - return '%' + result.join('%'); - } - }), '%8c%a7=%91%e5%8d%e3%95%7b&='); - st.end(); - }); - - t.test('receives the default encoder as a second argument', function (st) { - st.plan(8); - - qs.stringify({ a: 1, b: new Date(), c: true, d: [1] }, { - encoder: function (str) { - st.match(typeof str, /^(?:string|number|boolean)$/); - return ''; - } - }); - - st.end(); - }); - - t.test('receives the default encoder as a second argument', function (st) { - st.plan(2); - - qs.stringify({ a: 1 }, { - encoder: function (str, defaultEncoder) { - st.equal(defaultEncoder, utils.encode); - } - }); - - st.end(); - }); - - t.test('throws error with wrong encoder', function (st) { - st['throws'](function () { - qs.stringify({}, { encoder: 'string' }); - }, new TypeError('Encoder has to be a function.')); - st.end(); - }); - - t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) { - st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, { - encoder: function (buffer) { - if (typeof buffer === 'string') { - return buffer; - } - return String.fromCharCode(buffer.readUInt8(0) + 97); - } - }), 'a=b'); - - st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, { - encoder: function (buffer) { - return buffer; - } - }), 'a=a b'); - st.end(); - }); - - t.test('serializeDate option', function (st) { - var date = new Date(); - st.equal( - qs.stringify({ a: date }), - 'a=' + date.toISOString().replace(/:/g, '%3A'), - 'default is toISOString' - ); - - var mutatedDate = new Date(); - mutatedDate.toISOString = function () { - throw new SyntaxError(); - }; - st['throws'](function () { - mutatedDate.toISOString(); - }, SyntaxError); - st.equal( - qs.stringify({ a: mutatedDate }), - 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), - 'toISOString works even when method is not locally present' - ); - - var specificDate = new Date(6); - st.equal( - qs.stringify( - { a: specificDate }, - { serializeDate: function (d) { return d.getTime() * 7; } } - ), - 'a=42', - 'custom serializeDate function called' - ); - - st.equal( - qs.stringify( - { a: [date] }, - { - serializeDate: function (d) { return d.getTime(); }, - arrayFormat: 'comma' - } - ), - 'a=' + date.getTime(), - 'works with arrayFormat comma' - ); - st.equal( - qs.stringify( - { a: [date] }, - { - serializeDate: function (d) { return d.getTime(); }, - arrayFormat: 'comma', - commaRoundTrip: true - } - ), - 'a%5B%5D=' + date.getTime(), - 'works with arrayFormat comma' - ); - - st.end(); - }); - - t.test('RFC 1738 serialization', function (st) { - st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); - st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); - st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b'); - - st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar'); - - st.end(); - }); - - t.test('RFC 3986 spaces serialization', function (st) { - st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); - st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); - st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b'); - - st.end(); - }); - - t.test('Backward compatibility to RFC 3986', function (st) { - st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); - st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b'); - - st.end(); - }); - - t.test('Edge cases and unknown formats', function (st) { - ['UFO1234', false, 1234, null, {}, []].forEach(function (format) { - st['throws']( - function () { - qs.stringify({ a: 'b c' }, { format: format }); - }, - new TypeError('Unknown format option provided.') - ); - }); - st.end(); - }); - - t.test('encodeValuesOnly', function (st) { - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'indices' } - ), - 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', - 'encodeValuesOnly + indices' - ); - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'brackets' } - ), - 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', - 'encodeValuesOnly + brackets' - ); - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'repeat' } - ), - 'a=b&c=d&c=e%3Df&f=g&f=h', - 'encodeValuesOnly + repeat' - ); - - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, - { arrayFormat: 'indices' } - ), - 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', - 'no encodeValuesOnly + indices' - ); - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, - { arrayFormat: 'brackets' } - ), - 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', - 'no encodeValuesOnly + brackets' - ); - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, - { arrayFormat: 'repeat' } - ), - 'a=b&c=d&c=e&f=g&f=h', - 'no encodeValuesOnly + repeat' - ); - - st.end(); - }); - - t.test('encodeValuesOnly - strictNullHandling', function (st) { - st.equal( - qs.stringify( - { a: { b: null } }, - { encodeValuesOnly: true, strictNullHandling: true } - ), - 'a[b]' - ); - st.end(); - }); - - t.test('throws if an invalid charset is specified', function (st) { - st['throws'](function () { - qs.stringify({ a: 'b' }, { charset: 'foobar' }); - }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - st.end(); - }); - - t.test('respects a charset of iso-8859-1', function (st) { - st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); - st.end(); - }); - - t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) { - st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); - st.end(); - }); - - t.test('respects an explicit charset of utf-8 (the default)', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); - st.end(); - }); - - t.test('`charsetSentinel` option', function (st) { - st.equal( - qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), - 'utf8=%E2%9C%93&a=%C3%A6', - 'adds the right sentinel when instructed to and the charset is utf-8' - ); - - st.equal( - qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), - 'utf8=%26%2310003%3B&a=%E6', - 'adds the right sentinel when instructed to and the charset is iso-8859-1' - ); - - st.end(); - }); - - t.test('does not mutate the options argument', function (st) { - var options = {}; - qs.stringify({}, options); - st.deepEqual(options, {}); - st.end(); - }); - - t.test('strictNullHandling works with custom filter', function (st) { - var filter = function (prefix, value) { - return value; - }; - - var options = { strictNullHandling: true, filter: filter }; - st.equal(qs.stringify({ key: null }, options), 'key'); - st.end(); - }); - - t.test('strictNullHandling works with null serializeDate', function (st) { - var serializeDate = function () { - return null; - }; - var options = { strictNullHandling: true, serializeDate: serializeDate }; - var date = new Date(); - st.equal(qs.stringify({ key: date }, options), 'key'); - st.end(); - }); - - t.test('allows for encoding keys and values differently', function (st) { - var encoder = function (str, defaultEncoder, charset, type) { - if (type === 'key') { - return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); - } - if (type === 'value') { - return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); - } - throw 'this should never happen! type: ' + type; - }; - - st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); - st.end(); - }); - - t.test('objects inside arrays', function (st) { - var obj = { a: { b: { c: 'd', e: 'f' } } }; - var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; - - st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'brackets' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'no array, repeat'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma'); - - st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); - st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'brackets' }), 'a[b][][c]=d&a[b][][e]=f', 'array, bracket'); - st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); - st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'array, repeat'); - st.equal( - qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }), - '???', - 'array, comma', - { skip: 'TODO: figure out what this should do' } - ); - - st.end(); - }); - - t.test('stringifies sparse arrays', function (st) { - /* eslint no-sparse-arrays: 0 */ - st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1]=2&a[4]=1'); - st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=2&a[]=1'); - st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=2&a=1'); - - st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][b][2][c]=1'); - st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][b][][c]=1'); - st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[b][c]=1'); - - st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); - - st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c][1]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c][]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); - - st.end(); - }); - - t.test('encodes a very long string', function (st) { - var chars = []; - var expected = []; - for (var i = 0; i < 5e3; i++) { - chars.push(' ' + i); - - expected.push('%20' + i); - } - - var obj = { - foo: chars.join('') - }; - - st.equal( - qs.stringify(obj, { arrayFormat: 'brackets', charset: 'utf-8' }), - 'foo=' + expected.join('') - ); - - st.end(); - }); - - t.end(); -}); - -test('stringifies empty keys', function (t) { - emptyTestCases.forEach(function (testCase) { - t.test('stringifies an object with empty string key with ' + testCase.input, function (st) { - st.deepEqual( - qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), - testCase.stringifyOutput.indices, - 'test case: ' + testCase.input + ', indices' - ); - st.deepEqual( - qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), - testCase.stringifyOutput.brackets, - 'test case: ' + testCase.input + ', brackets' - ); - st.deepEqual( - qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), - testCase.stringifyOutput.repeat, - 'test case: ' + testCase.input + ', repeat' - ); - - st.end(); - }); - }); - - t.test('edge case with object/arrays', function (st) { - st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); - st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2'); - st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3'); - st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3&[a]=2'); - - st.end(); - }); - - t.test('stringifies non-string keys', function (st) { - var S = Object('abc'); - S.toString = function () { - return 'd'; - }; - var actual = qs.stringify({ a: 'b', 'false': {}, 1e+22: 'c', d: 'e' }, { - filter: ['a', false, null, 10000000000000000000000, S], - allowDots: true, - encodeDotInKeys: true - }); - - st.equal(actual, 'a=b&1e%2B22=c&d=e', 'stringifies correctly'); - - st.end(); - }); -}); diff --git a/node_modules/qs/test/utils.js b/node_modules/qs/test/utils.js deleted file mode 100644 index defb7f2..0000000 --- a/node_modules/qs/test/utils.js +++ /dev/null @@ -1,381 +0,0 @@ -'use strict'; - -var test = require('tape'); -var inspect = require('object-inspect'); -var SaferBuffer = require('safer-buffer').Buffer; -var forEach = require('for-each'); -var v = require('es-value-fixtures'); - -var utils = require('../lib/utils'); - -test('merge()', function (t) { - t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null'); - - t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array'); - - t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); - - var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); - t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); - - var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); - t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); - - var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); - t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); - - var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); - t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); - - var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar'); - t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); - - var func = function f() {}; - t.deepEqual( - utils.merge(func, { foo: 'bar' }), - [func, { foo: 'bar' }], - 'functions can not be merged into' - ); - - func.bar = 'baz'; - t.deepEqual( - utils.merge({ foo: 'bar' }, func), - { foo: 'bar', bar: 'baz' }, - 'functions can be merge sources' - ); - - t.test( - 'avoids invoking array setters unnecessarily', - { skip: typeof Object.defineProperty !== 'function' }, - function (st) { - var setCount = 0; - var getCount = 0; - var observed = []; - Object.defineProperty(observed, 0, { - get: function () { - getCount += 1; - return { bar: 'baz' }; - }, - set: function () { setCount += 1; } - }); - utils.merge(observed, [null]); - st.equal(setCount, 0); - st.equal(getCount, 1); - observed[0] = observed[0]; // eslint-disable-line no-self-assign - st.equal(setCount, 1); - st.equal(getCount, 2); - st.end(); - } - ); - - t.test('with overflow objects (from arrayLimit)', function (st) { - st.test('merges primitive into overflow object at next index', function (s2t) { - // Create an overflow object via combine - var overflow = utils.combine(['a'], 'b', 1, false); - s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); - var merged = utils.merge(overflow, 'c'); - s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c' }, 'adds primitive at next numeric index'); - s2t.end(); - }); - - st.test('merges primitive into regular object with numeric keys normally', function (s2t) { - var obj = { 0: 'a', 1: 'b' }; - s2t.notOk(utils.isOverflow(obj), 'plain object is not marked as overflow'); - var merged = utils.merge(obj, 'c'); - s2t.deepEqual(merged, { 0: 'a', 1: 'b', c: true }, 'adds primitive as key (not at next index)'); - s2t.end(); - }); - - st.test('merges primitive into object with non-numeric keys normally', function (s2t) { - var obj = { foo: 'bar' }; - var merged = utils.merge(obj, 'baz'); - s2t.deepEqual(merged, { foo: 'bar', baz: true }, 'adds primitive as key with value true'); - s2t.end(); - }); - - st.test('merges overflow object into primitive', function (s2t) { - // Create an overflow object via combine - var overflow = utils.combine([], 'b', 0, false); - s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); - var merged = utils.merge('a', overflow); - s2t.ok(utils.isOverflow(merged), 'result is also marked as overflow'); - s2t.deepEqual(merged, { 0: 'a', 1: 'b' }, 'creates object with primitive at 0, source values shifted'); - s2t.end(); - }); - - st.test('merges overflow object with multiple values into primitive', function (s2t) { - // Create an overflow object via combine - var overflow = utils.combine(['b'], 'c', 1, false); - s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); - var merged = utils.merge('a', overflow); - s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c' }, 'shifts all source indices by 1'); - s2t.end(); - }); - - st.test('merges regular object into primitive as array', function (s2t) { - var obj = { foo: 'bar' }; - var merged = utils.merge('a', obj); - s2t.deepEqual(merged, ['a', { foo: 'bar' }], 'creates array with primitive and object'); - s2t.end(); - }); - - st.end(); - }); - - t.end(); -}); - -test('assign()', function (t) { - var target = { a: 1, b: 2 }; - var source = { b: 3, c: 4 }; - var result = utils.assign(target, source); - - t.equal(result, target, 'returns the target'); - t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged'); - t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched'); - - t.end(); -}); - -test('combine()', function (t) { - t.test('both arrays', function (st) { - var a = [1]; - var b = [2]; - var combined = utils.combine(a, b); - - st.deepEqual(a, [1], 'a is not mutated'); - st.deepEqual(b, [2], 'b is not mutated'); - st.notEqual(a, combined, 'a !== combined'); - st.notEqual(b, combined, 'b !== combined'); - st.deepEqual(combined, [1, 2], 'combined is a + b'); - - st.end(); - }); - - t.test('one array, one non-array', function (st) { - var aN = 1; - var a = [aN]; - var bN = 2; - var b = [bN]; - - var combinedAnB = utils.combine(aN, b); - st.deepEqual(b, [bN], 'b is not mutated'); - st.notEqual(aN, combinedAnB, 'aN + b !== aN'); - st.notEqual(a, combinedAnB, 'aN + b !== a'); - st.notEqual(bN, combinedAnB, 'aN + b !== bN'); - st.notEqual(b, combinedAnB, 'aN + b !== b'); - st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); - - var combinedABn = utils.combine(a, bN); - st.deepEqual(a, [aN], 'a is not mutated'); - st.notEqual(aN, combinedABn, 'a + bN !== aN'); - st.notEqual(a, combinedABn, 'a + bN !== a'); - st.notEqual(bN, combinedABn, 'a + bN !== bN'); - st.notEqual(b, combinedABn, 'a + bN !== b'); - st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); - - st.end(); - }); - - t.test('neither is an array', function (st) { - var combined = utils.combine(1, 2); - st.notEqual(1, combined, '1 + 2 !== 1'); - st.notEqual(2, combined, '1 + 2 !== 2'); - st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); - - st.end(); - }); - - t.test('with arrayLimit', function (st) { - st.test('under the limit', function (s2t) { - var combined = utils.combine(['a', 'b'], 'c', 10, false); - s2t.deepEqual(combined, ['a', 'b', 'c'], 'returns array when under limit'); - s2t.ok(Array.isArray(combined), 'result is an array'); - s2t.end(); - }); - - st.test('exactly at the limit stays as array', function (s2t) { - var combined = utils.combine(['a', 'b'], 'c', 3, false); - s2t.deepEqual(combined, ['a', 'b', 'c'], 'stays as array when exactly at limit'); - s2t.ok(Array.isArray(combined), 'result is an array'); - s2t.end(); - }); - - st.test('over the limit', function (s2t) { - var combined = utils.combine(['a', 'b', 'c'], 'd', 3, false); - s2t.deepEqual(combined, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'converts to object when over limit'); - s2t.notOk(Array.isArray(combined), 'result is not an array'); - s2t.end(); - }); - - st.test('with arrayLimit 0', function (s2t) { - var combined = utils.combine([], 'a', 0, false); - s2t.deepEqual(combined, { 0: 'a' }, 'converts single element to object with arrayLimit 0'); - s2t.notOk(Array.isArray(combined), 'result is not an array'); - s2t.end(); - }); - - st.test('with plainObjects option', function (s2t) { - var combined = utils.combine(['a'], 'b', 1, true); - var expected = { __proto__: null, 0: 'a', 1: 'b' }; - s2t.deepEqual(combined, expected, 'converts to object with null prototype'); - s2t.equal(Object.getPrototypeOf(combined), null, 'result has null prototype when plainObjects is true'); - s2t.end(); - }); - - st.end(); - }); - - t.test('with existing overflow object', function (st) { - st.test('adds to existing overflow object at next index', function (s2t) { - // Create overflow object first via combine - var overflow = utils.combine(['a'], 'b', 1, false); - s2t.ok(utils.isOverflow(overflow), 'initial object is marked as overflow'); - - var combined = utils.combine(overflow, 'c', 10, false); - s2t.equal(combined, overflow, 'returns the same object (mutated)'); - s2t.deepEqual(combined, { 0: 'a', 1: 'b', 2: 'c' }, 'adds value at next numeric index'); - s2t.end(); - }); - - st.test('does not treat plain object with numeric keys as overflow', function (s2t) { - var plainObj = { 0: 'a', 1: 'b' }; - s2t.notOk(utils.isOverflow(plainObj), 'plain object is not marked as overflow'); - - // combine treats this as a regular value, not an overflow object to append to - var combined = utils.combine(plainObj, 'c', 10, false); - s2t.deepEqual(combined, [{ 0: 'a', 1: 'b' }, 'c'], 'concatenates as regular values'); - s2t.end(); - }); - - st.end(); - }); - - t.end(); -}); - -test('decode', function (t) { - t.equal( - utils.decode('a+b'), - 'a b', - 'decodes + to space' - ); - - t.equal( - utils.decode('name%2Eobj'), - 'name.obj', - 'decodes a string' - ); - t.equal( - utils.decode('name%2Eobj%2Efoo', null, 'iso-8859-1'), - 'name.obj.foo', - 'decodes a string in iso-8859-1' - ); - - t.end(); -}); - -test('encode', function (t) { - forEach(v.nullPrimitives, function (nullish) { - t['throws']( - function () { utils.encode(nullish); }, - TypeError, - inspect(nullish) + ' is not a string' - ); - }); - - t.equal(utils.encode(''), '', 'empty string returns itself'); - t.deepEqual(utils.encode([]), [], 'empty array returns itself'); - t.deepEqual(utils.encode({ length: 0 }), { length: 0 }, 'empty arraylike returns itself'); - - t.test('symbols', { skip: !v.hasSymbols }, function (st) { - st.equal(utils.encode(Symbol('x')), 'Symbol%28x%29', 'symbol is encoded'); - - st.end(); - }); - - t.equal( - utils.encode('(abc)'), - '%28abc%29', - 'encodes parentheses' - ); - t.equal( - utils.encode({ toString: function () { return '(abc)'; } }), - '%28abc%29', - 'toStrings and encodes parentheses' - ); - - t.equal( - utils.encode('abc 123 💩', null, 'iso-8859-1'), - 'abc%20123%20%26%2355357%3B%26%2356489%3B', - 'encodes in iso-8859-1' - ); - - var longString = ''; - var expectedString = ''; - for (var i = 0; i < 1500; i++) { - longString += ' '; - expectedString += '%20'; - } - - t.equal( - utils.encode(longString), - expectedString, - 'encodes a long string' - ); - - t.equal( - utils.encode('\x28\x29'), - '%28%29', - 'encodes parens normally' - ); - t.equal( - utils.encode('\x28\x29', null, null, null, 'RFC1738'), - '()', - 'does not encode parens in RFC1738' - ); - - // todo RFC1738 format - - t.equal( - utils.encode('Āက豈'), - '%C4%80%E1%80%80%EF%A4%80', - 'encodes multibyte chars' - ); - - t.equal( - utils.encode('\uD83D \uDCA9'), - '%F0%9F%90%A0%F0%BA%90%80', - 'encodes lone surrogates' - ); - - t.end(); -}); - -test('isBuffer()', function (t) { - forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) { - t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer'); - }); - - var fakeBuffer = { constructor: Buffer }; - t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer'); - - var saferBuffer = SaferBuffer.from('abc'); - t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); - - var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc'); - t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer'); - t.end(); -}); - -test('isRegExp()', function (t) { - t.equal(utils.isRegExp(/a/g), true, 'RegExp is a RegExp'); - t.equal(utils.isRegExp(new RegExp('a', 'g')), true, 'new RegExp is a RegExp'); - t.equal(utils.isRegExp(new Date()), false, 'Date is not a RegExp'); - - forEach(v.primitives, function (primitive) { - t.equal(utils.isRegExp(primitive), false, inspect(primitive) + ' is not a RegExp'); - }); - - t.end(); -}); diff --git a/node_modules/range-parser/HISTORY.md b/node_modules/range-parser/HISTORY.md deleted file mode 100644 index 70a973d..0000000 --- a/node_modules/range-parser/HISTORY.md +++ /dev/null @@ -1,56 +0,0 @@ -1.2.1 / 2019-05-10 -================== - - * Improve error when `str` is not a string - -1.2.0 / 2016-06-01 -================== - - * Add `combine` option to combine overlapping ranges - -1.1.0 / 2016-05-13 -================== - - * Fix incorrectly returning -1 when there is at least one valid range - * perf: remove internal function - -1.0.3 / 2015-10-29 -================== - - * perf: enable strict mode - -1.0.2 / 2014-09-08 -================== - - * Support Node.js 0.6 - -1.0.1 / 2014-09-07 -================== - - * Move repository to jshttp - -1.0.0 / 2013-12-11 -================== - - * Add repository to package.json - * Add MIT license - -0.0.4 / 2012-06-17 -================== - - * Change ret -1 for unsatisfiable and -2 when invalid - -0.0.3 / 2012-06-17 -================== - - * Fix last-byte-pos default to len - 1 - -0.0.2 / 2012-06-14 -================== - - * Add `.type` - -0.0.1 / 2012-06-11 -================== - - * Initial release diff --git a/node_modules/range-parser/LICENSE b/node_modules/range-parser/LICENSE deleted file mode 100644 index 3599954..0000000 --- a/node_modules/range-parser/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2014 TJ Holowaychuk -Copyright (c) 2015-2016 Douglas Christopher Wilson - -```js -var parseRange = require('range-parser') -``` - -### parseRange(size, header, options) - -Parse the given `header` string where `size` is the maximum size of the resource. -An array of ranges will be returned or negative numbers indicating an error parsing. - - * `-2` signals a malformed header string - * `-1` signals an unsatisfiable range - - - -```js -// parse header from request -var range = parseRange(size, req.headers.range) - -// the type of the range -if (range.type === 'bytes') { - // the ranges - range.forEach(function (r) { - // do something with r.start and r.end - }) -} -``` - -#### Options - -These properties are accepted in the options object. - -##### combine - -Specifies if overlapping & adjacent ranges should be combined, defaults to `false`. -When `true`, ranges will be combined and returned as if they were specified that -way in the header. - - - -```js -parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true }) -// => [ -// { start: 0, end: 10 }, -// { start: 50, end: 60 } -// ] -``` - -## License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/range-parser/master -[coveralls-url]: https://coveralls.io/r/jshttp/range-parser?branch=master -[node-image]: https://badgen.net/npm/node/range-parser -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/range-parser -[npm-url]: https://npmjs.org/package/range-parser -[npm-version-image]: https://badgen.net/npm/v/range-parser -[travis-image]: https://badgen.net/travis/jshttp/range-parser/master -[travis-url]: https://travis-ci.org/jshttp/range-parser diff --git a/node_modules/range-parser/index.js b/node_modules/range-parser/index.js deleted file mode 100644 index b7dc5c0..0000000 --- a/node_modules/range-parser/index.js +++ /dev/null @@ -1,162 +0,0 @@ -/*! - * range-parser - * Copyright(c) 2012-2014 TJ Holowaychuk - * Copyright(c) 2015-2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = rangeParser - -/** - * Parse "Range" header `str` relative to the given file `size`. - * - * @param {Number} size - * @param {String} str - * @param {Object} [options] - * @return {Array} - * @public - */ - -function rangeParser (size, str, options) { - if (typeof str !== 'string') { - throw new TypeError('argument str must be a string') - } - - var index = str.indexOf('=') - - if (index === -1) { - return -2 - } - - // split the range string - var arr = str.slice(index + 1).split(',') - var ranges = [] - - // add ranges type - ranges.type = str.slice(0, index) - - // parse all ranges - for (var i = 0; i < arr.length; i++) { - var range = arr[i].split('-') - var start = parseInt(range[0], 10) - var end = parseInt(range[1], 10) - - // -nnn - if (isNaN(start)) { - start = size - end - end = size - 1 - // nnn- - } else if (isNaN(end)) { - end = size - 1 - } - - // limit last-byte-pos to current length - if (end > size - 1) { - end = size - 1 - } - - // invalid or unsatisifiable - if (isNaN(start) || isNaN(end) || start > end || start < 0) { - continue - } - - // add range - ranges.push({ - start: start, - end: end - }) - } - - if (ranges.length < 1) { - // unsatisifiable - return -1 - } - - return options && options.combine - ? combineRanges(ranges) - : ranges -} - -/** - * Combine overlapping & adjacent ranges. - * @private - */ - -function combineRanges (ranges) { - var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart) - - for (var j = 0, i = 1; i < ordered.length; i++) { - var range = ordered[i] - var current = ordered[j] - - if (range.start > current.end + 1) { - // next range - ordered[++j] = range - } else if (range.end > current.end) { - // extend range - current.end = range.end - current.index = Math.min(current.index, range.index) - } - } - - // trim ordered array - ordered.length = j + 1 - - // generate combined range - var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex) - - // copy ranges type - combined.type = ranges.type - - return combined -} - -/** - * Map function to add index value to ranges. - * @private - */ - -function mapWithIndex (range, index) { - return { - start: range.start, - end: range.end, - index: index - } -} - -/** - * Map function to remove index value from ranges. - * @private - */ - -function mapWithoutIndex (range) { - return { - start: range.start, - end: range.end - } -} - -/** - * Sort function to sort ranges by index. - * @private - */ - -function sortByRangeIndex (a, b) { - return a.index - b.index -} - -/** - * Sort function to sort ranges by start position. - * @private - */ - -function sortByRangeStart (a, b) { - return a.start - b.start -} diff --git a/node_modules/range-parser/package.json b/node_modules/range-parser/package.json deleted file mode 100644 index abea6d8..0000000 --- a/node_modules/range-parser/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "range-parser", - "author": "TJ Holowaychuk (http://tjholowaychuk.com)", - "description": "Range header field string parser", - "version": "1.2.1", - "contributors": [ - "Douglas Christopher Wilson ", - "James Wyatt Cready ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "keywords": [ - "range", - "parser", - "http" - ], - "repository": "jshttp/range-parser", - "devDependencies": { - "deep-equal": "1.0.1", - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", - "mocha": "6.1.4", - "nyc": "14.1.1" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "test-travis": "nyc --reporter=text npm test" - } -} diff --git a/node_modules/raw-body/LICENSE b/node_modules/raw-body/LICENSE deleted file mode 100644 index 1029a7a..0000000 --- a/node_modules/raw-body/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2014 Jonathan Ong -Copyright (c) 2014-2022 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/raw-body/README.md b/node_modules/raw-body/README.md deleted file mode 100644 index d9b36d6..0000000 --- a/node_modules/raw-body/README.md +++ /dev/null @@ -1,223 +0,0 @@ -# raw-body - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build status][github-actions-ci-image]][github-actions-ci-url] -[![Test coverage][coveralls-image]][coveralls-url] - -Gets the entire buffer of a stream either as a `Buffer` or a string. -Validates the stream's length against an expected length and maximum limit. -Ideal for parsing request bodies. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install raw-body -``` - -### TypeScript - -This module includes a [TypeScript](https://www.typescriptlang.org/) -declaration file to enable auto complete in compatible editors and type -information for TypeScript projects. This module depends on the Node.js -types, so install `@types/node`: - -```sh -$ npm install @types/node -``` - -## API - -```js -var getRawBody = require('raw-body') -``` - -### getRawBody(stream, [options], [callback]) - -**Returns a promise if no callback specified and global `Promise` exists.** - -Options: - -- `length` - The length of the stream. - If the contents of the stream do not add up to this length, - an `400` error code is returned. -- `limit` - The byte limit of the body. - This is the number of bytes or any string format supported by - [bytes](https://www.npmjs.com/package/bytes), - for example `1000`, `'500kb'` or `'3mb'`. - If the body ends up being larger than this limit, - a `413` error code is returned. -- `encoding` - The encoding to use to decode the body into a string. - By default, a `Buffer` instance will be returned when no encoding is specified. - Most likely, you want `utf-8`, so setting `encoding` to `true` will decode as `utf-8`. - You can use any type of encoding supported by [iconv-lite](https://www.npmjs.org/package/iconv-lite#readme). - -You can also pass a string in place of options to just specify the encoding. - -If an error occurs, the stream will be paused, everything unpiped, -and you are responsible for correctly disposing the stream. -For HTTP requests, you may need to finish consuming the stream if -you want to keep the socket open for future requests. For streams -that use file descriptors, you should `stream.destroy()` or -`stream.close()` to prevent leaks. - -## Errors - -This module creates errors depending on the error condition during reading. -The error may be an error from the underlying Node.js implementation, but is -otherwise an error created by this module, which has the following attributes: - - * `limit` - the limit in bytes - * `length` and `expected` - the expected length of the stream - * `received` - the received bytes - * `encoding` - the invalid encoding - * `status` and `statusCode` - the corresponding status code for the error - * `type` - the error type - -### Types - -The errors from this module have a `type` property which allows for the programmatic -determination of the type of error returned. - -#### encoding.unsupported - -This error will occur when the `encoding` option is specified, but the value does -not map to an encoding supported by the [iconv-lite](https://www.npmjs.org/package/iconv-lite#readme) -module. - -#### entity.too.large - -This error will occur when the `limit` option is specified, but the stream has -an entity that is larger. - -#### request.aborted - -This error will occur when the request stream is aborted by the client before -reading the body has finished. - -#### request.size.invalid - -This error will occur when the `length` option is specified, but the stream has -emitted more bytes. - -#### stream.encoding.set - -This error will occur when the given stream has an encoding set on it, making it -a decoded stream. The stream should not have an encoding set and is expected to -emit `Buffer` objects. - -#### stream.not.readable - -This error will occur when the given stream is not readable. - -## Examples - -### Simple Express example - -```js -var contentType = require('content-type') -var express = require('express') -var getRawBody = require('raw-body') - -var app = express() - -app.use(function (req, res, next) { - getRawBody(req, { - length: req.headers['content-length'], - limit: '1mb', - encoding: contentType.parse(req).parameters.charset - }, function (err, string) { - if (err) return next(err) - req.text = string - next() - }) -}) - -// now access req.text -``` - -### Simple Koa example - -```js -var contentType = require('content-type') -var getRawBody = require('raw-body') -var koa = require('koa') - -var app = koa() - -app.use(function * (next) { - this.text = yield getRawBody(this.req, { - length: this.req.headers['content-length'], - limit: '1mb', - encoding: contentType.parse(this.req).parameters.charset - }) - yield next -}) - -// now access this.text -``` - -### Using as a promise - -To use this library as a promise, simply omit the `callback` and a promise is -returned, provided that a global `Promise` is defined. - -```js -var getRawBody = require('raw-body') -var http = require('http') - -var server = http.createServer(function (req, res) { - getRawBody(req) - .then(function (buf) { - res.statusCode = 200 - res.end(buf.length + ' bytes submitted') - }) - .catch(function (err) { - res.statusCode = 500 - res.end(err.message) - }) -}) - -server.listen(3000) -``` - -### Using with TypeScript - -```ts -import * as getRawBody from 'raw-body'; -import * as http from 'http'; - -const server = http.createServer((req, res) => { - getRawBody(req) - .then((buf) => { - res.statusCode = 200; - res.end(buf.length + ' bytes submitted'); - }) - .catch((err) => { - res.statusCode = err.statusCode; - res.end(err.message); - }); -}); - -server.listen(3000); -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/raw-body.svg -[npm-url]: https://npmjs.org/package/raw-body -[node-version-image]: https://img.shields.io/node/v/raw-body.svg -[node-version-url]: https://nodejs.org/en/download/ -[coveralls-image]: https://img.shields.io/coveralls/stream-utils/raw-body/master.svg -[coveralls-url]: https://coveralls.io/r/stream-utils/raw-body?branch=master -[downloads-image]: https://img.shields.io/npm/dm/raw-body.svg -[downloads-url]: https://npmjs.org/package/raw-body -[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/stream-utils/raw-body/ci.yml?branch=master&label=ci -[github-actions-ci-url]: https://github.com/jshttp/stream-utils/raw-body?query=workflow%3Aci diff --git a/node_modules/raw-body/index.d.ts b/node_modules/raw-body/index.d.ts deleted file mode 100644 index b504611..0000000 --- a/node_modules/raw-body/index.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -declare namespace getRawBody { - export type Encoding = string | true; - - export interface Options { - /** - * The expected length of the stream. - */ - length?: number | string | null; - /** - * The byte limit of the body. This is the number of bytes or any string - * format supported by `bytes`, for example `1000`, `'500kb'` or `'3mb'`. - */ - limit?: number | string | null; - /** - * The encoding to use to decode the body into a string. By default, a - * `Buffer` instance will be returned when no encoding is specified. Most - * likely, you want `utf-8`, so setting encoding to `true` will decode as - * `utf-8`. You can use any type of encoding supported by `iconv-lite`. - */ - encoding?: Encoding | null; - } - - export interface RawBodyError extends Error { - /** - * The limit in bytes. - */ - limit?: number; - /** - * The expected length of the stream. - */ - length?: number; - expected?: number; - /** - * The received bytes. - */ - received?: number; - /** - * The encoding. - */ - encoding?: string; - /** - * The corresponding status code for the error. - */ - status: number; - statusCode: number; - /** - * The error type. - */ - type: string; - } -} - -/** - * Gets the entire buffer of a stream either as a `Buffer` or a string. - * Validates the stream's length against an expected length and maximum - * limit. Ideal for parsing request bodies. - */ -declare function getRawBody( - stream: NodeJS.ReadableStream, - callback: (err: getRawBody.RawBodyError, body: Buffer) => void -): void; - -declare function getRawBody( - stream: NodeJS.ReadableStream, - options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding, - callback: (err: getRawBody.RawBodyError, body: string) => void -): void; - -declare function getRawBody( - stream: NodeJS.ReadableStream, - options: getRawBody.Options, - callback: (err: getRawBody.RawBodyError, body: Buffer) => void -): void; - -declare function getRawBody( - stream: NodeJS.ReadableStream, - options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding -): Promise; - -declare function getRawBody( - stream: NodeJS.ReadableStream, - options?: getRawBody.Options -): Promise; - -export = getRawBody; diff --git a/node_modules/raw-body/index.js b/node_modules/raw-body/index.js deleted file mode 100644 index 9cdcd12..0000000 --- a/node_modules/raw-body/index.js +++ /dev/null @@ -1,336 +0,0 @@ -/*! - * raw-body - * Copyright(c) 2013-2014 Jonathan Ong - * Copyright(c) 2014-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var asyncHooks = tryRequireAsyncHooks() -var bytes = require('bytes') -var createError = require('http-errors') -var iconv = require('iconv-lite') -var unpipe = require('unpipe') - -/** - * Module exports. - * @public - */ - -module.exports = getRawBody - -/** - * Module variables. - * @private - */ - -var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: / - -/** - * Get the decoder for a given encoding. - * - * @param {string} encoding - * @private - */ - -function getDecoder (encoding) { - if (!encoding) return null - - try { - return iconv.getDecoder(encoding) - } catch (e) { - // error getting decoder - if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e - - // the encoding was not found - throw createError(415, 'specified encoding unsupported', { - encoding: encoding, - type: 'encoding.unsupported' - }) - } -} - -/** - * Get the raw body of a stream (typically HTTP). - * - * @param {object} stream - * @param {object|string|function} [options] - * @param {function} [callback] - * @public - */ - -function getRawBody (stream, options, callback) { - var done = callback - var opts = options || {} - - // light validation - if (stream === undefined) { - throw new TypeError('argument stream is required') - } else if (typeof stream !== 'object' || stream === null || typeof stream.on !== 'function') { - throw new TypeError('argument stream must be a stream') - } - - if (options === true || typeof options === 'string') { - // short cut for encoding - opts = { - encoding: options - } - } - - if (typeof options === 'function') { - done = options - opts = {} - } - - // validate callback is a function, if provided - if (done !== undefined && typeof done !== 'function') { - throw new TypeError('argument callback must be a function') - } - - // require the callback without promises - if (!done && !global.Promise) { - throw new TypeError('argument callback is required') - } - - // get encoding - var encoding = opts.encoding !== true - ? opts.encoding - : 'utf-8' - - // convert the limit to an integer - var limit = bytes.parse(opts.limit) - - // convert the expected length to an integer - var length = opts.length != null && !isNaN(opts.length) - ? parseInt(opts.length, 10) - : null - - if (done) { - // classic callback style - return readStream(stream, encoding, length, limit, wrap(done)) - } - - return new Promise(function executor (resolve, reject) { - readStream(stream, encoding, length, limit, function onRead (err, buf) { - if (err) return reject(err) - resolve(buf) - }) - }) -} - -/** - * Halt a stream. - * - * @param {Object} stream - * @private - */ - -function halt (stream) { - // unpipe everything from the stream - unpipe(stream) - - // pause stream - if (typeof stream.pause === 'function') { - stream.pause() - } -} - -/** - * Read the data from the stream. - * - * @param {object} stream - * @param {string} encoding - * @param {number} length - * @param {number} limit - * @param {function} callback - * @public - */ - -function readStream (stream, encoding, length, limit, callback) { - var complete = false - var sync = true - - // check the length and limit options. - // note: we intentionally leave the stream paused, - // so users should handle the stream themselves. - if (limit !== null && length !== null && length > limit) { - return done(createError(413, 'request entity too large', { - expected: length, - length: length, - limit: limit, - type: 'entity.too.large' - })) - } - - // streams1: assert request encoding is buffer. - // streams2+: assert the stream encoding is buffer. - // stream._decoder: streams1 - // state.encoding: streams2 - // state.decoder: streams2, specifically < 0.10.6 - var state = stream._readableState - if (stream._decoder || (state && (state.encoding || state.decoder))) { - // developer error - return done(createError(500, 'stream encoding should not be set', { - type: 'stream.encoding.set' - })) - } - - if (typeof stream.readable !== 'undefined' && !stream.readable) { - return done(createError(500, 'stream is not readable', { - type: 'stream.not.readable' - })) - } - - var received = 0 - var decoder - - try { - decoder = getDecoder(encoding) - } catch (err) { - return done(err) - } - - var buffer = decoder - ? '' - : [] - - // attach listeners - stream.on('aborted', onAborted) - stream.on('close', cleanup) - stream.on('data', onData) - stream.on('end', onEnd) - stream.on('error', onEnd) - - // mark sync section complete - sync = false - - function done () { - var args = new Array(arguments.length) - - // copy arguments - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - - // mark complete - complete = true - - if (sync) { - process.nextTick(invokeCallback) - } else { - invokeCallback() - } - - function invokeCallback () { - cleanup() - - if (args[0]) { - // halt the stream on error - halt(stream) - } - - callback.apply(null, args) - } - } - - function onAborted () { - if (complete) return - - done(createError(400, 'request aborted', { - code: 'ECONNABORTED', - expected: length, - length: length, - received: received, - type: 'request.aborted' - })) - } - - function onData (chunk) { - if (complete) return - - received += chunk.length - - if (limit !== null && received > limit) { - done(createError(413, 'request entity too large', { - limit: limit, - received: received, - type: 'entity.too.large' - })) - } else if (decoder) { - buffer += decoder.write(chunk) - } else { - buffer.push(chunk) - } - } - - function onEnd (err) { - if (complete) return - if (err) return done(err) - - if (length !== null && received !== length) { - done(createError(400, 'request size did not match content length', { - expected: length, - length: length, - received: received, - type: 'request.size.invalid' - })) - } else { - var string = decoder - ? buffer + (decoder.end() || '') - : Buffer.concat(buffer) - done(null, string) - } - } - - function cleanup () { - buffer = null - - stream.removeListener('aborted', onAborted) - stream.removeListener('data', onData) - stream.removeListener('end', onEnd) - stream.removeListener('error', onEnd) - stream.removeListener('close', cleanup) - } -} - -/** - * Try to require async_hooks - * @private - */ - -function tryRequireAsyncHooks () { - try { - return require('async_hooks') - } catch (e) { - return {} - } -} - -/** - * Wrap function with async resource, if possible. - * AsyncResource.bind static method backported. - * @private - */ - -function wrap (fn) { - var res - - // create anonymous resource - if (asyncHooks.AsyncResource) { - res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn') - } - - // incompatible node.js - if (!res || !res.runInAsyncScope) { - return fn - } - - // return bound function - return res.runInAsyncScope.bind(res, fn, null) -} diff --git a/node_modules/raw-body/package.json b/node_modules/raw-body/package.json deleted file mode 100644 index eab819f..0000000 --- a/node_modules/raw-body/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "raw-body", - "description": "Get and validate the raw body of a readable stream.", - "version": "3.0.2", - "author": "Jonathan Ong (http://jongleberry.com)", - "contributors": [ - "Douglas Christopher Wilson ", - "Raynos " - ], - "license": "MIT", - "repository": "stream-utils/raw-body", - "dependencies": { - "bytes": "~3.1.2", - "http-errors": "~2.0.1", - "iconv-lite": "~0.7.0", - "unpipe": "~1.0.0" - }, - "devDependencies": { - "@stylistic/eslint-plugin": "^5.1.0", - "@stylistic/eslint-plugin-js": "^4.1.0", - "bluebird": "3.7.2", - "eslint": "^9.0.0", - "mocha": "10.7.0", - "neostandard": "^0.12.0", - "nyc": "17.0.0", - "readable-stream": "2.3.7", - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.10" - }, - "files": [ - "LICENSE", - "README.md", - "index.d.ts", - "index.js" - ], - "scripts": { - "lint": "eslint", - "lint:fix": "eslint --fix", - "test": "mocha --trace-deprecation --reporter spec --check-leaks test/", - "test:ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test:cov": "nyc --reporter=html --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/require-from-string/index.js b/node_modules/require-from-string/index.js deleted file mode 100644 index cb5595f..0000000 --- a/node_modules/require-from-string/index.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var Module = require('module'); -var path = require('path'); - -module.exports = function requireFromString(code, filename, opts) { - if (typeof filename === 'object') { - opts = filename; - filename = undefined; - } - - opts = opts || {}; - filename = filename || ''; - - opts.appendPaths = opts.appendPaths || []; - opts.prependPaths = opts.prependPaths || []; - - if (typeof code !== 'string') { - throw new Error('code must be a string, not ' + typeof code); - } - - var paths = Module._nodeModulePaths(path.dirname(filename)); - - var parent = module.parent; - var m = new Module(filename, parent); - m.filename = filename; - m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths); - m._compile(code, filename); - - var exports = m.exports; - parent && parent.children && parent.children.splice(parent.children.indexOf(m), 1); - - return exports; -}; diff --git a/node_modules/require-from-string/license b/node_modules/require-from-string/license deleted file mode 100644 index 1aeb74f..0000000 --- a/node_modules/require-from-string/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/require-from-string/package.json b/node_modules/require-from-string/package.json deleted file mode 100644 index 800d46e..0000000 --- a/node_modules/require-from-string/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "require-from-string", - "version": "2.0.2", - "description": "Require module from string", - "license": "MIT", - "repository": "floatdrop/require-from-string", - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js" - ], - "keywords": [ - "" - ], - "dependencies": {}, - "devDependencies": { - "mocha": "*" - } -} diff --git a/node_modules/require-from-string/readme.md b/node_modules/require-from-string/readme.md deleted file mode 100644 index 88b3236..0000000 --- a/node_modules/require-from-string/readme.md +++ /dev/null @@ -1,56 +0,0 @@ -# require-from-string [![Build Status](https://travis-ci.org/floatdrop/require-from-string.svg?branch=master)](https://travis-ci.org/floatdrop/require-from-string) - -Load module from string in Node. - -## Install - -``` -$ npm install --save require-from-string -``` - - -## Usage - -```js -var requireFromString = require('require-from-string'); - -requireFromString('module.exports = 1'); -//=> 1 -``` - - -## API - -### requireFromString(code, [filename], [options]) - -#### code - -*Required* -Type: `string` - -Module code. - -#### filename -Type: `string` -Default: `''` - -Optional filename. - - -#### options -Type: `object` - -##### appendPaths -Type: `Array` - -List of `paths`, that will be appended to module `paths`. Useful, when you want -to be able require modules from these paths. - -##### prependPaths -Type: `Array` - -Same as `appendPaths`, but paths will be prepended. - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/resolve-pkg-maps/LICENSE b/node_modules/resolve-pkg-maps/LICENSE deleted file mode 100644 index 51e4fd8..0000000 --- a/node_modules/resolve-pkg-maps/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Hiroki Osame - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/resolve-pkg-maps/README.md b/node_modules/resolve-pkg-maps/README.md deleted file mode 100644 index 2469b1b..0000000 --- a/node_modules/resolve-pkg-maps/README.md +++ /dev/null @@ -1,216 +0,0 @@ -# resolve-pkg-maps - -Utils to resolve `package.json` subpath & conditional [`exports`](https://nodejs.org/api/packages.html#exports)/[`imports`](https://nodejs.org/api/packages.html#imports) in resolvers. - -Implements the [ESM resolution algorithm](https://nodejs.org/api/esm.html#resolver-algorithm-specification). Tested [against Node.js](/tests/) for accuracy. - -Support this project by ⭐️ starring and sharing it. [Follow me](https://github.com/privatenumber) to see what other cool projects I'm working on! ❤️ - -## Usage - -### Resolving `exports` - -_utils/package.json_ -```json5 -{ - // ... - "exports": { - "./reverse": { - "require": "./file.cjs", - "default": "./file.mjs" - } - }, - // ... -} -``` - -```ts -import { resolveExports } from 'resolve-pkg-maps' - -const [packageName, packageSubpath] = parseRequest('utils/reverse') - -const resolvedPaths: string[] = resolveExports( - getPackageJson(packageName).exports, - packageSubpath, - ['import', ...otherConditions] -) -// => ['./file.mjs'] -``` - -### Resolving `imports` - -_package.json_ -```json5 -{ - // ... - "imports": { - "#supports-color": { - "node": "./index.js", - "default": "./browser.js" - } - }, - // ... -} -``` - -```ts -import { resolveImports } from 'resolve-pkg-maps' - -const resolvedPaths: string[] = resolveImports( - getPackageJson('.').imports, - '#supports-color', - ['node', ...otherConditions] -) -// => ['./index.js'] -``` - -## API - -### resolveExports(exports, request, conditions) - -Returns: `string[]` - -Resolves the `request` based on `exports` and `conditions`. Returns an array of paths (e.g. in case a fallback array is matched). - -#### exports - -Type: -```ts -type Exports = PathOrMap | readonly PathOrMap[] - -type PathOrMap = string | PathConditionsMap - -type PathConditionsMap = { - [condition: string]: PathConditions | null -} -``` - -The [`exports` property](https://nodejs.org/api/packages.html#exports) value in `package.json`. - -#### request - -Type: `string` - -The package subpath to resolve. Assumes a normalized path is passed in (eg. [repeating slashes `//`](https://github.com/nodejs/node/issues/44316)). - -It _should not_ start with `/` or `./`. - -Example: if the full import path is `some-package/subpath/file`, the request is `subpath/file`. - - -#### conditions - -Type: `readonly string[]` - -An array of conditions to use when resolving the request. For reference, Node.js's default conditions are [`['node', 'import']`](https://nodejs.org/api/esm.html#:~:text=defaultConditions%20is%20the%20conditional%20environment%20name%20array%2C%20%5B%22node%22%2C%20%22import%22%5D.). - -The order of this array does not matter; the order of condition keys in the export map is what matters instead. - -Not all conditions in the array need to be met to resolve the request. It just needs enough to resolve to a path. - ---- - -### resolveImports(imports, request, conditions) - -Returns: `string[]` - -Resolves the `request` based on `imports` and `conditions`. Returns an array of paths (e.g. in case a fallback array is matched). - -#### imports - -Type: -```ts -type Imports = { - [condition: string]: PathOrMap | readonly PathOrMap[] | null -} - -type PathOrMap = string | Imports -``` - -The [`imports` property](https://nodejs.org/api/packages.html#imports) value in `package.json`. - - -#### request - -Type: `string` - -The request resolve. Assumes a normalized path is passed in (eg. [repeating slashes `//`](https://github.com/nodejs/node/issues/44316)). - -> **Note:** In Node.js, imports resolutions are limited to requests prefixed with `#`. However, this package does not enforce that requirement in case you want to add custom support for non-prefixed entries. - -#### conditions - -Type: `readonly string[]` - -An array of conditions to use when resolving the request. For reference, Node.js's default conditions are [`['node', 'import']`](https://nodejs.org/api/esm.html#:~:text=defaultConditions%20is%20the%20conditional%20environment%20name%20array%2C%20%5B%22node%22%2C%20%22import%22%5D.). - -The order of this array does not matter; the order of condition keys in the import map is what matters instead. - -Not all conditions in the array need to be met to resolve the request. It just needs enough to resolve to a path. - ---- - -### Errors - -#### `ERR_PACKAGE_PATH_NOT_EXPORTED` - - If the request is not exported by the export map - -#### `ERR_PACKAGE_IMPORT_NOT_DEFINED` - - If the request is not defined by the import map - -#### `ERR_INVALID_PACKAGE_CONFIG` - - - If an object contains properties that are both paths and conditions (e.g. start with and without `.`) - - If an object contains numeric properties - -#### `ERR_INVALID_PACKAGE_TARGET` - - If a resolved exports path is not a valid path (e.g. not relative or has protocol) - - If a resolved path includes `..` or `node_modules` - - If a resolved path is a type that cannot be parsed - -## FAQ - -### Why do the APIs return an array of paths? - -`exports`/`imports` supports passing in a [fallback array](https://github.com/jkrems/proposal-pkg-exports/#:~:text=Whenever%20there%20is,to%20new%20cases.) to provide fallback paths if the previous one is invalid: - -```json5 -{ - "exports": { - "./feature": [ - "./file.js", - "./fallback.js" - ] - } -} -``` - -Node.js's implementation [picks the first valid path (without attempting to resolve it)](https://github.com/nodejs/node/issues/44282#issuecomment-1220151715) and throws an error if it can't be resolved. Node.js's fallback array is designed for [forward compatibility with features](https://github.com/jkrems/proposal-pkg-exports/#:~:text=providing%20forwards%20compatiblitiy%20for%20new%20features) (e.g. protocols) that can be immediately/inexpensively validated: - -```json5 -{ - "exports": { - "./core-polyfill": ["std:core-module", "./core-polyfill.js"] - } -} -``` - -However, [Webpack](https://webpack.js.org/guides/package-exports/#alternatives) and [TypeScript](https://github.com/microsoft/TypeScript/blob/71e852922888337ef51a0e48416034a94a6c34d9/src/compiler/moduleSpecifiers.ts#L695) have deviated from this behavior and attempts to resolve the next path if a path cannot be resolved. - -By returning an array of matched paths instead of just the first one, the user can decide which behavior to adopt. - -### How is it different from [`resolve.exports`](https://github.com/lukeed/resolve.exports)? - -`resolve.exports` only resolves `exports`, whereas this package resolves both `exports` & `imports`. This comparison will only cover resolving `exports`. - -- Despite it's name, `resolve.exports` handles more than just `exports`. It takes in the entire `package.json` object to handle resolving `.` and [self-references](https://nodejs.org/api/packages.html#self-referencing-a-package-using-its-name). This package only accepts `exports`/`imports` maps from `package.json` and is scoped to only resolving what's defined in the maps. - -- `resolve.exports` accepts the full request (e.g. `foo/bar`), whereas this package only accepts the requested subpath (e.g. `bar`). - -- `resolve.exports` only returns the first result in a fallback array. This package returns an array of results for the user to decide how to handle it. - -- `resolve.exports` supports [subpath folder mapping](https://nodejs.org/docs/latest-v16.x/api/packages.html#subpath-folder-mappings) (deprecated in Node.js v16 & removed in v17) but seems to [have a bug](https://github.com/lukeed/resolve.exports/issues/7). This package does not support subpath folder mapping because Node.js has removed it in favor of using subpath patterns. - -- Neither resolvers rely on a file-system - -This package also addresses many of the bugs in `resolve.exports`, demonstrated in [this test](/tests/exports/compare-resolve.exports.ts). diff --git a/node_modules/resolve-pkg-maps/dist/index.cjs b/node_modules/resolve-pkg-maps/dist/index.cjs deleted file mode 100755 index 6fe6ba8..0000000 --- a/node_modules/resolve-pkg-maps/dist/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const d=r=>r!==null&&typeof r=="object",s=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),g="ERR_INVALID_PACKAGE_CONFIG",E="ERR_INVALID_PACKAGE_TARGET",I="ERR_PACKAGE_PATH_NOT_EXPORTED",P="ERR_PACKAGE_IMPORT_NOT_DEFINED",R=/^\d+$/,O=/^(\.{1,2}|node_modules)$/i,u=/\/|\\/;var h=(r=>(r.Export="exports",r.Import="imports",r))(h||{});const f=(r,t,n,o,c)=>{if(t==null)return[];if(typeof t=="string"){const[e,...i]=t.split(u);if(e===".."||i.some(l=>O.test(l)))throw s(E,`Invalid "${r}" target "${t}" defined in the package config`);return[c?t.replace(/\*/g,c):t]}if(Array.isArray(t))return t.flatMap(e=>f(r,e,n,o,c));if(d(t)){for(const e of Object.keys(t)){if(R.test(e))throw s(g,"Cannot contain numeric property keys");if(e==="default"||o.includes(e))return f(r,t[e],n,o,c)}return[]}throw s(E,`Invalid "${r}" target "${t}"`)},a="*",v=(r,t)=>{const n=r.indexOf(a),o=t.indexOf(a);return n===o?t.length>r.length:o>n};function A(r,t){if(!t.includes(a)&&r.hasOwnProperty(t))return[t];let n,o;for(const c of Object.keys(r))if(c.includes(a)){const[e,i,l]=c.split(a);if(l===void 0&&t.startsWith(e)&&t.endsWith(i)){const _=t.slice(e.length,-i.length||void 0);_&&(!n||v(n,c))&&(n=c,o=_)}}return[n,o]}const p=r=>Object.keys(r).reduce((t,n)=>{const o=n===""||n[0]!==".";if(t===void 0||t===o)return o;throw s(g,'"exports" cannot contain some keys starting with "." and some not')},void 0),w=/^\w+:/,m=(r,t,n)=>{if(!r)throw new Error('"exports" is required');t=t===""?".":`./${t}`,(typeof r=="string"||Array.isArray(r)||d(r)&&p(r))&&(r={".":r});const[o,c]=A(r,t),e=f(h.Export,r[o],t,n,c);if(e.length===0)throw s(I,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const i of e)if(!i.startsWith("./")&&!w.test(i))throw s(E,`Invalid "exports" target "${i}" defined in the package config`);return e},T=(r,t,n)=>{if(!r)throw new Error('"imports" is required');const[o,c]=A(r,t),e=f(h.Import,r[o],t,n,c);if(e.length===0)throw s(P,`Package import specifier "${t}" is not defined in package`);return e};exports.resolveExports=m,exports.resolveImports=T; diff --git a/node_modules/resolve-pkg-maps/dist/index.d.cts b/node_modules/resolve-pkg-maps/dist/index.d.cts deleted file mode 100644 index fc84489..0000000 --- a/node_modules/resolve-pkg-maps/dist/index.d.cts +++ /dev/null @@ -1,11 +0,0 @@ -type PathConditionsMap = { - [condition: string]: PathConditions | null; -}; -type PathOrMap = string | PathConditionsMap; -type PathConditions = PathOrMap | readonly PathOrMap[]; - -declare const resolveExports: (exports: PathConditions, request: string, conditions: readonly string[]) => string[]; - -declare const resolveImports: (imports: PathConditionsMap, request: string, conditions: readonly string[]) => string[]; - -export { PathConditions, PathConditionsMap, resolveExports, resolveImports }; diff --git a/node_modules/resolve-pkg-maps/dist/index.d.mts b/node_modules/resolve-pkg-maps/dist/index.d.mts deleted file mode 100644 index fc84489..0000000 --- a/node_modules/resolve-pkg-maps/dist/index.d.mts +++ /dev/null @@ -1,11 +0,0 @@ -type PathConditionsMap = { - [condition: string]: PathConditions | null; -}; -type PathOrMap = string | PathConditionsMap; -type PathConditions = PathOrMap | readonly PathOrMap[]; - -declare const resolveExports: (exports: PathConditions, request: string, conditions: readonly string[]) => string[]; - -declare const resolveImports: (imports: PathConditionsMap, request: string, conditions: readonly string[]) => string[]; - -export { PathConditions, PathConditionsMap, resolveExports, resolveImports }; diff --git a/node_modules/resolve-pkg-maps/dist/index.mjs b/node_modules/resolve-pkg-maps/dist/index.mjs deleted file mode 100755 index d2a3be5..0000000 --- a/node_modules/resolve-pkg-maps/dist/index.mjs +++ /dev/null @@ -1 +0,0 @@ -const A=r=>r!==null&&typeof r=="object",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_="ERR_INVALID_PACKAGE_CONFIG",E="ERR_INVALID_PACKAGE_TARGET",I="ERR_PACKAGE_PATH_NOT_EXPORTED",P="ERR_PACKAGE_IMPORT_NOT_DEFINED",R=/^\d+$/,O=/^(\.{1,2}|node_modules)$/i,w=/\/|\\/;var h=(r=>(r.Export="exports",r.Import="imports",r))(h||{});const f=(r,t,e,o,c)=>{if(t==null)return[];if(typeof t=="string"){const[n,...i]=t.split(w);if(n===".."||i.some(l=>O.test(l)))throw a(E,`Invalid "${r}" target "${t}" defined in the package config`);return[c?t.replace(/\*/g,c):t]}if(Array.isArray(t))return t.flatMap(n=>f(r,n,e,o,c));if(A(t)){for(const n of Object.keys(t)){if(R.test(n))throw a(_,"Cannot contain numeric property keys");if(n==="default"||o.includes(n))return f(r,t[n],e,o,c)}return[]}throw a(E,`Invalid "${r}" target "${t}"`)},s="*",m=(r,t)=>{const e=r.indexOf(s),o=t.indexOf(s);return e===o?t.length>r.length:o>e};function d(r,t){if(!t.includes(s)&&r.hasOwnProperty(t))return[t];let e,o;for(const c of Object.keys(r))if(c.includes(s)){const[n,i,l]=c.split(s);if(l===void 0&&t.startsWith(n)&&t.endsWith(i)){const g=t.slice(n.length,-i.length||void 0);g&&(!e||m(e,c))&&(e=c,o=g)}}return[e,o]}const p=r=>Object.keys(r).reduce((t,e)=>{const o=e===""||e[0]!==".";if(t===void 0||t===o)return o;throw a(_,'"exports" cannot contain some keys starting with "." and some not')},void 0),u=/^\w+:/,v=(r,t,e)=>{if(!r)throw new Error('"exports" is required');t=t===""?".":`./${t}`,(typeof r=="string"||Array.isArray(r)||A(r)&&p(r))&&(r={".":r});const[o,c]=d(r,t),n=f(h.Export,r[o],t,e,c);if(n.length===0)throw a(I,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const i of n)if(!i.startsWith("./")&&!u.test(i))throw a(E,`Invalid "exports" target "${i}" defined in the package config`);return n},T=(r,t,e)=>{if(!r)throw new Error('"imports" is required');const[o,c]=d(r,t),n=f(h.Import,r[o],t,e,c);if(n.length===0)throw a(P,`Package import specifier "${t}" is not defined in package`);return n};export{v as resolveExports,T as resolveImports}; diff --git a/node_modules/resolve-pkg-maps/package.json b/node_modules/resolve-pkg-maps/package.json deleted file mode 100644 index 720d984..0000000 --- a/node_modules/resolve-pkg-maps/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "resolve-pkg-maps", - "version": "1.0.0", - "description": "Resolve package.json exports & imports maps", - "keywords": [ - "node.js", - "package.json", - "exports", - "imports" - ], - "license": "MIT", - "repository": "privatenumber/resolve-pkg-maps", - "funding": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1", - "author": { - "name": "Hiroki Osame", - "email": "hiroki.osame@gmail.com" - }, - "type": "module", - "files": [ - "dist" - ], - "main": "./dist/index.cjs", - "module": "./dist/index.mjs", - "types": "./dist/index.d.cts", - "exports": { - "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" - }, - "import": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" - } - }, - "imports": { - "#resolve-pkg-maps": { - "types": "./src/index.ts", - "development": "./src/index.ts", - "default": "./dist/index.mjs" - } - } -} \ No newline at end of file diff --git a/node_modules/router/HISTORY.md b/node_modules/router/HISTORY.md deleted file mode 100644 index b292257..0000000 --- a/node_modules/router/HISTORY.md +++ /dev/null @@ -1,228 +0,0 @@ -2.2.0 / 2025-03-26 -================== - -* Remove `setImmediate` support check -* Restore `debug` dependency - -2.1.0 / 2025-02-10 -================== - -* Updated `engines` field to Node@18 or higher -* Remove `Object.setPrototypeOf` polyfill -* Use `Array.flat` instead of `array-flatten` package -* Replace `methods` dependency with standard library -* deps: parseurl@^1.3.3 -* deps: is-promise@^4.0.0 -* Replace `utils-merge` dependency with `Object.assign` -* deps: Remove unused dep `after` - -2.0.0 / 2024-09-09 -================== - -* Drop support for node <18 -* deps: path-to-regexp@^8.0.0 - - Drop support for partial capture group `router.route('/user(s?)/:user/:op')` but still have optional non-capture `/user{s}/:user/:op` - - `:name?` becomes `{:name}` - - `:name*` becomes `*name`. - - The splat change also changes splat from strings to an array of strings - - Optional splats become `{*name}` - - `:name+` becomes `*name` and thus equivalent to `*name` so I dropped those tests - - Strings as regular expressions are fully removed, need to be converted to native regular expressions - -2.0.0-beta.2 / 2024-03-20 -========================= - -This incorporates all changes after 1.3.5 up to 1.3.8. - - * Add support for returned, rejected Promises to `router.param` - -2.0.0-beta.1 / 2020-03-29 -========================= - -This incorporates all changes after 1.3.3 up to 1.3.5. - - * Internalize private `router.process_params` method - * Remove `debug` dependency - * deps: array-flatten@3.0.0 - * deps: parseurl@~1.3.3 - * deps: path-to-regexp@3.2.0 - - Add new `?`, `*`, and `+` parameter modifiers. - - Matching group expressions are only RegExp syntax. - `(*)` is no longer valid and must be written as `(.*)`, for example. - - Named matching groups no longer available by position in `req.params`. - `/:foo(.*)` only captures as `req.params.foo` and not available as - `req.params[0]`. - - Regular expressions can only be used in a matching group. - `/\\d+` is no longer valid and must be written as `/(\\d+)`. - - Matching groups are now literal regular expressions. - `:foo` named captures can no longer be included inside a capture group. - - Special `*` path segment behavior removed. - `/foo/*/bar` will match a literal `*` as the middle segment. - * deps: setprototypeof@1.2.0 - -2.0.0-alpha.1 / 2018-07-27 -========================== - - * Add basic support for returned, rejected Promises - - Rejected Promises from middleware functions `next(error)` - * Drop support for Node.js below 0.10 - * deps: debug@3.1.0 - - Add `DEBUG_HIDE_DATE` environment variable - - Change timer to per-namespace instead of global - - Change non-TTY date format - - Remove `DEBUG_FD` environment variable support - - Support 256 namespace colors - -1.3.8 / 2023-02-24 -================== - - * Fix routing requests without method - -1.3.7 / 2022-04-28 -================== - - * Fix hanging on large stack of sync routes - -1.3.6 / 2021-11-15 -================== - - * Fix handling very large stacks of sync middleware - * deps: safe-buffer@5.2.1 - -1.3.5 / 2020-03-24 -================== - - * Fix incorrect middleware execution with unanchored `RegExp`s - * perf: use plain object for internal method map - -1.3.4 / 2020-01-24 -================== - - * deps: array-flatten@3.0.0 - * deps: parseurl@~1.3.3 - * deps: setprototypeof@1.2.0 - -1.3.3 / 2018-07-06 -================== - - * Fix JSDoc for `Router` constructor - -1.3.2 / 2017-09-24 -================== - - * deps: debug@2.6.9 - * deps: parseurl@~1.3.2 - - perf: reduce overhead for full URLs - - perf: unroll the "fast-path" `RegExp` - * deps: setprototypeof@1.1.0 - * deps: utils-merge@1.0.1 - -1.3.1 / 2017-05-19 -================== - - * deps: debug@2.6.8 - - Fix `DEBUG_MAX_ARRAY_LENGTH` - - deps: ms@2.0.0 - -1.3.0 / 2017-02-25 -================== - - * Add `next("router")` to exit from router - * Fix case where `router.use` skipped requests routes did not - * Use `%o` in path debug to tell types apart - * deps: setprototypeof@1.0.3 - * perf: add fast match path for `*` route - -1.2.0 / 2017-02-17 -================== - - * Skip routing when `req.url` is not set - * deps: debug@2.6.1 - - Allow colors in workers - - Deprecated `DEBUG_FD` environment variable set to `3` or higher - - Fix error when running under React Native - - Use same color for same namespace - - deps: ms@0.7.2 - -1.1.5 / 2017-01-28 -================== - - * deps: array-flatten@2.1.1 - * deps: setprototypeof@1.0.2 - - Fix using fallback even when native method exists - -1.1.4 / 2016-01-21 -================== - - * deps: array-flatten@2.0.0 - * deps: methods@~1.1.2 - - perf: enable strict mode - * deps: parseurl@~1.3.1 - - perf: enable strict mode - -1.1.3 / 2015-08-02 -================== - - * Fix infinite loop condition using `mergeParams: true` - * Fix inner numeric indices incorrectly altering parent `req.params` - * deps: array-flatten@1.1.1 - - perf: enable strict mode - * deps: path-to-regexp@0.1.7 - - Fix regression with escaped round brackets and matching groups - -1.1.2 / 2015-07-06 -================== - - * Fix hiding platform issues with `decodeURIComponent` - - Only `URIError`s are a 400 - * Fix using `*` before params in routes - * Fix using capture groups before params in routes - * deps: path-to-regexp@0.1.6 - * perf: enable strict mode - * perf: remove argument reassignments in routing - * perf: skip attempting to decode zero length string - * perf: use plain for loops - -1.1.1 / 2015-05-25 -================== - - * Fix issue where `next('route')` in `router.param` would incorrectly skip values - * deps: array-flatten@1.1.0 - * deps: debug@~2.2.0 - - deps: ms@0.7.1 - -1.1.0 / 2015-04-22 -================== - - * Use `setprototypeof` instead of `__proto__` - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - -1.0.0 / 2015-01-13 -================== - - * Fix crash from error within `OPTIONS` response handler - * deps: array-flatten@1.0.2 - - Remove redundant code path - -1.0.0-beta.3 / 2015-01-11 -========================= - - * Fix duplicate methods appearing in OPTIONS responses - * Fix OPTIONS responses to include the HEAD method properly - * Remove support for leading colon in `router.param(name, fn)` - * Use `array-flatten` for flattening arrays - * deps: debug@~2.1.1 - * deps: methods@~1.1.1 - -1.0.0-beta.2 / 2014-11-19 -========================= - - * Match routes iteratively to prevent stack overflows - -1.0.0-beta.1 / 2014-11-16 -========================= - - * Initial release ported from Express 4.x - - Altered to work without Express diff --git a/node_modules/router/LICENSE b/node_modules/router/LICENSE deleted file mode 100644 index 237e1b6..0000000 --- a/node_modules/router/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Roman Shtylman -Copyright (c) 2014-2022 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/router/README.md b/node_modules/router/README.md deleted file mode 100644 index 218fd57..0000000 --- a/node_modules/router/README.md +++ /dev/null @@ -1,416 +0,0 @@ -# router - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Simple middleware-style router - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install router -``` - -## API - -```js -var finalhandler = require('finalhandler') -var http = require('http') -var Router = require('router') - -var router = Router() -router.get('/', function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Hello World!') -}) - -var server = http.createServer(function (req, res) { - router(req, res, finalhandler(req, res)) -}) - -server.listen(3000) -``` - -This module is currently an extracted version from the Express project, -but with the main change being it can be used with a plain `http.createServer` -object or other web frameworks by removing Express-specific API calls. - -## Router(options) - -Options - -- `strict` - When `false` trailing slashes are optional (default: `false`) -- `caseSensitive` - When `true` the routing will be case sensitive. (default: `false`) -- `mergeParams` - When `true` any `req.params` passed to the router will be - merged into the router's `req.params`. (default: `false`) ([example](#example-using-mergeparams)) - -Returns a function with the signature `router(req, res, callback)` where -`callback([err])` must be provided to handle errors and fall-through from -not handling requests. - -### router.use([path], ...middleware) - -Use the given [middleware function](#middleware) for all http methods on the -given `path`, defaulting to the root path. - -`router` does not automatically see `use` as a handler. As such, it will not -consider it one for handling `OPTIONS` requests. - -* Note: If a `path` is specified, that `path` is stripped from the start of - `req.url`. - - - -```js -router.use(function (req, res, next) { - // do your things - - // continue to the next middleware - // the request will stall if this is not called - next() - - // note: you should NOT call `next` if you have begun writing to the response -}) -``` - -[Middleware](#middleware) can themselves use `next('router')` at any time to -exit the current router instance completely, invoking the top-level callback. - -### router\[method](path, ...[middleware], handler) - -The [http methods](https://github.com/jshttp/methods/blob/master/index.js) provide -the routing functionality in `router`. - -Method middleware and handlers follow usual [middleware](#middleware) behavior, -except they will only be called when the method and path match the request. - - - -```js -// handle a `GET` request -router.get('/', function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Hello World!') -}) -``` - -[Middleware](#middleware) given before the handler have one additional trick, -they may invoke `next('route')`. Calling `next('route')` bypasses the remaining -middleware and the handler mounted for this route, passing the request to the -next route suitable for handling this request. - -Route handlers and middleware can themselves use `next('router')` at any time -to exit the current router instance completely, invoking the top-level callback. - -### router.param(name, param_middleware) - -Maps the specified path parameter `name` to a specialized param-capturing middleware. - -This function positions the middleware in the same stack as `.use`. - -The function can optionally return a `Promise` object. If a `Promise` object -is returned from the function, the router will attach an `onRejected` callback -using `.then`. If the promise is rejected, `next` will be called with the -rejected value, or an error if the value is falsy. - -Parameter mapping is used to provide pre-conditions to routes -which use normalized placeholders. For example a _:user_id_ parameter -could automatically load a user's information from the database without -any additional code: - - - -```js -router.param('user_id', function (req, res, next, id) { - User.find(id, function (err, user) { - if (err) { - return next(err) - } else if (!user) { - return next(new Error('failed to load user')) - } - req.user = user - - // continue processing the request - next() - }) -}) -``` - -### router.route(path) - -Creates an instance of a single `Route` for the given `path`. -(See `Router.Route` below) - -Routes can be used to handle http `methods` with their own, optional middleware. - -Using `router.route(path)` is a recommended approach to avoiding duplicate -route naming and thus typo errors. - - - -```js -var api = router.route('/api/') -``` - -## Router.Route(path) - -Represents a single route as an instance that can be used to handle http -`methods` with it's own, optional middleware. - -### route\[method](handler) - -These are functions which you can directly call on a route to register a new -`handler` for the `method` on the route. - - - -```js -// handle a `GET` request -var status = router.route('/status') - -status.get(function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('All Systems Green!') -}) -``` - -### route.all(handler) - -Adds a handler for all HTTP methods to this route. - -The handler can behave like middleware and call `next` to continue processing -rather than responding. - - - -```js -router.route('/') - .all(function (req, res, next) { - next() - }) - .all(checkSomething) - .get(function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Hello World!') - }) -``` - -## Middleware - -Middleware (and method handlers) are functions that follow specific function -parameters and have defined behavior when used with `router`. The most common -format is with three parameters - "req", "res" and "next". - -- `req` - This is a [HTTP incoming message](https://nodejs.org/api/http.html#http_http_incomingmessage) instance. -- `res` - This is a [HTTP server response](https://nodejs.org/api/http.html#http_class_http_serverresponse) instance. -- `next` - Calling this function that tells `router` to proceed to the next matching middleware or method handler. It accepts an error as the first argument. - -The function can optionally return a `Promise` object. If a `Promise` object -is returned from the function, the router will attach an `onRejected` callback -using `.then`. If the promise is rejected, `next` will be called with the -rejected value, or an error if the value is falsy. - -Middleware and method handlers can also be defined with four arguments. When -the function has four parameters defined, the first argument is an error and -subsequent arguments remain, becoming - "err", "req", "res", "next". These -functions are "error handling middleware", and can be used for handling -errors that occurred in previous handlers (E.g. from calling `next(err)`). -This is most used when you want to define arbitrary rendering of errors. - - - -```js -router.get('/error_route', function (req, res, next) { - return next(new Error('Bad Request')) -}) - -router.use(function (err, req, res, next) { - res.end(err.message) //= > "Bad Request" -}) -``` - -Error handling middleware will **only** be invoked when an error was given. As -long as the error is in the pipeline, normal middleware and handlers will be -bypassed - only error handling middleware will be invoked with an error. - -## Examples - -```js -// import our modules -var http = require('http') -var Router = require('router') -var finalhandler = require('finalhandler') -var compression = require('compression') -var bodyParser = require('body-parser') - -// store our message to display -var message = 'Hello World!' - -// initialize the router & server and add a final callback. -var router = Router() -var server = http.createServer(function onRequest (req, res) { - router(req, res, finalhandler(req, res)) -}) - -// use some middleware and compress all outgoing responses -router.use(compression()) - -// handle `GET` requests to `/message` -router.get('/message', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end(message + '\n') -}) - -// create and mount a new router for our API -var api = Router() -router.use('/api/', api) - -// add a body parsing middleware to our API -api.use(bodyParser.json()) - -// handle `PATCH` requests to `/api/set-message` -api.patch('/set-message', function (req, res) { - if (req.body.value) { - message = req.body.value - - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end(message + '\n') - } else { - res.statusCode = 400 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Invalid API Syntax\n') - } -}) - -// make our http server listen to connections -server.listen(8080) -``` - -You can get the message by running this command in your terminal, - or navigating to `127.0.0.1:8080` in a web browser. -```bash -curl http://127.0.0.1:8080 -``` - -You can set the message by sending it a `PATCH` request via this command: -```bash -curl http://127.0.0.1:8080/api/set-message -X PATCH -H "Content-Type: application/json" -d '{"value":"Cats!"}' -``` - -### Example using mergeParams - -```js -var http = require('http') -var Router = require('router') -var finalhandler = require('finalhandler') - -// this example is about the mergeParams option -var opts = { mergeParams: true } - -// make a router with out special options -var router = Router(opts) -var server = http.createServer(function onRequest (req, res) { - // set something to be passed into the router - req.params = { type: 'kitten' } - - router(req, res, finalhandler(req, res)) -}) - -router.get('/', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - - // with respond with the the params that were passed in - res.end(req.params.type + '\n') -}) - -// make another router with our options -var handler = Router(opts) - -// mount our new router to a route that accepts a param -router.use('/:path', handler) - -handler.get('/', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - - // will respond with the param of the router's parent route - res.end(req.params.path + '\n') -}) - -// make our http server listen to connections -server.listen(8080) -``` - -Now you can get the type, or what path you are requesting: -```bash -curl http://127.0.0.1:8080 -> kitten -curl http://127.0.0.1:8080/such_path -> such_path -``` - -### Example of advanced `.route()` usage - -This example shows how to implement routes where there is a custom -handler to execute when the path matched, but no methods matched. -Without any special handling, this would be treated as just a -generic non-match by `router` (which typically results in a 404), -but with a custom handler, a `405 Method Not Allowed` can be sent. - -```js -var http = require('http') -var finalhandler = require('finalhandler') -var Router = require('router') - -// create the router and server -var router = new Router() -var server = http.createServer(function onRequest (req, res) { - router(req, res, finalhandler(req, res)) -}) - -// register a route and add all methods -router.route('/pet/:id') - .get(function (req, res) { - // this is GET /pet/:id - res.setHeader('Content-Type', 'application/json') - res.end(JSON.stringify({ name: 'tobi' })) - }) - .delete(function (req, res) { - // this is DELETE /pet/:id - res.end() - }) - .all(function (req, res) { - // this is called for all other methods not - // defined above for /pet/:id - res.statusCode = 405 - res.end() - }) - -// make our http server listen to connections -server.listen(8080) -``` - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/pillarjs/router/master?label=ci -[ci-url]: https://github.com/pillarjs/router/actions/workflows/ci.yml -[npm-image]: https://img.shields.io/npm/v/router.svg -[npm-url]: https://npmjs.org/package/router -[node-version-image]: https://img.shields.io/node/v/router.svg -[node-version-url]: http://nodejs.org/download/ -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/router/master.svg -[coveralls-url]: https://coveralls.io/r/pillarjs/router?branch=master -[downloads-image]: https://img.shields.io/npm/dm/router.svg -[downloads-url]: https://npmjs.org/package/router diff --git a/node_modules/router/index.js b/node_modules/router/index.js deleted file mode 100644 index 4358aeb..0000000 --- a/node_modules/router/index.js +++ /dev/null @@ -1,748 +0,0 @@ -/*! - * router - * Copyright(c) 2013 Roman Shtylman - * Copyright(c) 2014-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -const isPromise = require('is-promise') -const Layer = require('./lib/layer') -const { METHODS } = require('node:http') -const parseUrl = require('parseurl') -const Route = require('./lib/route') -const debug = require('debug')('router') -const deprecate = require('depd')('router') - -/** - * Module variables. - * @private - */ - -const slice = Array.prototype.slice -const flatten = Array.prototype.flat -const methods = METHODS.map((method) => method.toLowerCase()) - -/** - * Expose `Router`. - */ - -module.exports = Router - -/** - * Expose `Route`. - */ - -module.exports.Route = Route - -/** - * Initialize a new `Router` with the given `options`. - * - * @param {object} [options] - * @return {Router} which is a callable function - * @public - */ - -function Router (options) { - if (!(this instanceof Router)) { - return new Router(options) - } - - const opts = options || {} - - function router (req, res, next) { - router.handle(req, res, next) - } - - // inherit from the correct prototype - Object.setPrototypeOf(router, this) - - router.caseSensitive = opts.caseSensitive - router.mergeParams = opts.mergeParams - router.params = {} - router.strict = opts.strict - router.stack = [] - - return router -} - -/** - * Router prototype inherits from a Function. - */ - -/* istanbul ignore next */ -Router.prototype = function () {} - -/** - * Map the given param placeholder `name`(s) to the given callback. - * - * Parameter mapping is used to provide pre-conditions to routes - * which use normalized placeholders. For example a _:user_id_ parameter - * could automatically load a user's information from the database without - * any additional code. - * - * The callback uses the same signature as middleware, the only difference - * being that the value of the placeholder is passed, in this case the _id_ - * of the user. Once the `next()` function is invoked, just like middleware - * it will continue on to execute the route, or subsequent parameter functions. - * - * Just like in middleware, you must either respond to the request or call next - * to avoid stalling the request. - * - * router.param('user_id', function(req, res, next, id){ - * User.find(id, function(err, user){ - * if (err) { - * return next(err) - * } else if (!user) { - * return next(new Error('failed to load user')) - * } - * req.user = user - * next() - * }) - * }) - * - * @param {string} name - * @param {function} fn - * @public - */ - -Router.prototype.param = function param (name, fn) { - if (!name) { - throw new TypeError('argument name is required') - } - - if (typeof name !== 'string') { - throw new TypeError('argument name must be a string') - } - - if (!fn) { - throw new TypeError('argument fn is required') - } - - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - let params = this.params[name] - - if (!params) { - params = this.params[name] = [] - } - - params.push(fn) - - return this -} - -/** - * Dispatch a req, res into the router. - * - * @private - */ - -Router.prototype.handle = function handle (req, res, callback) { - if (!callback) { - throw new TypeError('argument callback is required') - } - - debug('dispatching %s %s', req.method, req.url) - - let idx = 0 - let methods - const protohost = getProtohost(req.url) || '' - let removed = '' - const self = this - let slashAdded = false - let sync = 0 - const paramcalled = {} - - // middleware and routes - const stack = this.stack - - // manage inter-router variables - const parentParams = req.params - const parentUrl = req.baseUrl || '' - let done = restore(callback, req, 'baseUrl', 'next', 'params') - - // setup next layer - req.next = next - - // for options requests, respond with a default if nothing else responds - if (req.method === 'OPTIONS') { - methods = [] - done = wrap(done, generateOptionsResponder(res, methods)) - } - - // setup basic req values - req.baseUrl = parentUrl - req.originalUrl = req.originalUrl || req.url - - next() - - function next (err) { - let layerError = err === 'route' - ? null - : err - - // remove added slash - if (slashAdded) { - req.url = req.url.slice(1) - slashAdded = false - } - - // restore altered req.url - if (removed.length !== 0) { - req.baseUrl = parentUrl - req.url = protohost + removed + req.url.slice(protohost.length) - removed = '' - } - - // signal to exit router - if (layerError === 'router') { - setImmediate(done, null) - return - } - - // no more matching layers - if (idx >= stack.length) { - setImmediate(done, layerError) - return - } - - // max sync stack - if (++sync > 100) { - return setImmediate(next, err) - } - - // get pathname of request - const path = getPathname(req) - - if (path == null) { - return done(layerError) - } - - // find next matching layer - let layer - let match - let route - - while (match !== true && idx < stack.length) { - layer = stack[idx++] - match = matchLayer(layer, path) - route = layer.route - - if (typeof match !== 'boolean') { - // hold on to layerError - layerError = layerError || match - } - - if (match !== true) { - continue - } - - if (!route) { - // process non-route handlers normally - continue - } - - if (layerError) { - // routes do not match with a pending error - match = false - continue - } - - const method = req.method - const hasMethod = route._handlesMethod(method) - - // build up automatic options response - if (!hasMethod && method === 'OPTIONS' && methods) { - methods.push.apply(methods, route._methods()) - } - - // don't even bother matching route - if (!hasMethod && method !== 'HEAD') { - match = false - } - } - - // no match - if (match !== true) { - return done(layerError) - } - - // store route for dispatch on change - if (route) { - req.route = route - } - - // Capture one-time layer values - req.params = self.mergeParams - ? mergeParams(layer.params, parentParams) - : layer.params - const layerPath = layer.path - - // this should be done for the layer - processParams(self.params, layer, paramcalled, req, res, function (err) { - if (err) { - next(layerError || err) - } else if (route) { - layer.handleRequest(req, res, next) - } else { - trimPrefix(layer, layerError, layerPath, path) - } - - sync = 0 - }) - } - - function trimPrefix (layer, layerError, layerPath, path) { - if (layerPath.length !== 0) { - // Validate path is a prefix match - if (layerPath !== path.substring(0, layerPath.length)) { - next(layerError) - return - } - - // Validate path breaks on a path separator - const c = path[layerPath.length] - if (c && c !== '/') { - next(layerError) - return - } - - // Trim off the part of the url that matches the route - // middleware (.use stuff) needs to have the path stripped - debug('trim prefix (%s) from url %s', layerPath, req.url) - removed = layerPath - req.url = protohost + req.url.slice(protohost.length + removed.length) - - // Ensure leading slash - if (!protohost && req.url[0] !== '/') { - req.url = '/' + req.url - slashAdded = true - } - - // Setup base URL (no trailing slash) - req.baseUrl = parentUrl + (removed[removed.length - 1] === '/' - ? removed.substring(0, removed.length - 1) - : removed) - } - - debug('%s %s : %s', layer.name, layerPath, req.originalUrl) - - if (layerError) { - layer.handleError(layerError, req, res, next) - } else { - layer.handleRequest(req, res, next) - } - } -} - -/** - * Use the given middleware function, with optional path, defaulting to "/". - * - * Use (like `.all`) will run for any http METHOD, but it will not add - * handlers for those methods so OPTIONS requests will not consider `.use` - * functions even if they could respond. - * - * The other difference is that _route_ path is stripped and not visible - * to the handler function. The main effect of this feature is that mounted - * handlers can operate without any code changes regardless of the "prefix" - * pathname. - * - * @public - */ - -Router.prototype.use = function use (handler) { - let offset = 0 - let path = '/' - - // default path to '/' - // disambiguate router.use([handler]) - if (typeof handler !== 'function') { - let arg = handler - - while (Array.isArray(arg) && arg.length !== 0) { - arg = arg[0] - } - - // first arg is the path - if (typeof arg !== 'function') { - offset = 1 - path = handler - } - } - - const callbacks = flatten.call(slice.call(arguments, offset), Infinity) - - if (callbacks.length === 0) { - throw new TypeError('argument handler is required') - } - - for (let i = 0; i < callbacks.length; i++) { - const fn = callbacks[i] - - if (typeof fn !== 'function') { - throw new TypeError('argument handler must be a function') - } - - // add the middleware - debug('use %o %s', path, fn.name || '') - - const layer = new Layer(path, { - sensitive: this.caseSensitive, - strict: false, - end: false - }, fn) - - layer.route = undefined - - this.stack.push(layer) - } - - return this -} - -/** - * Create a new Route for the given path. - * - * Each route contains a separate middleware stack and VERB handlers. - * - * See the Route api documentation for details on adding handlers - * and middleware to routes. - * - * @param {string} path - * @return {Route} - * @public - */ - -Router.prototype.route = function route (path) { - const route = new Route(path) - - const layer = new Layer(path, { - sensitive: this.caseSensitive, - strict: this.strict, - end: true - }, handle) - - function handle (req, res, next) { - route.dispatch(req, res, next) - } - - layer.route = route - - this.stack.push(layer) - return route -} - -// create Router#VERB functions -methods.concat('all').forEach(function (method) { - Router.prototype[method] = function (path) { - const route = this.route(path) - route[method].apply(route, slice.call(arguments, 1)) - return this - } -}) - -/** - * Generate a callback that will make an OPTIONS response. - * - * @param {OutgoingMessage} res - * @param {array} methods - * @private - */ - -function generateOptionsResponder (res, methods) { - return function onDone (fn, err) { - if (err || methods.length === 0) { - return fn(err) - } - - trySendOptionsResponse(res, methods, fn) - } -} - -/** - * Get pathname of request. - * - * @param {IncomingMessage} req - * @private - */ - -function getPathname (req) { - try { - return parseUrl(req).pathname - } catch (err) { - return undefined - } -} - -/** - * Get get protocol + host for a URL. - * - * @param {string} url - * @private - */ - -function getProtohost (url) { - if (typeof url !== 'string' || url.length === 0 || url[0] === '/') { - return undefined - } - - const searchIndex = url.indexOf('?') - const pathLength = searchIndex !== -1 - ? searchIndex - : url.length - const fqdnIndex = url.substring(0, pathLength).indexOf('://') - - return fqdnIndex !== -1 - ? url.substring(0, url.indexOf('/', 3 + fqdnIndex)) - : undefined -} - -/** - * Match path to a layer. - * - * @param {Layer} layer - * @param {string} path - * @private - */ - -function matchLayer (layer, path) { - try { - return layer.match(path) - } catch (err) { - return err - } -} - -/** - * Merge params with parent params - * - * @private - */ - -function mergeParams (params, parent) { - if (typeof parent !== 'object' || !parent) { - return params - } - - // make copy of parent for base - const obj = Object.assign({}, parent) - - // simple non-numeric merging - if (!(0 in params) || !(0 in parent)) { - return Object.assign(obj, params) - } - - let i = 0 - let o = 0 - - // determine numeric gap in params - while (i in params) { - i++ - } - - // determine numeric gap in parent - while (o in parent) { - o++ - } - - // offset numeric indices in params before merge - for (i--; i >= 0; i--) { - params[i + o] = params[i] - - // create holes for the merge when necessary - if (i < o) { - delete params[i] - } - } - - return Object.assign(obj, params) -} - -/** - * Process any parameters for the layer. - * - * @private - */ - -function processParams (params, layer, called, req, res, done) { - // captured parameters from the layer, keys and values - const keys = layer.keys - - // fast track - if (!keys || keys.length === 0) { - return done() - } - - let i = 0 - let paramIndex = 0 - let key - let paramVal - let paramCallbacks - let paramCalled - - // process params in order - // param callbacks can be async - function param (err) { - if (err) { - return done(err) - } - - if (i >= keys.length) { - return done() - } - - paramIndex = 0 - key = keys[i++] - paramVal = req.params[key] - paramCallbacks = params[key] - paramCalled = called[key] - - if (paramVal === undefined || !paramCallbacks) { - return param() - } - - // param previously called with same value or error occurred - if (paramCalled && (paramCalled.match === paramVal || - (paramCalled.error && paramCalled.error !== 'route'))) { - // restore value - req.params[key] = paramCalled.value - - // next param - return param(paramCalled.error) - } - - called[key] = paramCalled = { - error: null, - match: paramVal, - value: paramVal - } - - paramCallback() - } - - // single param callbacks - function paramCallback (err) { - const fn = paramCallbacks[paramIndex++] - - // store updated value - paramCalled.value = req.params[key] - - if (err) { - // store error - paramCalled.error = err - param(err) - return - } - - if (!fn) return param() - - try { - const ret = fn(req, res, paramCallback, paramVal, key) - if (isPromise(ret)) { - if (!(ret instanceof Promise)) { - deprecate('parameters that are Promise-like are deprecated, use a native Promise instead') - } - - ret.then(null, function (error) { - paramCallback(error || new Error('Rejected promise')) - }) - } - } catch (e) { - paramCallback(e) - } - } - - param() -} - -/** - * Restore obj props after function - * - * @private - */ - -function restore (fn, obj) { - const props = new Array(arguments.length - 2) - const vals = new Array(arguments.length - 2) - - for (let i = 0; i < props.length; i++) { - props[i] = arguments[i + 2] - vals[i] = obj[props[i]] - } - - return function () { - // restore vals - for (let i = 0; i < props.length; i++) { - obj[props[i]] = vals[i] - } - - return fn.apply(this, arguments) - } -} - -/** - * Send an OPTIONS response. - * - * @private - */ - -function sendOptionsResponse (res, methods) { - const options = Object.create(null) - - // build unique method map - for (let i = 0; i < methods.length; i++) { - options[methods[i]] = true - } - - // construct the allow list - const allow = Object.keys(options).sort().join(', ') - - // send response - res.setHeader('Allow', allow) - res.setHeader('Content-Length', Buffer.byteLength(allow)) - res.setHeader('Content-Type', 'text/plain') - res.setHeader('X-Content-Type-Options', 'nosniff') - res.end(allow) -} - -/** - * Try to send an OPTIONS response. - * - * @private - */ - -function trySendOptionsResponse (res, methods, next) { - try { - sendOptionsResponse(res, methods) - } catch (err) { - next(err) - } -} - -/** - * Wrap a function - * - * @private - */ - -function wrap (old, fn) { - return function proxy () { - const args = new Array(arguments.length + 1) - - args[0] = old - for (let i = 0, len = arguments.length; i < len; i++) { - args[i + 1] = arguments[i] - } - - fn.apply(this, args) - } -} diff --git a/node_modules/router/lib/layer.js b/node_modules/router/lib/layer.js deleted file mode 100644 index 6a4408f..0000000 --- a/node_modules/router/lib/layer.js +++ /dev/null @@ -1,247 +0,0 @@ -/*! - * router - * Copyright(c) 2013 Roman Shtylman - * Copyright(c) 2014-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -const isPromise = require('is-promise') -const pathRegexp = require('path-to-regexp') -const debug = require('debug')('router:layer') -const deprecate = require('depd')('router') - -/** - * Module variables. - * @private - */ - -const TRAILING_SLASH_REGEXP = /\/+$/ -const MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g - -/** - * Expose `Layer`. - */ - -module.exports = Layer - -function Layer (path, options, fn) { - if (!(this instanceof Layer)) { - return new Layer(path, options, fn) - } - - debug('new %o', path) - const opts = options || {} - - this.handle = fn - this.keys = [] - this.name = fn.name || '' - this.params = undefined - this.path = undefined - this.slash = path === '/' && opts.end === false - - function matcher (_path) { - if (_path instanceof RegExp) { - const keys = [] - let name = 0 - let m - // eslint-disable-next-line no-cond-assign - while (m = MATCHING_GROUP_REGEXP.exec(_path.source)) { - keys.push({ - name: m[1] || name++, - offset: m.index - }) - } - - return function regexpMatcher (p) { - const match = _path.exec(p) - if (!match) { - return false - } - - const params = {} - for (let i = 1; i < match.length; i++) { - const key = keys[i - 1] - const prop = key.name - const val = decodeParam(match[i]) - - if (val !== undefined) { - params[prop] = val - } - } - - return { - params, - path: match[0] - } - } - } - - return pathRegexp.match((opts.strict ? _path : loosen(_path)), { - sensitive: opts.sensitive, - end: opts.end, - trailing: !opts.strict, - decode: decodeParam - }) - } - this.matchers = Array.isArray(path) ? path.map(matcher) : [matcher(path)] -} - -/** - * Handle the error for the layer. - * - * @param {Error} error - * @param {Request} req - * @param {Response} res - * @param {function} next - * @api private - */ - -Layer.prototype.handleError = function handleError (error, req, res, next) { - const fn = this.handle - - if (fn.length !== 4) { - // not a standard error handler - return next(error) - } - - try { - // invoke function - const ret = fn(error, req, res, next) - - // wait for returned promise - if (isPromise(ret)) { - if (!(ret instanceof Promise)) { - deprecate('handlers that are Promise-like are deprecated, use a native Promise instead') - } - - ret.then(null, function (error) { - next(error || new Error('Rejected promise')) - }) - } - } catch (err) { - next(err) - } -} - -/** - * Handle the request for the layer. - * - * @param {Request} req - * @param {Response} res - * @param {function} next - * @api private - */ - -Layer.prototype.handleRequest = function handleRequest (req, res, next) { - const fn = this.handle - - if (fn.length > 3) { - // not a standard request handler - return next() - } - - try { - // invoke function - const ret = fn(req, res, next) - - // wait for returned promise - if (isPromise(ret)) { - if (!(ret instanceof Promise)) { - deprecate('handlers that are Promise-like are deprecated, use a native Promise instead') - } - - ret.then(null, function (error) { - next(error || new Error('Rejected promise')) - }) - } - } catch (err) { - next(err) - } -} - -/** - * Check if this route matches `path`, if so - * populate `.params`. - * - * @param {String} path - * @return {Boolean} - * @api private - */ - -Layer.prototype.match = function match (path) { - let match - - if (path != null) { - // fast path non-ending match for / (any path matches) - if (this.slash) { - this.params = {} - this.path = '' - return true - } - - let i = 0 - while (!match && i < this.matchers.length) { - // match the path - match = this.matchers[i](path) - i++ - } - } - - if (!match) { - this.params = undefined - this.path = undefined - return false - } - - // store values - this.params = match.params - this.path = match.path - this.keys = Object.keys(match.params) - - return true -} - -/** - * Decode param value. - * - * @param {string} val - * @return {string} - * @private - */ - -function decodeParam (val) { - if (typeof val !== 'string' || val.length === 0) { - return val - } - - try { - return decodeURIComponent(val) - } catch (err) { - if (err instanceof URIError) { - err.message = 'Failed to decode param \'' + val + '\'' - err.status = 400 - } - - throw err - } -} - -/** - * Loosens the given path for path-to-regexp matching. - */ -function loosen (path) { - if (path instanceof RegExp || path === '/') { - return path - } - - return Array.isArray(path) - ? path.map(function (p) { return loosen(p) }) - : String(path).replace(TRAILING_SLASH_REGEXP, '') -} diff --git a/node_modules/router/lib/route.js b/node_modules/router/lib/route.js deleted file mode 100644 index 1887d78..0000000 --- a/node_modules/router/lib/route.js +++ /dev/null @@ -1,242 +0,0 @@ -/*! - * router - * Copyright(c) 2013 Roman Shtylman - * Copyright(c) 2014-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -const debug = require('debug')('router:route') -const Layer = require('./layer') -const { METHODS } = require('node:http') - -/** - * Module variables. - * @private - */ - -const slice = Array.prototype.slice -const flatten = Array.prototype.flat -const methods = METHODS.map((method) => method.toLowerCase()) - -/** - * Expose `Route`. - */ - -module.exports = Route - -/** - * Initialize `Route` with the given `path`, - * - * @param {String} path - * @api private - */ - -function Route (path) { - debug('new %o', path) - this.path = path - this.stack = [] - - // route handlers for various http methods - this.methods = Object.create(null) -} - -/** - * @private - */ - -Route.prototype._handlesMethod = function _handlesMethod (method) { - if (this.methods._all) { - return true - } - - // normalize name - let name = typeof method === 'string' - ? method.toLowerCase() - : method - - if (name === 'head' && !this.methods.head) { - name = 'get' - } - - return Boolean(this.methods[name]) -} - -/** - * @return {array} supported HTTP methods - * @private - */ - -Route.prototype._methods = function _methods () { - const methods = Object.keys(this.methods) - - // append automatic head - if (this.methods.get && !this.methods.head) { - methods.push('head') - } - - for (let i = 0; i < methods.length; i++) { - // make upper case - methods[i] = methods[i].toUpperCase() - } - - return methods -} - -/** - * dispatch req, res into this route - * - * @private - */ - -Route.prototype.dispatch = function dispatch (req, res, done) { - let idx = 0 - const stack = this.stack - let sync = 0 - - if (stack.length === 0) { - return done() - } - - let method = typeof req.method === 'string' - ? req.method.toLowerCase() - : req.method - - if (method === 'head' && !this.methods.head) { - method = 'get' - } - - req.route = this - - next() - - function next (err) { - // signal to exit route - if (err && err === 'route') { - return done() - } - - // signal to exit router - if (err && err === 'router') { - return done(err) - } - - // no more matching layers - if (idx >= stack.length) { - return done(err) - } - - // max sync stack - if (++sync > 100) { - return setImmediate(next, err) - } - - let layer - let match - - // find next matching layer - while (match !== true && idx < stack.length) { - layer = stack[idx++] - match = !layer.method || layer.method === method - } - - // no match - if (match !== true) { - return done(err) - } - - if (err) { - layer.handleError(err, req, res, next) - } else { - layer.handleRequest(req, res, next) - } - - sync = 0 - } -} - -/** - * Add a handler for all HTTP verbs to this route. - * - * Behaves just like middleware and can respond or call `next` - * to continue processing. - * - * You can use multiple `.all` call to add multiple handlers. - * - * function check_something(req, res, next){ - * next() - * } - * - * function validate_user(req, res, next){ - * next() - * } - * - * route - * .all(validate_user) - * .all(check_something) - * .get(function(req, res, next){ - * res.send('hello world') - * }) - * - * @param {array|function} handler - * @return {Route} for chaining - * @api public - */ - -Route.prototype.all = function all (handler) { - const callbacks = flatten.call(slice.call(arguments), Infinity) - - if (callbacks.length === 0) { - throw new TypeError('argument handler is required') - } - - for (let i = 0; i < callbacks.length; i++) { - const fn = callbacks[i] - - if (typeof fn !== 'function') { - throw new TypeError('argument handler must be a function') - } - - const layer = Layer('/', {}, fn) - layer.method = undefined - - this.methods._all = true - this.stack.push(layer) - } - - return this -} - -methods.forEach(function (method) { - Route.prototype[method] = function (handler) { - const callbacks = flatten.call(slice.call(arguments), Infinity) - - if (callbacks.length === 0) { - throw new TypeError('argument handler is required') - } - - for (let i = 0; i < callbacks.length; i++) { - const fn = callbacks[i] - - if (typeof fn !== 'function') { - throw new TypeError('argument handler must be a function') - } - - debug('%s %s', method, this.path) - - const layer = Layer('/', {}, fn) - layer.method = method - - this.methods[method] = true - this.stack.push(layer) - } - - return this - } -}) diff --git a/node_modules/router/package.json b/node_modules/router/package.json deleted file mode 100644 index 123eca2..0000000 --- a/node_modules/router/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "router", - "description": "Simple middleware-style router", - "version": "2.2.0", - "author": "Douglas Christopher Wilson ", - "contributors": [ - "Blake Embrey " - ], - "license": "MIT", - "repository": "pillarjs/router", - "dependencies": { - "debug": "^4.4.0", - "depd": "^2.0.0", - "is-promise": "^4.0.0", - "parseurl": "^1.3.3", - "path-to-regexp": "^8.0.0" - }, - "devDependencies": { - "finalhandler": "^2.1.0", - "mocha": "10.2.0", - "nyc": "15.1.0", - "run-series": "^1.1.9", - "standard": "^17.1.0", - "supertest": "6.3.3" - }, - "files": [ - "lib/", - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "engines": { - "node": ">= 18" - }, - "scripts": { - "lint": "standard", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test:debug": "mocha --reporter spec --bail --check-leaks test/ --inspect --inspect-brk", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/safer-buffer/LICENSE b/node_modules/safer-buffer/LICENSE deleted file mode 100644 index 4fe9e6f..0000000 --- a/node_modules/safer-buffer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Nikita Skovoroda - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/safer-buffer/Porting-Buffer.md b/node_modules/safer-buffer/Porting-Buffer.md deleted file mode 100644 index 68d86ba..0000000 --- a/node_modules/safer-buffer/Porting-Buffer.md +++ /dev/null @@ -1,268 +0,0 @@ -# Porting to the Buffer.from/Buffer.alloc API - - -## Overview - -- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*) -- [Variant 2: Use a polyfill](#variant-2) -- [Variant 3: manual detection, with safeguards](#variant-3) - -### Finding problematic bits of code using grep - -Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`. - -It will find all the potentially unsafe places in your own code (with some considerably unlikely -exceptions). - -### Finding problematic bits of code using Node.js 8 - -If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code: - -- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js. -- `--trace-deprecation` does the same thing, but only for deprecation warnings. -- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8. - -You can set these flags using an environment variable: - -```console -$ export NODE_OPTIONS='--trace-warnings --pending-deprecation' -$ cat example.js -'use strict'; -const foo = new Buffer('foo'); -$ node example.js -(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead. - at showFlaggedDeprecation (buffer.js:127:13) - at new Buffer (buffer.js:148:3) - at Object. (/path/to/example.js:2:13) - [... more stack trace lines ...] -``` - -### Finding problematic bits of code using linters - -Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) -or -[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) -also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets. - -There is a drawback, though, that it doesn't always -[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is -overriden e.g. with a polyfill, so recommended is a combination of this and some other method -described above. - - -## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x. - -This is the recommended solution nowadays that would imply only minimal overhead. - -The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible. - -What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way: - -- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`. -- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`). -- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`. - -Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than -`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling. - -Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) -or -[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) -is recommended to avoid accidential unsafe Buffer API usage. - -There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005) -for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`. -Note that it currently only works with cases where the arguments are literals or where the -constructor is invoked with two arguments. - -_If you currently support those older Node.js versions and dropping them would be a semver-major change -for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2) -or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive -the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and -your users will not observe a runtime deprecation warning when running your code on Node.js 10._ - - -## Variant 2: Use a polyfill - -Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older -Node.js versions. - -You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill -`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api. - -Make sure that you do not use old `new Buffer` API — in any files where the line above is added, -using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though. - -Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or -[buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) — -those are great, the only downsides being 4 deps in the tree and slightly more code changes to -migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only -`Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies. - -_Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also -provides a polyfill, but takes a different approach which has -[it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you -to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as -it is problematic, can cause issues in your code, and will start emitting runtime deprecation -warnings starting with Node.js 10._ - -Note that in either case, it is important that you also remove all calls to the old Buffer -API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides -a polyfill for the new API. I have seen people doing that mistake. - -Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) -or -[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) -is recommended. - -_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._ - - -## Variant 3 — manual detection, with safeguards - -This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own -wrapper around them. - -### Buffer(0) - -This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which -returns the same result all the way down to Node.js 0.8.x. - -### Buffer(notNumber) - -Before: - -```js -var buf = new Buffer(notNumber, encoding); -``` - -After: - -```js -var buf; -if (Buffer.from && Buffer.from !== Uint8Array.from) { - buf = Buffer.from(notNumber, encoding); -} else { - if (typeof notNumber === 'number') - throw new Error('The "size" argument must be of type number.'); - buf = new Buffer(notNumber, encoding); -} -``` - -`encoding` is optional. - -Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not -hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the -Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous -security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create -problems ranging from DoS to leaking sensitive information to the attacker from the process memory. - -When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can -be omitted. - -Also note that using TypeScript does not fix this problem for you — when libs written in -`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as -all type checks are translation-time only and are not present in the actual JS code which TS -compiles to. - -### Buffer(number) - -For Node.js 0.10.x (and below) support: - -```js -var buf; -if (Buffer.alloc) { - buf = Buffer.alloc(number); -} else { - buf = new Buffer(number); - buf.fill(0); -} -``` - -Otherwise (Node.js ≥ 0.12.x): - -```js -const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0); -``` - -## Regarding Buffer.allocUnsafe - -Be extra cautious when using `Buffer.allocUnsafe`: - * Don't use it if you don't have a good reason to - * e.g. you probably won't ever see a performance difference for small buffers, in fact, those - might be even faster with `Buffer.alloc()`, - * if your code is not in the hot code path — you also probably won't notice a difference, - * keep in mind that zero-filling minimizes the potential risks. - * If you use it, make sure that you never return the buffer in a partially-filled state, - * if you are writing to it sequentially — always truncate it to the actuall written length - -Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues, -ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs) -leaking to the remote attacker. - -_Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js -version (and lacking type checks also adds DoS to the list of potential problems)._ - - -## FAQ - - -### What is wrong with the `Buffer` constructor? - -The `Buffer` constructor could be used to create a buffer in many different ways: - -- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained - *arbitrary memory* for performance reasons, which could include anything ranging from - program source code to passwords and encryption keys. -- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of - the string `'abc'`. A second argument could specify another encoding: For example, - `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original - sequence of bytes that it represents. -- There are several other combinations of arguments. - -This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell -what exactly the contents of the generated buffer are* without knowing the type of `foo`. - -Sometimes, the value of `foo` comes from an external source. For example, this function -could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form: - -``` -function stringToBase64(req, res) { - // The request body should have the format of `{ string: 'foobar' }` - const rawBytes = new Buffer(req.body.string) - const encoded = rawBytes.toString('base64') - res.end({ encoded: encoded }) -} -``` - -Note that this code does *not* validate the type of `req.body.string`: - -- `req.body.string` is expected to be a string. If this is the case, all goes well. -- `req.body.string` is controlled by the client that sends the request. -- If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes: - - Before Node.js 8, the content would be uninitialized - - After Node.js 8, the content would be `50` bytes with the value `0` - -Because of the missing type check, an attacker could intentionally send a number -as part of the request. Using this, they can either: - -- Read uninitialized memory. This **will** leak passwords, encryption keys and other - kinds of sensitive information. (Information leak) -- Force the program to allocate a large amount of memory. For example, when specifying - `500000000` as the input value, each request will allocate 500MB of memory. - This can be used to either exhaust the memory available of a program completely - and make it crash, or slow it down significantly. (Denial of Service) - -Both of these scenarios are considered serious security issues in a real-world -web server context. - -when using `Buffer.from(req.body.string)` instead, passing a number will always -throw an exception instead, giving a controlled behaviour that can always be -handled by the program. - - -### The `Buffer()` constructor has been deprecated for a while. Is this really an issue? - -Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still -widely used. This includes new code, and overall usage of such code has actually been -*increasing*. diff --git a/node_modules/safer-buffer/Readme.md b/node_modules/safer-buffer/Readme.md deleted file mode 100644 index 14b0822..0000000 --- a/node_modules/safer-buffer/Readme.md +++ /dev/null @@ -1,156 +0,0 @@ -# safer-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![javascript style guide][standard-image]][standard-url] [![Security Responsible Disclosure][secuirty-image]][secuirty-url] - -[travis-image]: https://travis-ci.org/ChALkeR/safer-buffer.svg?branch=master -[travis-url]: https://travis-ci.org/ChALkeR/safer-buffer -[npm-image]: https://img.shields.io/npm/v/safer-buffer.svg -[npm-url]: https://npmjs.org/package/safer-buffer -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com -[secuirty-image]: https://img.shields.io/badge/Security-Responsible%20Disclosure-green.svg -[secuirty-url]: https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md - -Modern Buffer API polyfill without footguns, working on Node.js from 0.8 to current. - -## How to use? - -First, port all `Buffer()` and `new Buffer()` calls to `Buffer.alloc()` and `Buffer.from()` API. - -Then, to achieve compatibility with outdated Node.js versions (`<4.5.0` and 5.x `<5.9.0`), use -`const Buffer = require('safer-buffer').Buffer` in all files where you make calls to the new -Buffer API. _Use `var` instead of `const` if you need that for your Node.js version range support._ - -Also, see the -[porting Buffer](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) guide. - -## Do I need it? - -Hopefully, not — dropping support for outdated Node.js versions should be fine nowdays, and that -is the recommended path forward. You _do_ need to port to the `Buffer.alloc()` and `Buffer.from()` -though. - -See the [porting guide](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) -for a better description. - -## Why not [safe-buffer](https://npmjs.com/safe-buffer)? - -_In short: while `safe-buffer` serves as a polyfill for the new API, it allows old API usage and -itself contains footguns._ - -`safe-buffer` could be used safely to get the new API while still keeping support for older -Node.js versions (like this module), but while analyzing ecosystem usage of the old Buffer API -I found out that `safe-buffer` is itself causing problems in some cases. - -For example, consider the following snippet: - -```console -$ cat example.unsafe.js -console.log(Buffer(20)) -$ ./node-v6.13.0-linux-x64/bin/node example.unsafe.js - -$ standard example.unsafe.js -standard: Use JavaScript Standard Style (https://standardjs.com) - /home/chalker/repo/safer-buffer/example.unsafe.js:2:13: 'Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead. -``` - -This is allocates and writes to console an uninitialized chunk of memory. -[standard](https://www.npmjs.com/package/standard) linter (among others) catch that and warn people -to avoid using unsafe API. - -Let's now throw in `safe-buffer`! - -```console -$ cat example.safe-buffer.js -const Buffer = require('safe-buffer').Buffer -console.log(Buffer(20)) -$ standard example.safe-buffer.js -$ ./node-v6.13.0-linux-x64/bin/node example.safe-buffer.js - -``` - -See the problem? Adding in `safe-buffer` _magically removes the lint warning_, but the behavior -remains identiсal to what we had before, and when launched on Node.js 6.x LTS — this dumps out -chunks of uninitialized memory. -_And this code will still emit runtime warnings on Node.js 10.x and above._ - -That was done by design. I first considered changing `safe-buffer`, prohibiting old API usage or -emitting warnings on it, but that significantly diverges from `safe-buffer` design. After some -discussion, it was decided to move my approach into a separate package, and _this is that separate -package_. - -This footgun is not imaginary — I observed top-downloaded packages doing that kind of thing, -«fixing» the lint warning by blindly including `safe-buffer` without any actual changes. - -Also in some cases, even if the API _was_ migrated to use of safe Buffer API — a random pull request -can bring unsafe Buffer API usage back to the codebase by adding new calls — and that could go -unnoticed even if you have a linter prohibiting that (becase of the reason stated above), and even -pass CI. _I also observed that being done in popular packages._ - -Some examples: - * [webdriverio](https://github.com/webdriverio/webdriverio/commit/05cbd3167c12e4930f09ef7cf93b127ba4effae4#diff-124380949022817b90b622871837d56cR31) - (a module with 548 759 downloads/month), - * [websocket-stream](https://github.com/maxogden/websocket-stream/commit/c9312bd24d08271687d76da0fe3c83493871cf61) - (218 288 d/m, fix in [maxogden/websocket-stream#142](https://github.com/maxogden/websocket-stream/pull/142)), - * [node-serialport](https://github.com/node-serialport/node-serialport/commit/e8d9d2b16c664224920ce1c895199b1ce2def48c) - (113 138 d/m, fix in [node-serialport/node-serialport#1510](https://github.com/node-serialport/node-serialport/pull/1510)), - * [karma](https://github.com/karma-runner/karma/commit/3d94b8cf18c695104ca195334dc75ff054c74eec) - (3 973 193 d/m, fix in [karma-runner/karma#2947](https://github.com/karma-runner/karma/pull/2947)), - * [spdy-transport](https://github.com/spdy-http2/spdy-transport/commit/5375ac33f4a62a4f65bcfc2827447d42a5dbe8b1) - (5 970 727 d/m, fix in [spdy-http2/spdy-transport#53](https://github.com/spdy-http2/spdy-transport/pull/53)). - * And there are a lot more over the ecosystem. - -I filed a PR at -[mysticatea/eslint-plugin-node#110](https://github.com/mysticatea/eslint-plugin-node/pull/110) to -partially fix that (for cases when that lint rule is used), but it is a semver-major change for -linter rules and presets, so it would take significant time for that to reach actual setups. -_It also hasn't been released yet (2018-03-20)._ - -Also, `safer-buffer` discourages the usage of `.allocUnsafe()`, which is often done by a mistake. -It still supports it with an explicit concern barier, by placing it under -`require('safer-buffer/dangereous')`. - -## But isn't throwing bad? - -Not really. It's an error that could be noticed and fixed early, instead of causing havoc later like -unguarded `new Buffer()` calls that end up receiving user input can do. - -This package affects only the files where `var Buffer = require('safer-buffer').Buffer` was done, so -it is really simple to keep track of things and make sure that you don't mix old API usage with that. -Also, CI should hint anything that you might have missed. - -New commits, if tested, won't land new usage of unsafe Buffer API this way. -_Node.js 10.x also deals with that by printing a runtime depecation warning._ - -### Would it affect third-party modules? - -No, unless you explicitly do an awful thing like monkey-patching or overriding the built-in `Buffer`. -Don't do that. - -### But I don't want throwing… - -That is also fine! - -Also, it could be better in some cases when you don't comprehensive enough test coverage. - -In that case — just don't override `Buffer` and use -`var SaferBuffer = require('safer-buffer').Buffer` instead. - -That way, everything using `Buffer` natively would still work, but there would be two drawbacks: - -* `Buffer.from`/`Buffer.alloc` won't be polyfilled — use `SaferBuffer.from` and - `SaferBuffer.alloc` instead. -* You are still open to accidentally using the insecure deprecated API — use a linter to catch that. - -Note that using a linter to catch accidential `Buffer` constructor usage in this case is strongly -recommended. `Buffer` is not overriden in this usecase, so linters won't get confused. - -## «Without footguns»? - -Well, it is still possible to do _some_ things with `Buffer` API, e.g. accessing `.buffer` property -on older versions and duping things from there. You shouldn't do that in your code, probabably. - -The intention is to remove the most significant footguns that affect lots of packages in the -ecosystem, and to do it in the proper way. - -Also, this package doesn't protect against security issues affecting some Node.js versions, so for -usage in your own production code, it is still recommended to update to a Node.js version -[supported by upstream](https://github.com/nodejs/release#release-schedule). diff --git a/node_modules/safer-buffer/dangerous.js b/node_modules/safer-buffer/dangerous.js deleted file mode 100644 index ca41fdc..0000000 --- a/node_modules/safer-buffer/dangerous.js +++ /dev/null @@ -1,58 +0,0 @@ -/* eslint-disable node/no-deprecated-api */ - -'use strict' - -var buffer = require('buffer') -var Buffer = buffer.Buffer -var safer = require('./safer.js') -var Safer = safer.Buffer - -var dangerous = {} - -var key - -for (key in safer) { - if (!safer.hasOwnProperty(key)) continue - dangerous[key] = safer[key] -} - -var Dangereous = dangerous.Buffer = {} - -// Copy Safer API -for (key in Safer) { - if (!Safer.hasOwnProperty(key)) continue - Dangereous[key] = Safer[key] -} - -// Copy those missing unsafe methods, if they are present -for (key in Buffer) { - if (!Buffer.hasOwnProperty(key)) continue - if (Dangereous.hasOwnProperty(key)) continue - Dangereous[key] = Buffer[key] -} - -if (!Dangereous.allocUnsafe) { - Dangereous.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) - } - if (size < 0 || size >= 2 * (1 << 30)) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } - return Buffer(size) - } -} - -if (!Dangereous.allocUnsafeSlow) { - Dangereous.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) - } - if (size < 0 || size >= 2 * (1 << 30)) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } - return buffer.SlowBuffer(size) - } -} - -module.exports = dangerous diff --git a/node_modules/safer-buffer/package.json b/node_modules/safer-buffer/package.json deleted file mode 100644 index d452b04..0000000 --- a/node_modules/safer-buffer/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "safer-buffer", - "version": "2.1.2", - "description": "Modern Buffer API polyfill without footguns", - "main": "safer.js", - "scripts": { - "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", - "test": "standard && tape tests.js" - }, - "author": { - "name": "Nikita Skovoroda", - "email": "chalkerx@gmail.com", - "url": "https://github.com/ChALkeR" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/ChALkeR/safer-buffer.git" - }, - "bugs": { - "url": "https://github.com/ChALkeR/safer-buffer/issues" - }, - "devDependencies": { - "standard": "^11.0.1", - "tape": "^4.9.0" - }, - "files": [ - "Porting-Buffer.md", - "Readme.md", - "tests.js", - "dangerous.js", - "safer.js" - ] -} diff --git a/node_modules/safer-buffer/safer.js b/node_modules/safer-buffer/safer.js deleted file mode 100644 index 37c7e1a..0000000 --- a/node_modules/safer-buffer/safer.js +++ /dev/null @@ -1,77 +0,0 @@ -/* eslint-disable node/no-deprecated-api */ - -'use strict' - -var buffer = require('buffer') -var Buffer = buffer.Buffer - -var safer = {} - -var key - -for (key in buffer) { - if (!buffer.hasOwnProperty(key)) continue - if (key === 'SlowBuffer' || key === 'Buffer') continue - safer[key] = buffer[key] -} - -var Safer = safer.Buffer = {} -for (key in Buffer) { - if (!Buffer.hasOwnProperty(key)) continue - if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue - Safer[key] = Buffer[key] -} - -safer.Buffer.prototype = Buffer.prototype - -if (!Safer.from || Safer.from === Uint8Array.from) { - Safer.from = function (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) - } - if (value && typeof value.length === 'undefined') { - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) - } - return Buffer(value, encodingOrOffset, length) - } -} - -if (!Safer.alloc) { - Safer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) - } - if (size < 0 || size >= 2 * (1 << 30)) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } - var buf = Buffer(size) - if (!fill || fill.length === 0) { - buf.fill(0) - } else if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - return buf - } -} - -if (!safer.kStringMaxLength) { - try { - safer.kStringMaxLength = process.binding('buffer').kStringMaxLength - } catch (e) { - // we can't determine kStringMaxLength in environments where process.binding - // is unsupported, so let's not set it - } -} - -if (!safer.constants) { - safer.constants = { - MAX_LENGTH: safer.kMaxLength - } - if (safer.kStringMaxLength) { - safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength - } -} - -module.exports = safer diff --git a/node_modules/safer-buffer/tests.js b/node_modules/safer-buffer/tests.js deleted file mode 100644 index 7ed2777..0000000 --- a/node_modules/safer-buffer/tests.js +++ /dev/null @@ -1,406 +0,0 @@ -/* eslint-disable node/no-deprecated-api */ - -'use strict' - -var test = require('tape') - -var buffer = require('buffer') - -var index = require('./') -var safer = require('./safer') -var dangerous = require('./dangerous') - -/* Inheritance tests */ - -test('Default is Safer', function (t) { - t.equal(index, safer) - t.notEqual(safer, dangerous) - t.notEqual(index, dangerous) - t.end() -}) - -test('Is not a function', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.equal(typeof impl, 'object') - t.equal(typeof impl.Buffer, 'object') - }); - [buffer].forEach(function (impl) { - t.equal(typeof impl, 'object') - t.equal(typeof impl.Buffer, 'function') - }) - t.end() -}) - -test('Constructor throws', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.throws(function () { impl.Buffer() }) - t.throws(function () { impl.Buffer(0) }) - t.throws(function () { impl.Buffer('a') }) - t.throws(function () { impl.Buffer('a', 'utf-8') }) - t.throws(function () { return new impl.Buffer() }) - t.throws(function () { return new impl.Buffer(0) }) - t.throws(function () { return new impl.Buffer('a') }) - t.throws(function () { return new impl.Buffer('a', 'utf-8') }) - }) - t.end() -}) - -test('Safe methods exist', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.equal(typeof impl.Buffer.alloc, 'function', 'alloc') - t.equal(typeof impl.Buffer.from, 'function', 'from') - }) - t.end() -}) - -test('Unsafe methods exist only in Dangerous', function (t) { - [index, safer].forEach(function (impl) { - t.equal(typeof impl.Buffer.allocUnsafe, 'undefined') - t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined') - }); - [dangerous].forEach(function (impl) { - t.equal(typeof impl.Buffer.allocUnsafe, 'function') - t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function') - }) - t.end() -}) - -test('Generic methods/properties are defined and equal', function (t) { - ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) { - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl.Buffer[method], buffer.Buffer[method], method) - t.notEqual(typeof impl.Buffer[method], 'undefined', method) - }) - }) - t.end() -}) - -test('Built-in buffer static methods/properties are inherited', function (t) { - Object.keys(buffer).forEach(function (method) { - if (method === 'SlowBuffer' || method === 'Buffer') return; - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl[method], buffer[method], method) - t.notEqual(typeof impl[method], 'undefined', method) - }) - }) - t.end() -}) - -test('Built-in Buffer static methods/properties are inherited', function (t) { - Object.keys(buffer.Buffer).forEach(function (method) { - if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl.Buffer[method], buffer.Buffer[method], method) - t.notEqual(typeof impl.Buffer[method], 'undefined', method) - }) - }) - t.end() -}) - -test('.prototype property of Buffer is inherited', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype') - t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype') - }) - t.end() -}) - -test('All Safer methods are present in Dangerous', function (t) { - Object.keys(safer).forEach(function (method) { - if (method === 'Buffer') return; - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl[method], safer[method], method) - if (method !== 'kStringMaxLength') { - t.notEqual(typeof impl[method], 'undefined', method) - } - }) - }) - Object.keys(safer.Buffer).forEach(function (method) { - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl.Buffer[method], safer.Buffer[method], method) - t.notEqual(typeof impl.Buffer[method], 'undefined', method) - }) - }) - t.end() -}) - -test('Safe methods from Dangerous methods are present in Safer', function (t) { - Object.keys(dangerous).forEach(function (method) { - if (method === 'Buffer') return; - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl[method], dangerous[method], method) - if (method !== 'kStringMaxLength') { - t.notEqual(typeof impl[method], 'undefined', method) - } - }) - }) - Object.keys(dangerous.Buffer).forEach(function (method) { - if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl.Buffer[method], dangerous.Buffer[method], method) - t.notEqual(typeof impl.Buffer[method], 'undefined', method) - }) - }) - t.end() -}) - -/* Behaviour tests */ - -test('Methods return Buffers', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a'))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x'))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab'))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(''))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string'))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8'))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3]))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3])))) - t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([]))) - }); - ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { - t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0))) - t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10))) - }) - t.end() -}) - -test('Constructor is buffer.Buffer', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer) - t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer) - t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer) - t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer) - t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer) - t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer) - t.equal(impl.Buffer.from('').constructor, buffer.Buffer) - t.equal(impl.Buffer.from('string').constructor, buffer.Buffer) - t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer) - t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer) - t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer) - t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer) - t.equal(impl.Buffer.from([]).constructor, buffer.Buffer) - }); - [0, 10, 100].forEach(function (arg) { - t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer) - t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor) - }) - t.end() -}) - -test('Invalid calls throw', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.throws(function () { impl.Buffer.from(0) }) - t.throws(function () { impl.Buffer.from(10) }) - t.throws(function () { impl.Buffer.from(10, 'utf-8') }) - t.throws(function () { impl.Buffer.from('string', 'invalid encoding') }) - t.throws(function () { impl.Buffer.from(-10) }) - t.throws(function () { impl.Buffer.from(1e90) }) - t.throws(function () { impl.Buffer.from(Infinity) }) - t.throws(function () { impl.Buffer.from(-Infinity) }) - t.throws(function () { impl.Buffer.from(NaN) }) - t.throws(function () { impl.Buffer.from(null) }) - t.throws(function () { impl.Buffer.from(undefined) }) - t.throws(function () { impl.Buffer.from() }) - t.throws(function () { impl.Buffer.from({}) }) - t.throws(function () { impl.Buffer.alloc('') }) - t.throws(function () { impl.Buffer.alloc('string') }) - t.throws(function () { impl.Buffer.alloc('string', 'utf-8') }) - t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') }) - t.throws(function () { impl.Buffer.alloc(-10) }) - t.throws(function () { impl.Buffer.alloc(1e90) }) - t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) }) - t.throws(function () { impl.Buffer.alloc(Infinity) }) - t.throws(function () { impl.Buffer.alloc(-Infinity) }) - t.throws(function () { impl.Buffer.alloc(null) }) - t.throws(function () { impl.Buffer.alloc(undefined) }) - t.throws(function () { impl.Buffer.alloc() }) - t.throws(function () { impl.Buffer.alloc([]) }) - t.throws(function () { impl.Buffer.alloc([0, 42, 3]) }) - t.throws(function () { impl.Buffer.alloc({}) }) - }); - ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { - t.throws(function () { dangerous.Buffer[method]('') }) - t.throws(function () { dangerous.Buffer[method]('string') }) - t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') }) - t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) }) - t.throws(function () { dangerous.Buffer[method](Infinity) }) - if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) { - t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0') - } else { - t.throws(function () { dangerous.Buffer[method](-10) }) - t.throws(function () { dangerous.Buffer[method](-1e90) }) - t.throws(function () { dangerous.Buffer[method](-Infinity) }) - } - t.throws(function () { dangerous.Buffer[method](null) }) - t.throws(function () { dangerous.Buffer[method](undefined) }) - t.throws(function () { dangerous.Buffer[method]() }) - t.throws(function () { dangerous.Buffer[method]([]) }) - t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) }) - t.throws(function () { dangerous.Buffer[method]({}) }) - }) - t.end() -}) - -test('Buffers have appropriate lengths', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.equal(impl.Buffer.alloc(0).length, 0) - t.equal(impl.Buffer.alloc(10).length, 10) - t.equal(impl.Buffer.from('').length, 0) - t.equal(impl.Buffer.from('string').length, 6) - t.equal(impl.Buffer.from('string', 'utf-8').length, 6) - t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11) - t.equal(impl.Buffer.from([0, 42, 3]).length, 3) - t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3) - t.equal(impl.Buffer.from([]).length, 0) - }); - ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { - t.equal(dangerous.Buffer[method](0).length, 0) - t.equal(dangerous.Buffer[method](10).length, 10) - }) - t.end() -}) - -test('Buffers have appropriate lengths (2)', function (t) { - t.equal(index.Buffer.alloc, safer.Buffer.alloc) - t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) - var ok = true; - [ safer.Buffer.alloc, - dangerous.Buffer.allocUnsafe, - dangerous.Buffer.allocUnsafeSlow - ].forEach(function (method) { - for (var i = 0; i < 1e2; i++) { - var length = Math.round(Math.random() * 1e5) - var buf = method(length) - if (!buffer.Buffer.isBuffer(buf)) ok = false - if (buf.length !== length) ok = false - } - }) - t.ok(ok) - t.end() -}) - -test('.alloc(size) is zero-filled and has correct length', function (t) { - t.equal(index.Buffer.alloc, safer.Buffer.alloc) - t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) - var ok = true - for (var i = 0; i < 1e2; i++) { - var length = Math.round(Math.random() * 2e6) - var buf = index.Buffer.alloc(length) - if (!buffer.Buffer.isBuffer(buf)) ok = false - if (buf.length !== length) ok = false - var j - for (j = 0; j < length; j++) { - if (buf[j] !== 0) ok = false - } - buf.fill(1) - for (j = 0; j < length; j++) { - if (buf[j] !== 1) ok = false - } - } - t.ok(ok) - t.end() -}) - -test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) { - ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { - var ok = true - for (var i = 0; i < 1e2; i++) { - var length = Math.round(Math.random() * 2e6) - var buf = dangerous.Buffer[method](length) - if (!buffer.Buffer.isBuffer(buf)) ok = false - if (buf.length !== length) ok = false - buf.fill(0, 0, length) - var j - for (j = 0; j < length; j++) { - if (buf[j] !== 0) ok = false - } - buf.fill(1, 0, length) - for (j = 0; j < length; j++) { - if (buf[j] !== 1) ok = false - } - } - t.ok(ok, method) - }) - t.end() -}) - -test('.alloc(size, fill) is `fill`-filled', function (t) { - t.equal(index.Buffer.alloc, safer.Buffer.alloc) - t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) - var ok = true - for (var i = 0; i < 1e2; i++) { - var length = Math.round(Math.random() * 2e6) - var fill = Math.round(Math.random() * 255) - var buf = index.Buffer.alloc(length, fill) - if (!buffer.Buffer.isBuffer(buf)) ok = false - if (buf.length !== length) ok = false - for (var j = 0; j < length; j++) { - if (buf[j] !== fill) ok = false - } - } - t.ok(ok) - t.end() -}) - -test('.alloc(size, fill) is `fill`-filled', function (t) { - t.equal(index.Buffer.alloc, safer.Buffer.alloc) - t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) - var ok = true - for (var i = 0; i < 1e2; i++) { - var length = Math.round(Math.random() * 2e6) - var fill = Math.round(Math.random() * 255) - var buf = index.Buffer.alloc(length, fill) - if (!buffer.Buffer.isBuffer(buf)) ok = false - if (buf.length !== length) ok = false - for (var j = 0; j < length; j++) { - if (buf[j] !== fill) ok = false - } - } - t.ok(ok) - t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97)) - t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98)) - - var tmp = new buffer.Buffer(2) - tmp.fill('ok') - if (tmp[1] === tmp[0]) { - // Outdated Node.js - t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo')) - } else { - t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko')) - } - t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok')) - - t.end() -}) - -test('safer.Buffer.from returns results same as Buffer constructor', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.deepEqual(impl.Buffer.from(''), new buffer.Buffer('')) - t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string')) - t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8')) - t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64')) - t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3])) - t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3]))) - t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([])) - }) - t.end() -}) - -test('safer.Buffer.from returns consistent results', function (t) { - [index, safer, dangerous].forEach(function (impl) { - t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0)) - t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0)) - t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0)) - t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string')) - t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103])) - t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string'))) - t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree')) - t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree')) - }) - t.end() -}) diff --git a/node_modules/send/LICENSE b/node_modules/send/LICENSE deleted file mode 100644 index b6ea1c1..0000000 --- a/node_modules/send/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 TJ Holowaychuk -Copyright (c) 2014-2022 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/send/README.md b/node_modules/send/README.md deleted file mode 100644 index 350fccd..0000000 --- a/node_modules/send/README.md +++ /dev/null @@ -1,317 +0,0 @@ -# send - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![CI][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Send is a library for streaming files from the file system as a http response -supporting partial responses (Ranges), conditional-GET negotiation (If-Match, -If-Unmodified-Since, If-None-Match, If-Modified-Since), high test coverage, -and granular events which may be leveraged to take appropriate actions in your -application or framework. - -Looking to serve up entire folders mapped to URLs? Try [serve-static](https://www.npmjs.org/package/serve-static). - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install send -``` - -## API - -```js -var send = require('send') -``` - -### send(req, path, [options]) - -Create a new `SendStream` for the given path to send to a `res`. The `req` is -the Node.js HTTP request and the `path` is a urlencoded path to send (urlencoded, -not the actual file-system path). - -#### Options - -##### acceptRanges - -Enable or disable accepting ranged requests, defaults to true. -Disabling this will not send `Accept-Ranges` and ignore the contents -of the `Range` request header. - -##### cacheControl - -Enable or disable setting `Cache-Control` response header, defaults to -true. Disabling this will ignore the `immutable` and `maxAge` options. - -##### dotfiles - -Set how "dotfiles" are treated when encountered. A dotfile is a file -or directory that begins with a dot ("."). Note this check is done on -the path itself without checking if the path actually exists on the -disk. If `root` is specified, only the dotfiles above the root are -checked (i.e. the root itself can be within a dotfile when set -to "deny"). - - - `'allow'` No special treatment for dotfiles. - - `'deny'` Send a 403 for any request for a dotfile. - - `'ignore'` Pretend like the dotfile does not exist and 404. - -The default value is _similar_ to `'ignore'`, with the exception that -this default will not ignore the files within a directory that begins -with a dot, for backward-compatibility. - -##### end - -Byte offset at which the stream ends, defaults to the length of the file -minus 1. The end is inclusive in the stream, meaning `end: 3` will include -the 4th byte in the stream. - -##### etag - -Enable or disable etag generation, defaults to true. - -##### extensions - -If a given file doesn't exist, try appending one of the given extensions, -in the given order. By default, this is disabled (set to `false`). An -example value that will serve extension-less HTML files: `['html', 'htm']`. -This is skipped if the requested file already has an extension. - -##### immutable - -Enable or disable the `immutable` directive in the `Cache-Control` response -header, defaults to `false`. If set to `true`, the `maxAge` option should -also be specified to enable caching. The `immutable` directive will prevent -supported clients from making conditional requests during the life of the -`maxAge` option to check if the file has changed. - -##### index - -By default send supports "index.html" files, to disable this -set `false` or to supply a new index pass a string or an array -in preferred order. - -##### lastModified - -Enable or disable `Last-Modified` header, defaults to true. Uses the file -system's last modified value. - -##### maxAge - -Provide a max-age in milliseconds for http caching, defaults to 0. -This can also be a string accepted by the -[ms](https://www.npmjs.org/package/ms#readme) module. - -##### root - -Serve files relative to `path`. - -##### start - -Byte offset at which the stream starts, defaults to 0. The start is inclusive, -meaning `start: 2` will include the 3rd byte in the stream. - -#### Events - -The `SendStream` is an event emitter and will emit the following events: - - - `error` an error occurred `(err)` - - `directory` a directory was requested `(res, path)` - - `file` a file was requested `(path, stat)` - - `headers` the headers are about to be set on a file `(res, path, stat)` - - `stream` file streaming has started `(stream)` - - `end` streaming has completed - -#### .pipe - -The `pipe` method is used to pipe the response into the Node.js HTTP response -object, typically `send(req, path, options).pipe(res)`. - -## Error-handling - -By default when no `error` listeners are present an automatic response will be -made, otherwise you have full control over the response, aka you may show a 5xx -page etc. - -## Caching - -It does _not_ perform internal caching, you should use a reverse proxy cache -such as Varnish for this, or those fancy things called CDNs. If your -application is small enough that it would benefit from single-node memory -caching, it's small enough that it does not need caching at all ;). - -## Debugging - -To enable `debug()` instrumentation output export __DEBUG__: - -``` -$ DEBUG=send node app -``` - -## Running tests - -``` -$ npm install -$ npm test -``` - -## Examples - -### Serve a specific file - -This simple example will send a specific file to all requests. - -```js -var http = require('http') -var send = require('send') - -var server = http.createServer(function onRequest (req, res) { - send(req, '/path/to/index.html') - .pipe(res) -}) - -server.listen(3000) -``` - -### Serve all files from a directory - -This simple example will just serve up all the files in a -given directory as the top-level. For example, a request -`GET /foo.txt` will send back `/www/public/foo.txt`. - -```js -var http = require('http') -var parseUrl = require('parseurl') -var send = require('send') - -var server = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname, { root: '/www/public' }) - .pipe(res) -}) - -server.listen(3000) -``` - -### Custom file types - -```js -var extname = require('path').extname -var http = require('http') -var parseUrl = require('parseurl') -var send = require('send') - -var server = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname, { root: '/www/public' }) - .on('headers', function (res, path) { - switch (extname(path)) { - case '.x-mt': - case '.x-mtt': - // custom type for these extensions - res.setHeader('Content-Type', 'application/x-my-type') - break - } - }) - .pipe(res) -}) - -server.listen(3000) -``` - -### Custom directory index view - -This is an example of serving up a structure of directories with a -custom function to render a listing of a directory. - -```js -var http = require('http') -var fs = require('fs') -var parseUrl = require('parseurl') -var send = require('send') - -// Transfer arbitrary files from within /www/example.com/public/* -// with a custom handler for directory listing -var server = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname, { index: false, root: '/www/public' }) - .once('directory', directory) - .pipe(res) -}) - -server.listen(3000) - -// Custom directory handler -function directory (res, path) { - var stream = this - - // redirect to trailing slash for consistent url - if (!stream.hasTrailingSlash()) { - return stream.redirect(path) - } - - // get directory list - fs.readdir(path, function onReaddir (err, list) { - if (err) return stream.error(err) - - // render an index for the directory - res.setHeader('Content-Type', 'text/plain; charset=UTF-8') - res.end(list.join('\n') + '\n') - }) -} -``` - -### Serving from a root directory with custom error-handling - -```js -var http = require('http') -var parseUrl = require('parseurl') -var send = require('send') - -var server = http.createServer(function onRequest (req, res) { - // your custom error-handling logic: - function error (err) { - res.statusCode = err.status || 500 - res.end(err.message) - } - - // your custom headers - function headers (res, path, stat) { - // serve all files for download - res.setHeader('Content-Disposition', 'attachment') - } - - // your custom directory handling logic: - function redirect () { - res.statusCode = 301 - res.setHeader('Location', req.url + '/') - res.end('Redirecting to ' + req.url + '/') - } - - // transfer arbitrary files from within - // /www/example.com/public/* - send(req, parseUrl(req).pathname, { root: '/www/public' }) - .on('error', error) - .on('directory', redirect) - .on('headers', headers) - .pipe(res) -}) - -server.listen(3000) -``` - -## License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master -[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master -[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux -[github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml -[node-image]: https://badgen.net/npm/node/send -[node-url]: https://nodejs.org/en/download/ -[npm-downloads-image]: https://badgen.net/npm/dm/send -[npm-url]: https://npmjs.org/package/send -[npm-version-image]: https://badgen.net/npm/v/send diff --git a/node_modules/send/index.js b/node_modules/send/index.js deleted file mode 100644 index 1655053..0000000 --- a/node_modules/send/index.js +++ /dev/null @@ -1,997 +0,0 @@ -/*! - * send - * Copyright(c) 2012 TJ Holowaychuk - * Copyright(c) 2014-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var createError = require('http-errors') -var debug = require('debug')('send') -var encodeUrl = require('encodeurl') -var escapeHtml = require('escape-html') -var etag = require('etag') -var fresh = require('fresh') -var fs = require('fs') -var mime = require('mime-types') -var ms = require('ms') -var onFinished = require('on-finished') -var parseRange = require('range-parser') -var path = require('path') -var statuses = require('statuses') -var Stream = require('stream') -var util = require('util') - -/** - * Path function references. - * @private - */ - -var extname = path.extname -var join = path.join -var normalize = path.normalize -var resolve = path.resolve -var sep = path.sep - -/** - * Regular expression for identifying a bytes Range header. - * @private - */ - -var BYTES_RANGE_REGEXP = /^ *bytes=/ - -/** - * Maximum value allowed for the max age. - * @private - */ - -var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year - -/** - * Regular expression to match a path with a directory up component. - * @private - */ - -var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/ - -/** - * Module exports. - * @public - */ - -module.exports = send - -/** - * Return a `SendStream` for `req` and `path`. - * - * @param {object} req - * @param {string} path - * @param {object} [options] - * @return {SendStream} - * @public - */ - -function send (req, path, options) { - return new SendStream(req, path, options) -} - -/** - * Initialize a `SendStream` with the given `path`. - * - * @param {Request} req - * @param {String} path - * @param {object} [options] - * @private - */ - -function SendStream (req, path, options) { - Stream.call(this) - - var opts = options || {} - - this.options = opts - this.path = path - this.req = req - - this._acceptRanges = opts.acceptRanges !== undefined - ? Boolean(opts.acceptRanges) - : true - - this._cacheControl = opts.cacheControl !== undefined - ? Boolean(opts.cacheControl) - : true - - this._etag = opts.etag !== undefined - ? Boolean(opts.etag) - : true - - this._dotfiles = opts.dotfiles !== undefined - ? opts.dotfiles - : 'ignore' - - if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') { - throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"') - } - - this._extensions = opts.extensions !== undefined - ? normalizeList(opts.extensions, 'extensions option') - : [] - - this._immutable = opts.immutable !== undefined - ? Boolean(opts.immutable) - : false - - this._index = opts.index !== undefined - ? normalizeList(opts.index, 'index option') - : ['index.html'] - - this._lastModified = opts.lastModified !== undefined - ? Boolean(opts.lastModified) - : true - - this._maxage = opts.maxAge || opts.maxage - this._maxage = typeof this._maxage === 'string' - ? ms(this._maxage) - : Number(this._maxage) - this._maxage = !isNaN(this._maxage) - ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) - : 0 - - this._root = opts.root - ? resolve(opts.root) - : null -} - -/** - * Inherits from `Stream`. - */ - -util.inherits(SendStream, Stream) - -/** - * Emit error with `status`. - * - * @param {number} status - * @param {Error} [err] - * @private - */ - -SendStream.prototype.error = function error (status, err) { - // emit if listeners instead of responding - if (hasListeners(this, 'error')) { - return this.emit('error', createHttpError(status, err)) - } - - var res = this.res - var msg = statuses.message[status] || String(status) - var doc = createHtmlDocument('Error', escapeHtml(msg)) - - // clear existing headers - clearHeaders(res) - - // add error headers - if (err && err.headers) { - setHeaders(res, err.headers) - } - - // send basic response - res.statusCode = status - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(doc)) - res.setHeader('Content-Security-Policy', "default-src 'none'") - res.setHeader('X-Content-Type-Options', 'nosniff') - res.end(doc) -} - -/** - * Check if the pathname ends with "/". - * - * @return {boolean} - * @private - */ - -SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () { - return this.path[this.path.length - 1] === '/' -} - -/** - * Check if this is a conditional GET request. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isConditionalGET = function isConditionalGET () { - return this.req.headers['if-match'] || - this.req.headers['if-unmodified-since'] || - this.req.headers['if-none-match'] || - this.req.headers['if-modified-since'] -} - -/** - * Check if the request preconditions failed. - * - * @return {boolean} - * @private - */ - -SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () { - var req = this.req - var res = this.res - - // if-match - var match = req.headers['if-match'] - if (match) { - var etag = res.getHeader('ETag') - return !etag || (match !== '*' && parseTokenList(match).every(function (match) { - return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag - })) - } - - // if-unmodified-since - var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since']) - if (!isNaN(unmodifiedSince)) { - var lastModified = parseHttpDate(res.getHeader('Last-Modified')) - return isNaN(lastModified) || lastModified > unmodifiedSince - } - - return false -} - -/** - * Strip various content header fields for a change in entity. - * - * @private - */ - -SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () { - var res = this.res - - res.removeHeader('Content-Encoding') - res.removeHeader('Content-Language') - res.removeHeader('Content-Length') - res.removeHeader('Content-Range') - res.removeHeader('Content-Type') -} - -/** - * Respond with 304 not modified. - * - * @api private - */ - -SendStream.prototype.notModified = function notModified () { - var res = this.res - debug('not modified') - this.removeContentHeaderFields() - res.statusCode = 304 - res.end() -} - -/** - * Raise error that headers already sent. - * - * @api private - */ - -SendStream.prototype.headersAlreadySent = function headersAlreadySent () { - var err = new Error('Can\'t set headers after they are sent.') - debug('headers already sent') - this.error(500, err) -} - -/** - * Check if the request is cacheable, aka - * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isCachable = function isCachable () { - var statusCode = this.res.statusCode - return (statusCode >= 200 && statusCode < 300) || - statusCode === 304 -} - -/** - * Handle stat() error. - * - * @param {Error} error - * @private - */ - -SendStream.prototype.onStatError = function onStatError (error) { - switch (error.code) { - case 'ENAMETOOLONG': - case 'ENOENT': - case 'ENOTDIR': - this.error(404, error) - break - default: - this.error(500, error) - break - } -} - -/** - * Check if the cache is fresh. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isFresh = function isFresh () { - return fresh(this.req.headers, { - etag: this.res.getHeader('ETag'), - 'last-modified': this.res.getHeader('Last-Modified') - }) -} - -/** - * Check if the range is fresh. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isRangeFresh = function isRangeFresh () { - var ifRange = this.req.headers['if-range'] - - if (!ifRange) { - return true - } - - // if-range as etag - if (ifRange.indexOf('"') !== -1) { - var etag = this.res.getHeader('ETag') - return Boolean(etag && ifRange.indexOf(etag) !== -1) - } - - // if-range as modified date - var lastModified = this.res.getHeader('Last-Modified') - return parseHttpDate(lastModified) <= parseHttpDate(ifRange) -} - -/** - * Redirect to path. - * - * @param {string} path - * @private - */ - -SendStream.prototype.redirect = function redirect (path) { - var res = this.res - - if (hasListeners(this, 'directory')) { - this.emit('directory', res, path) - return - } - - if (this.hasTrailingSlash()) { - this.error(403) - return - } - - var loc = encodeUrl(collapseLeadingSlashes(this.path + '/')) - var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) - - // redirect - res.statusCode = 301 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(doc)) - res.setHeader('Content-Security-Policy', "default-src 'none'") - res.setHeader('X-Content-Type-Options', 'nosniff') - res.setHeader('Location', loc) - res.end(doc) -} - -/** - * Pipe to `res. - * - * @param {Stream} res - * @return {Stream} res - * @api public - */ - -SendStream.prototype.pipe = function pipe (res) { - // root path - var root = this._root - - // references - this.res = res - - // decode the path - var path = decode(this.path) - if (path === -1) { - this.error(400) - return res - } - - // null byte(s) - if (~path.indexOf('\0')) { - this.error(400) - return res - } - - var parts - if (root !== null) { - // normalize - if (path) { - path = normalize('.' + sep + path) - } - - // malicious path - if (UP_PATH_REGEXP.test(path)) { - debug('malicious path "%s"', path) - this.error(403) - return res - } - - // explode path parts - parts = path.split(sep) - - // join / normalize from optional root dir - path = normalize(join(root, path)) - } else { - // ".." is malicious without "root" - if (UP_PATH_REGEXP.test(path)) { - debug('malicious path "%s"', path) - this.error(403) - return res - } - - // explode path parts - parts = normalize(path).split(sep) - - // resolve the path - path = resolve(path) - } - - // dotfile handling - if (containsDotFile(parts)) { - debug('%s dotfile "%s"', this._dotfiles, path) - switch (this._dotfiles) { - case 'allow': - break - case 'deny': - this.error(403) - return res - case 'ignore': - default: - this.error(404) - return res - } - } - - // index file support - if (this._index.length && this.hasTrailingSlash()) { - this.sendIndex(path) - return res - } - - this.sendFile(path) - return res -} - -/** - * Transfer `path`. - * - * @param {String} path - * @api public - */ - -SendStream.prototype.send = function send (path, stat) { - var len = stat.size - var options = this.options - var opts = {} - var res = this.res - var req = this.req - var ranges = req.headers.range - var offset = options.start || 0 - - if (res.headersSent) { - // impossible to send now - this.headersAlreadySent() - return - } - - debug('pipe "%s"', path) - - // set header fields - this.setHeader(path, stat) - - // set content-type - this.type(path) - - // conditional GET support - if (this.isConditionalGET()) { - if (this.isPreconditionFailure()) { - this.error(412) - return - } - - if (this.isCachable() && this.isFresh()) { - this.notModified() - return - } - } - - // adjust len to start/end options - len = Math.max(0, len - offset) - if (options.end !== undefined) { - var bytes = options.end - offset + 1 - if (len > bytes) len = bytes - } - - // Range support - if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { - // parse - ranges = parseRange(len, ranges, { - combine: true - }) - - // If-Range support - if (!this.isRangeFresh()) { - debug('range stale') - ranges = -2 - } - - // unsatisfiable - if (ranges === -1) { - debug('range unsatisfiable') - - // Content-Range - res.setHeader('Content-Range', contentRange('bytes', len)) - - // 416 Requested Range Not Satisfiable - return this.error(416, { - headers: { 'Content-Range': res.getHeader('Content-Range') } - }) - } - - // valid (syntactically invalid/multiple ranges are treated as a regular response) - if (ranges !== -2 && ranges.length === 1) { - debug('range %j', ranges) - - // Content-Range - res.statusCode = 206 - res.setHeader('Content-Range', contentRange('bytes', len, ranges[0])) - - // adjust for requested range - offset += ranges[0].start - len = ranges[0].end - ranges[0].start + 1 - } - } - - // clone options - for (var prop in options) { - opts[prop] = options[prop] - } - - // set read options - opts.start = offset - opts.end = Math.max(offset, offset + len - 1) - - // content-length - res.setHeader('Content-Length', len) - - // HEAD support - if (req.method === 'HEAD') { - res.end() - return - } - - this.stream(path, opts) -} - -/** - * Transfer file for `path`. - * - * @param {String} path - * @api private - */ -SendStream.prototype.sendFile = function sendFile (path) { - var i = 0 - var self = this - - debug('stat "%s"', path) - fs.stat(path, function onstat (err, stat) { - var pathEndsWithSep = path[path.length - 1] === sep - if (err && err.code === 'ENOENT' && !extname(path) && !pathEndsWithSep) { - // not found, check extensions - return next(err) - } - if (err) return self.onStatError(err) - if (stat.isDirectory()) return self.redirect(path) - if (pathEndsWithSep) return self.error(404) - self.emit('file', path, stat) - self.send(path, stat) - }) - - function next (err) { - if (self._extensions.length <= i) { - return err - ? self.onStatError(err) - : self.error(404) - } - - var p = path + '.' + self._extensions[i++] - - debug('stat "%s"', p) - fs.stat(p, function (err, stat) { - if (err) return next(err) - if (stat.isDirectory()) return next() - self.emit('file', p, stat) - self.send(p, stat) - }) - } -} - -/** - * Transfer index for `path`. - * - * @param {String} path - * @api private - */ -SendStream.prototype.sendIndex = function sendIndex (path) { - var i = -1 - var self = this - - function next (err) { - if (++i >= self._index.length) { - if (err) return self.onStatError(err) - return self.error(404) - } - - var p = join(path, self._index[i]) - - debug('stat "%s"', p) - fs.stat(p, function (err, stat) { - if (err) return next(err) - if (stat.isDirectory()) return next() - self.emit('file', p, stat) - self.send(p, stat) - }) - } - - next() -} - -/** - * Stream `path` to the response. - * - * @param {String} path - * @param {Object} options - * @api private - */ - -SendStream.prototype.stream = function stream (path, options) { - var self = this - var res = this.res - - // pipe - var stream = fs.createReadStream(path, options) - this.emit('stream', stream) - stream.pipe(res) - - // cleanup - function cleanup () { - stream.destroy() - } - - // response finished, cleanup - onFinished(res, cleanup) - - // error handling - stream.on('error', function onerror (err) { - // clean up stream early - cleanup() - - // error - self.onStatError(err) - }) - - // end - stream.on('end', function onend () { - self.emit('end') - }) -} - -/** - * Set content-type based on `path` - * if it hasn't been explicitly set. - * - * @param {String} path - * @api private - */ - -SendStream.prototype.type = function type (path) { - var res = this.res - - if (res.getHeader('Content-Type')) return - - var ext = extname(path) - var type = mime.contentType(ext) || 'application/octet-stream' - - debug('content-type %s', type) - res.setHeader('Content-Type', type) -} - -/** - * Set response header fields, most - * fields may be pre-defined. - * - * @param {String} path - * @param {Object} stat - * @api private - */ - -SendStream.prototype.setHeader = function setHeader (path, stat) { - var res = this.res - - this.emit('headers', res, path, stat) - - if (this._acceptRanges && !res.getHeader('Accept-Ranges')) { - debug('accept ranges') - res.setHeader('Accept-Ranges', 'bytes') - } - - if (this._cacheControl && !res.getHeader('Cache-Control')) { - var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000) - - if (this._immutable) { - cacheControl += ', immutable' - } - - debug('cache-control %s', cacheControl) - res.setHeader('Cache-Control', cacheControl) - } - - if (this._lastModified && !res.getHeader('Last-Modified')) { - var modified = stat.mtime.toUTCString() - debug('modified %s', modified) - res.setHeader('Last-Modified', modified) - } - - if (this._etag && !res.getHeader('ETag')) { - var val = etag(stat) - debug('etag %s', val) - res.setHeader('ETag', val) - } -} - -/** - * Clear all headers from a response. - * - * @param {object} res - * @private - */ - -function clearHeaders (res) { - for (const header of res.getHeaderNames()) { - res.removeHeader(header) - } -} - -/** - * Collapse all leading slashes into a single slash - * - * @param {string} str - * @private - */ -function collapseLeadingSlashes (str) { - for (var i = 0; i < str.length; i++) { - if (str[i] !== '/') { - break - } - } - - return i > 1 - ? '/' + str.substr(i) - : str -} - -/** - * Determine if path parts contain a dotfile. - * - * @api private - */ - -function containsDotFile (parts) { - for (var i = 0; i < parts.length; i++) { - var part = parts[i] - if (part.length > 1 && part[0] === '.') { - return true - } - } - - return false -} - -/** - * Create a Content-Range header. - * - * @param {string} type - * @param {number} size - * @param {array} [range] - */ - -function contentRange (type, size, range) { - return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size -} - -/** - * Create a minimal HTML document. - * - * @param {string} title - * @param {string} body - * @private - */ - -function createHtmlDocument (title, body) { - return '\n' + - '\n' + - '\n' + - '\n' + - '' + title + '\n' + - '\n' + - '\n' + - '
' + body + '
\n' + - '\n' + - '\n' -} - -/** - * Create a HttpError object from simple arguments. - * - * @param {number} status - * @param {Error|object} err - * @private - */ - -function createHttpError (status, err) { - if (!err) { - return createError(status) - } - - return err instanceof Error - ? createError(status, err, { expose: false }) - : createError(status, err) -} - -/** - * decodeURIComponent. - * - * Allows V8 to only deoptimize this fn instead of all - * of send(). - * - * @param {String} path - * @api private - */ - -function decode (path) { - try { - return decodeURIComponent(path) - } catch (err) { - return -1 - } -} - -/** - * Determine if emitter has listeners of a given type. - * - * The way to do this check is done three different ways in Node.js >= 0.10 - * so this consolidates them into a minimal set using instance methods. - * - * @param {EventEmitter} emitter - * @param {string} type - * @returns {boolean} - * @private - */ - -function hasListeners (emitter, type) { - var count = typeof emitter.listenerCount !== 'function' - ? emitter.listeners(type).length - : emitter.listenerCount(type) - - return count > 0 -} - -/** - * Normalize the index option into an array. - * - * @param {boolean|string|array} val - * @param {string} name - * @private - */ - -function normalizeList (val, name) { - var list = [].concat(val || []) - - for (var i = 0; i < list.length; i++) { - if (typeof list[i] !== 'string') { - throw new TypeError(name + ' must be array of strings or false') - } - } - - return list -} - -/** - * Parse an HTTP Date into a number. - * - * @param {string} date - * @private - */ - -function parseHttpDate (date) { - var timestamp = date && Date.parse(date) - - return typeof timestamp === 'number' - ? timestamp - : NaN -} - -/** - * Parse a HTTP token list. - * - * @param {string} str - * @private - */ - -function parseTokenList (str) { - var end = 0 - var list = [] - var start = 0 - - // gather tokens - for (var i = 0, len = str.length; i < len; i++) { - switch (str.charCodeAt(i)) { - case 0x20: /* */ - if (start === end) { - start = end = i + 1 - } - break - case 0x2c: /* , */ - if (start !== end) { - list.push(str.substring(start, end)) - } - start = end = i + 1 - break - default: - end = i + 1 - break - } - } - - // final token - if (start !== end) { - list.push(str.substring(start, end)) - } - - return list -} - -/** - * Set an object of headers on a response. - * - * @param {object} res - * @param {object} headers - * @private - */ - -function setHeaders (res, headers) { - var keys = Object.keys(headers) - - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - res.setHeader(key, headers[key]) - } -} diff --git a/node_modules/send/package.json b/node_modules/send/package.json deleted file mode 100644 index e9d3cc2..0000000 --- a/node_modules/send/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "send", - "description": "Better streaming static file server with Range and conditional-GET support", - "version": "1.2.1", - "author": "TJ Holowaychuk ", - "contributors": [ - "Douglas Christopher Wilson ", - "James Wyatt Cready ", - "Jesús Leganés Combarro " - ], - "license": "MIT", - "repository": "pillarjs/send", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, - "keywords": [ - "static", - "file", - "server" - ], - "dependencies": { - "debug": "^4.4.3", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "fresh": "^2.0.0", - "http-errors": "^2.0.1", - "mime-types": "^3.0.2", - "ms": "^2.1.3", - "on-finished": "^2.4.1", - "range-parser": "^1.2.1", - "statuses": "^2.0.2" - }, - "devDependencies": { - "after": "^0.8.2", - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.32.0", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "^10.7.0", - "nyc": "^17.0.0", - "supertest": "6.3.4" - }, - "files": [ - "LICENSE", - "README.md", - "index.js" - ], - "engines": { - "node": ">= 18" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --check-leaks --reporter spec", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/serve-static/LICENSE b/node_modules/serve-static/LICENSE deleted file mode 100644 index cbe62e8..0000000 --- a/node_modules/serve-static/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -(The MIT License) - -Copyright (c) 2010 Sencha Inc. -Copyright (c) 2011 LearnBoost -Copyright (c) 2011 TJ Holowaychuk -Copyright (c) 2014-2016 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/serve-static/README.md b/node_modules/serve-static/README.md deleted file mode 100644 index 3ff1f1f..0000000 --- a/node_modules/serve-static/README.md +++ /dev/null @@ -1,253 +0,0 @@ -# serve-static - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![CI][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install serve-static -``` - -## API - -```js -const serveStatic = require('serve-static') -``` - -### serveStatic(root, options) - -Create a new middleware function to serve files from within a given root -directory. The file to serve will be determined by combining `req.url` -with the provided root directory. When a file is not found, instead of -sending a 404 response, this module will instead call `next()` to move on -to the next middleware, allowing for stacking and fall-backs. - -#### Options - -##### acceptRanges - -Enable or disable accepting ranged requests, defaults to true. -Disabling this will not send `Accept-Ranges` and ignore the contents -of the `Range` request header. - -##### cacheControl - -Enable or disable setting `Cache-Control` response header, defaults to -true. Disabling this will ignore the `immutable` and `maxAge` options. - -##### dotfiles - -Set how "dotfiles" are treated when encountered. A dotfile is a file -or directory that begins with a dot ("."). Note this check is done on -the path itself without checking if the path actually exists on the -disk. If `root` is specified, only the dotfiles above the root are -checked (i.e. the root itself can be within a dotfile when set -to "deny"). - - - `'allow'` No special treatment for dotfiles. - - `'deny'` Deny a request for a dotfile and 403/`next()`. - - `'ignore'` Pretend like the dotfile does not exist and 404/`next()`. - -The default value is `'ignore'`. - -##### etag - -Enable or disable etag generation, defaults to true. - -##### extensions - -Set file extension fallbacks. When set, if a file is not found, the given -extensions will be added to the file name and search for. The first that -exists will be served. Example: `['html', 'htm']`. - -The default value is `false`. - -##### fallthrough - -Set the middleware to have client errors fall-through as just unhandled -requests, otherwise forward a client error. The difference is that client -errors like a bad request or a request to a non-existent file will cause -this middleware to simply `next()` to your next middleware when this value -is `true`. When this value is `false`, these errors (even 404s), will invoke -`next(err)`. - -Typically `true` is desired such that multiple physical directories can be -mapped to the same web address or for routes to fill in non-existent files. - -The value `false` can be used if this middleware is mounted at a path that -is designed to be strictly a single file system directory, which allows for -short-circuiting 404s for less overhead. This middleware will also reply to -all methods. - -The default value is `true`. - -##### immutable - -Enable or disable the `immutable` directive in the `Cache-Control` response -header, defaults to `false`. If set to `true`, the `maxAge` option should -also be specified to enable caching. The `immutable` directive will prevent -supported clients from making conditional requests during the life of the -`maxAge` option to check if the file has changed. - -##### index - -By default this module will send "index.html" files in response to a request -on a directory. To disable this set `false` or to supply a new index pass a -string or an array in preferred order. - -##### lastModified - -Enable or disable `Last-Modified` header, defaults to true. Uses the file -system's last modified value. - -##### maxAge - -Provide a max-age in milliseconds for http caching, defaults to 0. This -can also be a string accepted by the [ms](https://www.npmjs.org/package/ms#readme) -module. - -##### redirect - -Redirect to trailing "/" when the pathname is a dir. Defaults to `true`. - -##### setHeaders - -Function to set custom headers on response. Alterations to the headers need to -occur synchronously. The function is called as `fn(res, path, stat)`, where -the arguments are: - - - `res` the response object - - `path` the file path that is being sent - - `stat` the stat object of the file that is being sent - -## Examples - -### Serve files with vanilla node.js http server - -```js -const finalhandler = require('finalhandler') -const http = require('http') -const serveStatic = require('serve-static') - -// Serve up public/ftp folder -const serve = serveStatic('public/ftp', { index: ['index.html', 'index.htm'] }) - -// Create server -const server = http.createServer((req, res) => { - serve(req, res, finalhandler(req, res)) -}) - -// Listen -server.listen(3000) -``` - -### Serve all files as downloads - -```js -const contentDisposition = require('content-disposition') -const finalhandler = require('finalhandler') -const http = require('http') -const serveStatic = require('serve-static') - -// Serve up public/ftp folder -const serve = serveStatic('public/ftp', { - index: false, - setHeaders: setHeaders -}) - -// Set header to force download -function setHeaders (res, path) { - res.setHeader('Content-Disposition', contentDisposition(path)) -} - -// Create server -const server = http.createServer((req, res) => { - serve(req, res, finalhandler(req, res)) -}) - -// Listen -server.listen(3000) -``` - -### Serving using express - -#### Simple - -This is a simple example of using Express. - -```js -const express = require('express') -const serveStatic = require('serve-static') - -const app = express() - -app.use(serveStatic('public/ftp', { index: ['default.html', 'default.htm'] })) -app.listen(3000) -``` - -#### Multiple roots - -This example shows a simple way to search through multiple directories. -Files are searched for in `public-optimized/` first, then `public/` second -as a fallback. - -```js -const express = require('express') -const path = require('path') -const serveStatic = require('serve-static') - -const app = express() - -app.use(serveStatic(path.join(__dirname, 'public-optimized'))) -app.use(serveStatic(path.join(__dirname, 'public'))) -app.listen(3000) -``` - -#### Different settings for paths - -This example shows how to set a different max age depending on the served -file. In this example, HTML files are not cached, while everything else -is for 1 day. - -```js -const express = require('express') -const path = require('path') -const serveStatic = require('serve-static') - -const app = express() - -app.use(serveStatic(path.join(__dirname, 'public'), { - maxAge: '1d', - setHeaders: setCustomCacheControl -})) - -app.listen(3000) - -function setCustomCacheControl (res, file) { - if (path.extname(file) === '.html') { - // Custom Cache-Control for HTML files - res.setHeader('Cache-Control', 'public, max-age=0') - } -} -``` - -## License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master -[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master -[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux -[github-actions-ci-url]: https://github.com/expressjs/serve-static/actions/workflows/ci.yml -[node-image]: https://badgen.net/npm/node/serve-static -[node-url]: https://nodejs.org/en/download/ -[npm-downloads-image]: https://badgen.net/npm/dm/serve-static -[npm-url]: https://npmjs.org/package/serve-static -[npm-version-image]: https://badgen.net/npm/v/serve-static diff --git a/node_modules/serve-static/index.js b/node_modules/serve-static/index.js deleted file mode 100644 index 1bee463..0000000 --- a/node_modules/serve-static/index.js +++ /dev/null @@ -1,208 +0,0 @@ -/*! - * serve-static - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * Copyright(c) 2014-2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var encodeUrl = require('encodeurl') -var escapeHtml = require('escape-html') -var parseUrl = require('parseurl') -var resolve = require('path').resolve -var send = require('send') -var url = require('url') - -/** - * Module exports. - * @public - */ - -module.exports = serveStatic - -/** - * @param {string} root - * @param {object} [options] - * @return {function} - * @public - */ - -function serveStatic (root, options) { - if (!root) { - throw new TypeError('root path required') - } - - if (typeof root !== 'string') { - throw new TypeError('root path must be a string') - } - - // copy options object - var opts = Object.create(options || null) - - // fall-though - var fallthrough = opts.fallthrough !== false - - // default redirect - var redirect = opts.redirect !== false - - // headers listener - var setHeaders = opts.setHeaders - - if (setHeaders && typeof setHeaders !== 'function') { - throw new TypeError('option setHeaders must be function') - } - - // setup options for send - opts.maxage = opts.maxage || opts.maxAge || 0 - opts.root = resolve(root) - - // construct directory listener - var onDirectory = redirect - ? createRedirectDirectoryListener() - : createNotFoundDirectoryListener() - - return function serveStatic (req, res, next) { - if (req.method !== 'GET' && req.method !== 'HEAD') { - if (fallthrough) { - return next() - } - - // method not allowed - res.statusCode = 405 - res.setHeader('Allow', 'GET, HEAD') - res.setHeader('Content-Length', '0') - res.end() - return - } - - var forwardError = !fallthrough - var originalUrl = parseUrl.original(req) - var path = parseUrl(req).pathname - - // make sure redirect occurs at mount - if (path === '/' && originalUrl.pathname.substr(-1) !== '/') { - path = '' - } - - // create send stream - var stream = send(req, path, opts) - - // add directory handler - stream.on('directory', onDirectory) - - // add headers listener - if (setHeaders) { - stream.on('headers', setHeaders) - } - - // add file listener for fallthrough - if (fallthrough) { - stream.on('file', function onFile () { - // once file is determined, always forward error - forwardError = true - }) - } - - // forward errors - stream.on('error', function error (err) { - if (forwardError || !(err.statusCode < 500)) { - next(err) - return - } - - next() - }) - - // pipe - stream.pipe(res) - } -} - -/** - * Collapse all leading slashes into a single slash - * @private - */ -function collapseLeadingSlashes (str) { - for (var i = 0; i < str.length; i++) { - if (str.charCodeAt(i) !== 0x2f /* / */) { - break - } - } - - return i > 1 - ? '/' + str.substr(i) - : str -} - -/** - * Create a minimal HTML document. - * - * @param {string} title - * @param {string} body - * @private - */ - -function createHtmlDocument (title, body) { - return '\n' + - '\n' + - '\n' + - '\n' + - '' + title + '\n' + - '\n' + - '\n' + - '
' + body + '
\n' + - '\n' + - '\n' -} - -/** - * Create a directory listener that just 404s. - * @private - */ - -function createNotFoundDirectoryListener () { - return function notFound () { - this.error(404) - } -} - -/** - * Create a directory listener that performs a redirect. - * @private - */ - -function createRedirectDirectoryListener () { - return function redirect (res) { - if (this.hasTrailingSlash()) { - this.error(404) - return - } - - // get original URL - var originalUrl = parseUrl.original(this.req) - - // append trailing slash - originalUrl.path = null - originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/') - - // reformat the URL - var loc = encodeUrl(url.format(originalUrl)) - var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) - - // send redirect response - res.statusCode = 301 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(doc)) - res.setHeader('Content-Security-Policy', "default-src 'none'") - res.setHeader('X-Content-Type-Options', 'nosniff') - res.setHeader('Location', loc) - res.end(doc) - } -} diff --git a/node_modules/serve-static/package.json b/node_modules/serve-static/package.json deleted file mode 100644 index 5fb5b02..0000000 --- a/node_modules/serve-static/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "serve-static", - "description": "Serve static files", - "version": "2.2.1", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "repository": "expressjs/serve-static", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, - "dependencies": { - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "parseurl": "^1.3.3", - "send": "^1.2.0" - }, - "devDependencies": { - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.32.0", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "^10.7.0", - "nyc": "^17.0.0", - "supertest": "^6.3.4" - }, - "files": [ - "LICENSE", - "index.js" - ], - "engines": { - "node": ">= 18" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/setprototypeof/LICENSE b/node_modules/setprototypeof/LICENSE deleted file mode 100644 index 61afa2f..0000000 --- a/node_modules/setprototypeof/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2015, Wes Todd - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/setprototypeof/README.md b/node_modules/setprototypeof/README.md deleted file mode 100644 index 791eeff..0000000 --- a/node_modules/setprototypeof/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Polyfill for `Object.setPrototypeOf` - -[![NPM Version](https://img.shields.io/npm/v/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) -[![NPM Downloads](https://img.shields.io/npm/dm/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard) - -A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8. - -## Usage: - -``` -$ npm install --save setprototypeof -``` - -```javascript -var setPrototypeOf = require('setprototypeof') - -var obj = {} -setPrototypeOf(obj, { - foo: function () { - return 'bar' - } -}) -obj.foo() // bar -``` - -TypeScript is also supported: - -```typescript -import setPrototypeOf from 'setprototypeof' -``` diff --git a/node_modules/setprototypeof/index.d.ts b/node_modules/setprototypeof/index.d.ts deleted file mode 100644 index f108ecd..0000000 --- a/node_modules/setprototypeof/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function setPrototypeOf(o: any, proto: object | null): any; -export = setPrototypeOf; diff --git a/node_modules/setprototypeof/index.js b/node_modules/setprototypeof/index.js deleted file mode 100644 index c527055..0000000 --- a/node_modules/setprototypeof/index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' -/* eslint no-proto: 0 */ -module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties) - -function setProtoOf (obj, proto) { - obj.__proto__ = proto - return obj -} - -function mixinProperties (obj, proto) { - for (var prop in proto) { - if (!Object.prototype.hasOwnProperty.call(obj, prop)) { - obj[prop] = proto[prop] - } - } - return obj -} diff --git a/node_modules/setprototypeof/package.json b/node_modules/setprototypeof/package.json deleted file mode 100644 index f20915b..0000000 --- a/node_modules/setprototypeof/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "setprototypeof", - "version": "1.2.0", - "description": "A small polyfill for Object.setprototypeof", - "main": "index.js", - "typings": "index.d.ts", - "scripts": { - "test": "standard && mocha", - "testallversions": "npm run node010 && npm run node4 && npm run node6 && npm run node9 && npm run node11", - "testversion": "docker run -it --rm -v $(PWD):/usr/src/app -w /usr/src/app node:${NODE_VER} npm install mocha@${MOCHA_VER:-latest} && npm t", - "node010": "NODE_VER=0.10 MOCHA_VER=3 npm run testversion", - "node4": "NODE_VER=4 npm run testversion", - "node6": "NODE_VER=6 npm run testversion", - "node9": "NODE_VER=9 npm run testversion", - "node11": "NODE_VER=11 npm run testversion", - "prepublishOnly": "npm t", - "postpublish": "git push origin && git push origin --tags" - }, - "repository": { - "type": "git", - "url": "https://github.com/wesleytodd/setprototypeof.git" - }, - "keywords": [ - "polyfill", - "object", - "setprototypeof" - ], - "author": "Wes Todd", - "license": "ISC", - "bugs": { - "url": "https://github.com/wesleytodd/setprototypeof/issues" - }, - "homepage": "https://github.com/wesleytodd/setprototypeof", - "devDependencies": { - "mocha": "^6.1.4", - "standard": "^13.0.2" - } -} diff --git a/node_modules/setprototypeof/test/index.js b/node_modules/setprototypeof/test/index.js deleted file mode 100644 index afeb4dd..0000000 --- a/node_modules/setprototypeof/test/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict' -/* eslint-env mocha */ -/* eslint no-proto: 0 */ -var assert = require('assert') -var setPrototypeOf = require('..') - -describe('setProtoOf(obj, proto)', function () { - it('should merge objects', function () { - var obj = { a: 1, b: 2 } - var proto = { b: 3, c: 4 } - var mergeObj = setPrototypeOf(obj, proto) - - if (Object.getPrototypeOf) { - assert.strictEqual(Object.getPrototypeOf(obj), proto) - } else if ({ __proto__: [] } instanceof Array) { - assert.strictEqual(obj.__proto__, proto) - } else { - assert.strictEqual(obj.a, 1) - assert.strictEqual(obj.b, 2) - assert.strictEqual(obj.c, 4) - } - assert.strictEqual(mergeObj, obj) - }) -}) diff --git a/node_modules/shebang-command/index.js b/node_modules/shebang-command/index.js deleted file mode 100644 index f35db30..0000000 --- a/node_modules/shebang-command/index.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -const shebangRegex = require('shebang-regex'); - -module.exports = (string = '') => { - const match = string.match(shebangRegex); - - if (!match) { - return null; - } - - const [path, argument] = match[0].replace(/#! ?/, '').split(' '); - const binary = path.split('/').pop(); - - if (binary === 'env') { - return argument; - } - - return argument ? `${binary} ${argument}` : binary; -}; diff --git a/node_modules/shebang-command/license b/node_modules/shebang-command/license deleted file mode 100644 index db6bc32..0000000 --- a/node_modules/shebang-command/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Kevin Mårtensson (github.com/kevva) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-command/package.json b/node_modules/shebang-command/package.json deleted file mode 100644 index 18e3c04..0000000 --- a/node_modules/shebang-command/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "shebang-command", - "version": "2.0.0", - "description": "Get the command from a shebang", - "license": "MIT", - "repository": "kevva/shebang-command", - "author": { - "name": "Kevin Mårtensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "cmd", - "command", - "parse", - "shebang" - ], - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "devDependencies": { - "ava": "^2.3.0", - "xo": "^0.24.0" - } -} diff --git a/node_modules/shebang-command/readme.md b/node_modules/shebang-command/readme.md deleted file mode 100644 index 84feb44..0000000 --- a/node_modules/shebang-command/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command) - -> Get the command from a shebang - - -## Install - -``` -$ npm install shebang-command -``` - - -## Usage - -```js -const shebangCommand = require('shebang-command'); - -shebangCommand('#!/usr/bin/env node'); -//=> 'node' - -shebangCommand('#!/bin/bash'); -//=> 'bash' -``` - - -## API - -### shebangCommand(string) - -#### string - -Type: `string` - -String containing a shebang. diff --git a/node_modules/shebang-regex/index.d.ts b/node_modules/shebang-regex/index.d.ts deleted file mode 100644 index 61d034b..0000000 --- a/node_modules/shebang-regex/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** -Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line. - -@example -``` -import shebangRegex = require('shebang-regex'); - -const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; - -shebangRegex.test(string); -//=> true - -shebangRegex.exec(string)[0]; -//=> '#!/usr/bin/env node' - -shebangRegex.exec(string)[1]; -//=> '/usr/bin/env node' -``` -*/ -declare const shebangRegex: RegExp; - -export = shebangRegex; diff --git a/node_modules/shebang-regex/index.js b/node_modules/shebang-regex/index.js deleted file mode 100644 index 63fc4a0..0000000 --- a/node_modules/shebang-regex/index.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -module.exports = /^#!(.*)/; diff --git a/node_modules/shebang-regex/license b/node_modules/shebang-regex/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/shebang-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-regex/package.json b/node_modules/shebang-regex/package.json deleted file mode 100644 index 00ab30f..0000000 --- a/node_modules/shebang-regex/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "shebang-regex", - "version": "3.0.0", - "description": "Regular expression for matching a shebang line", - "license": "MIT", - "repository": "sindresorhus/shebang-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "regex", - "regexp", - "shebang", - "match", - "test", - "line" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/shebang-regex/readme.md b/node_modules/shebang-regex/readme.md deleted file mode 100644 index 5ecf863..0000000 --- a/node_modules/shebang-regex/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex) - -> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line - - -## Install - -``` -$ npm install shebang-regex -``` - - -## Usage - -```js -const shebangRegex = require('shebang-regex'); - -const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; - -shebangRegex.test(string); -//=> true - -shebangRegex.exec(string)[0]; -//=> '#!/usr/bin/env node' - -shebangRegex.exec(string)[1]; -//=> '/usr/bin/env node' -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/side-channel-list/.editorconfig b/node_modules/side-channel-list/.editorconfig deleted file mode 100644 index 72e0eba..0000000 --- a/node_modules/side-channel-list/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = tab -indent_size = 2 -trim_trailing_whitespace = true diff --git a/node_modules/side-channel-list/.eslintrc b/node_modules/side-channel-list/.eslintrc deleted file mode 100644 index 93978e7..0000000 --- a/node_modules/side-channel-list/.eslintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "max-lines-per-function": 0, - "multiline-comment-style": 1, - "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], - }, -} diff --git a/node_modules/side-channel-list/.github/FUNDING.yml b/node_modules/side-channel-list/.github/FUNDING.yml deleted file mode 100644 index eaff735..0000000 --- a/node_modules/side-channel-list/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/side-channel-list -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/side-channel-list/.nycrc b/node_modules/side-channel-list/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/side-channel-list/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/side-channel-list/CHANGELOG.md b/node_modules/side-channel-list/CHANGELOG.md deleted file mode 100644 index 2ec51b7..0000000 --- a/node_modules/side-channel-list/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## v1.0.0 - 2024-12-10 - -### Commits - -- Initial implementation, tests, readme, types [`5d6baee`](https://github.com/ljharb/side-channel-list/commit/5d6baee5c9054a1238007f5a1dfc109a7a816251) -- Initial commit [`3ae784c`](https://github.com/ljharb/side-channel-list/commit/3ae784c63a47895fbaeed2a91ab54a8029a7a100) -- npm init [`07055a4`](https://github.com/ljharb/side-channel-list/commit/07055a4d139895565b199dba5fe2479c1a1b9e28) -- Only apps should have lockfiles [`9573058`](https://github.com/ljharb/side-channel-list/commit/9573058a47494e2d68f8c6c77b5d7fbe441949c1) diff --git a/node_modules/side-channel-list/LICENSE b/node_modules/side-channel-list/LICENSE deleted file mode 100644 index f82f389..0000000 --- a/node_modules/side-channel-list/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/side-channel-list/README.md b/node_modules/side-channel-list/README.md deleted file mode 100644 index d9c7a13..0000000 --- a/node_modules/side-channel-list/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# side-channel-list [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Store information about any JS value in a side channel, using a linked list. - -Warning: this implementation will leak memory until you `delete` the `key`. -Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. - -## Getting started - -```sh -npm install --save side-channel-list -``` - -## Usage/Examples - -```js -const assert = require('assert'); -const getSideChannelList = require('side-channel-list'); - -const channel = getSideChannelList(); - -const key = {}; -assert.equal(channel.has(key), false); -assert.throws(() => channel.assert(key), TypeError); - -channel.set(key, 42); - -channel.assert(key); // does not throw -assert.equal(channel.has(key), true); -assert.equal(channel.get(key), 42); - -channel.delete(key); -assert.equal(channel.has(key), false); -assert.throws(() => channel.assert(key), TypeError); -``` - -## Tests - -Clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/side-channel-list -[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-list.svg -[deps-svg]: https://david-dm.org/ljharb/side-channel-list.svg -[deps-url]: https://david-dm.org/ljharb/side-channel-list -[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-list/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/side-channel-list#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/side-channel-list.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/side-channel-list.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/side-channel-list.svg -[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-list -[codecov-image]: https://codecov.io/gh/ljharb/side-channel-list/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-list/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-list -[actions-url]: https://github.com/ljharb/side-channel-list/actions diff --git a/node_modules/side-channel-list/index.d.ts b/node_modules/side-channel-list/index.d.ts deleted file mode 100644 index c9cabc8..0000000 --- a/node_modules/side-channel-list/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare namespace getSideChannelList { - type Channel = { - assert: (key: K) => void; - has: (key: K) => boolean; - get: (key: K) => V | undefined; - set: (key: K, value: V) => void; - delete: (key: K) => boolean; - }; -} - -declare function getSideChannelList(): getSideChannelList.Channel; - -export = getSideChannelList; diff --git a/node_modules/side-channel-list/index.js b/node_modules/side-channel-list/index.js deleted file mode 100644 index 8d6f98c..0000000 --- a/node_modules/side-channel-list/index.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -var inspect = require('object-inspect'); - -var $TypeError = require('es-errors/type'); - -/* -* This function traverses the list returning the node corresponding to the given key. -* -* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. -* By doing so, all the recently used nodes can be accessed relatively quickly. -*/ -/** @type {import('./list.d.ts').listGetNode} */ -// eslint-disable-next-line consistent-return -var listGetNode = function (list, key, isDelete) { - /** @type {typeof list | NonNullable<(typeof list)['next']>} */ - var prev = list; - /** @type {(typeof list)['next']} */ - var curr; - // eslint-disable-next-line eqeqeq - for (; (curr = prev.next) != null; prev = curr) { - if (curr.key === key) { - prev.next = curr.next; - if (!isDelete) { - // eslint-disable-next-line no-extra-parens - curr.next = /** @type {NonNullable} */ (list.next); - list.next = curr; // eslint-disable-line no-param-reassign - } - return curr; - } - } -}; - -/** @type {import('./list.d.ts').listGet} */ -var listGet = function (objects, key) { - if (!objects) { - return void undefined; - } - var node = listGetNode(objects, key); - return node && node.value; -}; -/** @type {import('./list.d.ts').listSet} */ -var listSet = function (objects, key, value) { - var node = listGetNode(objects, key); - if (node) { - node.value = value; - } else { - // Prepend the new node to the beginning of the list - objects.next = /** @type {import('./list.d.ts').ListNode} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens - key: key, - next: objects.next, - value: value - }); - } -}; -/** @type {import('./list.d.ts').listHas} */ -var listHas = function (objects, key) { - if (!objects) { - return false; - } - return !!listGetNode(objects, key); -}; -/** @type {import('./list.d.ts').listDelete} */ -// eslint-disable-next-line consistent-return -var listDelete = function (objects, key) { - if (objects) { - return listGetNode(objects, key, true); - } -}; - -/** @type {import('.')} */ -module.exports = function getSideChannelList() { - /** @typedef {ReturnType} Channel */ - /** @typedef {Parameters[0]} K */ - /** @typedef {Parameters[1]} V */ - - /** @type {import('./list.d.ts').RootNode | undefined} */ var $o; - - /** @type {Channel} */ - var channel = { - assert: function (key) { - if (!channel.has(key)) { - throw new $TypeError('Side channel does not contain ' + inspect(key)); - } - }, - 'delete': function (key) { - var root = $o && $o.next; - var deletedNode = listDelete($o, key); - if (deletedNode && root && root === deletedNode) { - $o = void undefined; - } - return !!deletedNode; - }, - get: function (key) { - return listGet($o, key); - }, - has: function (key) { - return listHas($o, key); - }, - set: function (key, value) { - if (!$o) { - // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head - $o = { - next: void undefined - }; - } - // eslint-disable-next-line no-extra-parens - listSet(/** @type {NonNullable} */ ($o), key, value); - } - }; - // @ts-expect-error TODO: figure out why this is erroring - return channel; -}; diff --git a/node_modules/side-channel-list/list.d.ts b/node_modules/side-channel-list/list.d.ts deleted file mode 100644 index 2c759e2..0000000 --- a/node_modules/side-channel-list/list.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -type ListNode = { - key: K; - next: undefined | ListNode; - value: T; -}; -type RootNode = { - next: undefined | ListNode; -}; - -export function listGetNode(list: RootNode, key: ListNode['key'], isDelete?: boolean): ListNode | undefined; -export function listGet(objects: undefined | RootNode, key: ListNode['key']): T | undefined; -export function listSet(objects: RootNode, key: ListNode['key'], value: T): void; -export function listHas(objects: undefined | RootNode, key: ListNode['key']): boolean; -export function listDelete(objects: undefined | RootNode, key: ListNode['key']): ListNode | undefined; diff --git a/node_modules/side-channel-list/package.json b/node_modules/side-channel-list/package.json deleted file mode 100644 index ba0f5c5..0000000 --- a/node_modules/side-channel-list/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "side-channel-list", - "version": "1.0.0", - "description": "Store information about any JS value in a side channel, using a linked list", - "main": "index.js", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "types": "./index.d.ts", - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", - "lint": "eslint --ext=js,mjs .", - "postlint": "tsc -p . && attw -P", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "npx npm@'>= 10.2' audit --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/side-channel-list.git" - }, - "keywords": [], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/side-channel-list/issues" - }, - "homepage": "https://github.com/ljharb/side-channel-list#readme", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "devDependencies": { - "@arethetypeswrong/cli": "^0.17.1", - "@ljharb/eslint-config": "^21.1.1", - "@ljharb/tsconfig": "^0.2.2", - "@types/object-inspect": "^1.13.0", - "@types/tape": "^5.6.5", - "auto-changelog": "^2.5.0", - "eclint": "^2.8.1", - "encoding": "^0.1.13", - "eslint": "=8.8.0", - "evalmd": "^0.0.19", - "in-publish": "^2.0.1", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "tape": "^5.9.0", - "typescript": "next" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - }, - "engines": { - "node": ">= 0.4" - } -} diff --git a/node_modules/side-channel-list/test/index.js b/node_modules/side-channel-list/test/index.js deleted file mode 100644 index 3ad4368..0000000 --- a/node_modules/side-channel-list/test/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var getSideChannelList = require('../'); - -test('getSideChannelList', function (t) { - t.test('export', function (st) { - st.equal(typeof getSideChannelList, 'function', 'is a function'); - - st.equal(getSideChannelList.length, 0, 'takes no arguments'); - - var channel = getSideChannelList(); - st.ok(channel, 'is truthy'); - st.equal(typeof channel, 'object', 'is an object'); - st.end(); - }); - - t.test('assert', function (st) { - var channel = getSideChannelList(); - st['throws']( - function () { channel.assert({}); }, - TypeError, - 'nonexistent value throws' - ); - - var o = {}; - channel.set(o, 'data'); - st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); - - st.end(); - }); - - t.test('has', function (st) { - var channel = getSideChannelList(); - /** @type {unknown[]} */ var o = []; - - st.equal(channel.has(o), false, 'nonexistent value yields false'); - - channel.set(o, 'foo'); - st.equal(channel.has(o), true, 'existent value yields true'); - - st.equal(channel.has('abc'), false, 'non object value non existent yields false'); - - channel.set('abc', 'foo'); - st.equal(channel.has('abc'), true, 'non object value that exists yields true'); - - st.end(); - }); - - t.test('get', function (st) { - var channel = getSideChannelList(); - var o = {}; - st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); - - var data = {}; - channel.set(o, data); - st.equal(channel.get(o), data, '"get" yields data set by "set"'); - - st.end(); - }); - - t.test('set', function (st) { - var channel = getSideChannelList(); - var o = function () {}; - st.equal(channel.get(o), undefined, 'value not set'); - - channel.set(o, 42); - st.equal(channel.get(o), 42, 'value was set'); - - channel.set(o, Infinity); - st.equal(channel.get(o), Infinity, 'value was set again'); - - var o2 = {}; - channel.set(o2, 17); - st.equal(channel.get(o), Infinity, 'o is not modified'); - st.equal(channel.get(o2), 17, 'o2 is set'); - - channel.set(o, 14); - st.equal(channel.get(o), 14, 'o is modified'); - st.equal(channel.get(o2), 17, 'o2 is not modified'); - - st.end(); - }); - - t.test('delete', function (st) { - var channel = getSideChannelList(); - var o = {}; - st.equal(channel['delete']({}), false, 'nonexistent value yields false'); - - channel.set(o, 42); - st.equal(channel.has(o), true, 'value is set'); - - st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); - - st.equal(channel['delete'](o), true, 'deleted value yields true'); - - st.equal(channel.has(o), false, 'value is no longer set'); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/side-channel-list/tsconfig.json b/node_modules/side-channel-list/tsconfig.json deleted file mode 100644 index d9a6668..0000000 --- a/node_modules/side-channel-list/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@ljharb/tsconfig", - "compilerOptions": { - "target": "es2021", - }, - "exclude": [ - "coverage", - ], -} diff --git a/node_modules/side-channel-map/.editorconfig b/node_modules/side-channel-map/.editorconfig deleted file mode 100644 index 72e0eba..0000000 --- a/node_modules/side-channel-map/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = tab -indent_size = 2 -trim_trailing_whitespace = true diff --git a/node_modules/side-channel-map/.eslintrc b/node_modules/side-channel-map/.eslintrc deleted file mode 100644 index 93978e7..0000000 --- a/node_modules/side-channel-map/.eslintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "max-lines-per-function": 0, - "multiline-comment-style": 1, - "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], - }, -} diff --git a/node_modules/side-channel-map/.github/FUNDING.yml b/node_modules/side-channel-map/.github/FUNDING.yml deleted file mode 100644 index f2891bd..0000000 --- a/node_modules/side-channel-map/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/side-channel-map -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/side-channel-map/.nycrc b/node_modules/side-channel-map/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/side-channel-map/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/side-channel-map/CHANGELOG.md b/node_modules/side-channel-map/CHANGELOG.md deleted file mode 100644 index b6ccea9..0000000 --- a/node_modules/side-channel-map/CHANGELOG.md +++ /dev/null @@ -1,22 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.1](https://github.com/ljharb/side-channel-map/compare/v1.0.0...v1.0.1) - 2024-12-10 - -### Commits - -- [Deps] update `call-bound` [`6d05aaa`](https://github.com/ljharb/side-channel-map/commit/6d05aaa4ce5f2be4e7825df433d650696f0ba40f) -- [types] fix generics ordering [`11c0184`](https://github.com/ljharb/side-channel-map/commit/11c0184132ac11fdc16857e12682e148e5e9ee74) - -## v1.0.0 - 2024-12-10 - -### Commits - -- Initial implementation, tests, readme, types [`ad877b4`](https://github.com/ljharb/side-channel-map/commit/ad877b42926d46d63fff76a2bd01d2b4a01959a9) -- Initial commit [`28f8879`](https://github.com/ljharb/side-channel-map/commit/28f8879c512abe8fcf9b6a4dc7754a0287e5eba4) -- npm init [`2c9604e`](https://github.com/ljharb/side-channel-map/commit/2c9604e5aa40223e425ea7cea78f8a07697504bd) -- Only apps should have lockfiles [`5e7ba9c`](https://github.com/ljharb/side-channel-map/commit/5e7ba9cffe3ef42095815adc8ac1255b49bbadf5) diff --git a/node_modules/side-channel-map/LICENSE b/node_modules/side-channel-map/LICENSE deleted file mode 100644 index f82f389..0000000 --- a/node_modules/side-channel-map/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/side-channel-map/README.md b/node_modules/side-channel-map/README.md deleted file mode 100644 index 8fa6f77..0000000 --- a/node_modules/side-channel-map/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# side-channel-map [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Store information about any JS value in a side channel, using a Map. - -Warning: if the `key` is an object, this implementation will leak memory until you `delete` it. -Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. - -## Getting started - -```sh -npm install --save side-channel-map -``` - -## Usage/Examples - -```js -const assert = require('assert'); -const getSideChannelMap = require('side-channel-map'); - -const channel = getSideChannelMap(); - -const key = {}; -assert.equal(channel.has(key), false); -assert.throws(() => channel.assert(key), TypeError); - -channel.set(key, 42); - -channel.assert(key); // does not throw -assert.equal(channel.has(key), true); -assert.equal(channel.get(key), 42); - -channel.delete(key); -assert.equal(channel.has(key), false); -assert.throws(() => channel.assert(key), TypeError); -``` - -## Tests - -Clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/side-channel-map -[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-map.svg -[deps-svg]: https://david-dm.org/ljharb/side-channel-map.svg -[deps-url]: https://david-dm.org/ljharb/side-channel-map -[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-map/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/side-channel-map#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/side-channel-map.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/side-channel-map.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/side-channel-map.svg -[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-map -[codecov-image]: https://codecov.io/gh/ljharb/side-channel-map/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-map/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-map -[actions-url]: https://github.com/ljharb/side-channel-map/actions diff --git a/node_modules/side-channel-map/index.d.ts b/node_modules/side-channel-map/index.d.ts deleted file mode 100644 index de33e89..0000000 --- a/node_modules/side-channel-map/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare namespace getSideChannelMap { - type Channel = { - assert: (key: K) => void; - has: (key: K) => boolean; - get: (key: K) => V | undefined; - set: (key: K, value: V) => void; - delete: (key: K) => boolean; - }; -} - -declare function getSideChannelMap(): getSideChannelMap.Channel; - -declare const x: false | typeof getSideChannelMap; - -export = x; diff --git a/node_modules/side-channel-map/index.js b/node_modules/side-channel-map/index.js deleted file mode 100644 index e111100..0000000 --- a/node_modules/side-channel-map/index.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); -var callBound = require('call-bound'); -var inspect = require('object-inspect'); - -var $TypeError = require('es-errors/type'); -var $Map = GetIntrinsic('%Map%', true); - -/** @type {(thisArg: Map, key: K) => V} */ -var $mapGet = callBound('Map.prototype.get', true); -/** @type {(thisArg: Map, key: K, value: V) => void} */ -var $mapSet = callBound('Map.prototype.set', true); -/** @type {(thisArg: Map, key: K) => boolean} */ -var $mapHas = callBound('Map.prototype.has', true); -/** @type {(thisArg: Map, key: K) => boolean} */ -var $mapDelete = callBound('Map.prototype.delete', true); -/** @type {(thisArg: Map) => number} */ -var $mapSize = callBound('Map.prototype.size', true); - -/** @type {import('.')} */ -module.exports = !!$Map && /** @type {Exclude} */ function getSideChannelMap() { - /** @typedef {ReturnType} Channel */ - /** @typedef {Parameters[0]} K */ - /** @typedef {Parameters[1]} V */ - - /** @type {Map | undefined} */ var $m; - - /** @type {Channel} */ - var channel = { - assert: function (key) { - if (!channel.has(key)) { - throw new $TypeError('Side channel does not contain ' + inspect(key)); - } - }, - 'delete': function (key) { - if ($m) { - var result = $mapDelete($m, key); - if ($mapSize($m) === 0) { - $m = void undefined; - } - return result; - } - return false; - }, - get: function (key) { // eslint-disable-line consistent-return - if ($m) { - return $mapGet($m, key); - } - }, - has: function (key) { - if ($m) { - return $mapHas($m, key); - } - return false; - }, - set: function (key, value) { - if (!$m) { - // @ts-expect-error TS can't handle narrowing a variable inside a closure - $m = new $Map(); - } - $mapSet($m, key, value); - } - }; - - // @ts-expect-error TODO: figure out why TS is erroring here - return channel; -}; diff --git a/node_modules/side-channel-map/package.json b/node_modules/side-channel-map/package.json deleted file mode 100644 index 18e8080..0000000 --- a/node_modules/side-channel-map/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "side-channel-map", - "version": "1.0.1", - "description": "Store information about any JS value in a side channel, using a Map", - "main": "index.js", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "types": "./index.d.ts", - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", - "lint": "eslint --ext=js,mjs .", - "postlint": "tsc -p . && attw -P", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "npx npm@'>= 10.2' audit --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/side-channel-map.git" - }, - "keywords": [], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/side-channel-map/issues" - }, - "homepage": "https://github.com/ljharb/side-channel-map#readme", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "devDependencies": { - "@arethetypeswrong/cli": "^0.17.1", - "@ljharb/eslint-config": "^21.1.1", - "@ljharb/tsconfig": "^0.2.2", - "@types/get-intrinsic": "^1.2.3", - "@types/object-inspect": "^1.13.0", - "@types/tape": "^5.6.5", - "auto-changelog": "^2.5.0", - "eclint": "^2.8.1", - "encoding": "^0.1.13", - "eslint": "=8.8.0", - "evalmd": "^0.0.19", - "in-publish": "^2.0.1", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "tape": "^5.9.0", - "typescript": "next" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - }, - "engines": { - "node": ">= 0.4" - } -} diff --git a/node_modules/side-channel-map/test/index.js b/node_modules/side-channel-map/test/index.js deleted file mode 100644 index 1743323..0000000 --- a/node_modules/side-channel-map/test/index.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var getSideChannelMap = require('../'); - -test('getSideChannelMap', { skip: typeof Map !== 'function' }, function (t) { - var getSideChannel = getSideChannelMap || function () { - throw new EvalError('should never happen'); - }; - - t.test('export', function (st) { - st.equal(typeof getSideChannel, 'function', 'is a function'); - - st.equal(getSideChannel.length, 0, 'takes no arguments'); - - var channel = getSideChannel(); - st.ok(channel, 'is truthy'); - st.equal(typeof channel, 'object', 'is an object'); - st.end(); - }); - - t.test('assert', function (st) { - var channel = getSideChannel(); - st['throws']( - function () { channel.assert({}); }, - TypeError, - 'nonexistent value throws' - ); - - var o = {}; - channel.set(o, 'data'); - st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); - - st.end(); - }); - - t.test('has', function (st) { - var channel = getSideChannel(); - /** @type {unknown[]} */ var o = []; - - st.equal(channel.has(o), false, 'nonexistent value yields false'); - - channel.set(o, 'foo'); - st.equal(channel.has(o), true, 'existent value yields true'); - - st.equal(channel.has('abc'), false, 'non object value non existent yields false'); - - channel.set('abc', 'foo'); - st.equal(channel.has('abc'), true, 'non object value that exists yields true'); - - st.end(); - }); - - t.test('get', function (st) { - var channel = getSideChannel(); - var o = {}; - st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); - - var data = {}; - channel.set(o, data); - st.equal(channel.get(o), data, '"get" yields data set by "set"'); - - st.end(); - }); - - t.test('set', function (st) { - var channel = getSideChannel(); - var o = function () {}; - st.equal(channel.get(o), undefined, 'value not set'); - - channel.set(o, 42); - st.equal(channel.get(o), 42, 'value was set'); - - channel.set(o, Infinity); - st.equal(channel.get(o), Infinity, 'value was set again'); - - var o2 = {}; - channel.set(o2, 17); - st.equal(channel.get(o), Infinity, 'o is not modified'); - st.equal(channel.get(o2), 17, 'o2 is set'); - - channel.set(o, 14); - st.equal(channel.get(o), 14, 'o is modified'); - st.equal(channel.get(o2), 17, 'o2 is not modified'); - - st.end(); - }); - - t.test('delete', function (st) { - var channel = getSideChannel(); - var o = {}; - st.equal(channel['delete']({}), false, 'nonexistent value yields false'); - - channel.set(o, 42); - st.equal(channel.has(o), true, 'value is set'); - - st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); - - st.equal(channel['delete'](o), true, 'deleted value yields true'); - - st.equal(channel.has(o), false, 'value is no longer set'); - - st.end(); - }); - - t.end(); -}); - -test('getSideChannelMap, no Maps', { skip: typeof Map === 'function' }, function (t) { - t.equal(getSideChannelMap, false, 'is false'); - - t.end(); -}); diff --git a/node_modules/side-channel-map/tsconfig.json b/node_modules/side-channel-map/tsconfig.json deleted file mode 100644 index d9a6668..0000000 --- a/node_modules/side-channel-map/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@ljharb/tsconfig", - "compilerOptions": { - "target": "es2021", - }, - "exclude": [ - "coverage", - ], -} diff --git a/node_modules/side-channel-weakmap/.editorconfig b/node_modules/side-channel-weakmap/.editorconfig deleted file mode 100644 index 72e0eba..0000000 --- a/node_modules/side-channel-weakmap/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = tab -indent_size = 2 -trim_trailing_whitespace = true diff --git a/node_modules/side-channel-weakmap/.eslintrc b/node_modules/side-channel-weakmap/.eslintrc deleted file mode 100644 index 9b13ad8..0000000 --- a/node_modules/side-channel-weakmap/.eslintrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "id-length": 0, - "max-lines-per-function": 0, - "multiline-comment-style": 1, - "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], - }, -} diff --git a/node_modules/side-channel-weakmap/.github/FUNDING.yml b/node_modules/side-channel-weakmap/.github/FUNDING.yml deleted file mode 100644 index 2ae71cd..0000000 --- a/node_modules/side-channel-weakmap/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/side-channel-weakmap -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/side-channel-weakmap/.nycrc b/node_modules/side-channel-weakmap/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/side-channel-weakmap/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/side-channel-weakmap/CHANGELOG.md b/node_modules/side-channel-weakmap/CHANGELOG.md deleted file mode 100644 index aba7ab0..0000000 --- a/node_modules/side-channel-weakmap/CHANGELOG.md +++ /dev/null @@ -1,28 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.2](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.1...v1.0.2) - 2024-12-10 - -### Commits - -- [types] fix generics ordering [`1b62e94`](https://github.com/ljharb/side-channel-weakmap/commit/1b62e94a2ad6ed30b640ba73c4a2535836c67289) - -## [v1.0.1](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.0...v1.0.1) - 2024-12-10 - -### Commits - -- [types] fix generics ordering [`08a4a5d`](https://github.com/ljharb/side-channel-weakmap/commit/08a4a5dbffedc3ebc79f1aaaf5a3dd6d2196dc1b) -- [Deps] update `side-channel-map` [`b53fe44`](https://github.com/ljharb/side-channel-weakmap/commit/b53fe447dfdd3a9aebedfd015b384eac17fce916) - -## v1.0.0 - 2024-12-10 - -### Commits - -- Initial implementation, tests, readme, types [`53c0fa4`](https://github.com/ljharb/side-channel-weakmap/commit/53c0fa4788435a006f58b9d7b43cb65989ecee49) -- Initial commit [`a157947`](https://github.com/ljharb/side-channel-weakmap/commit/a157947f26fcaf2c4a941d3a044e76bf67343532) -- npm init [`54dfc55`](https://github.com/ljharb/side-channel-weakmap/commit/54dfc55bafb16265910d5aad4e743c43aee5bbbb) -- Only apps should have lockfiles [`0ddd6c7`](https://github.com/ljharb/side-channel-weakmap/commit/0ddd6c7b07fe8ee04d67b2e9f7255af7ce62c07d) diff --git a/node_modules/side-channel-weakmap/LICENSE b/node_modules/side-channel-weakmap/LICENSE deleted file mode 100644 index 3900dd7..0000000 --- a/node_modules/side-channel-weakmap/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/side-channel-weakmap/README.md b/node_modules/side-channel-weakmap/README.md deleted file mode 100644 index 856ee36..0000000 --- a/node_modules/side-channel-weakmap/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# side-channel-weakmap [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Store information about any JS value in a side channel. Uses WeakMap if available. - -Warning: this implementation will leak memory until you `delete` the `key`. -Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. - -## Getting started - -```sh -npm install --save side-channel-weakmap -``` - -## Usage/Examples - -```js -const assert = require('assert'); -const getSideChannelList = require('side-channel-weakmap'); - -const channel = getSideChannelList(); - -const key = {}; -assert.equal(channel.has(key), false); -assert.throws(() => channel.assert(key), TypeError); - -channel.set(key, 42); - -channel.assert(key); // does not throw -assert.equal(channel.has(key), true); -assert.equal(channel.get(key), 42); - -channel.delete(key); -assert.equal(channel.has(key), false); -assert.throws(() => channel.assert(key), TypeError); -``` - -## Tests - -Clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/side-channel-weakmap -[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-weakmap.svg -[deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap.svg -[deps-url]: https://david-dm.org/ljharb/side-channel-weakmap -[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/side-channel-weakmap#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/side-channel-weakmap.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/side-channel-weakmap.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/side-channel-weakmap.svg -[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-weakmap -[codecov-image]: https://codecov.io/gh/ljharb/side-channel-weakmap/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-weakmap/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-weakmap -[actions-url]: https://github.com/ljharb/side-channel-weakmap/actions diff --git a/node_modules/side-channel-weakmap/index.d.ts b/node_modules/side-channel-weakmap/index.d.ts deleted file mode 100644 index ce1bc2a..0000000 --- a/node_modules/side-channel-weakmap/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare namespace getSideChannelWeakMap { - type Channel = { - assert: (key: K) => void; - has: (key: K) => boolean; - get: (key: K) => V | undefined; - set: (key: K, value: V) => void; - delete: (key: K) => boolean; - } -} - -declare function getSideChannelWeakMap(): getSideChannelWeakMap.Channel; - -declare const x: false | typeof getSideChannelWeakMap; - -export = x; diff --git a/node_modules/side-channel-weakmap/index.js b/node_modules/side-channel-weakmap/index.js deleted file mode 100644 index e5b8183..0000000 --- a/node_modules/side-channel-weakmap/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); -var callBound = require('call-bound'); -var inspect = require('object-inspect'); -var getSideChannelMap = require('side-channel-map'); - -var $TypeError = require('es-errors/type'); -var $WeakMap = GetIntrinsic('%WeakMap%', true); - -/** @type {(thisArg: WeakMap, key: K) => V} */ -var $weakMapGet = callBound('WeakMap.prototype.get', true); -/** @type {(thisArg: WeakMap, key: K, value: V) => void} */ -var $weakMapSet = callBound('WeakMap.prototype.set', true); -/** @type {(thisArg: WeakMap, key: K) => boolean} */ -var $weakMapHas = callBound('WeakMap.prototype.has', true); -/** @type {(thisArg: WeakMap, key: K) => boolean} */ -var $weakMapDelete = callBound('WeakMap.prototype.delete', true); - -/** @type {import('.')} */ -module.exports = $WeakMap - ? /** @type {Exclude} */ function getSideChannelWeakMap() { - /** @typedef {ReturnType} Channel */ - /** @typedef {Parameters[0]} K */ - /** @typedef {Parameters[1]} V */ - - /** @type {WeakMap | undefined} */ var $wm; - /** @type {Channel | undefined} */ var $m; - - /** @type {Channel} */ - var channel = { - assert: function (key) { - if (!channel.has(key)) { - throw new $TypeError('Side channel does not contain ' + inspect(key)); - } - }, - 'delete': function (key) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $weakMapDelete($wm, key); - } - } else if (getSideChannelMap) { - if ($m) { - return $m['delete'](key); - } - } - return false; - }, - get: function (key) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $weakMapGet($wm, key); - } - } - return $m && $m.get(key); - }, - has: function (key) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $weakMapHas($wm, key); - } - } - return !!$m && $m.has(key); - }, - set: function (key, value) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if (!$wm) { - $wm = new $WeakMap(); - } - $weakMapSet($wm, key, value); - } else if (getSideChannelMap) { - if (!$m) { - $m = getSideChannelMap(); - } - // eslint-disable-next-line no-extra-parens - /** @type {NonNullable} */ ($m).set(key, value); - } - } - }; - - // @ts-expect-error TODO: figure out why this is erroring - return channel; - } - : getSideChannelMap; diff --git a/node_modules/side-channel-weakmap/package.json b/node_modules/side-channel-weakmap/package.json deleted file mode 100644 index 9ef6583..0000000 --- a/node_modules/side-channel-weakmap/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "side-channel-weakmap", - "version": "1.0.2", - "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", - "main": "index.js", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "types": "./index.d.ts", - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", - "lint": "eslint --ext=js,mjs .", - "postlint": "tsc -p . && attw -P", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "npx npm@'>=10.2' audit --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/side-channel-weakmap.git" - }, - "keywords": [ - "weakmap", - "map", - "side", - "channel", - "metadata" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/side-channel-weakmap/issues" - }, - "homepage": "https://github.com/ljharb/side-channel-weakmap#readme", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "devDependencies": { - "@arethetypeswrong/cli": "^0.17.1", - "@ljharb/eslint-config": "^21.1.1", - "@ljharb/tsconfig": "^0.2.2", - "@types/call-bind": "^1.0.5", - "@types/get-intrinsic": "^1.2.3", - "@types/object-inspect": "^1.13.0", - "@types/tape": "^5.6.5", - "auto-changelog": "^2.5.0", - "eclint": "^2.8.1", - "encoding": "^0.1.13", - "eslint": "=8.8.0", - "in-publish": "^2.0.1", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "tape": "^5.9.0", - "typescript": "next" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - }, - "engines": { - "node": ">= 0.4" - } -} diff --git a/node_modules/side-channel-weakmap/test/index.js b/node_modules/side-channel-weakmap/test/index.js deleted file mode 100644 index a01248b..0000000 --- a/node_modules/side-channel-weakmap/test/index.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var getSideChannelWeakMap = require('../'); - -test('getSideChannelMap', { skip: typeof WeakMap !== 'function' && typeof Map !== 'function' }, function (t) { - var getSideChannel = getSideChannelWeakMap || function () { - throw new EvalError('should never happen'); - }; - - t.test('export', function (st) { - st.equal(typeof getSideChannel, 'function', 'is a function'); - - st.equal(getSideChannel.length, 0, 'takes no arguments'); - - var channel = getSideChannel(); - st.ok(channel, 'is truthy'); - st.equal(typeof channel, 'object', 'is an object'); - st.end(); - }); - - t.test('assert', function (st) { - var channel = getSideChannel(); - st['throws']( - function () { channel.assert({}); }, - TypeError, - 'nonexistent value throws' - ); - - var o = {}; - channel.set(o, 'data'); - st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); - - st.end(); - }); - - t.test('has', function (st) { - var channel = getSideChannel(); - /** @type {unknown[]} */ var o = []; - - st.equal(channel.has(o), false, 'nonexistent value yields false'); - - channel.set(o, 'foo'); - st.equal(channel.has(o), true, 'existent value yields true'); - - st.equal(channel.has('abc'), false, 'non object value non existent yields false'); - - channel.set('abc', 'foo'); - st.equal(channel.has('abc'), true, 'non object value that exists yields true'); - - st.end(); - }); - - t.test('get', function (st) { - var channel = getSideChannel(); - var o = {}; - st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); - - var data = {}; - channel.set(o, data); - st.equal(channel.get(o), data, '"get" yields data set by "set"'); - - st.end(); - }); - - t.test('set', function (st) { - var channel = getSideChannel(); - var o = function () {}; - st.equal(channel.get(o), undefined, 'value not set'); - - channel.set(o, 42); - st.equal(channel.get(o), 42, 'value was set'); - - channel.set(o, Infinity); - st.equal(channel.get(o), Infinity, 'value was set again'); - - var o2 = {}; - channel.set(o2, 17); - st.equal(channel.get(o), Infinity, 'o is not modified'); - st.equal(channel.get(o2), 17, 'o2 is set'); - - channel.set(o, 14); - st.equal(channel.get(o), 14, 'o is modified'); - st.equal(channel.get(o2), 17, 'o2 is not modified'); - - st.end(); - }); - - t.test('delete', function (st) { - var channel = getSideChannel(); - var o = {}; - st.equal(channel['delete']({}), false, 'nonexistent value yields false'); - - channel.set(o, 42); - st.equal(channel.has(o), true, 'value is set'); - - st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); - - st.equal(channel['delete'](o), true, 'deleted value yields true'); - - st.equal(channel.has(o), false, 'value is no longer set'); - - st.end(); - }); - - t.end(); -}); - -test('getSideChannelMap, no WeakMaps and/or Maps', { skip: typeof WeakMap === 'function' || typeof Map === 'function' }, function (t) { - t.equal(getSideChannelWeakMap, false, 'is false'); - - t.end(); -}); diff --git a/node_modules/side-channel-weakmap/tsconfig.json b/node_modules/side-channel-weakmap/tsconfig.json deleted file mode 100644 index d9a6668..0000000 --- a/node_modules/side-channel-weakmap/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@ljharb/tsconfig", - "compilerOptions": { - "target": "es2021", - }, - "exclude": [ - "coverage", - ], -} diff --git a/node_modules/side-channel/.editorconfig b/node_modules/side-channel/.editorconfig deleted file mode 100644 index 72e0eba..0000000 --- a/node_modules/side-channel/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = tab -indent_size = 2 -trim_trailing_whitespace = true diff --git a/node_modules/side-channel/.eslintrc b/node_modules/side-channel/.eslintrc deleted file mode 100644 index 9b13ad8..0000000 --- a/node_modules/side-channel/.eslintrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "id-length": 0, - "max-lines-per-function": 0, - "multiline-comment-style": 1, - "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], - }, -} diff --git a/node_modules/side-channel/.github/FUNDING.yml b/node_modules/side-channel/.github/FUNDING.yml deleted file mode 100644 index 2a94840..0000000 --- a/node_modules/side-channel/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/side-channel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/side-channel/.nycrc b/node_modules/side-channel/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/side-channel/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/side-channel/CHANGELOG.md b/node_modules/side-channel/CHANGELOG.md deleted file mode 100644 index 58e378c..0000000 --- a/node_modules/side-channel/CHANGELOG.md +++ /dev/null @@ -1,110 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.1.0](https://github.com/ljharb/side-channel/compare/v1.0.6...v1.1.0) - 2024-12-11 - -### Commits - -- [Refactor] extract implementations to `side-channel-weakmap`, `side-channel-map`, `side-channel-list` [`ada5955`](https://github.com/ljharb/side-channel/commit/ada595549a5c4c6c853756d598846b180941c6da) -- [New] add `channel.delete` [`c01d2d3`](https://github.com/ljharb/side-channel/commit/c01d2d3fd51dbb1ce6da72ad7916e61bd6172aad) -- [types] improve types [`0c54356`](https://github.com/ljharb/side-channel/commit/0c5435651417df41b8cc1a5f7cdce8bffae68cde) -- [readme] add content [`be24868`](https://github.com/ljharb/side-channel/commit/be248682ac294b0e22c883092c45985aa91c490a) -- [actions] split out node 10-20, and 20+ [`c4488e2`](https://github.com/ljharb/side-channel/commit/c4488e241ef3d49a19fe266ac830a2e644305911) -- [types] use shared tsconfig [`0e0d57c`](https://github.com/ljharb/side-channel/commit/0e0d57c2ff17c7b45c6cbd43ebcf553edc9e3adc) -- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/object-inspect`, `@types/tape`, `auto-changelog`, `tape` [`fb4f622`](https://github.com/ljharb/side-channel/commit/fb4f622e64a99a1e40b6e5cd7691674a9dc429e4) -- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`b78336b`](https://github.com/ljharb/side-channel/commit/b78336b886172d1b457d414ac9e28de8c5fecc78) -- [Tests] replace `aud` with `npm audit` [`ee3ab46`](https://github.com/ljharb/side-channel/commit/ee3ab4690d954311c35115651bcfd45edd205aa1) -- [Dev Deps] add missing peer dep [`c03e21a`](https://github.com/ljharb/side-channel/commit/c03e21a7def3b67cdc15ae22316884fefcb2f6a8) - -## [v1.0.6](https://github.com/ljharb/side-channel/compare/v1.0.5...v1.0.6) - 2024-02-29 - -### Commits - -- add types [`9beef66`](https://github.com/ljharb/side-channel/commit/9beef6643e6d717ea57bedabf86448123a7dd9e9) -- [meta] simplify `exports` [`4334cf9`](https://github.com/ljharb/side-channel/commit/4334cf9df654151504c383b62a2f9ebdc8d9d5ac) -- [Deps] update `call-bind` [`d6043c4`](https://github.com/ljharb/side-channel/commit/d6043c4d8f4d7be9037dd0f0419c7a2e0e39ec6a) -- [Dev Deps] update `tape` [`6aca376`](https://github.com/ljharb/side-channel/commit/6aca3761868dc8cd5ff7fd9799bf6b95e09a6eb0) - -## [v1.0.5](https://github.com/ljharb/side-channel/compare/v1.0.4...v1.0.5) - 2024-02-06 - -### Commits - -- [actions] reuse common workflows [`3d2e1ff`](https://github.com/ljharb/side-channel/commit/3d2e1ffd16dd6eaaf3e40ff57951f840d2d63c04) -- [meta] use `npmignore` to autogenerate an npmignore file [`04296ea`](https://github.com/ljharb/side-channel/commit/04296ea17d1544b0a5d20fd5bfb31aa4f6513eb9) -- [meta] add `.editorconfig`; add `eclint` [`130f0a6`](https://github.com/ljharb/side-channel/commit/130f0a6adbc04d385c7456a601d38344dce3d6a9) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`d480c2f`](https://github.com/ljharb/side-channel/commit/d480c2fbe757489ae9b4275491ffbcc3ac4725e9) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ecbe70e`](https://github.com/ljharb/side-channel/commit/ecbe70e53a418234081a77971fec1fdfae20c841) -- [actions] update rebase action [`75240b9`](https://github.com/ljharb/side-channel/commit/75240b9963b816e8846400d2287cb68f88c7fba7) -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`ae8d281`](https://github.com/ljharb/side-channel/commit/ae8d281572430099109870fd9430d2ca3f320b8d) -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`7125b88`](https://github.com/ljharb/side-channel/commit/7125b885fd0eacad4fee9b073b72d14065ece278) -- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`82577c9`](https://github.com/ljharb/side-channel/commit/82577c9796304519139a570f82a317211b5f3b86) -- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`550aadf`](https://github.com/ljharb/side-channel/commit/550aadf20475a6081fd70304cc54f77259a5c8a8) -- [Tests] increase coverage [`5130877`](https://github.com/ljharb/side-channel/commit/5130877a7b27c862e64e6d1c12a178b28808859d) -- [Deps] update `get-intrinsic`, `object-inspect` [`ba0194c`](https://github.com/ljharb/side-channel/commit/ba0194c505b1a8a0427be14cadd5b8a46d4d01b8) -- [meta] add missing `engines.node` [`985fd24`](https://github.com/ljharb/side-channel/commit/985fd249663cb06617a693a94fe08cad12f5cb70) -- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`40227a8`](https://github.com/ljharb/side-channel/commit/40227a87b01709ad2c0eebf87eb4223a800099b9) -- [Deps] update `get-intrinsic` [`a989b40`](https://github.com/ljharb/side-channel/commit/a989b4024958737ae7be9fbffdeff2078f33a0fd) -- [Deps] update `object-inspect` [`aec42d2`](https://github.com/ljharb/side-channel/commit/aec42d2ec541a31aaa02475692c87d489237d9a3) - -## [v1.0.4](https://github.com/ljharb/side-channel/compare/v1.0.3...v1.0.4) - 2020-12-29 - -### Commits - -- [Tests] migrate tests to Github Actions [`10909cb`](https://github.com/ljharb/side-channel/commit/10909cbf8ce9c0bf96f604cf13d7ffd5a22c2d40) -- [Refactor] Use a linked list rather than an array, and move accessed nodes to the beginning [`195613f`](https://github.com/ljharb/side-channel/commit/195613f28b5c1e6072ef0b61b5beebaf2b6a304e) -- [meta] do not publish github action workflow files [`290ec29`](https://github.com/ljharb/side-channel/commit/290ec29cd21a60585145b4a7237ec55228c52c27) -- [Tests] run `nyc` on all tests; use `tape` runner [`ea6d030`](https://github.com/ljharb/side-channel/commit/ea6d030ff3fe6be2eca39e859d644c51ecd88869) -- [actions] add "Allow Edits" workflow [`d464d8f`](https://github.com/ljharb/side-channel/commit/d464d8fe52b5eddf1504a0ed97f0941a90f32c15) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog` [`02daca8`](https://github.com/ljharb/side-channel/commit/02daca87c6809821c97be468d1afa2f5ef447383) -- [Refactor] use `call-bind` and `get-intrinsic` instead of `es-abstract` [`e09d481`](https://github.com/ljharb/side-channel/commit/e09d481528452ebafa5cdeae1af665c35aa2deee) -- [Deps] update `object.assign` [`ee83aa8`](https://github.com/ljharb/side-channel/commit/ee83aa81df313b5e46319a63adb05cf0c179079a) -- [actions] update rebase action to use checkout v2 [`7726b0b`](https://github.com/ljharb/side-channel/commit/7726b0b058b632fccea709f58960871defaaa9d7) - -## [v1.0.3](https://github.com/ljharb/side-channel/compare/v1.0.2...v1.0.3) - 2020-08-23 - -### Commits - -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`1f10561`](https://github.com/ljharb/side-channel/commit/1f105611ef3acf32dec8032ae5c0baa5e56bb868) -- [Deps] update `es-abstract`, `object-inspect` [`bc20159`](https://github.com/ljharb/side-channel/commit/bc201597949a505e37cef9eaf24c7010831e6f03) -- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`b9b2b22`](https://github.com/ljharb/side-channel/commit/b9b2b225f9e0ea72a6ec2b89348f0bd690bc9ed1) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7055ab4`](https://github.com/ljharb/side-channel/commit/7055ab4de0860606efd2003674a74f1fe6ebc07e) -- [Dev Deps] update `auto-changelog`; add `aud` [`d278c37`](https://github.com/ljharb/side-channel/commit/d278c37d08227be4f84aa769fcd919e73feeba40) -- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`3bcf982`](https://github.com/ljharb/side-channel/commit/3bcf982faa122745b39c33ce83d32fdf003741c6) -- [Tests] only audit prod deps [`18d01c4`](https://github.com/ljharb/side-channel/commit/18d01c4015b82a3d75044c4d5ba7917b2eac01ec) -- [Deps] update `es-abstract` [`6ab096d`](https://github.com/ljharb/side-channel/commit/6ab096d9de2b482cf5e0717e34e212f5b2b9bc9a) -- [Dev Deps] update `tape` [`9dc174c`](https://github.com/ljharb/side-channel/commit/9dc174cc651dfd300b4b72da936a0a7eda5f9452) -- [Deps] update `es-abstract` [`431d0f0`](https://github.com/ljharb/side-channel/commit/431d0f0ff11fbd2ae6f3115582a356d3a1cfce82) -- [Deps] update `es-abstract` [`49869fd`](https://github.com/ljharb/side-channel/commit/49869fd323bf4453f0ba515c0fb265cf5ab7b932) -- [meta] Add package.json to package's exports [`77d9cdc`](https://github.com/ljharb/side-channel/commit/77d9cdceb2a9e47700074f2ae0c0a202e7dac0d4) - -## [v1.0.2](https://github.com/ljharb/side-channel/compare/v1.0.1...v1.0.2) - 2019-12-20 - -### Commits - -- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`4a526df`](https://github.com/ljharb/side-channel/commit/4a526df44e4701566ed001ec78546193f818b082) -- [Deps] update `es-abstract` [`d4f6e62`](https://github.com/ljharb/side-channel/commit/d4f6e629b6fb93a07415db7f30d3c90fd7f264fe) - -## [v1.0.1](https://github.com/ljharb/side-channel/compare/v1.0.0...v1.0.1) - 2019-12-01 - -### Commits - -- [Fix] add missing "exports" [`d212907`](https://github.com/ljharb/side-channel/commit/d2129073abf0701a5343bf28aa2145617604dc2e) - -## v1.0.0 - 2019-12-01 - -### Commits - -- Initial implementation [`dbebd3a`](https://github.com/ljharb/side-channel/commit/dbebd3a4b5ed64242f9a6810efe7c4214cd8cde4) -- Initial tests [`73bdefe`](https://github.com/ljharb/side-channel/commit/73bdefe568c9076cf8c0b8719bc2141aec0e19b8) -- Initial commit [`43c03e1`](https://github.com/ljharb/side-channel/commit/43c03e1c2849ec50a87b7a5cd76238a62b0b8770) -- npm init [`5c090a7`](https://github.com/ljharb/side-channel/commit/5c090a765d66a5527d9889b89aeff78dee91348c) -- [meta] add `auto-changelog` [`a5c4e56`](https://github.com/ljharb/side-channel/commit/a5c4e5675ec02d5eb4d84b4243aeea2a1d38fbec) -- [actions] add automatic rebasing / merge commit blocking [`bab1683`](https://github.com/ljharb/side-channel/commit/bab1683d8f9754b086e94397699fdc645e0d7077) -- [meta] add `funding` field; create FUNDING.yml [`63d7aea`](https://github.com/ljharb/side-channel/commit/63d7aeaf34f5650650ae97ca4b9fae685bd0937c) -- [Tests] add `npm run lint` [`46a5a81`](https://github.com/ljharb/side-channel/commit/46a5a81705cd2664f83df232c01dbbf2ee952885) -- Only apps should have lockfiles [`8b16b03`](https://github.com/ljharb/side-channel/commit/8b16b0305f00895d90c4e2e5773c854cfea0e448) -- [meta] add `safe-publish-latest` [`2f098ef`](https://github.com/ljharb/side-channel/commit/2f098ef092a39399cfe548b19a1fc03c2fd2f490) diff --git a/node_modules/side-channel/LICENSE b/node_modules/side-channel/LICENSE deleted file mode 100644 index 3900dd7..0000000 --- a/node_modules/side-channel/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/side-channel/README.md b/node_modules/side-channel/README.md deleted file mode 100644 index cc7e103..0000000 --- a/node_modules/side-channel/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# side-channel [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Store information about any JS value in a side channel. Uses WeakMap if available. - -Warning: in an environment that lacks `WeakMap`, this implementation will leak memory until you `delete` the `key`. - -## Getting started - -```sh -npm install --save side-channel -``` - -## Usage/Examples - -```js -const assert = require('assert'); -const getSideChannel = require('side-channel'); - -const channel = getSideChannel(); - -const key = {}; -assert.equal(channel.has(key), false); -assert.throws(() => channel.assert(key), TypeError); - -channel.set(key, 42); - -channel.assert(key); // does not throw -assert.equal(channel.has(key), true); -assert.equal(channel.get(key), 42); - -channel.delete(key); -assert.equal(channel.has(key), false); -assert.throws(() => channel.assert(key), TypeError); -``` - -## Tests - -Clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/side-channel -[npm-version-svg]: https://versionbadg.es/ljharb/side-channel.svg -[deps-svg]: https://david-dm.org/ljharb/side-channel.svg -[deps-url]: https://david-dm.org/ljharb/side-channel -[dev-deps-svg]: https://david-dm.org/ljharb/side-channel/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/side-channel#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/side-channel.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/side-channel.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/side-channel.svg -[downloads-url]: https://npm-stat.com/charts.html?package=side-channel -[codecov-image]: https://codecov.io/gh/ljharb/side-channel/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel -[actions-url]: https://github.com/ljharb/side-channel/actions diff --git a/node_modules/side-channel/index.d.ts b/node_modules/side-channel/index.d.ts deleted file mode 100644 index 18c6317..0000000 --- a/node_modules/side-channel/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import getSideChannelList from 'side-channel-list'; -import getSideChannelMap from 'side-channel-map'; -import getSideChannelWeakMap from 'side-channel-weakmap'; - -declare namespace getSideChannel { - type Channel = - | getSideChannelList.Channel - | ReturnType, false>> - | ReturnType, false>>; -} - -declare function getSideChannel(): getSideChannel.Channel; - -export = getSideChannel; diff --git a/node_modules/side-channel/index.js b/node_modules/side-channel/index.js deleted file mode 100644 index a8a9b05..0000000 --- a/node_modules/side-channel/index.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -var $TypeError = require('es-errors/type'); -var inspect = require('object-inspect'); -var getSideChannelList = require('side-channel-list'); -var getSideChannelMap = require('side-channel-map'); -var getSideChannelWeakMap = require('side-channel-weakmap'); - -var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; - -/** @type {import('.')} */ -module.exports = function getSideChannel() { - /** @typedef {ReturnType} Channel */ - - /** @type {Channel | undefined} */ var $channelData; - - /** @type {Channel} */ - var channel = { - assert: function (key) { - if (!channel.has(key)) { - throw new $TypeError('Side channel does not contain ' + inspect(key)); - } - }, - 'delete': function (key) { - return !!$channelData && $channelData['delete'](key); - }, - get: function (key) { - return $channelData && $channelData.get(key); - }, - has: function (key) { - return !!$channelData && $channelData.has(key); - }, - set: function (key, value) { - if (!$channelData) { - $channelData = makeChannel(); - } - - $channelData.set(key, value); - } - }; - // @ts-expect-error TODO: figure out why this is erroring - return channel; -}; diff --git a/node_modules/side-channel/package.json b/node_modules/side-channel/package.json deleted file mode 100644 index 30fa42c..0000000 --- a/node_modules/side-channel/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "side-channel", - "version": "1.1.0", - "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", - "main": "index.js", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "types": "./index.d.ts", - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", - "lint": "eslint --ext=js,mjs .", - "postlint": "tsc -p . && attw -P", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "npx npm@'>=10.2' audit --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/side-channel.git" - }, - "keywords": [ - "weakmap", - "map", - "side", - "channel", - "metadata" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/side-channel/issues" - }, - "homepage": "https://github.com/ljharb/side-channel#readme", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "devDependencies": { - "@arethetypeswrong/cli": "^0.17.1", - "@ljharb/eslint-config": "^21.1.1", - "@ljharb/tsconfig": "^0.2.2", - "@types/object-inspect": "^1.13.0", - "@types/tape": "^5.6.5", - "auto-changelog": "^2.5.0", - "eclint": "^2.8.1", - "encoding": "^0.1.13", - "eslint": "=8.8.0", - "in-publish": "^2.0.1", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "tape": "^5.9.0", - "typescript": "next" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - }, - "engines": { - "node": ">= 0.4" - } -} diff --git a/node_modules/side-channel/test/index.js b/node_modules/side-channel/test/index.js deleted file mode 100644 index bd1e7c2..0000000 --- a/node_modules/side-channel/test/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var getSideChannel = require('../'); - -test('getSideChannel', function (t) { - t.test('export', function (st) { - st.equal(typeof getSideChannel, 'function', 'is a function'); - - st.equal(getSideChannel.length, 0, 'takes no arguments'); - - var channel = getSideChannel(); - st.ok(channel, 'is truthy'); - st.equal(typeof channel, 'object', 'is an object'); - st.end(); - }); - - t.test('assert', function (st) { - var channel = getSideChannel(); - st['throws']( - function () { channel.assert({}); }, - TypeError, - 'nonexistent value throws' - ); - - var o = {}; - channel.set(o, 'data'); - st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); - - st.end(); - }); - - t.test('has', function (st) { - var channel = getSideChannel(); - /** @type {unknown[]} */ var o = []; - - st.equal(channel.has(o), false, 'nonexistent value yields false'); - - channel.set(o, 'foo'); - st.equal(channel.has(o), true, 'existent value yields true'); - - st.equal(channel.has('abc'), false, 'non object value non existent yields false'); - - channel.set('abc', 'foo'); - st.equal(channel.has('abc'), true, 'non object value that exists yields true'); - - st.end(); - }); - - t.test('get', function (st) { - var channel = getSideChannel(); - var o = {}; - st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); - - var data = {}; - channel.set(o, data); - st.equal(channel.get(o), data, '"get" yields data set by "set"'); - - st.end(); - }); - - t.test('set', function (st) { - var channel = getSideChannel(); - var o = function () {}; - st.equal(channel.get(o), undefined, 'value not set'); - - channel.set(o, 42); - st.equal(channel.get(o), 42, 'value was set'); - - channel.set(o, Infinity); - st.equal(channel.get(o), Infinity, 'value was set again'); - - var o2 = {}; - channel.set(o2, 17); - st.equal(channel.get(o), Infinity, 'o is not modified'); - st.equal(channel.get(o2), 17, 'o2 is set'); - - channel.set(o, 14); - st.equal(channel.get(o), 14, 'o is modified'); - st.equal(channel.get(o2), 17, 'o2 is not modified'); - - st.end(); - }); - - t.test('delete', function (st) { - var channel = getSideChannel(); - var o = {}; - st.equal(channel['delete']({}), false, 'nonexistent value yields false'); - - channel.set(o, 42); - st.equal(channel.has(o), true, 'value is set'); - - st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); - - st.equal(channel['delete'](o), true, 'deleted value yields true'); - - st.equal(channel.has(o), false, 'value is no longer set'); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/side-channel/tsconfig.json b/node_modules/side-channel/tsconfig.json deleted file mode 100644 index d9a6668..0000000 --- a/node_modules/side-channel/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@ljharb/tsconfig", - "compilerOptions": { - "target": "es2021", - }, - "exclude": [ - "coverage", - ], -} diff --git a/node_modules/statuses/HISTORY.md b/node_modules/statuses/HISTORY.md deleted file mode 100644 index dc549b8..0000000 --- a/node_modules/statuses/HISTORY.md +++ /dev/null @@ -1,87 +0,0 @@ -2.0.2 / 2025-06-06 -================== - - * Migrate to `String.prototype.slice()` - -2.0.1 / 2021-01-03 -================== - - * Fix returning values from `Object.prototype` - -2.0.0 / 2020-04-19 -================== - - * Drop support for Node.js 0.6 - * Fix messaging casing of `418 I'm a Teapot` - * Remove code 306 - * Remove `status[code]` exports; use `status.message[code]` - * Remove `status[msg]` exports; use `status.code[msg]` - * Rename `425 Unordered Collection` to standard `425 Too Early` - * Rename `STATUS_CODES` export to `message` - * Return status message for `statuses(code)` when given code - -1.5.0 / 2018-03-27 -================== - - * Add `103 Early Hints` - -1.4.0 / 2017-10-20 -================== - - * Add `STATUS_CODES` export - -1.3.1 / 2016-11-11 -================== - - * Fix return type in JSDoc - -1.3.0 / 2016-05-17 -================== - - * Add `421 Misdirected Request` - * perf: enable strict mode - -1.2.1 / 2015-02-01 -================== - - * Fix message for status 451 - - `451 Unavailable For Legal Reasons` - -1.2.0 / 2014-09-28 -================== - - * Add `208 Already Repored` - * Add `226 IM Used` - * Add `306 (Unused)` - * Add `415 Unable For Legal Reasons` - * Add `508 Loop Detected` - -1.1.1 / 2014-09-24 -================== - - * Add missing 308 to `codes.json` - -1.1.0 / 2014-09-21 -================== - - * Add `codes.json` for universal support - -1.0.4 / 2014-08-20 -================== - - * Package cleanup - -1.0.3 / 2014-06-08 -================== - - * Add 308 to `.redirect` category - -1.0.2 / 2014-03-13 -================== - - * Add `.retry` category - -1.0.1 / 2014-03-12 -================== - - * Initial release diff --git a/node_modules/statuses/LICENSE b/node_modules/statuses/LICENSE deleted file mode 100644 index 28a3161..0000000 --- a/node_modules/statuses/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2016 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/statuses/README.md b/node_modules/statuses/README.md deleted file mode 100644 index 89d542f..0000000 --- a/node_modules/statuses/README.md +++ /dev/null @@ -1,139 +0,0 @@ -# statuses - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] -[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] - -HTTP status utility for node. - -This module provides a list of status codes and messages sourced from -a few different projects: - - * The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) - * The [Node.js project](https://nodejs.org/) - * The [NGINX project](https://www.nginx.com/) - * The [Apache HTTP Server project](https://httpd.apache.org/) - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install statuses -``` - -## API - - - -```js -var status = require('statuses') -``` - -### status(code) - -Returns the status message string for a known HTTP status code. The code -may be a number or a string. An error is thrown for an unknown status code. - - - -```js -status(403) // => 'Forbidden' -status('403') // => 'Forbidden' -status(306) // throws -``` - -### status(msg) - -Returns the numeric status code for a known HTTP status message. The message -is case-insensitive. An error is thrown for an unknown status message. - - - -```js -status('forbidden') // => 403 -status('Forbidden') // => 403 -status('foo') // throws -``` - -### status.codes - -Returns an array of all the status codes as `Integer`s. - -### status.code[msg] - -Returns the numeric status code for a known status message (in lower-case), -otherwise `undefined`. - - - -```js -status['not found'] // => 404 -``` - -### status.empty[code] - -Returns `true` if a status code expects an empty body. - - - -```js -status.empty[200] // => undefined -status.empty[204] // => true -status.empty[304] // => true -``` - -### status.message[code] - -Returns the string message for a known numeric status code, otherwise -`undefined`. This object is the same format as the -[Node.js http module `http.STATUS_CODES`](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes). - - - -```js -status.message[404] // => 'Not Found' -``` - -### status.redirect[code] - -Returns `true` if a status code is a valid redirect status. - - - -```js -status.redirect[200] // => undefined -status.redirect[301] // => true -``` - -### status.retry[code] - -Returns `true` if you should retry the rest. - - - -```js -status.retry[501] // => undefined -status.retry[503] // => true -``` - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/statuses/master?label=ci -[ci-url]: https://github.com/jshttp/statuses/actions?query=workflow%3Aci -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/statuses/master -[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master -[node-version-image]: https://badgen.net/npm/node/statuses -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/statuses -[npm-url]: https://npmjs.org/package/statuses -[npm-version-image]: https://badgen.net/npm/v/statuses -[ossf-scorecard-badge]: https://api.securityscorecards.dev/projects/github.com/jshttp/statuses/badge -[ossf-scorecard-visualizer]: https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/jshttp/statuses diff --git a/node_modules/statuses/codes.json b/node_modules/statuses/codes.json deleted file mode 100644 index 1333ed1..0000000 --- a/node_modules/statuses/codes.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "100": "Continue", - "101": "Switching Protocols", - "102": "Processing", - "103": "Early Hints", - "200": "OK", - "201": "Created", - "202": "Accepted", - "203": "Non-Authoritative Information", - "204": "No Content", - "205": "Reset Content", - "206": "Partial Content", - "207": "Multi-Status", - "208": "Already Reported", - "226": "IM Used", - "300": "Multiple Choices", - "301": "Moved Permanently", - "302": "Found", - "303": "See Other", - "304": "Not Modified", - "305": "Use Proxy", - "307": "Temporary Redirect", - "308": "Permanent Redirect", - "400": "Bad Request", - "401": "Unauthorized", - "402": "Payment Required", - "403": "Forbidden", - "404": "Not Found", - "405": "Method Not Allowed", - "406": "Not Acceptable", - "407": "Proxy Authentication Required", - "408": "Request Timeout", - "409": "Conflict", - "410": "Gone", - "411": "Length Required", - "412": "Precondition Failed", - "413": "Payload Too Large", - "414": "URI Too Long", - "415": "Unsupported Media Type", - "416": "Range Not Satisfiable", - "417": "Expectation Failed", - "418": "I'm a Teapot", - "421": "Misdirected Request", - "422": "Unprocessable Entity", - "423": "Locked", - "424": "Failed Dependency", - "425": "Too Early", - "426": "Upgrade Required", - "428": "Precondition Required", - "429": "Too Many Requests", - "431": "Request Header Fields Too Large", - "451": "Unavailable For Legal Reasons", - "500": "Internal Server Error", - "501": "Not Implemented", - "502": "Bad Gateway", - "503": "Service Unavailable", - "504": "Gateway Timeout", - "505": "HTTP Version Not Supported", - "506": "Variant Also Negotiates", - "507": "Insufficient Storage", - "508": "Loop Detected", - "509": "Bandwidth Limit Exceeded", - "510": "Not Extended", - "511": "Network Authentication Required" -} diff --git a/node_modules/statuses/index.js b/node_modules/statuses/index.js deleted file mode 100644 index ea351c5..0000000 --- a/node_modules/statuses/index.js +++ /dev/null @@ -1,146 +0,0 @@ -/*! - * statuses - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var codes = require('./codes.json') - -/** - * Module exports. - * @public - */ - -module.exports = status - -// status code to message map -status.message = codes - -// status message (lower-case) to code map -status.code = createMessageToStatusCodeMap(codes) - -// array of status codes -status.codes = createStatusCodeList(codes) - -// status codes for redirects -status.redirect = { - 300: true, - 301: true, - 302: true, - 303: true, - 305: true, - 307: true, - 308: true -} - -// status codes for empty bodies -status.empty = { - 204: true, - 205: true, - 304: true -} - -// status codes for when you should retry the request -status.retry = { - 502: true, - 503: true, - 504: true -} - -/** - * Create a map of message to status code. - * @private - */ - -function createMessageToStatusCodeMap (codes) { - var map = {} - - Object.keys(codes).forEach(function forEachCode (code) { - var message = codes[code] - var status = Number(code) - - // populate map - map[message.toLowerCase()] = status - }) - - return map -} - -/** - * Create a list of all status codes. - * @private - */ - -function createStatusCodeList (codes) { - return Object.keys(codes).map(function mapCode (code) { - return Number(code) - }) -} - -/** - * Get the status code for given message. - * @private - */ - -function getStatusCode (message) { - var msg = message.toLowerCase() - - if (!Object.prototype.hasOwnProperty.call(status.code, msg)) { - throw new Error('invalid status message: "' + message + '"') - } - - return status.code[msg] -} - -/** - * Get the status message for given code. - * @private - */ - -function getStatusMessage (code) { - if (!Object.prototype.hasOwnProperty.call(status.message, code)) { - throw new Error('invalid status code: ' + code) - } - - return status.message[code] -} - -/** - * Get the status code. - * - * Given a number, this will throw if it is not a known status - * code, otherwise the code will be returned. Given a string, - * the string will be parsed for a number and return the code - * if valid, otherwise will lookup the code assuming this is - * the status message. - * - * @param {string|number} code - * @returns {number} - * @public - */ - -function status (code) { - if (typeof code === 'number') { - return getStatusMessage(code) - } - - if (typeof code !== 'string') { - throw new TypeError('code must be a number or string') - } - - // '403' - var n = parseInt(code, 10) - if (!isNaN(n)) { - return getStatusMessage(n) - } - - return getStatusCode(code) -} diff --git a/node_modules/statuses/package.json b/node_modules/statuses/package.json deleted file mode 100644 index b5d016e..0000000 --- a/node_modules/statuses/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "statuses", - "description": "HTTP status utility", - "version": "2.0.2", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "repository": "jshttp/statuses", - "license": "MIT", - "keywords": [ - "http", - "status", - "code" - ], - "files": [ - "HISTORY.md", - "index.js", - "codes.json", - "LICENSE" - ], - "devDependencies": { - "csv-parse": "4.16.3", - "eslint": "7.19.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.31.0", - "eslint-plugin-markdown": "1.0.2", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.3.1", - "eslint-plugin-standard": "4.1.0", - "mocha": "8.4.0", - "nyc": "15.1.0", - "raw-body": "2.5.2", - "stream-to-array": "2.3.0" - }, - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "build": "node scripts/build.js", - "fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js", - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "update": "npm run fetch && npm run build", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/toidentifier/HISTORY.md b/node_modules/toidentifier/HISTORY.md deleted file mode 100644 index cb7cc89..0000000 --- a/node_modules/toidentifier/HISTORY.md +++ /dev/null @@ -1,9 +0,0 @@ -1.0.1 / 2021-11-14 -================== - - * pref: enable strict mode - -1.0.0 / 2018-07-09 -================== - - * Initial release diff --git a/node_modules/toidentifier/LICENSE b/node_modules/toidentifier/LICENSE deleted file mode 100644 index de22d15..0000000 --- a/node_modules/toidentifier/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/toidentifier/README.md b/node_modules/toidentifier/README.md deleted file mode 100644 index 57e8a78..0000000 --- a/node_modules/toidentifier/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# toidentifier - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][codecov-image]][codecov-url] - -> Convert a string of words to a JavaScript identifier - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install toidentifier -``` - -## Example - -```js -var toIdentifier = require('toidentifier') - -console.log(toIdentifier('Bad Request')) -// => "BadRequest" -``` - -## API - -This CommonJS module exports a single default function: `toIdentifier`. - -### toIdentifier(string) - -Given a string as the argument, it will be transformed according to -the following rules and the new string will be returned: - -1. Split into words separated by space characters (`0x20`). -2. Upper case the first character of each word. -3. Join the words together with no separator. -4. Remove all non-word (`[0-9a-z_]`) characters. - -## License - -[MIT](LICENSE) - -[codecov-image]: https://img.shields.io/codecov/c/github/component/toidentifier.svg -[codecov-url]: https://codecov.io/gh/component/toidentifier -[downloads-image]: https://img.shields.io/npm/dm/toidentifier.svg -[downloads-url]: https://npmjs.org/package/toidentifier -[github-actions-ci-image]: https://img.shields.io/github/workflow/status/component/toidentifier/ci/master?label=ci -[github-actions-ci-url]: https://github.com/component/toidentifier?query=workflow%3Aci -[npm-image]: https://img.shields.io/npm/v/toidentifier.svg -[npm-url]: https://npmjs.org/package/toidentifier - - -## - -[npm]: https://www.npmjs.com/ - -[yarn]: https://yarnpkg.com/ diff --git a/node_modules/toidentifier/index.js b/node_modules/toidentifier/index.js deleted file mode 100644 index 9295d02..0000000 --- a/node_modules/toidentifier/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/*! - * toidentifier - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = toIdentifier - -/** - * Trasform the given string into a JavaScript identifier - * - * @param {string} str - * @returns {string} - * @public - */ - -function toIdentifier (str) { - return str - .split(' ') - .map(function (token) { - return token.slice(0, 1).toUpperCase() + token.slice(1) - }) - .join('') - .replace(/[^ _0-9a-z]/gi, '') -} diff --git a/node_modules/toidentifier/package.json b/node_modules/toidentifier/package.json deleted file mode 100644 index 42db1a6..0000000 --- a/node_modules/toidentifier/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "toidentifier", - "description": "Convert a string of words to a JavaScript identifier", - "version": "1.0.1", - "author": "Douglas Christopher Wilson ", - "contributors": [ - "Douglas Christopher Wilson ", - "Nick Baugh (http://niftylettuce.com/)" - ], - "repository": "component/toidentifier", - "devDependencies": { - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.3", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.3.1", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.1.3", - "nyc": "15.1.0" - }, - "engines": { - "node": ">=0.6" - }, - "license": "MIT", - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/tsx/LICENSE b/node_modules/tsx/LICENSE deleted file mode 100644 index bf183d2..0000000 --- a/node_modules/tsx/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Hiroki Osame - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/node_modules/tsx/README.md b/node_modules/tsx/README.md deleted file mode 100644 index b269d1c..0000000 --- a/node_modules/tsx/README.md +++ /dev/null @@ -1,32 +0,0 @@ -

-
- - - tsx - -

- -

- -

-TypeScript Execute (tsx): The easiest way to run TypeScript in Node.js -

-Documentation    |    Getting started → -

- -
- -

- - -

-

Already a sponsor? Join the discussion in the Development repo!

- -## Sponsors - -

- - - -

- diff --git a/node_modules/tsx/dist/cjs/api/index.cjs b/node_modules/tsx/dist/cjs/api/index.cjs deleted file mode 100755 index 7c0f094..0000000 --- a/node_modules/tsx/dist/cjs/api/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";require("../../get-pipe-path-BoR10qr8.cjs");var r=require("../../register-D46fvsV_.cjs"),e=require("../../require-D4F1Lv60.cjs");require("module"),require("node:path"),require("../../temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:module"),require("node:url"),require("get-tsconfig"),require("node:fs"),require("../../index-gckBtVBf.cjs"),require("esbuild"),require("node:crypto"),require("../../client-D6NvIMSC.cjs"),require("node:net"),require("node:util"),require("../../index-BWFBUo6r.cjs"),exports.register=r.register,exports.require=e.tsxRequire; diff --git a/node_modules/tsx/dist/cjs/api/index.d.cts b/node_modules/tsx/dist/cjs/api/index.d.cts deleted file mode 100644 index 2ef7ba3..0000000 --- a/node_modules/tsx/dist/cjs/api/index.d.cts +++ /dev/null @@ -1,35 +0,0 @@ -import { R as RequiredProperty } from '../../types-Cxp8y2TL.js'; - -type RegisterOptions = { - namespace?: string; -}; -type Unregister = () => void; -type ScopedRequire = (id: string, fromFile: string | URL) => any; -type ScopedResolve = (id: string, fromFile: string | URL, resolveOptions?: { - paths?: string[] | undefined; -}) => string; -type NamespacedUnregister = Unregister & { - require: ScopedRequire; - resolve: ScopedResolve; - unregister: Unregister; -}; -type Register = { - (options: RequiredProperty): NamespacedUnregister; - (options?: RegisterOptions): Unregister; -}; -declare const register: Register; - -declare const tsxRequire: { - (id: string, fromFile: string | URL): any; - resolve: { - (id: string, fromFile: string | URL, options?: { - paths?: string[] | undefined; - }): string; - paths: (request: string) => string[] | null; - }; - main: NodeJS.Module | undefined; - extensions: NodeJS.RequireExtensions; - cache: NodeJS.Dict; -}; - -export { register, tsxRequire as require }; diff --git a/node_modules/tsx/dist/cjs/api/index.d.mts b/node_modules/tsx/dist/cjs/api/index.d.mts deleted file mode 100644 index 2ef7ba3..0000000 --- a/node_modules/tsx/dist/cjs/api/index.d.mts +++ /dev/null @@ -1,35 +0,0 @@ -import { R as RequiredProperty } from '../../types-Cxp8y2TL.js'; - -type RegisterOptions = { - namespace?: string; -}; -type Unregister = () => void; -type ScopedRequire = (id: string, fromFile: string | URL) => any; -type ScopedResolve = (id: string, fromFile: string | URL, resolveOptions?: { - paths?: string[] | undefined; -}) => string; -type NamespacedUnregister = Unregister & { - require: ScopedRequire; - resolve: ScopedResolve; - unregister: Unregister; -}; -type Register = { - (options: RequiredProperty): NamespacedUnregister; - (options?: RegisterOptions): Unregister; -}; -declare const register: Register; - -declare const tsxRequire: { - (id: string, fromFile: string | URL): any; - resolve: { - (id: string, fromFile: string | URL, options?: { - paths?: string[] | undefined; - }): string; - paths: (request: string) => string[] | null; - }; - main: NodeJS.Module | undefined; - extensions: NodeJS.RequireExtensions; - cache: NodeJS.Dict; -}; - -export { register, tsxRequire as require }; diff --git a/node_modules/tsx/dist/cjs/api/index.mjs b/node_modules/tsx/dist/cjs/api/index.mjs deleted file mode 100755 index 7eca845..0000000 --- a/node_modules/tsx/dist/cjs/api/index.mjs +++ /dev/null @@ -1 +0,0 @@ -import"../../get-pipe-path-BHW2eJdv.mjs";import{r as j}from"../../register-CFH5oNdT.mjs";import{t as l}from"../../require-DQxpCAr4.mjs";import"module";import"node:path";import"../../temporary-directory-CwHp0_NW.mjs";import"node:os";import"node:module";import"node:url";import"get-tsconfig";import"node:fs";import"../../index-7AaEi15b.mjs";import"esbuild";import"node:crypto";import"../../client-BQVF1NaW.mjs";import"node:net";import"node:util";import"../../index-gbaejti9.mjs";export{j as register,l as require}; diff --git a/node_modules/tsx/dist/cjs/index.cjs b/node_modules/tsx/dist/cjs/index.cjs deleted file mode 100755 index 346c5da..0000000 --- a/node_modules/tsx/dist/cjs/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var r=require("../register-D46fvsV_.cjs");require("../get-pipe-path-BoR10qr8.cjs"),require("module"),require("node:path"),require("../temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:module"),require("node:url"),require("get-tsconfig"),require("node:fs"),require("../index-gckBtVBf.cjs"),require("esbuild"),require("node:crypto"),require("../client-D6NvIMSC.cjs"),require("node:net"),require("node:util"),require("../index-BWFBUo6r.cjs"),r.register(); diff --git a/node_modules/tsx/dist/cjs/index.mjs b/node_modules/tsx/dist/cjs/index.mjs deleted file mode 100755 index 473f99d..0000000 --- a/node_modules/tsx/dist/cjs/index.mjs +++ /dev/null @@ -1 +0,0 @@ -import{r}from"../register-CFH5oNdT.mjs";import"../get-pipe-path-BHW2eJdv.mjs";import"module";import"node:path";import"../temporary-directory-CwHp0_NW.mjs";import"node:os";import"node:module";import"node:url";import"get-tsconfig";import"node:fs";import"../index-7AaEi15b.mjs";import"esbuild";import"node:crypto";import"../client-BQVF1NaW.mjs";import"node:net";import"node:util";import"../index-gbaejti9.mjs";r(); diff --git a/node_modules/tsx/dist/cli.cjs b/node_modules/tsx/dist/cli.cjs deleted file mode 100755 index 18f0299..0000000 --- a/node_modules/tsx/dist/cli.cjs +++ /dev/null @@ -1,54 +0,0 @@ -"use strict";var bn=Object.defineProperty;var a=(t,e)=>bn(t,"name",{value:e,configurable:!0});var ct=require("node:os"),vn=require("tty"),Sn=require("esbuild"),Bn=require("./package-Dxt5kIHw.cjs"),he=require("./get-pipe-path-BoR10qr8.cjs"),_u=require("node:url"),$n=require("child_process"),z=require("path"),oe=require("fs"),ke=require("./node-features-roYmp9jK.cjs"),Tn=require("node:path"),xn=require("events"),_e=require("util"),On=require("stream"),Au=require("os"),ue=require("./index-BWFBUo6r.cjs"),Nn=require("node:net"),ft=require("node:fs"),Hn=require("./temporary-directory-B83uKxJF.cjs");require("module");const Pn="known-flag",Ln="unknown-flag",In="argument",{stringify:Ae}=JSON,kn=/\B([A-Z])/g,Mn=a(t=>t.replace(kn,"-$1").toLowerCase(),"v$1"),{hasOwnProperty:Gn}=Object.prototype,ye=a((t,e)=>Gn.call(t,e),"w$2"),Wn=a(t=>Array.isArray(t),"L$2"),yu=a(t=>typeof t=="function"?[t,!1]:Wn(t)?[t[0],!0]:yu(t.type),"b$2"),jn=a((t,e)=>t===Boolean?e!=="false":e,"d$2"),Un=a((t,e)=>typeof e=="boolean"?e:t===Number&&e===""?Number.NaN:t(e),"m$1"),Kn=/[\s.:=]/,Vn=a(t=>{const e=`Flag name ${Ae(t)}`;if(t.length===0)throw new Error(`${e} cannot be empty`);if(t.length===1)throw new Error(`${e} must be longer than a character`);const u=t.match(Kn);if(u)throw new Error(`${e} cannot contain ${Ae(u?.[0])}`)},"B"),zn=a(t=>{const e={},u=a((r,n)=>{if(ye(e,r))throw new Error(`Duplicate flags named ${Ae(r)}`);e[r]=n},"r");for(const r in t){if(!ye(t,r))continue;Vn(r);const n=t[r],s=[[],...yu(n),n];u(r,s);const i=Mn(r);if(r!==i&&u(i,s),"alias"in n&&typeof n.alias=="string"){const{alias:D}=n,o=`Flag alias ${Ae(D)} for flag ${Ae(r)}`;if(D.length===0)throw new Error(`${o} cannot be empty`);if(D.length>1)throw new Error(`${o} must be a single character`);u(D,s)}}return e},"K$1"),Yn=a((t,e)=>{const u={};for(const r in t){if(!ye(t,r))continue;const[n,,s,i]=e[r];if(n.length===0&&"default"in i){let{default:D}=i;typeof D=="function"&&(D=D()),u[r]=D}else u[r]=s?n:n.pop()}return u},"_$2"),Me="--",qn=/[.:=]/,Xn=/^-{1,2}\w/,Qn=a(t=>{if(!Xn.test(t))return;const e=!t.startsWith(Me);let u=t.slice(e?1:2),r;const n=u.match(qn);if(n){const{index:s}=n;r=u.slice(s+1),u=u.slice(0,s)}return[u,r,e]},"N"),Zn=a((t,{onFlag:e,onArgument:u})=>{let r;const n=a((s,i)=>{if(typeof r!="function")return!0;r(s,i),r=void 0},"o");for(let s=0;s{for(const[u,r,n]of e.reverse()){if(r){const s=t[u];let i=s.slice(0,r);if(n||(i+=s.slice(r+1)),i!=="-"){t[u]=i;continue}}t.splice(u,1)}},"E"),wu=a((t,e=process.argv.slice(2),{ignore:u}={})=>{const r=[],n=zn(t),s={},i=[];return i[Me]=[],Zn(e,{onFlag(D,o,c){const f=ye(n,D);if(!u?.(f?Pn:Ln,D,o)){if(f){const[h,l]=n[D],p=jn(l,o),C=a((g,y)=>{r.push(c),y&&r.push(y),h.push(Un(l,g||""))},"p");return p===void 0?C:C(p)}ye(s,D)||(s[D]=[]),s[D].push(o===void 0?!0:o),r.push(c)}},onArgument(D,o,c){u?.(In,e[o[0]])||(i.push(...D),c?(i[Me]=D,e.splice(o[0])):r.push(o))}}),Jn(e,r),{flags:Yn(t,n),unknownFlags:s,_:i}},"U$2");var es=Object.create,Ge=Object.defineProperty,ts=Object.defineProperties,us=Object.getOwnPropertyDescriptor,rs=Object.getOwnPropertyDescriptors,ns=Object.getOwnPropertyNames,Ru=Object.getOwnPropertySymbols,ss=Object.getPrototypeOf,bu=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,vu=a((t,e,u)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,"W$1"),We=a((t,e)=>{for(var u in e||(e={}))bu.call(e,u)&&vu(t,u,e[u]);if(Ru)for(var u of Ru(e))is.call(e,u)&&vu(t,u,e[u]);return t},"p"),ht=a((t,e)=>ts(t,rs(e)),"c"),Ds=a(t=>Ge(t,"__esModule",{value:!0}),"nD"),os=a((t,e)=>()=>(t&&(e=t(t=0)),e),"rD"),as=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"iD"),ls=a((t,e,u,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ns(e))!bu.call(t,n)&&n!=="default"&&Ge(t,n,{get:a(()=>e[n],"get"),enumerable:!(r=us(e,n))||r.enumerable});return t},"oD"),cs=a((t,e)=>ls(Ds(Ge(t!=null?es(ss(t)):{},"default",{value:t,enumerable:!0})),t),"BD"),K=os(()=>{}),fs=as((t,e)=>{K(),e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C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uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\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DB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70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g}});K(),K(),K();var hs=a(t=>{var e,u,r;let n=(e=process.stdout.columns)!=null?e:Number.POSITIVE_INFINITY;return typeof t=="function"&&(t=t(n)),t||(t={}),Array.isArray(t)?{columns:t,stdoutColumns:n}:{columns:(u=t.columns)!=null?u:[],stdoutColumns:(r=t.stdoutColumns)!=null?r:n}},"v");K(),K(),K(),K(),K();function ds({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}a(ds,"w$1");function Su(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(ds(),"")}a(Su,"d$1"),K();function Es(t){return Number.isInteger(t)?t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141):!1}a(Es,"y$1");var ps=cs(fs());function ae(t){if(typeof t!="string"||t.length===0||(t=Su(t),t.length===0))return 0;t=t.replace((0,ps.default)()," ");let e=0;for(let u=0;u=127&&r<=159||r>=768&&r<=879||(r>65535&&u++,e+=Es(r)?2:1)}return e}a(ae,"g");var Bu=a(t=>Math.max(...t.split(` -`).map(ae)),"b$1"),Cs=a(t=>{let e=[];for(let u of t){let{length:r}=u,n=r-e.length;for(let s=0;se[s]&&(e[s]=i)}}return e},"k$1");K();var $u=/^\d+%$/,Tu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Fs=a((t,e)=>{var u;let r=[];for(let n=0;n=e){let o=i-e,c=Math.ceil(u.paddingLeft/n*o),f=o-c;u.paddingLeft-=c,u.paddingRight-=f,u.horizontalPadding=u.paddingLeft+u.paddingRight}u.paddingLeftString=u.paddingLeft?" ".repeat(u.paddingLeft):"",u.paddingRightString=u.paddingRight?" ".repeat(u.paddingRight):"";let D=e-u.horizontalPadding;u.width=Math.max(Math.min(u.width,D),s)}}a(gs,"aD");var xu=a(()=>Object.assign([],{columns:0}),"G$1");function ms(t,e){let u=[xu()],[r]=u;for(let n of t){let s=n.width+n.horizontalPadding;r.columns+s>e&&(r=xu(),u.push(r)),r.push(n),r.columns+=s}for(let n of u){let s=n.reduce((l,p)=>l+p.width+p.horizontalPadding,0),i=e-s;if(i===0)continue;let D=n.filter(l=>"autoOverflow"in l),o=D.filter(l=>l.autoOverflow>0),c=o.reduce((l,p)=>l+p.autoOverflow,0),f=Math.min(c,i);for(let l of o){let p=Math.floor(l.autoOverflow/c*f);l.width+=p,i-=p}let h=Math.floor(i/D.length);for(let l=0;le=>`\x1B[${e+t}m`,"U$1"),Nu=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"V$1"),Hu=a((t=0)=>(e,u,r)=>`\x1B[${38+t};2;${e};${u};${r}m`,"Y");function As(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[u,r]of Object.entries(e)){for(let[n,s]of Object.entries(r))e[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=e[n],t.set(s[0],s[1]);Object.defineProperty(e,u,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=Ou(),e.color.ansi256=Nu(),e.color.ansi16m=Hu(),e.bgColor.ansi=Ou(dt),e.bgColor.ansi256=Nu(dt),e.bgColor.ansi16m=Hu(dt),Object.defineProperties(e,{rgbToAnsi256:{value:a((u,r,n)=>u===r&&r===n?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),"value"),enumerable:!1},hexToRgb:{value:a(u=>{let r=/(?[a-f\d]{6}|[a-f\d]{3})/i.exec(u.toString(16));if(!r)return[0,0,0];let{colorString:n}=r.groups;n.length===3&&(n=n.split("").map(i=>i+i).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},"value"),enumerable:!1},hexToAnsi256:{value:a(u=>e.rgbToAnsi256(...e.hexToRgb(u)),"value"),enumerable:!1},ansi256ToAnsi:{value:a(u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let r,n,s;if(u>=232)r=((u-232)*10+8)/255,n=r,s=r;else{u-=16;let o=u%36;r=Math.floor(u/36)/5,n=Math.floor(o/6)/5,s=o%6/5}let i=Math.max(r,n,s)*2;if(i===0)return 30;let D=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(D+=60),D},"value"),enumerable:!1},rgbToAnsi:{value:a((u,r,n)=>e.ansi256ToAnsi(e.rgbToAnsi256(u,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(u=>e.ansi256ToAnsi(e.hexToAnsi256(u)),"value"),enumerable:!1}}),e}a(As,"AD");var ys=As(),ws=ys,je=new Set(["\x1B","\x9B"]),Rs=39,Et="\x07",Pu="[",bs="]",Lu="m",pt=`${bs}8;;`,Iu=a(t=>`${je.values().next().value}${Pu}${t}${Lu}`,"J$1"),ku=a(t=>`${je.values().next().value}${pt}${t}${Et}`,"Q"),vs=a(t=>t.split(" ").map(e=>ae(e)),"hD"),Ct=a((t,e,u)=>{let r=[...e],n=!1,s=!1,i=ae(Su(t[t.length-1]));for(let[D,o]of r.entries()){let c=ae(o);if(i+c<=u?t[t.length-1]+=o:(t.push(o),i=0),je.has(o)&&(n=!0,s=r.slice(D+1).join("").startsWith(pt)),n){s?o===Et&&(n=!1,s=!1):o===Lu&&(n=!1);continue}i+=c,i===u&&D0&&t.length>1&&(t[t.length-2]+=t.pop())},"S$1"),Ss=a(t=>{let e=t.split(" "),u=e.length;for(;u>0&&!(ae(e[u-1])>0);)u--;return u===e.length?t:e.slice(0,u).join(" ")+e.slice(u).join("")},"cD"),Bs=a((t,e,u={})=>{if(u.trim!==!1&&t.trim()==="")return"";let r="",n,s,i=vs(t),D=[""];for(let[c,f]of t.split(" ").entries()){u.trim!==!1&&(D[D.length-1]=D[D.length-1].trimStart());let h=ae(D[D.length-1]);if(c!==0&&(h>=e&&(u.wordWrap===!1||u.trim===!1)&&(D.push(""),h=0),(h>0||u.trim===!1)&&(D[D.length-1]+=" ",h++)),u.hard&&i[c]>e){let l=e-h,p=1+Math.floor((i[c]-l-1)/e);Math.floor((i[c]-1)/e)e&&h>0&&i[c]>0){if(u.wordWrap===!1&&he&&u.wordWrap===!1){Ct(D,f,e);continue}D[D.length-1]+=f}u.trim!==!1&&(D=D.map(c=>Ss(c)));let o=[...D.join(` -`)];for(let[c,f]of o.entries()){if(r+=f,je.has(f)){let{groups:l}=new RegExp(`(?:\\${Pu}(?\\d+)m|\\${pt}(?.*)${Et})`).exec(o.slice(c).join(""))||{groups:{}};if(l.code!==void 0){let p=Number.parseFloat(l.code);n=p===Rs?void 0:p}else l.uri!==void 0&&(s=l.uri.length===0?void 0:l.uri)}let h=ws.codes.get(Number(n));o[c+1]===` -`?(s&&(r+=ku("")),n&&h&&(r+=Iu(h))):f===` -`&&(n&&h&&(r+=Iu(n)),s&&(r+=ku(s)))}return r},"dD");function $s(t,e,u){return String(t).normalize().replace(/\r\n/g,` -`).split(` -`).map(r=>Bs(r,e,u)).join(` -`)}a($s,"T$1");var Mu=a(t=>Array.from({length:t}).fill(""),"X");function Ts(t,e){let u=[],r=0;for(let n of t){let s=0,i=n.map(o=>{var c;let f=(c=e[r])!=null?c:"";r+=1,o.preprocess&&(f=o.preprocess(f)),Bu(f)>o.width&&(f=$s(f,o.width,{hard:!0}));let h=f.split(` -`);if(o.postprocess){let{postprocess:l}=o;h=h.map((p,C)=>l.call(o,p,C))}return o.paddingTop&&h.unshift(...Mu(o.paddingTop)),o.paddingBottom&&h.push(...Mu(o.paddingBottom)),h.length>s&&(s=h.length),ht(We({},o),{lines:h})}),D=[];for(let o=0;o{var h;let l=(h=f.lines[o])!=null?h:"",p=Number.isFinite(f.width)?" ".repeat(f.width-ae(l)):"",C=f.paddingLeftString;return f.align==="right"&&(C+=p),C+=l,f.align==="left"&&(C+=p),C+f.paddingRightString}).join("");D.push(c)}u.push(D.join(` -`))}return u.join(` -`)}a(Ts,"P");function xs(t,e){if(!t||t.length===0)return"";let u=Cs(t),r=u.length;if(r===0)return"";let{stdoutColumns:n,columns:s}=hs(e);if(s.length>r)throw new Error(`${s.length} columns defined, but only ${r} columns found`);let i=_s(n,s,u);return t.map(D=>Ts(i,D)).join(` -`)}a(xs,"mD"),K();var Os=["<",">","=",">=","<="];function Ns(t){if(!Os.includes(t))throw new TypeError(`Invalid breakpoint operator: ${t}`)}a(Ns,"xD");function Hs(t){let e=Object.keys(t).map(u=>{let[r,n]=u.split(" ");Ns(r);let s=Number.parseInt(n,10);if(Number.isNaN(s))throw new TypeError(`Invalid breakpoint value: ${n}`);let i=t[u];return{operator:r,breakpoint:s,value:i}}).sort((u,r)=>r.breakpoint-u.breakpoint);return u=>{var r;return(r=e.find(({operator:n,breakpoint:s})=>n==="="&&u===s||n===">"&&u>s||n==="<"&&u="&&u>=s||n==="<="&&u<=s))==null?void 0:r.value}}a(Hs,"wD");const Ps=a(t=>t.replace(/[\W_]([a-z\d])?/gi,(e,u)=>u?u.toUpperCase():""),"S"),Ls=a(t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase(),"q"),Is={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:a(t=>t.trim(),"preprocess")},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function ks(t){let e=!1;return{type:"table",data:{tableData:Object.keys(t).sort((u,r)=>u.localeCompare(r)).map(u=>{const r=t[u],n="alias"in r;return n&&(e=!0),{name:u,flag:r,flagFormatted:`--${Ls(u)}`,aliasesEnabled:e,aliasFormatted:n?`-${r.alias}`:void 0}}).map(u=>(u.aliasesEnabled=e,[{type:"flagName",data:u},{type:"flagDescription",data:u}])),tableBreakpoints:Is}}}a(ks,"D");const Gu=a(t=>!t||(t.version??(t.help?t.help.version:void 0)),"A"),Wu=a(t=>{const e="parent"in t&&t.parent?.name;return(e?`${e} `:"")+t.name},"C");function Ms(t){const e=[];t.name&&e.push(Wu(t));const u=Gu(t)??("parent"in t&&Gu(t.parent));if(u&&e.push(`v${u}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")} -`}}a(Ms,"R");function Gs(t){const{help:e}=t;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description} -`}}a(Gs,"L");function Ws(t){const e=t.help||{};if("usage"in e)return e.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(e.usage)?e.usage.join(` -`):e.usage}}:void 0;if(t.name){const u=[],r=[Wu(t)];if(t.flags&&Object.keys(t.flags).length>0&&r.push("[flags...]"),t.parameters&&t.parameters.length>0){const{parameters:n}=t,s=n.indexOf("--"),i=s>-1&&n.slice(s+1).some(D=>D.startsWith("<"));r.push(n.map(D=>D!=="--"?D:i?"--":"[--]").join(" "))}if(r.length>1&&u.push(r.join(" ")),"commands"in t&&t.commands?.length&&u.push(`${t.name} `),u.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:u.join(` -`)}}}}a(Ws,"T");function js(t){return!("commands"in t)||!t.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:t.commands.map(e=>[e.options.name,e.options.help?e.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}a(js,"_");function Us(t){if(!(!t.flags||Object.keys(t.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:ks(t.flags),indentBody:0}}}a(Us,"k");function Ks(t){const{help:e}=t;if(!e||!e.examples||e.examples.length===0)return;let{examples:u}=e;if(Array.isArray(u)&&(u=u.join(` -`)),u)return{id:"examples",type:"section",data:{title:"Examples:",body:u}}}a(Ks,"F");function Vs(t){if(!("alias"in t)||!t.alias)return;const{alias:e}=t;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(e)?e.join(", "):e}}}a(Vs,"H");const zs=a(t=>[Ms,Gs,Ws,js,Us,Ks,Vs].map(e=>e(t)).filter(Boolean),"U"),Ys=vn.WriteStream.prototype.hasColors();class qs{static{a(this,"M")}text(e){return e}bold(e){return Ys?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:u}){return e.replace(/^/gm," ".repeat(u))}heading(e){return this.bold(e)}section({title:e,body:u,indentBody:r=2}){return`${(e?`${this.heading(e)} -`:"")+(u?this.indentText({text:this.render(u),spaces:r}):"")} -`}table({tableData:e,tableOptions:u,tableBreakpoints:r}){return xs(e.map(n=>n.map(s=>this.render(s))),r?Hs(r):u)}flagParameter(e){return e===Boolean?"":e===String?"":e===Number?"":Array.isArray(e)?this.flagParameter(e[0]):""}flagOperator(e){return" "}flagName(e){const{flag:u,flagFormatted:r,aliasesEnabled:n,aliasFormatted:s}=e;let i="";if(s?i+=`${s}, `:n&&(i+=" "),i+=r,"placeholder"in u&&typeof u.placeholder=="string")i+=`${this.flagOperator(e)}${u.placeholder}`;else{const D=this.flagParameter("type"in u?u.type:u);D&&(i+=`${this.flagOperator(e)}${D}`)}return i}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){let u="description"in e?e.description??"":"";if("default"in e){let{default:r}=e;typeof r=="function"&&(r=r()),r&&(u+=` (default: ${this.flagDefault(r)})`)}return u}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(u=>this.render(u)).join(` -`);if("type"in e&&this[e.type]){const u=this[e.type];if(typeof u=="function")return u.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}}const Ft=/^[\w.-]+$/,{stringify:ee}=JSON,Xs=/[|\\{}()[\]^$+*?.]/;function gt(t){const e=[];let u,r;for(const n of t){if(r)throw new Error(`Invalid parameter: Spread parameter ${ee(r)} must be last`);const s=n[0],i=n[n.length-1];let D;if(s==="<"&&i===">"&&(D=!0,u))throw new Error(`Invalid parameter: Required parameter ${ee(n)} cannot come after optional parameter ${ee(u)}`);if(s==="["&&i==="]"&&(D=!1,u=n),D===void 0)throw new Error(`Invalid parameter: ${ee(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let o=n.slice(1,-1);const c=o.slice(-3)==="...";c&&(r=n,o=o.slice(0,-3));const f=o.match(Xs);if(f)throw new Error(`Invalid parameter: ${ee(n)}. Invalid character found ${ee(f[0])}`);e.push({name:o,required:D,spread:c})}return e}a(gt,"w");function mt(t,e,u,r){for(let n=0;n{console.log(e.version)},"f");if(s&&o.flags.version===!0)return c(),process.exit(0);const f=new qs,h=D&&i?.render?i.render:C=>f.render(C),l=a(C=>{const g=zs({...e,...C?{help:C}:{},flags:n});console.log(h(g,f))},"u");if(D&&o.flags.help===!0)return l(),process.exit(0);if(e.parameters){let{parameters:C}=e,g=o._;const y=C.indexOf("--"),B=C.slice(y+1),H=Object.create(null);if(y>-1&&B.length>0){C=C.slice(0,y);const $=o._["--"];g=g.slice(0,-$.length||void 0),mt(H,gt(C),g,l),mt(H,gt(B),$,l)}else mt(H,gt(C),g,l);Object.assign(o._,H)}const p={...o,showVersion:c,showHelp:l};return typeof u=="function"&&u(p),{command:t,...p}}a(ju,"x");function Zs(t,e){const u=new Map;for(const r of e){const n=[r.options.name],{alias:s}=r.options;s&&(Array.isArray(s)?n.push(...s):n.push(s));for(const i of n){if(u.has(i))throw new Error(`Duplicate command name found: ${ee(i)}`);u.set(i,r)}}return u.get(t)}a(Zs,"z");function Uu(t,e,u=process.argv.slice(2)){if(!t)throw new Error("Options is required");if("name"in t&&(!t.name||!Ft.test(t.name)))throw new Error(`Invalid script name: ${ee(t.name)}`);const r=u[0];if(t.commands&&Ft.test(r)){const n=Zs(r,t.commands);if(n)return ju(n.options.name,{...n.options,parent:t},n.callback,u.slice(1))}return ju(void 0,t,e,u)}a(Uu,"Z");function Js(t,e){if(!t)throw new Error("Command options are required");const{name:u}=t;if(t.name===void 0)throw new Error("Command name is required");if(!Ft.test(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:t,callback:e}}a(Js,"G");var ei=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ti(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a(ti,"getDefaultExportFromCjs");var de={exports:{}},_t,Ku;function ui(){if(Ku)return _t;Ku=1,_t=r,r.sync=n;var t=oe;function e(s,i){var D=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!D||(D=D.split(";"),D.indexOf("")!==-1))return!0;for(var o=0;oObject.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),Xu=a((t,e)=>{const u=e.colon||ii,r=t.match(/\//)||Ee&&t.match(/\\/)?[""]:[...Ee?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(u)],n=Ee?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ee?n.split(u):[""];return Ee&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:n}},"getPathInfo"),Qu=a((t,e,u)=>{typeof e=="function"&&(u=e,e={}),e||(e={});const{pathEnv:r,pathExt:n,pathExtExe:s}=Xu(t,e),i=[],D=a(c=>new Promise((f,h)=>{if(c===r.length)return e.all&&i.length?f(i):h(qu(t));const l=r[c],p=/^".*"$/.test(l)?l.slice(1,-1):l,C=zu.join(p,t),g=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+C:C;f(o(g,c,0))}),"step"),o=a((c,f,h)=>new Promise((l,p)=>{if(h===n.length)return l(D(f+1));const C=n[h];Yu(c+C,{pathExt:s},(g,y)=>{if(!g&&y)if(e.all)i.push(c+C);else return l(c+C);return l(o(c,f,h+1))})}),"subStep");return u?D(0).then(c=>u(null,c),u):D(0)},"which$1"),Di=a((t,e)=>{e=e||{};const{pathEnv:u,pathExt:r,pathExtExe:n}=Xu(t,e),s=[];for(let i=0;i{const e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"},"pathKey");wt.exports=Zu,wt.exports.default=Zu;var ai=wt.exports;const Ju=z,li=oi,ci=ai;function er(t,e){const u=t.options.env||process.env,r=process.cwd(),n=t.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let i;try{i=li.sync(t.command,{path:u[ci({env:u})],pathExt:e?Ju.delimiter:void 0})}catch{}finally{s&&process.chdir(r)}return i&&(i=Ju.resolve(n?t.options.cwd:"",i)),i}a(er,"resolveCommandAttempt");function fi(t){return er(t)||er(t,!0)}a(fi,"resolveCommand$1");var hi=fi,Rt={};const bt=/([()\][%!^"`<>&|;, *?])/g;function di(t){return t=t.replace(bt,"^$1"),t}a(di,"escapeCommand");function Ei(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(bt,"^$1"),e&&(t=t.replace(bt,"^$1")),t}a(Ei,"escapeArgument"),Rt.command=di,Rt.argument=Ei;var pi=/^#!(.*)/;const Ci=pi;var Fi=a((t="")=>{const e=t.match(Ci);if(!e)return null;const[u,r]=e[0].replace(/#! ?/,"").split(" "),n=u.split("/").pop();return n==="env"?r:r?`${n} ${r}`:n},"shebangCommand$1");const vt=oe,gi=Fi;function mi(t){const u=Buffer.alloc(150);let r;try{r=vt.openSync(t,"r"),vt.readSync(r,u,0,150,0),vt.closeSync(r)}catch{}return gi(u.toString())}a(mi,"readShebang$1");var _i=mi;const Ai=z,tr=hi,ur=Rt,yi=_i,wi=process.platform==="win32",Ri=/\.(?:com|exe)$/i,bi=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function vi(t){t.file=tr(t);const e=t.file&&yi(t.file);return e?(t.args.unshift(t.file),t.command=e,tr(t)):t.file}a(vi,"detectShebang");function Si(t){if(!wi)return t;const e=vi(t),u=!Ri.test(e);if(t.options.forceShell||u){const r=bi.test(e);t.command=Ai.normalize(t.command),t.command=ur.command(t.command),t.args=t.args.map(s=>ur.argument(s,r));const n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}a(Si,"parseNonShell");function Bi(t,e,u){e&&!Array.isArray(e)&&(u=e,e=null),e=e?e.slice(0):[],u=Object.assign({},u);const r={command:t,args:e,options:u,file:void 0,original:{command:t,args:e}};return u.shell?r:Si(r)}a(Bi,"parse$5");var $i=Bi;const St=process.platform==="win32";function Bt(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}a(Bt,"notFoundError");function Ti(t,e){if(!St)return;const u=t.emit;t.emit=function(r,n){if(r==="exit"){const s=rr(n,e);if(s)return u.call(t,"error",s)}return u.apply(t,arguments)}}a(Ti,"hookChildProcess");function rr(t,e){return St&&t===1&&!e.file?Bt(e.original,"spawn"):null}a(rr,"verifyENOENT");function xi(t,e){return St&&t===1&&!e.file?Bt(e.original,"spawnSync"):null}a(xi,"verifyENOENTSync");var Oi={hookChildProcess:Ti,verifyENOENT:rr,verifyENOENTSync:xi,notFoundError:Bt};const nr=$n,$t=$i,Tt=Oi;function sr(t,e,u){const r=$t(t,e,u),n=nr.spawn(r.command,r.args,r.options);return Tt.hookChildProcess(n,r),n}a(sr,"spawn");function Ni(t,e,u){const r=$t(t,e,u),n=nr.spawnSync(r.command,r.args,r.options);return n.error=n.error||Tt.verifyENOENTSync(n.status,r),n}a(Ni,"spawnSync"),de.exports=sr,de.exports.spawn=sr,de.exports.sync=Ni,de.exports._parse=$t,de.exports._enoent=Tt;var Hi=de.exports,Pi=ti(Hi);const ir=a((t,e)=>{const u={...process.env},r=["inherit","inherit","inherit"];process.send&&r.push("ipc"),e&&(e.noCache&&(u.TSX_DISABLE_CACHE="1"),e.tsconfigPath&&(u.TSX_TSCONFIG_PATH=e.tsconfigPath));const n=t.filter(s=>s!=="-i"&&s!=="--interactive").length===0;return Pi(process.execPath,["--require",he.require.resolve("./preflight.cjs"),...n?["--require",he.require.resolve("./patch-repl.cjs")]:[],ke.isFeatureSupported(ke.moduleRegister)?"--import":"--loader",_u.pathToFileURL(he.require.resolve("./loader.mjs")).toString(),...t],{stdio:r,env:u})},"run");var Ke={};const Li=z,te="\\\\/",Dr=`[^${te}]`,re="\\.",Ii="\\+",ki="\\?",Ve="\\/",Mi="(?=.)",or="[^/]",xt=`(?:${Ve}|$)`,ar=`(?:^|${Ve})`,Ot=`${re}{1,2}${xt}`,Gi=`(?!${re})`,Wi=`(?!${ar}${Ot})`,ji=`(?!${re}{0,1}${xt})`,Ui=`(?!${Ot})`,Ki=`[^.${Ve}]`,Vi=`${or}*?`,lr={DOT_LITERAL:re,PLUS_LITERAL:Ii,QMARK_LITERAL:ki,SLASH_LITERAL:Ve,ONE_CHAR:Mi,QMARK:or,END_ANCHOR:xt,DOTS_SLASH:Ot,NO_DOT:Gi,NO_DOTS:Wi,NO_DOT_SLASH:ji,NO_DOTS_SLASH:Ui,QMARK_NO_DOT:Ki,STAR:Vi,START_ANCHOR:ar},zi={...lr,SLASH_LITERAL:`[${te}]`,QMARK:Dr,STAR:`${Dr}*?`,DOTS_SLASH:`${re}{1,2}(?:[${te}]|$)`,NO_DOT:`(?!${re})`,NO_DOTS:`(?!(?:^|[${te}])${re}{1,2}(?:[${te}]|$))`,NO_DOT_SLASH:`(?!${re}{0,1}(?:[${te}]|$))`,NO_DOTS_SLASH:`(?!${re}{1,2}(?:[${te}]|$))`,QMARK_NO_DOT:`[^.${te}]`,START_ANCHOR:`(?:^|[${te}])`,END_ANCHOR:`(?:[${te}]|$)`},Yi={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var ze={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Yi,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Li.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?zi:lr}};(function(t){const e=z,u=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:i}=ze;t.isObject=D=>D!==null&&typeof D=="object"&&!Array.isArray(D),t.hasRegexChars=D=>s.test(D),t.isRegexChar=D=>D.length===1&&t.hasRegexChars(D),t.escapeRegex=D=>D.replace(i,"\\$1"),t.toPosixSlashes=D=>D.replace(r,"/"),t.removeBackslashes=D=>D.replace(n,o=>o==="\\"?"":o),t.supportsLookbehinds=()=>{const D=process.version.slice(1).split(".").map(Number);return D.length===3&&D[0]>=9||D[0]===8&&D[1]>=10},t.isWindows=D=>D&&typeof D.windows=="boolean"?D.windows:u===!0||e.sep==="\\",t.escapeLast=(D,o,c)=>{const f=D.lastIndexOf(o,c);return f===-1?D:D[f-1]==="\\"?t.escapeLast(D,o,f-1):`${D.slice(0,f)}\\${D.slice(f)}`},t.removePrefix=(D,o={})=>{let c=D;return c.startsWith("./")&&(c=c.slice(2),o.prefix="./"),c},t.wrapOutput=(D,o={},c={})=>{const f=c.contains?"":"^",h=c.contains?"":"$";let l=`${f}(?:${D})${h}`;return o.negated===!0&&(l=`(?:^(?!${l}).*$)`),l}})(Ke);const cr=Ke,{CHAR_ASTERISK:Nt,CHAR_AT:qi,CHAR_BACKWARD_SLASH:we,CHAR_COMMA:Xi,CHAR_DOT:Ht,CHAR_EXCLAMATION_MARK:Pt,CHAR_FORWARD_SLASH:fr,CHAR_LEFT_CURLY_BRACE:Lt,CHAR_LEFT_PARENTHESES:It,CHAR_LEFT_SQUARE_BRACKET:Qi,CHAR_PLUS:Zi,CHAR_QUESTION_MARK:hr,CHAR_RIGHT_CURLY_BRACE:Ji,CHAR_RIGHT_PARENTHESES:dr,CHAR_RIGHT_SQUARE_BRACKET:eD}=ze,Er=a(t=>t===fr||t===we,"isPathSeparator"),pr=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),tD=a((t,e)=>{const u=e||{},r=t.length-1,n=u.parts===!0||u.scanToEnd===!0,s=[],i=[],D=[];let o=t,c=-1,f=0,h=0,l=!1,p=!1,C=!1,g=!1,y=!1,B=!1,H=!1,$=!1,Q=!1,G=!1,se=0,W,A,v={value:"",depth:0,isGlob:!1};const M=a(()=>c>=r,"eos"),F=a(()=>o.charCodeAt(c+1),"peek"),O=a(()=>(W=A,o.charCodeAt(++c)),"advance");for(;c0&&(ie=o.slice(0,f),o=o.slice(f),h-=f),T&&C===!0&&h>0?(T=o.slice(0,h),d=o.slice(h)):C===!0?(T="",d=o):T=o,T&&T!==""&&T!=="/"&&T!==o&&Er(T.charCodeAt(T.length-1))&&(T=T.slice(0,-1)),u.unescape===!0&&(d&&(d=cr.removeBackslashes(d)),T&&H===!0&&(T=cr.removeBackslashes(T)));const E={prefix:ie,input:t,start:f,base:T,glob:d,isBrace:l,isBracket:p,isGlob:C,isExtglob:g,isGlobstar:y,negated:$,negatedExtglob:Q};if(u.tokens===!0&&(E.maxDepth=0,Er(A)||i.push(v),E.tokens=i),u.parts===!0||u.tokens===!0){let j;for(let b=0;b{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();const u=`[${t.join("-")}]`;try{new RegExp(u)}catch{return t.map(n=>Y.escapeRegex(n)).join("..")}return u},"expandRange"),pe=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),kt=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Cr[t]||t;const u={...e},r=typeof u.maxLength=="number"?Math.min(qe,u.maxLength):qe;let n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);const s={type:"bos",value:"",output:u.prepend||""},i=[s],D=u.capture?"":"?:",o=Y.isWindows(e),c=Ye.globChars(o),f=Ye.extglobChars(c),{DOT_LITERAL:h,PLUS_LITERAL:l,SLASH_LITERAL:p,ONE_CHAR:C,DOTS_SLASH:g,NO_DOT:y,NO_DOT_SLASH:B,NO_DOTS_SLASH:H,QMARK:$,QMARK_NO_DOT:Q,STAR:G,START_ANCHOR:se}=c,W=a(_=>`(${D}(?:(?!${se}${_.dot?g:h}).)*?)`,"globstar"),A=u.dot?"":y,v=u.dot?$:Q;let M=u.bash===!0?W(u):G;u.capture&&(M=`(${M})`),typeof u.noext=="boolean"&&(u.noextglob=u.noext);const F={input:t,index:-1,start:0,dot:u.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=Y.removePrefix(t,F),n=t.length;const O=[],T=[],ie=[];let d=s,E;const j=a(()=>F.index===n-1,"eos"),b=F.peek=(_=1)=>t[F.index+_],Z=F.advance=()=>t[++F.index]||"",J=a(()=>t.slice(F.index+1),"remaining"),V=a((_="",x=0)=>{F.consumed+=_,F.index+=x},"consume"),He=a(_=>{F.output+=_.output!=null?_.output:_.value,V(_.value)},"append"),wn=a(()=>{let _=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)Z(),F.start++,_++;return _%2===0?!1:(F.negated=!0,F.start++,!0)},"negate"),Pe=a(_=>{F[_]++,ie.push(_)},"increment"),De=a(_=>{F[_]--,ie.pop()},"decrement"),R=a(_=>{if(d.type==="globstar"){const x=F.braces>0&&(_.type==="comma"||_.type==="brace"),m=_.extglob===!0||O.length&&(_.type==="pipe"||_.type==="paren");_.type!=="slash"&&_.type!=="paren"&&!x&&!m&&(F.output=F.output.slice(0,-d.output.length),d.type="star",d.value="*",d.output=M,F.output+=d.output)}if(O.length&&_.type!=="paren"&&(O[O.length-1].inner+=_.value),(_.value||_.output)&&He(_),d&&d.type==="text"&&_.type==="text"){d.value+=_.value,d.output=(d.output||"")+_.value;return}_.prev=d,i.push(_),d=_},"push"),Le=a((_,x)=>{const m={...f[x],conditions:1,inner:""};m.prev=d,m.parens=F.parens,m.output=F.output;const w=(u.capture?"(":"")+m.open;Pe("parens"),R({type:_,value:x,output:F.output?"":C}),R({type:"paren",extglob:!0,value:Z(),output:w}),O.push(m)},"extglobOpen"),Rn=a(_=>{let x=_.close+(u.capture?")":""),m;if(_.type==="negate"){let w=M;if(_.inner&&_.inner.length>1&&_.inner.includes("/")&&(w=W(u)),(w!==M||j()||/^\)+$/.test(J()))&&(x=_.close=`)$))${w}`),_.inner.includes("*")&&(m=J())&&/^\.[^\\/.]+$/.test(m)){const N=kt(m,{...e,fastpaths:!1}).output;x=_.close=`)${N})${w})`}_.prev.type==="bos"&&(F.negatedExtglob=!0)}R({type:"paren",extglob:!0,value:E,output:x}),De("parens")},"extglobClose");if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let _=!1,x=t.replace(sD,(m,w,N,U,L,lt)=>U==="\\"?(_=!0,m):U==="?"?w?w+U+(L?$.repeat(L.length):""):lt===0?v+(L?$.repeat(L.length):""):$.repeat(N.length):U==="."?h.repeat(N.length):U==="*"?w?w+U+(L?M:""):M:w?m:`\\${m}`);return _===!0&&(u.unescape===!0?x=x.replace(/\\/g,""):x=x.replace(/\\+/g,m=>m.length%2===0?"\\\\":m?"\\":"")),x===t&&u.contains===!0?(F.output=t,F):(F.output=Y.wrapOutput(x,F,e),F)}for(;!j();){if(E=Z(),E==="\0")continue;if(E==="\\"){const m=b();if(m==="/"&&u.bash!==!0||m==="."||m===";")continue;if(!m){E+="\\",R({type:"text",value:E});continue}const w=/^\\+/.exec(J());let N=0;if(w&&w[0].length>2&&(N=w[0].length,F.index+=N,N%2!==0&&(E+="\\")),u.unescape===!0?E=Z():E+=Z(),F.brackets===0){R({type:"text",value:E});continue}}if(F.brackets>0&&(E!=="]"||d.value==="["||d.value==="[^")){if(u.posix!==!1&&E===":"){const m=d.value.slice(1);if(m.includes("[")&&(d.posix=!0,m.includes(":"))){const w=d.value.lastIndexOf("["),N=d.value.slice(0,w),U=d.value.slice(w+2),L=rD[U];if(L){d.value=N+L,F.backtrack=!0,Z(),!s.output&&i.indexOf(d)===1&&(s.output=C);continue}}}(E==="["&&b()!==":"||E==="-"&&b()==="]")&&(E=`\\${E}`),E==="]"&&(d.value==="["||d.value==="[^")&&(E=`\\${E}`),u.posix===!0&&E==="!"&&d.value==="["&&(E="^"),d.value+=E,He({value:E});continue}if(F.quotes===1&&E!=='"'){E=Y.escapeRegex(E),d.value+=E,He({value:E});continue}if(E==='"'){F.quotes=F.quotes===1?0:1,u.keepQuotes===!0&&R({type:"text",value:E});continue}if(E==="("){Pe("parens"),R({type:"paren",value:E});continue}if(E===")"){if(F.parens===0&&u.strictBrackets===!0)throw new SyntaxError(pe("opening","("));const m=O[O.length-1];if(m&&F.parens===m.parens+1){Rn(O.pop());continue}R({type:"paren",value:E,output:F.parens?")":"\\)"}),De("parens");continue}if(E==="["){if(u.nobracket===!0||!J().includes("]")){if(u.nobracket!==!0&&u.strictBrackets===!0)throw new SyntaxError(pe("closing","]"));E=`\\${E}`}else Pe("brackets");R({type:"bracket",value:E});continue}if(E==="]"){if(u.nobracket===!0||d&&d.type==="bracket"&&d.value.length===1){R({type:"text",value:E,output:`\\${E}`});continue}if(F.brackets===0){if(u.strictBrackets===!0)throw new SyntaxError(pe("opening","["));R({type:"text",value:E,output:`\\${E}`});continue}De("brackets");const m=d.value.slice(1);if(d.posix!==!0&&m[0]==="^"&&!m.includes("/")&&(E=`/${E}`),d.value+=E,He({value:E}),u.literalBrackets===!1||Y.hasRegexChars(m))continue;const w=Y.escapeRegex(d.value);if(F.output=F.output.slice(0,-d.value.length),u.literalBrackets===!0){F.output+=w,d.value=w;continue}d.value=`(${D}${w}|${d.value})`,F.output+=d.value;continue}if(E==="{"&&u.nobrace!==!0){Pe("braces");const m={type:"brace",value:E,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};T.push(m),R(m);continue}if(E==="}"){const m=T[T.length-1];if(u.nobrace===!0||!m){R({type:"text",value:E,output:E});continue}let w=")";if(m.dots===!0){const N=i.slice(),U=[];for(let L=N.length-1;L>=0&&(i.pop(),N[L].type!=="brace");L--)N[L].type!=="dots"&&U.unshift(N[L].value);w=iD(U,u),F.backtrack=!0}if(m.comma!==!0&&m.dots!==!0){const N=F.output.slice(0,m.outputIndex),U=F.tokens.slice(m.tokensIndex);m.value=m.output="\\{",E=w="\\}",F.output=N;for(const L of U)F.output+=L.output||L.value}R({type:"brace",value:E,output:w}),De("braces"),T.pop();continue}if(E==="|"){O.length>0&&O[O.length-1].conditions++,R({type:"text",value:E});continue}if(E===","){let m=E;const w=T[T.length-1];w&&ie[ie.length-1]==="braces"&&(w.comma=!0,m="|"),R({type:"comma",value:E,output:m});continue}if(E==="/"){if(d.type==="dot"&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",i.pop(),d=s;continue}R({type:"slash",value:E,output:p});continue}if(E==="."){if(F.braces>0&&d.type==="dot"){d.value==="."&&(d.output=h);const m=T[T.length-1];d.type="dots",d.output+=E,d.value+=E,m.dots=!0;continue}if(F.braces+F.parens===0&&d.type!=="bos"&&d.type!=="slash"){R({type:"text",value:E,output:h});continue}R({type:"dot",value:E,output:h});continue}if(E==="?"){if(!(d&&d.value==="(")&&u.noextglob!==!0&&b()==="("&&b(2)!=="?"){Le("qmark",E);continue}if(d&&d.type==="paren"){const w=b();let N=E;if(w==="<"&&!Y.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(d.value==="("&&!/[!=<:]/.test(w)||w==="<"&&!/<([!=]|\w+>)/.test(J()))&&(N=`\\${E}`),R({type:"text",value:E,output:N});continue}if(u.dot!==!0&&(d.type==="slash"||d.type==="bos")){R({type:"qmark",value:E,output:Q});continue}R({type:"qmark",value:E,output:$});continue}if(E==="!"){if(u.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){Le("negate",E);continue}if(u.nonegate!==!0&&F.index===0){wn();continue}}if(E==="+"){if(u.noextglob!==!0&&b()==="("&&b(2)!=="?"){Le("plus",E);continue}if(d&&d.value==="("||u.regex===!1){R({type:"plus",value:E,output:l});continue}if(d&&(d.type==="bracket"||d.type==="paren"||d.type==="brace")||F.parens>0){R({type:"plus",value:E});continue}R({type:"plus",value:l});continue}if(E==="@"){if(u.noextglob!==!0&&b()==="("&&b(2)!=="?"){R({type:"at",extglob:!0,value:E,output:""});continue}R({type:"text",value:E});continue}if(E!=="*"){(E==="$"||E==="^")&&(E=`\\${E}`);const m=nD.exec(J());m&&(E+=m[0],F.index+=m[0].length),R({type:"text",value:E});continue}if(d&&(d.type==="globstar"||d.star===!0)){d.type="star",d.star=!0,d.value+=E,d.output=M,F.backtrack=!0,F.globstar=!0,V(E);continue}let _=J();if(u.noextglob!==!0&&/^\([^?]/.test(_)){Le("star",E);continue}if(d.type==="star"){if(u.noglobstar===!0){V(E);continue}const m=d.prev,w=m.prev,N=m.type==="slash"||m.type==="bos",U=w&&(w.type==="star"||w.type==="globstar");if(u.bash===!0&&(!N||_[0]&&_[0]!=="/")){R({type:"star",value:E,output:""});continue}const L=F.braces>0&&(m.type==="comma"||m.type==="brace"),lt=O.length&&(m.type==="pipe"||m.type==="paren");if(!N&&m.type!=="paren"&&!L&&!lt){R({type:"star",value:E,output:""});continue}for(;_.slice(0,3)==="/**";){const Ie=t[F.index+4];if(Ie&&Ie!=="/")break;_=_.slice(3),V("/**",3)}if(m.type==="bos"&&j()){d.type="globstar",d.value+=E,d.output=W(u),F.output=d.output,F.globstar=!0,V(E);continue}if(m.type==="slash"&&m.prev.type!=="bos"&&!U&&j()){F.output=F.output.slice(0,-(m.output+d.output).length),m.output=`(?:${m.output}`,d.type="globstar",d.output=W(u)+(u.strictSlashes?")":"|$)"),d.value+=E,F.globstar=!0,F.output+=m.output+d.output,V(E);continue}if(m.type==="slash"&&m.prev.type!=="bos"&&_[0]==="/"){const Ie=_[1]!==void 0?"|$":"";F.output=F.output.slice(0,-(m.output+d.output).length),m.output=`(?:${m.output}`,d.type="globstar",d.output=`${W(u)}${p}|${p}${Ie})`,d.value+=E,F.output+=m.output+d.output,F.globstar=!0,V(E+Z()),R({type:"slash",value:"/",output:""});continue}if(m.type==="bos"&&_[0]==="/"){d.type="globstar",d.value+=E,d.output=`(?:^|${p}|${W(u)}${p})`,F.output=d.output,F.globstar=!0,V(E+Z()),R({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-d.output.length),d.type="globstar",d.output=W(u),d.value+=E,F.output+=d.output,F.globstar=!0,V(E);continue}const x={type:"star",value:E,output:M};if(u.bash===!0){x.output=".*?",(d.type==="bos"||d.type==="slash")&&(x.output=A+x.output),R(x);continue}if(d&&(d.type==="bracket"||d.type==="paren")&&u.regex===!0){x.output=E,R(x);continue}(F.index===F.start||d.type==="slash"||d.type==="dot")&&(d.type==="dot"?(F.output+=B,d.output+=B):u.dot===!0?(F.output+=H,d.output+=H):(F.output+=A,d.output+=A),b()!=="*"&&(F.output+=C,d.output+=C)),R(x)}for(;F.brackets>0;){if(u.strictBrackets===!0)throw new SyntaxError(pe("closing","]"));F.output=Y.escapeLast(F.output,"["),De("brackets")}for(;F.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(pe("closing",")"));F.output=Y.escapeLast(F.output,"("),De("parens")}for(;F.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(pe("closing","}"));F.output=Y.escapeLast(F.output,"{"),De("braces")}if(u.strictSlashes!==!0&&(d.type==="star"||d.type==="bracket")&&R({type:"maybe_slash",value:"",output:`${p}?`}),F.backtrack===!0){F.output="";for(const _ of F.tokens)F.output+=_.output!=null?_.output:_.value,_.suffix&&(F.output+=_.suffix)}return F},"parse$3");kt.fastpaths=(t,e)=>{const u={...e},r=typeof u.maxLength=="number"?Math.min(qe,u.maxLength):qe,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);t=Cr[t]||t;const s=Y.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:D,ONE_CHAR:o,DOTS_SLASH:c,NO_DOT:f,NO_DOTS:h,NO_DOTS_SLASH:l,STAR:p,START_ANCHOR:C}=Ye.globChars(s),g=u.dot?h:f,y=u.dot?l:f,B=u.capture?"":"?:",H={negated:!1,prefix:""};let $=u.bash===!0?".*?":p;u.capture&&($=`(${$})`);const Q=a(A=>A.noglobstar===!0?$:`(${B}(?:(?!${C}${A.dot?c:i}).)*?)`,"globstar"),G=a(A=>{switch(A){case"*":return`${g}${o}${$}`;case".*":return`${i}${o}${$}`;case"*.*":return`${g}${$}${i}${o}${$}`;case"*/*":return`${g}${$}${D}${o}${y}${$}`;case"**":return g+Q(u);case"**/*":return`(?:${g}${Q(u)}${D})?${y}${o}${$}`;case"**/*.*":return`(?:${g}${Q(u)}${D})?${y}${$}${i}${o}${$}`;case"**/.*":return`(?:${g}${Q(u)}${D})?${i}${o}${$}`;default:{const v=/^(.*?)\.(\w+)$/.exec(A);if(!v)return;const M=G(v[1]);return M?M+i+v[2]:void 0}}},"create"),se=Y.removePrefix(t,H);let W=G(se);return W&&u.strictSlashes!==!0&&(W+=`${D}?`),W};var DD=kt;const oD=z,aD=uD,Mt=DD,Gt=Ke,lD=ze,cD=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject$1"),P=a((t,e,u=!1)=>{if(Array.isArray(t)){const f=t.map(l=>P(l,e,u));return a(l=>{for(const p of f){const C=p(l);if(C)return C}return!1},"arrayMatcher")}const r=cD(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const n=e||{},s=Gt.isWindows(e),i=r?P.compileRe(t,e):P.makeRe(t,e,!1,!0),D=i.state;delete i.state;let o=a(()=>!1,"isIgnored");if(n.ignore){const f={...e,ignore:null,onMatch:null,onResult:null};o=P(n.ignore,f,u)}const c=a((f,h=!1)=>{const{isMatch:l,match:p,output:C}=P.test(f,i,e,{glob:t,posix:s}),g={glob:t,state:D,regex:i,posix:s,input:f,output:C,match:p,isMatch:l};return typeof n.onResult=="function"&&n.onResult(g),l===!1?(g.isMatch=!1,h?g:!1):o(f)?(typeof n.onIgnore=="function"&&n.onIgnore(g),g.isMatch=!1,h?g:!1):(typeof n.onMatch=="function"&&n.onMatch(g),h?g:!0)},"matcher");return u&&(c.state=D),c},"picomatch$3");P.test=(t,e,u,{glob:r,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};const s=u||{},i=s.format||(n?Gt.toPosixSlashes:null);let D=t===r,o=D&&i?i(t):t;return D===!1&&(o=i?i(t):t,D=o===r),(D===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?D=P.matchBase(t,e,u,n):D=e.exec(o)),{isMatch:!!D,match:D,output:o}},P.matchBase=(t,e,u,r=Gt.isWindows(u))=>(e instanceof RegExp?e:P.makeRe(e,u)).test(oD.basename(t)),P.isMatch=(t,e,u)=>P(e,u)(t),P.parse=(t,e)=>Array.isArray(t)?t.map(u=>P.parse(u,e)):Mt(t,{...e,fastpaths:!1}),P.scan=(t,e)=>aD(t,e),P.compileRe=(t,e,u=!1,r=!1)=>{if(u===!0)return t.output;const n=e||{},s=n.contains?"":"^",i=n.contains?"":"$";let D=`${s}(?:${t.output})${i}`;t&&t.negated===!0&&(D=`^(?!${D}).*$`);const o=P.toRegex(D,e);return r===!0&&(o.state=t),o},P.makeRe=(t,e={},u=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(n.output=Mt.fastpaths(t,e)),n.output||(n=Mt(t,e)),P.compileRe(n,e,u,r)},P.toRegex=(t,e)=>{try{const u=e||{};return new RegExp(t,u.flags||(u.nocase?"i":""))}catch(u){if(e&&e.debug===!0)throw u;return/$^/}},P.constants=lD;var fD=P,Fr=fD;const Re=oe,{Readable:hD}=On,be=z,{promisify:Xe}=_e,Wt=Fr,dD=Xe(Re.readdir),ED=Xe(Re.stat),gr=Xe(Re.lstat),pD=Xe(Re.realpath),CD="!",mr="READDIRP_RECURSIVE_ERROR",FD=new Set(["ENOENT","EPERM","EACCES","ELOOP",mr]),jt="files",_r="directories",Qe="files_directories",Ze="all",Ar=[jt,_r,Qe,Ze],gD=a(t=>FD.has(t.code),"isNormalFlowError"),[yr,mD]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),_D=process.platform==="win32"&&(yr>10||yr===10&&mD>=5),wr=a(t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){const e=Wt(t.trim());return u=>e(u.basename)}if(Array.isArray(t)){const e=[],u=[];for(const r of t){const n=r.trim();n.charAt(0)===CD?u.push(Wt(n.slice(1))):e.push(Wt(n))}return u.length>0?e.length>0?r=>e.some(n=>n(r.basename))&&!u.some(n=>n(r.basename)):r=>!u.some(n=>n(r.basename)):r=>e.some(n=>n(r.basename))}}},"normalizeFilter");class at extends hD{static{a(this,"ReaddirpStream")}static get defaultOptions(){return{root:".",fileFilter:a(e=>!0,"fileFilter"),directoryFilter:a(e=>!0,"directoryFilter"),type:jt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});const u={...at.defaultOptions,...e},{root:r,type:n}=u;this._fileFilter=wr(u.fileFilter),this._directoryFilter=wr(u.directoryFilter);const s=u.lstat?gr:ED;_D?this._stat=i=>s(i,{bigint:!0}):this._stat=s,this._maxDepth=u.depth,this._wantsDir=[_r,Qe,Ze].includes(n),this._wantsFile=[jt,Qe,Ze].includes(n),this._wantsEverything=n===Ze,this._root=be.resolve(r),this._isDirent="Dirent"in Re&&!u.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const{path:u,depth:r,files:n=[]}=this.parent||{};if(n.length>0){const s=n.splice(0,e).map(i=>this._formatEntry(i,u));for(const i of await Promise.all(s)){if(this.destroyed)return;const D=await this._getEntryType(i);D==="directory"&&this._directoryFilter(i)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,r+1)),this._wantsDir&&(this.push(i),e--)):(D==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{const s=this.parents.pop();if(!s){this.push(null);break}if(this.parent=await s,this.destroyed)return}}}catch(u){this.destroy(u)}finally{this.reading=!1}}}async _exploreDir(e,u){let r;try{r=await dD(e,this._rdOptions)}catch(n){this._onError(n)}return{files:r,depth:u,path:e}}async _formatEntry(e,u){let r;try{const n=this._isDirent?e.name:e,s=be.resolve(be.join(u,n));r={path:be.relative(this._root,s),fullPath:s,basename:n},r[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(n){this._onError(n)}return r}_onError(e){gD(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){const u=e&&e[this._statsProp];if(u){if(u.isFile())return"file";if(u.isDirectory())return"directory";if(u&&u.isSymbolicLink()){const r=e.fullPath;try{const n=await pD(r),s=await gr(n);if(s.isFile())return"file";if(s.isDirectory()){const i=n.length;if(r.startsWith(n)&&r.substr(i,1)===be.sep){const D=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return D.code=mr,this._onError(D)}return"directory"}}catch(n){this._onError(n)}}}}_includeAsFile(e){const u=e&&e[this._statsProp];return u&&this._wantsEverything&&!u.isDirectory()}}const Ce=a((t,e={})=>{let u=e.entryType||e.type;if(u==="both"&&(u=Qe),u&&(e.type=u),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(u&&!Ar.includes(u))throw new Error(`readdirp: Invalid type passed. Use one of ${Ar.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new at(e)},"readdirp$1"),AD=a((t,e={})=>new Promise((u,r)=>{const n=[];Ce(t,e).on("data",s=>n.push(s)).on("end",()=>u(n)).on("error",s=>r(s))}),"readdirpPromise");Ce.promise=AD,Ce.ReaddirpStream=at,Ce.default=Ce;var yD=Ce,Ut={exports:{}};/*! - * normalize-path - * - * Copyright (c) 2014-2018, Jon Schlinkert. - * Released under the MIT License. - */var Rr=a(function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var u=t.length;if(u<=1)return t;var r="";if(u>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var s=t.split(/[/\\]+/);return e!==!1&&s[s.length-1]===""&&s.pop(),r+s.join("/")},"normalizePath$2"),wD=Ut.exports;Object.defineProperty(wD,"__esModule",{value:!0});const br=Fr,RD=Rr,vr="!",bD={returnIndex:!1},vD=a(t=>Array.isArray(t)?t:[t],"arrify$1"),SD=a((t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){const u=br(t,e);return r=>t===r||u(r)}return t instanceof RegExp?u=>t.test(u):u=>!1},"createPattern"),Sr=a((t,e,u,r)=>{const n=Array.isArray(u),s=n?u[0]:u;if(!n&&typeof s!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));const i=RD(s,!1);for(let o=0;o{if(t==null)throw new TypeError("anymatch: specify first argument");const r=typeof u=="boolean"?{returnIndex:u}:u,n=r.returnIndex||!1,s=vD(t),i=s.filter(o=>typeof o=="string"&&o.charAt(0)===vr).map(o=>o.slice(1)).map(o=>br(o,r)),D=s.filter(o=>typeof o!="string"||typeof o=="string"&&o.charAt(0)!==vr).map(o=>SD(o,r));return e==null?(o,c=!1)=>Sr(D,i,o,typeof c=="boolean"?c:!1):Sr(D,i,e,n)},"anymatch$1");Kt.default=Kt,Ut.exports=Kt;var BD=Ut.exports;/*! - * is-extglob - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - */var $D=a(function(e){if(typeof e!="string"||e==="")return!1;for(var u;u=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(u[2])return!0;e=e.slice(u.index+u[0].length)}return!1},"isExtglob");/*! - * is-glob - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */var TD=$D,Br={"{":"}","(":")","[":"]"},xD=a(function(t){if(t[0]==="!")return!0;for(var e=0,u=-2,r=-2,n=-2,s=-2,i=-2;ee&&(i===-1||i>r||(i=t.indexOf("\\",e),i===-1||i>r)))||n!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(n=t.indexOf("}",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(i=t.indexOf("\\",e),i===-1||i>s))||u!==-1&&t[e]==="("&&t[e+1]!=="|"&&(uu&&(i=t.indexOf("\\",u),i===-1||i>s))))return!0;if(t[e]==="\\"){var D=t[e+1];e+=2;var o=Br[D];if(o){var c=t.indexOf(o,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),OD=a(function(t){if(t[0]==="!")return!0;for(var e=0;etypeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,u)=>e.nodes.find(r=>r.type===u),t.exceedsLimit=(e,u,r=1,n)=>n===!1||!t.isInteger(e)||!t.isInteger(u)?!1:(Number(u)-Number(e))/Number(r)>=n,t.escapeNode=(e,u=0,r)=>{let n=e.nodes[u];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((u,r)=>(r.type==="text"&&u.push(r.value),r.type==="range"&&(r.type="text"),u),[]),t.flatten=(...e)=>{const u=[],r=a(n=>{for(let s=0;s{let u=a((r,n={})=>{let s=e.escapeInvalid&&Tr.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,D="";if(r.value)return(s||i)&&Tr.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let o of r.nodes)D+=u(o);return D},"stringify");return u(t)},"stringify$4");/*! - * is-number - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */var WD=a(function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1},"isNumber$2");/*! - * to-regex-range - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Released under the MIT License. - */const xr=WD,le=a((t,e,u)=>{if(xr(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(xr(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...u};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let n=String(r.relaxZeros),s=String(r.shorthand),i=String(r.capture),D=String(r.wrap),o=t+":"+e+"="+n+s+i+D;if(le.cache.hasOwnProperty(o))return le.cache[o].result;let c=Math.min(t,e),f=Math.max(t,e);if(Math.abs(c-f)===1){let g=t+"|"+e;return r.capture?`(${g})`:r.wrap===!1?g:`(?:${g})`}let h=Ir(t)||Ir(e),l={min:t,max:e,a:c,b:f},p=[],C=[];if(h&&(l.isPadded=h,l.maxLen=String(l.max).length),c<0){let g=f<0?Math.abs(f):1;C=Or(g,Math.abs(c),l,r),c=l.a=0}return f>=0&&(p=Or(c,f,l,r)),l.negatives=C,l.positives=p,l.result=jD(C,p),r.capture===!0?l.result=`(${l.result})`:r.wrap!==!1&&p.length+C.length>1&&(l.result=`(?:${l.result})`),le.cache[o]=l,l.result},"toRegexRange$1");function jD(t,e,u){let r=Yt(t,e,"-",!1)||[],n=Yt(e,t,"",!1)||[],s=Yt(t,e,"-?",!0)||[];return r.concat(s).concat(n).join("|")}a(jD,"collatePatterns");function UD(t,e){let u=1,r=1,n=Hr(t,u),s=new Set([e]);for(;t<=n&&n<=e;)s.add(n),u+=1,n=Hr(t,u);for(n=Pr(e+1,r)-1;t1&&D.count.pop(),D.count.push(f.count[0]),D.string=D.pattern+Lr(D.count),i=c+1;continue}u.isPadded&&(h=qD(c,u,r)),f.string=h+f.pattern+Lr(f.count),s.push(f),i=c+1,D=f}return s}a(Or,"splitToPatterns");function Yt(t,e,u,r,n){let s=[];for(let i of t){let{string:D}=i;!r&&!Nr(e,"string",D)&&s.push(u+D),r&&Nr(e,"string",D)&&s.push(u+D)}return s}a(Yt,"filterPatterns");function VD(t,e){let u=[];for(let r=0;re?1:e>t?-1:0}a(zD,"compare");function Nr(t,e,u){return t.some(r=>r[e]===u)}a(Nr,"contains");function Hr(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}a(Hr,"countNines");function Pr(t,e){return t-t%Math.pow(10,e)}a(Pr,"countZeros");function Lr(t){let[e=0,u=""]=t;return u||e>1?`{${e+(u?","+u:"")}}`:""}a(Lr,"toQuantifier");function YD(t,e,u){return`[${t}${e-t===1?"":"-"}${e}]`}a(YD,"toCharacterClass");function Ir(t){return/^-?(0+)\d/.test(t)}a(Ir,"hasPadding");function qD(t,e,u){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),n=u.relaxZeros!==!1;switch(r){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${r}}`:`0{${r}}`}}a(qD,"padZeros"),le.cache={},le.clearCache=()=>le.cache={};var XD=le;/*! - * fill-range - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Licensed under the MIT License. - */const QD=_e,kr=XD,Mr=a(t=>t!==null&&typeof t=="object"&&!Array.isArray(t),"isObject"),ZD=a(t=>e=>t===!0?Number(e):String(e),"transform"),qt=a(t=>typeof t=="number"||typeof t=="string"&&t!=="","isValidValue"),ve=a(t=>Number.isInteger(+t),"isNumber"),Xt=a(t=>{let e=`${t}`,u=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++u]==="0";);return u>0},"zeros"),JD=a((t,e,u)=>typeof t=="string"||typeof e=="string"?!0:u.stringify===!0,"stringify$3"),eo=a((t,e,u)=>{if(e>0){let r=t[0]==="-"?"-":"";r&&(t=t.slice(1)),t=r+t.padStart(r?e-1:e,"0")}return u===!1?String(t):t},"pad"),Gr=a((t,e)=>{let u=t[0]==="-"?"-":"";for(u&&(t=t.slice(1),e--);t.length{t.negatives.sort((i,D)=>iD?1:0),t.positives.sort((i,D)=>iD?1:0);let u=e.capture?"":"?:",r="",n="",s;return t.positives.length&&(r=t.positives.join("|")),t.negatives.length&&(n=`-(${u}${t.negatives.join("|")})`),r&&n?s=`${r}|${n}`:s=r||n,e.wrap?`(${u}${s})`:s},"toSequence"),Wr=a((t,e,u,r)=>{if(u)return kr(t,e,{wrap:!1,...r});let n=String.fromCharCode(t);if(t===e)return n;let s=String.fromCharCode(e);return`[${n}-${s}]`},"toRange"),jr=a((t,e,u)=>{if(Array.isArray(t)){let r=u.wrap===!0,n=u.capture?"":"?:";return r?`(${n}${t.join("|")})`:t.join("|")}return kr(t,e,u)},"toRegex"),Ur=a((...t)=>new RangeError("Invalid range arguments: "+QD.inspect(...t)),"rangeError"),Kr=a((t,e,u)=>{if(u.strictRanges===!0)throw Ur([t,e]);return[]},"invalidRange"),uo=a((t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},"invalidStep"),ro=a((t,e,u=1,r={})=>{let n=Number(t),s=Number(e);if(!Number.isInteger(n)||!Number.isInteger(s)){if(r.strictRanges===!0)throw Ur([t,e]);return[]}n===0&&(n=0),s===0&&(s=0);let i=n>s,D=String(t),o=String(e),c=String(u);u=Math.max(Math.abs(u),1);let f=Xt(D)||Xt(o)||Xt(c),h=f?Math.max(D.length,o.length,c.length):0,l=f===!1&&JD(t,e,r)===!1,p=r.transform||ZD(l);if(r.toRegex&&u===1)return Wr(Gr(t,h),Gr(e,h),!0,r);let C={negatives:[],positives:[]},g=a(H=>C[H<0?"negatives":"positives"].push(Math.abs(H)),"push"),y=[],B=0;for(;i?n>=s:n<=s;)r.toRegex===!0&&u>1?g(n):y.push(eo(p(n,B),h,l)),n=i?n-u:n+u,B++;return r.toRegex===!0?u>1?to(C,r):jr(y,null,{wrap:!1,...r}):y},"fillNumbers"),no=a((t,e,u=1,r={})=>{if(!ve(t)&&t.length>1||!ve(e)&&e.length>1)return Kr(t,e,r);let n=r.transform||(l=>String.fromCharCode(l)),s=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),D=s>i,o=Math.min(s,i),c=Math.max(s,i);if(r.toRegex&&u===1)return Wr(o,c,!1,r);let f=[],h=0;for(;D?s>=i:s<=i;)f.push(n(s,h)),s=D?s-u:s+u,h++;return r.toRegex===!0?jr(f,null,{wrap:!1,options:r}):f},"fillLetters"),et=a((t,e,u,r={})=>{if(e==null&&qt(t))return[t];if(!qt(t)||!qt(e))return Kr(t,e,r);if(typeof u=="function")return et(t,e,1,{transform:u});if(Mr(u))return et(t,e,0,u);let n={...r};return n.capture===!0&&(n.wrap=!0),u=u||n.step||1,ve(u)?ve(t)&&ve(e)?ro(t,e,u,n):no(t,e,Math.max(Math.abs(u),1),n):u!=null&&!Mr(u)?uo(u,n):et(t,e,1,u)},"fill$2");var Vr=et;const so=Vr,zr=Je,io=a((t,e={})=>{let u=a((r,n={})=>{let s=zr.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,D=s===!0||i===!0,o=e.escapeInvalid===!0?"\\":"",c="";if(r.isOpen===!0||r.isClose===!0)return o+r.value;if(r.type==="open")return D?o+r.value:"(";if(r.type==="close")return D?o+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":D?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let f=zr.reduce(r.nodes),h=so(...f,{...e,wrap:!1,toRegex:!0});if(h.length!==0)return f.length>1&&h.length>1?`(${h})`:h}if(r.nodes)for(let f of r.nodes)c+=u(f,r);return c},"walk");return u(t)},"compile$1");var Do=io;const oo=Vr,Yr=zt,Fe=Je,ce=a((t="",e="",u=!1)=>{let r=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return u?Fe.flatten(e).map(n=>`{${n}}`):e;for(let n of t)if(Array.isArray(n))for(let s of n)r.push(ce(s,e,u));else for(let s of e)u===!0&&typeof s=="string"&&(s=`{${s}}`),r.push(Array.isArray(s)?ce(n,s,u):n+s);return Fe.flatten(r)},"append"),ao=a((t,e={})=>{let u=e.rangeLimit===void 0?1e3:e.rangeLimit,r=a((n,s={})=>{n.queue=[];let i=s,D=s.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,D=i.queue;if(n.invalid||n.dollar){D.push(ce(D.pop(),Yr(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){D.push(ce(D.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let h=Fe.reduce(n.nodes);if(Fe.exceedsLimit(...h,e.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=oo(...h,e);l.length===0&&(l=Yr(n,e)),D.push(ce(D.pop(),l)),n.nodes=[];return}let o=Fe.encloseBrace(n),c=n.queue,f=n;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,c=f.queue;for(let h=0;h",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const fo=zt,{MAX_LENGTH:qr,CHAR_BACKSLASH:Qt,CHAR_BACKTICK:ho,CHAR_COMMA:Eo,CHAR_DOT:po,CHAR_LEFT_PARENTHESES:Co,CHAR_RIGHT_PARENTHESES:Fo,CHAR_LEFT_CURLY_BRACE:go,CHAR_RIGHT_CURLY_BRACE:mo,CHAR_LEFT_SQUARE_BRACKET:Xr,CHAR_RIGHT_SQUARE_BRACKET:Qr,CHAR_DOUBLE_QUOTE:_o,CHAR_SINGLE_QUOTE:Ao,CHAR_NO_BREAK_SPACE:yo,CHAR_ZERO_WIDTH_NOBREAK_SPACE:wo}=co,Ro=a((t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},r=typeof u.maxLength=="number"?Math.min(qr,u.maxLength):qr;if(t.length>r)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${r})`);let n={type:"root",input:t,nodes:[]},s=[n],i=n,D=n,o=0,c=t.length,f=0,h=0,l;const p=a(()=>t[f++],"advance"),C=a(g=>{if(g.type==="text"&&D.type==="dot"&&(D.type="text"),D&&D.type==="text"&&g.type==="text"){D.value+=g.value;return}return i.nodes.push(g),g.parent=i,g.prev=D,D=g,g},"push");for(C({type:"bos"});f0){if(i.ranges>0){i.ranges=0;let g=i.nodes.shift();i.nodes=[g,{type:"text",value:fo(i)}]}C({type:"comma",value:l}),i.commas++;continue}if(l===po&&h>0&&i.commas===0){let g=i.nodes;if(h===0||g.length===0){C({type:"text",value:l});continue}if(D.type==="dot"){if(i.range=[],D.value+=l,D.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,D.type="text";continue}i.ranges++,i.args=[];continue}if(D.type==="range"){g.pop();let y=g[g.length-1];y.value+=D.value+l,D=y,i.ranges--;continue}C({type:"dot",value:l});continue}C({type:"text",value:l})}do if(i=s.pop(),i.type!=="root"){i.nodes.forEach(B=>{B.nodes||(B.type==="open"&&(B.isOpen=!0),B.type==="close"&&(B.isClose=!0),B.nodes||(B.type="text"),B.invalid=!0)});let g=s[s.length-1],y=g.nodes.indexOf(i);g.nodes.splice(y,1,...i.nodes)}while(s.length>0);return C({type:"eos"}),n},"parse$1");var bo=Ro;const Zr=zt,vo=Do,So=lo,Bo=bo,q=a((t,e={})=>{let u=[];if(Array.isArray(t))for(let r of t){let n=q.create(r,e);Array.isArray(n)?u.push(...n):u.push(n)}else u=[].concat(q.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(u=[...new Set(u)]),u},"braces$1");q.parse=(t,e={})=>Bo(t,e),q.stringify=(t,e={})=>Zr(typeof t=="string"?q.parse(t,e):t,e),q.compile=(t,e={})=>(typeof t=="string"&&(t=q.parse(t,e)),vo(t,e)),q.expand=(t,e={})=>{typeof t=="string"&&(t=q.parse(t,e));let u=So(t,e);return e.noempty===!0&&(u=u.filter(Boolean)),e.nodupes===!0&&(u=[...new Set(u)]),u},q.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?q.compile(t,e):q.expand(t,e);var $o=q,To=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"],xo=To;const Oo=z,No=xo,Ho=new Set(No);var Po=a(t=>Ho.has(Oo.extname(t).slice(1).toLowerCase()),"isBinaryPath$1"),tt={};(function(t){const{sep:e}=z,{platform:u}=process,r=Au;t.EV_ALL="all",t.EV_READY="ready",t.EV_ADD="add",t.EV_CHANGE="change",t.EV_ADD_DIR="addDir",t.EV_UNLINK="unlink",t.EV_UNLINK_DIR="unlinkDir",t.EV_RAW="raw",t.EV_ERROR="error",t.STR_DATA="data",t.STR_END="end",t.STR_CLOSE="close",t.FSEVENT_CREATED="created",t.FSEVENT_MODIFIED="modified",t.FSEVENT_DELETED="deleted",t.FSEVENT_MOVED="moved",t.FSEVENT_CLONED="cloned",t.FSEVENT_UNKNOWN="unknown",t.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1,t.FSEVENT_TYPE_FILE="file",t.FSEVENT_TYPE_DIRECTORY="directory",t.FSEVENT_TYPE_SYMLINK="symlink",t.KEY_LISTENERS="listeners",t.KEY_ERR="errHandlers",t.KEY_RAW="rawEmitters",t.HANDLER_KEYS=[t.KEY_LISTENERS,t.KEY_ERR,t.KEY_RAW],t.DOT_SLASH=`.${e}`,t.BACK_SLASH_RE=/\\/g,t.DOUBLE_SLASH_RE=/\/\//,t.SLASH_OR_BACK_SLASH_RE=/[/\\]/,t.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,t.REPLACER_RE=/^\.[/\\]/,t.SLASH="/",t.SLASH_SLASH="//",t.BRACE_START="{",t.BANG="!",t.ONE_DOT=".",t.TWO_DOTS="..",t.STAR="*",t.GLOBSTAR="**",t.ROOT_GLOBSTAR="/**/*",t.SLASH_GLOBSTAR="/**",t.DIR_SUFFIX="Dir",t.ANYMATCH_OPTS={dot:!0},t.STRING_TYPE="string",t.FUNCTION_TYPE="function",t.EMPTY_STR="",t.EMPTY_FN=()=>{},t.IDENTITY_FN=n=>n,t.isWindows=u==="win32",t.isMacos=u==="darwin",t.isLinux=u==="linux",t.isIBMi=r.type()==="OS400"})(tt);const ne=oe,I=z,{promisify:Se}=_e,Lo=Po,{isWindows:Io,isLinux:ko,EMPTY_FN:Mo,EMPTY_STR:Go,KEY_LISTENERS:ge,KEY_ERR:Zt,KEY_RAW:Be,HANDLER_KEYS:Wo,EV_CHANGE:ut,EV_ADD:rt,EV_ADD_DIR:jo,EV_ERROR:Jr,STR_DATA:Uo,STR_END:Ko,BRACE_START:Vo,STAR:zo}=tt,Yo="watch",qo=Se(ne.open),en=Se(ne.stat),Xo=Se(ne.lstat),Qo=Se(ne.close),Jt=Se(ne.realpath),Zo={lstat:Xo,stat:en},eu=a((t,e)=>{t instanceof Set?t.forEach(e):e(t)},"foreach"),$e=a((t,e,u)=>{let r=t[e];r instanceof Set||(t[e]=r=new Set([r])),r.add(u)},"addAndConvert"),Jo=a(t=>e=>{const u=t[e];u instanceof Set?u.clear():delete t[e]},"clearItem"),Te=a((t,e,u)=>{const r=t[e];r instanceof Set?r.delete(u):r===u&&delete t[e]},"delFromSet"),tn=a(t=>t instanceof Set?t.size===0:!t,"isEmptySet"),nt=new Map;function un(t,e,u,r,n){const s=a((i,D)=>{u(t),n(i,D,{watchedPath:t}),D&&t!==D&&st(I.resolve(t,D),ge,I.join(t,D))},"handleEvent");try{return ne.watch(t,e,s)}catch(i){r(i)}}a(un,"createFsWatchInstance");const st=a((t,e,u,r,n)=>{const s=nt.get(t);s&&eu(s[e],i=>{i(u,r,n)})},"fsWatchBroadcast"),ea=a((t,e,u,r)=>{const{listener:n,errHandler:s,rawEmitter:i}=r;let D=nt.get(e),o;if(!u.persistent)return o=un(t,u,n,s,i),o.close.bind(o);if(D)$e(D,ge,n),$e(D,Zt,s),$e(D,Be,i);else{if(o=un(t,u,st.bind(null,e,ge),s,st.bind(null,e,Be)),!o)return;o.on(Jr,async c=>{const f=st.bind(null,e,Zt);if(D.watcherUnusable=!0,Io&&c.code==="EPERM")try{const h=await qo(t,"r");await Qo(h),f(c)}catch{}else f(c)}),D={listeners:n,errHandlers:s,rawEmitters:i,watcher:o},nt.set(e,D)}return()=>{Te(D,ge,n),Te(D,Zt,s),Te(D,Be,i),tn(D.listeners)&&(D.watcher.close(),nt.delete(e),Wo.forEach(Jo(D)),D.watcher=void 0,Object.freeze(D))}},"setFsWatchListener"),tu=new Map,ta=a((t,e,u,r)=>{const{listener:n,rawEmitter:s}=r;let i=tu.get(e);const D=i&&i.options;return D&&(D.persistentu.interval)&&(i.listeners,i.rawEmitters,ne.unwatchFile(e),i=void 0),i?($e(i,ge,n),$e(i,Be,s)):(i={listeners:n,rawEmitters:s,options:u,watcher:ne.watchFile(e,u,(o,c)=>{eu(i.rawEmitters,h=>{h(ut,e,{curr:o,prev:c})});const f=o.mtimeMs;(o.size!==c.size||f>c.mtimeMs||f===0)&&eu(i.listeners,h=>h(t,o))})},tu.set(e,i)),()=>{Te(i,ge,n),Te(i,Be,s),tn(i.listeners)&&(tu.delete(e),ne.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}},"setFsWatchFileListener");let ua=class{static{a(this,"NodeFsHandler")}constructor(e){this.fsw=e,this._boundHandleError=u=>e._handleError(u)}_watchWithNodeFs(e,u){const r=this.fsw.options,n=I.dirname(e),s=I.basename(e);this.fsw._getWatchedDir(n).add(s);const D=I.resolve(e),o={persistent:r.persistent};u||(u=Mo);let c;return r.usePolling?(o.interval=r.enableBinaryInterval&&Lo(s)?r.binaryInterval:r.interval,c=ta(e,D,o,{listener:u,rawEmitter:this.fsw._emitRaw})):c=ea(e,D,o,{listener:u,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),c}_handleFile(e,u,r){if(this.fsw.closed)return;const n=I.dirname(e),s=I.basename(e),i=this.fsw._getWatchedDir(n);let D=u;if(i.has(s))return;const o=a(async(f,h)=>{if(this.fsw._throttle(Yo,e,5)){if(!h||h.mtimeMs===0)try{const l=await en(e);if(this.fsw.closed)return;const p=l.atimeMs,C=l.mtimeMs;(!p||p<=C||C!==D.mtimeMs)&&this.fsw._emit(ut,e,l),ko&&D.ino!==l.ino?(this.fsw._closeFile(f),D=l,this.fsw._addPathCloser(f,this._watchWithNodeFs(e,o))):D=l}catch{this.fsw._remove(n,s)}else if(i.has(s)){const l=h.atimeMs,p=h.mtimeMs;(!l||l<=p||p!==D.mtimeMs)&&this.fsw._emit(ut,e,h),D=h}}},"listener"),c=this._watchWithNodeFs(e,o);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(rt,e,0))return;this.fsw._emit(rt,e,u)}return c}async _handleSymlink(e,u,r,n){if(this.fsw.closed)return;const s=e.fullPath,i=this.fsw._getWatchedDir(u);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let D;try{D=await Jt(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(n)?this.fsw._symlinkPaths.get(s)!==D&&(this.fsw._symlinkPaths.set(s,D),this.fsw._emit(ut,r,e.stats)):(i.add(n),this.fsw._symlinkPaths.set(s,D),this.fsw._emit(rt,r,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,u,r,n,s,i,D){if(e=I.join(e,Go),!r.hasGlob&&(D=this.fsw._throttle("readdir",e,1e3),!D))return;const o=this.fsw._getWatchedDir(r.path),c=new Set;let f=this.fsw._readdirp(e,{fileFilter:a(h=>r.filterPath(h),"fileFilter"),directoryFilter:a(h=>r.filterDir(h),"directoryFilter"),depth:0}).on(Uo,async h=>{if(this.fsw.closed){f=void 0;return}const l=h.path;let p=I.join(e,l);if(c.add(l),!(h.stats.isSymbolicLink()&&await this._handleSymlink(h,e,p,l))){if(this.fsw.closed){f=void 0;return}(l===n||!n&&!o.has(l))&&(this.fsw._incrReadyCount(),p=I.join(s,I.relative(s,p)),this._addToNodeFs(p,u,r,i+1))}}).on(Jr,this._boundHandleError);return new Promise(h=>f.once(Ko,()=>{if(this.fsw.closed){f=void 0;return}const l=D?D.clear():!1;h(),o.getChildren().filter(p=>p!==e&&!c.has(p)&&(!r.hasGlob||r.filterPath({fullPath:I.resolve(e,p)}))).forEach(p=>{this.fsw._remove(e,p)}),f=void 0,l&&this._handleRead(e,!1,r,n,s,i,D)}))}async _handleDir(e,u,r,n,s,i,D){const o=this.fsw._getWatchedDir(I.dirname(e)),c=o.has(I.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!s&&!c&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(jo,e,u),o.add(I.basename(e)),this.fsw._getWatchedDir(e);let f,h;const l=this.fsw.options.depth;if((l==null||n<=l)&&!this.fsw._symlinkPaths.has(D)){if(!s&&(await this._handleRead(e,r,i,s,e,n,f),this.fsw.closed))return;h=this._watchWithNodeFs(e,(p,C)=>{C&&C.mtimeMs===0||this._handleRead(p,!1,i,s,e,n,f)})}return h}async _addToNodeFs(e,u,r,n,s){const i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;const D=this.fsw._getWatchHelpers(e,n);!D.hasGlob&&r&&(D.hasGlob=r.hasGlob,D.globFilter=r.globFilter,D.filterPath=o=>r.filterPath(o),D.filterDir=o=>r.filterDir(o));try{const o=await Zo[D.statMethod](D.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(D.watchPath,o))return i(),!1;const c=this.fsw.options.followSymlinks&&!e.includes(zo)&&!e.includes(Vo);let f;if(o.isDirectory()){const h=I.resolve(e),l=c?await Jt(e):e;if(this.fsw.closed||(f=await this._handleDir(D.watchPath,o,u,n,s,D,l),this.fsw.closed))return;h!==l&&l!==void 0&&this.fsw._symlinkPaths.set(h,l)}else if(o.isSymbolicLink()){const h=c?await Jt(e):e;if(this.fsw.closed)return;const l=I.dirname(D.watchPath);if(this.fsw._getWatchedDir(l).add(D.watchPath),this.fsw._emit(rt,D.watchPath,o),f=await this._handleDir(l,o,u,n,e,D,h),this.fsw.closed)return;h!==void 0&&this.fsw._symlinkPaths.set(I.resolve(e),h)}else f=this._handleFile(D.watchPath,o,u);return i(),this.fsw._addPathCloser(e,f),!1}catch(o){if(this.fsw._handleError(o))return i(),e}}};var ra=ua,uu={exports:{}};const ru=oe,k=z,{promisify:nu}=_e;let me;try{me=he.require("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(me){const t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){const e=Number.parseInt(t[1],10),u=Number.parseInt(t[2],10);e===8&&u<16&&(me=void 0)}}const{EV_ADD:su,EV_CHANGE:na,EV_ADD_DIR:rn,EV_UNLINK:it,EV_ERROR:sa,STR_DATA:ia,STR_END:Da,FSEVENT_CREATED:oa,FSEVENT_MODIFIED:aa,FSEVENT_DELETED:la,FSEVENT_MOVED:ca,FSEVENT_UNKNOWN:fa,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:ha,FSEVENT_TYPE_FILE:da,FSEVENT_TYPE_DIRECTORY:xe,FSEVENT_TYPE_SYMLINK:nn,ROOT_GLOBSTAR:sn,DIR_SUFFIX:Ea,DOT_SLASH:Dn,FUNCTION_TYPE:iu,EMPTY_FN:pa,IDENTITY_FN:Ca}=tt,Fa=a(t=>isNaN(t)?{}:{depth:t},"Depth"),Du=nu(ru.stat),ga=nu(ru.lstat),on=nu(ru.realpath),ma={stat:Du,lstat:ga},fe=new Map,_a=10,Aa=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),ya=a((t,e)=>({stop:me.watch(t,e)}),"createFSEventsInstance");function wa(t,e,u,r){let n=k.extname(e)?k.dirname(e):e;const s=k.dirname(n);let i=fe.get(n);Ra(s)&&(n=s);const D=k.resolve(t),o=D!==e,c=a((h,l,p)=>{o&&(h=h.replace(e,D)),(h===D||!h.indexOf(D+k.sep))&&u(h,l,p)},"filteredListener");let f=!1;for(const h of fe.keys())if(e.indexOf(k.resolve(h)+k.sep)===0){n=h,i=fe.get(n),f=!0;break}return i||f?i.listeners.add(c):(i={listeners:new Set([c]),rawEmitter:r,watcher:ya(n,(h,l)=>{if(!i.listeners.size||l&ha)return;const p=me.getInfo(h,l);i.listeners.forEach(C=>{C(h,l,p)}),i.rawEmitter(p.event,h,p)})},fe.set(n,i)),()=>{const h=i.listeners;if(h.delete(c),!h.size&&(fe.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}a(wa,"setFSEventsListener");const Ra=a(t=>{let e=0;for(const u of fe.keys())if(u.indexOf(t)===0&&(e++,e>=_a))return!0;return!1},"couldConsolidate"),ba=a(()=>me&&fe.size<128,"canUse"),ou=a((t,e)=>{let u=0;for(;!t.indexOf(e)&&(t=k.dirname(t))!==e;)u++;return u},"calcDepth"),an=a((t,e)=>t.type===xe&&e.isDirectory()||t.type===nn&&e.isSymbolicLink()||t.type===da&&e.isFile(),"sameTypes");let va=class{static{a(this,"FsEventsHandler")}constructor(e){this.fsw=e}checkIgnored(e,u){const r=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,u))return r.add(e),u&&u.isDirectory()&&r.add(e+sn),!0;r.delete(e),r.delete(e+sn)}addOrChange(e,u,r,n,s,i,D,o){const c=s.has(i)?na:su;this.handleEvent(c,e,u,r,n,s,i,D,o)}async checkExists(e,u,r,n,s,i,D,o){try{const c=await Du(e);if(this.fsw.closed)return;an(D,c)?this.addOrChange(e,u,r,n,s,i,D,o):this.handleEvent(it,e,u,r,n,s,i,D,o)}catch(c){c.code==="EACCES"?this.addOrChange(e,u,r,n,s,i,D,o):this.handleEvent(it,e,u,r,n,s,i,D,o)}}handleEvent(e,u,r,n,s,i,D,o,c){if(!(this.fsw.closed||this.checkIgnored(u)))if(e===it){const f=o.type===xe;(f||i.has(D))&&this.fsw._remove(s,D,f)}else{if(e===su){if(o.type===xe&&this.fsw._getWatchedDir(u),o.type===nn&&c.followSymlinks){const h=c.depth===void 0?void 0:ou(r,n)+1;return this._addToFsEvents(u,!1,!0,h)}this.fsw._getWatchedDir(s).add(D)}const f=o.type===xe?e+Ea:e;this.fsw._emit(f,u),f===rn&&this._addToFsEvents(u,!1,!0)}}_watchWithFsEvents(e,u,r,n){if(this.fsw.closed||this.fsw._isIgnored(e))return;const s=this.fsw.options,D=wa(e,u,a(async(o,c,f)=>{if(this.fsw.closed||s.depth!==void 0&&ou(o,u)>s.depth)return;const h=r(k.join(e,k.relative(e,o)));if(n&&!n(h))return;const l=k.dirname(h),p=k.basename(h),C=this.fsw._getWatchedDir(f.type===xe?h:l);if(Aa.has(c)||f.event===fa)if(typeof s.ignored===iu){let g;try{g=await Du(h)}catch{}if(this.fsw.closed||this.checkIgnored(h,g))return;an(f,g)?this.addOrChange(h,o,u,l,C,p,f,s):this.handleEvent(it,h,o,u,l,C,p,f,s)}else this.checkExists(h,o,u,l,C,p,f,s);else switch(f.event){case oa:case aa:return this.addOrChange(h,o,u,l,C,p,f,s);case la:case ca:return this.checkExists(h,o,u,l,C,p,f,s)}},"watchCallback"),this.fsw._emitRaw);return this.fsw._emitReady(),D}async _handleFsEventsSymlink(e,u,r,n){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(u))){this.fsw._symlinkPaths.set(u,!0),this.fsw._incrReadyCount();try{const s=await on(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(s))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(s||e,i=>{let D=e;return s&&s!==Dn?D=i.replace(s,e):i!==Dn&&(D=k.join(e,i)),r(D)},!1,n)}catch(s){if(this.fsw._handleError(s))return this.fsw._emitReady()}}}emitAdd(e,u,r,n,s){const i=r(e),D=u.isDirectory(),o=this.fsw._getWatchedDir(k.dirname(i)),c=k.basename(i);D&&this.fsw._getWatchedDir(i),!o.has(c)&&(o.add(c),(!n.ignoreInitial||s===!0)&&this.fsw._emit(D?rn:su,i,u))}initWatch(e,u,r,n){if(this.fsw.closed)return;const s=this._watchWithFsEvents(r.watchPath,k.resolve(e||r.watchPath),n,r.globFilter);this.fsw._addPathCloser(u,s)}async _addToFsEvents(e,u,r,n){if(this.fsw.closed)return;const s=this.fsw.options,i=typeof u===iu?u:Ca,D=this.fsw._getWatchHelpers(e);try{const o=await ma[D.statMethod](D.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(D.watchPath,o))throw null;if(o.isDirectory()){if(D.globFilter||this.emitAdd(i(e),o,i,s,r),n&&n>s.depth)return;this.fsw._readdirp(D.watchPath,{fileFilter:a(c=>D.filterPath(c),"fileFilter"),directoryFilter:a(c=>D.filterDir(c),"directoryFilter"),...Fa(s.depth-(n||0))}).on(ia,c=>{if(this.fsw.closed||c.stats.isDirectory()&&!D.filterPath(c))return;const f=k.join(D.watchPath,c.path),{fullPath:h}=c;if(D.followSymlinks&&c.stats.isSymbolicLink()){const l=s.depth===void 0?void 0:ou(f,k.resolve(D.watchPath))+1;this._handleFsEventsSymlink(f,h,i,l)}else this.emitAdd(f,c.stats,i,s,r)}).on(sa,pa).on(Da,()=>{this.fsw._emitReady()})}else this.emitAdd(D.watchPath,o,i,s,r),this.fsw._emitReady()}catch(o){(!o||this.fsw._handleError(o))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(s.persistent&&r!==!0)if(typeof u===iu)this.initWatch(void 0,e,D,i);else{let o;try{o=await on(D.watchPath)}catch{}this.initWatch(o,e,D,i)}}};uu.exports=va,uu.exports.canUse=ba;var Sa=uu.exports;const{EventEmitter:Ba}=xn,au=oe,S=z,{promisify:ln}=_e,$a=yD,lu=BD.default,Ta=GD,cu=$r,xa=$o,Oa=Rr,Na=ra,cn=Sa,{EV_ALL:fu,EV_READY:Ha,EV_ADD:Dt,EV_CHANGE:Oe,EV_UNLINK:fn,EV_ADD_DIR:Pa,EV_UNLINK_DIR:La,EV_RAW:Ia,EV_ERROR:hu,STR_CLOSE:ka,STR_END:Ma,BACK_SLASH_RE:Ga,DOUBLE_SLASH_RE:hn,SLASH_OR_BACK_SLASH_RE:Wa,DOT_RE:ja,REPLACER_RE:Ua,SLASH:du,SLASH_SLASH:Ka,BRACE_START:Va,BANG:Eu,ONE_DOT:dn,TWO_DOTS:za,GLOBSTAR:Ya,SLASH_GLOBSTAR:pu,ANYMATCH_OPTS:Cu,STRING_TYPE:Fu,FUNCTION_TYPE:qa,EMPTY_STR:gu,EMPTY_FN:Xa,isWindows:Qa,isMacos:Za,isIBMi:Ja}=tt,el=ln(au.stat),tl=ln(au.readdir),mu=a((t=[])=>Array.isArray(t)?t:[t],"arrify"),En=a((t,e=[])=>(t.forEach(u=>{Array.isArray(u)?En(u,e):e.push(u)}),e),"flatten"),pn=a(t=>{const e=En(mu(t));if(!e.every(u=>typeof u===Fu))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Fn)},"unifyPaths"),Cn=a(t=>{let e=t.replace(Ga,du),u=!1;for(e.startsWith(Ka)&&(u=!0);e.match(hn);)e=e.replace(hn,du);return u&&(e=du+e),e},"toUnix"),Fn=a(t=>Cn(S.normalize(Cn(t))),"normalizePathToUnix"),gn=a((t=gu)=>e=>typeof e!==Fu?e:Fn(S.isAbsolute(e)?e:S.join(t,e)),"normalizeIgnored"),ul=a((t,e)=>S.isAbsolute(t)?t:t.startsWith(Eu)?Eu+S.join(e,t.slice(1)):S.join(e,t),"getAbsolutePath"),X=a((t,e)=>t[e]===void 0,"undef");class rl{static{a(this,"DirEntry")}constructor(e,u){this.path=e,this._removeWatcher=u,this.items=new Set}add(e){const{items:u}=this;u&&e!==dn&&e!==za&&u.add(e)}async remove(e){const{items:u}=this;if(!u||(u.delete(e),u.size>0))return;const r=this.path;try{await tl(r)}catch{this._removeWatcher&&this._removeWatcher(S.dirname(r),S.basename(r))}}has(e){const{items:u}=this;if(u)return u.has(e)}getChildren(){const{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}const nl="stat",sl="lstat";class il{static{a(this,"WatchHelper")}constructor(e,u,r,n){this.fsw=n,this.path=e=e.replace(Ua,gu),this.watchPath=u,this.fullWatchPath=S.resolve(u),this.hasGlob=u!==e,e===gu&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&r?void 0:!1,this.globFilter=this.hasGlob?lu(e,void 0,Cu):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=r,this.statMethod=r?nl:sl}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return S.join(this.watchPath,S.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:u}=e;if(u&&u.isSymbolicLink())return this.filterDir(e);const r=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===qa?this.globFilter(r):!0)&&this.fsw._isntIgnored(r,u)&&this.fsw._hasReadPermissions(u)}getDirParts(e){if(!this.hasGlob)return[];const u=[];return(e.includes(Va)?xa.expand(e):[e]).forEach(n=>{u.push(S.relative(this.watchPath,n).split(Wa))}),u}filterDir(e){if(this.hasGlob){const u=this.getDirParts(this.checkGlobSymlink(e));let r=!1;this.unmatchedGlob=!this.dirParts.some(n=>n.every((s,i)=>(s===Ya&&(r=!0),r||!u[0][i]||lu(s,u[0][i],Cu))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class Dl extends Ba{static{a(this,"FSWatcher")}constructor(e){super();const u={};e&&Object.assign(u,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,X(u,"persistent")&&(u.persistent=!0),X(u,"ignoreInitial")&&(u.ignoreInitial=!1),X(u,"ignorePermissionErrors")&&(u.ignorePermissionErrors=!1),X(u,"interval")&&(u.interval=100),X(u,"binaryInterval")&&(u.binaryInterval=300),X(u,"disableGlobbing")&&(u.disableGlobbing=!1),u.enableBinaryInterval=u.binaryInterval!==u.interval,X(u,"useFsEvents")&&(u.useFsEvents=!u.usePolling),cn.canUse()||(u.useFsEvents=!1),X(u,"usePolling")&&!u.useFsEvents&&(u.usePolling=Za),Ja&&(u.usePolling=!0);const n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){const o=n.toLowerCase();o==="false"||o==="0"?u.usePolling=!1:o==="true"||o==="1"?u.usePolling=!0:u.usePolling=!!o}const s=process.env.CHOKIDAR_INTERVAL;s&&(u.interval=Number.parseInt(s,10)),X(u,"atomic")&&(u.atomic=!u.usePolling&&!u.useFsEvents),u.atomic&&(this._pendingUnlinks=new Map),X(u,"followSymlinks")&&(u.followSymlinks=!0),X(u,"awaitWriteFinish")&&(u.awaitWriteFinish=!1),u.awaitWriteFinish===!0&&(u.awaitWriteFinish={});const i=u.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),u.ignored&&(u.ignored=mu(u.ignored));let D=0;this._emitReady=()=>{D++,D>=this._readyCount&&(this._emitReady=Xa,this._readyEmitted=!0,process.nextTick(()=>this.emit(Ha)))},this._emitRaw=(...o)=>this.emit(Ia,...o),this._readyEmitted=!1,this.options=u,u.useFsEvents?this._fsEventsHandler=new cn(this):this._nodeFsHandler=new Na(this),Object.freeze(u)}add(e,u,r){const{cwd:n,disableGlobbing:s}=this.options;this.closed=!1;let i=pn(e);return n&&(i=i.map(D=>{const o=ul(D,n);return s||!cu(D)?o:Oa(o)})),i=i.filter(D=>D.startsWith(Eu)?(this._ignoredPaths.add(D.slice(1)),!1):(this._ignoredPaths.delete(D),this._ignoredPaths.delete(D+pu),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount+=i.length),i.forEach(D=>this._fsEventsHandler._addToFsEvents(D))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async D=>{const o=await this._nodeFsHandler._addToNodeFs(D,!r,0,0,u);return o&&this._emitReady(),o})).then(D=>{this.closed||D.filter(o=>o).forEach(o=>{this.add(S.dirname(o),S.basename(u||o))})})),this}unwatch(e){if(this.closed)return this;const u=pn(e),{cwd:r}=this.options;return u.forEach(n=>{!S.isAbsolute(n)&&!this._closers.has(n)&&(r&&(n=S.join(r,n)),n=S.resolve(n)),this._closePath(n),this._ignoredPaths.add(n),this._watched.has(n)&&this._ignoredPaths.add(n+pu),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach(u=>u.forEach(r=>{const n=r();n instanceof Promise&&e.push(n)})),this._streams.forEach(u=>u.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(u=>u.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(u=>{this[`_${u}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach((u,r)=>{const n=this.options.cwd?S.relative(this.options.cwd,r):r;e[n||dn]=u.getChildren().sort()}),e}emitWithAll(e,u){this.emit(...u),e!==hu&&this.emit(fu,...u)}async _emit(e,u,r,n,s){if(this.closed)return;const i=this.options;Qa&&(u=S.normalize(u)),i.cwd&&(u=S.relative(i.cwd,u));const D=[e,u];s!==void 0?D.push(r,n,s):n!==void 0?D.push(r,n):r!==void 0&&D.push(r);const o=i.awaitWriteFinish;let c;if(o&&(c=this._pendingWrites.get(u)))return c.lastChange=new Date,this;if(i.atomic){if(e===fn)return this._pendingUnlinks.set(u,D),setTimeout(()=>{this._pendingUnlinks.forEach((f,h)=>{this.emit(...f),this.emit(fu,...f),this._pendingUnlinks.delete(h)})},typeof i.atomic=="number"?i.atomic:100),this;e===Dt&&this._pendingUnlinks.has(u)&&(e=D[0]=Oe,this._pendingUnlinks.delete(u))}if(o&&(e===Dt||e===Oe)&&this._readyEmitted){const f=a((h,l)=>{h?(e=D[0]=hu,D[1]=h,this.emitWithAll(e,D)):l&&(D.length>2?D[2]=l:D.push(l),this.emitWithAll(e,D))},"awfEmit");return this._awaitWriteFinish(u,o.stabilityThreshold,e,f),this}if(e===Oe&&!this._throttle(Oe,u,50))return this;if(i.alwaysStat&&r===void 0&&(e===Dt||e===Pa||e===Oe)){const f=i.cwd?S.join(i.cwd,u):u;let h;try{h=await el(f)}catch{}if(!h||this.closed)return;D.push(h)}return this.emitWithAll(e,D),this}_handleError(e){const u=e&&e.code;return e&&u!=="ENOENT"&&u!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||u!=="EPERM"&&u!=="EACCES")&&this.emit(hu,e),e||this.closed}_throttle(e,u,r){this._throttled.has(e)||this._throttled.set(e,new Map);const n=this._throttled.get(e),s=n.get(u);if(s)return s.count++,!1;let i;const D=a(()=>{const c=n.get(u),f=c?c.count:0;return n.delete(u),clearTimeout(i),c&&clearTimeout(c.timeoutObject),f},"clear");i=setTimeout(D,r);const o={timeoutObject:i,clear:D,count:0};return n.set(u,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,u,r,n){let s,i=e;this.options.cwd&&!S.isAbsolute(e)&&(i=S.join(this.options.cwd,e));const D=new Date,o=a(c=>{au.stat(i,(f,h)=>{if(f||!this._pendingWrites.has(e)){f&&f.code!=="ENOENT"&&n(f);return}const l=Number(new Date);c&&h.size!==c.size&&(this._pendingWrites.get(e).lastChange=l);const p=this._pendingWrites.get(e);l-p.lastChange>=u?(this._pendingWrites.delete(e),n(void 0,h)):s=setTimeout(o,this.options.awaitWriteFinish.pollInterval,h)})},"awaitWriteFinish");this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:D,cancelWait:a(()=>(this._pendingWrites.delete(e),clearTimeout(s),r),"cancelWait")}),s=setTimeout(o,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,u){if(this.options.atomic&&ja.test(e))return!0;if(!this._userIgnored){const{cwd:r}=this.options,n=this.options.ignored,s=n&&n.map(gn(r)),i=mu(s).filter(o=>typeof o===Fu&&!cu(o)).map(o=>o+pu),D=this._getGlobIgnored().map(gn(r)).concat(s,i);this._userIgnored=lu(D,void 0,Cu)}return this._userIgnored([e,u])}_isntIgnored(e,u){return!this._isIgnored(e,u)}_getWatchHelpers(e,u){const r=u||this.options.disableGlobbing||!cu(e)?e:Ta(e),n=this.options.followSymlinks;return new il(e,r,n,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));const u=S.resolve(e);return this._watched.has(u)||this._watched.set(u,new rl(u,this._boundRemove)),this._watched.get(u)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const r=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(r.toString(8)[0],10))}_remove(e,u,r){const n=S.join(e,u),s=S.resolve(n);if(r=r??(this._watched.has(n)||this._watched.has(s)),!this._throttle("remove",n,100))return;!r&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,u,!0),this._getWatchedDir(n).getChildren().forEach(l=>this._remove(n,l));const o=this._getWatchedDir(e),c=o.has(u);o.remove(u),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let f=n;if(this.options.cwd&&(f=S.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(f)&&this._pendingWrites.get(f).cancelWait()===Dt)return;this._watched.delete(n),this._watched.delete(s);const h=r?La:fn;c&&!this._isIgnored(n)&&this._emit(h,n),this.options.useFsEvents||this._closePath(n)}_closePath(e){this._closeFile(e);const u=S.dirname(e);this._getWatchedDir(u).remove(S.basename(e))}_closeFile(e){const u=this._closers.get(e);u&&(u.forEach(r=>r()),this._closers.delete(e))}_addPathCloser(e,u){if(!u)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(u)}_readdirp(e,u){if(this.closed)return;const r={type:fu,alwaysStat:!0,lstat:!0,...u};let n=$a(e,r);return this._streams.add(n),n.once(ka,()=>{n=void 0}),n.once(Ma,()=>{n&&(this._streams.delete(n),n=void 0)}),n}}const ol=a((t,e)=>{const u=new Dl(e);return u.add(t),u},"watch");var al=ol;const ot=a((t=!0)=>{let e=!1;return u=>{if(e||u==="unknown-flag")return!0;if(u==="argument")return e=!0,t}},"ignoreAfterArgument"),mn=a((t,e=process.argv.slice(2))=>(wu(t,e,{ignore:ot()}),e),"removeArgvFlags"),ll=a(t=>{let e=Buffer.alloc(0);return u=>{for(e=Buffer.concat([e,u]);e.length>4;){const r=e.readInt32BE(0);if(e.length>=4+r){const n=e.slice(4,4+r);t(n),e=e.slice(4+r)}else break}}},"bufferData"),_n=a(async()=>{const t=Nn.createServer(u=>{u.on("data",ll(r=>{const n=JSON.parse(r.toString());t.emit("data",n)}))}),e=he.getPipePath(process.pid);return await ft.promises.mkdir(Hn.tmpdir,{recursive:!0}),await ft.promises.rm(e,{force:!0}),await new Promise((u,r)=>{t.listen(e,u),t.on("error",r)}),t.unref(),process.on("exit",()=>{if(t.close(),!he.isWindows)try{ft.rmSync(e)}catch{}}),t},"createIpcServer"),cl=a(()=>new Date().toLocaleTimeString(),"currentTime"),Ne=a((...t)=>console.log(ue.gray(cl()),ue.lightCyan("[tsx]"),...t),"log"),fl="\x1Bc",hl=a((t,e)=>{let u;return function(){u&&clearTimeout(u),u=setTimeout(()=>Reflect.apply(t,this,arguments),e)}},"debounce"),An={noCache:{type:Boolean,description:"Disable caching",default:!1},tsconfig:{type:String,description:"Custom tsconfig.json path"},clearScreen:{type:Boolean,description:"Clearing the screen on rerun",default:!0},ignore:{type:[String],description:"Paths & globs to exclude from being watched (Deprecated: use --exclude)"},include:{type:[String],description:"Additional paths & globs to watch"},exclude:{type:[String],description:"Paths & globs to exclude from being watched"}},dl=Js({name:"watch",parameters:["