diff --git a/__test__/api/cli/auth/device.test.ts b/__test__/api/cli/auth/device.test.ts new file mode 100644 index 00000000..246e61f8 --- /dev/null +++ b/__test__/api/cli/auth/device.test.ts @@ -0,0 +1,58 @@ +import { jest, describe, it, expect, beforeAll } from "@jest/globals" + +// Set environment variables before any module loading +process.env.REDIS_URL = "redis://localhost:6379" +process.env.GITHUB_CLIENT_ID = "test-client-id" +process.env.GITHUB_CLIENT_SECRET = "test-client-secret" + +const mockInitiateDeviceFlow = jest.fn().mockResolvedValue({ + userCode: "ABCD-1234", + verificationUri: "https://github.com/login/device", + deviceCode: "device123", + sessionId: "session-uuid", + expiresIn: 899, + interval: 5, +}) + +// Use unstable_mockModule for ESM +jest.unstable_mockModule("@/common/key-value-store/RedisKeyValueStore", () => ({ + default: jest.fn().mockImplementation(() => ({})), +})) + +jest.unstable_mockModule("@/features/cli/data", () => ({ + RedisCLISessionStore: jest.fn().mockImplementation(() => ({})), +})) + +jest.unstable_mockModule("@/features/cli/domain", () => ({ + CLIDeviceFlowService: jest.fn().mockImplementation(() => ({ + initiateDeviceFlow: mockInitiateDeviceFlow, + })), +})) + +describe("POST /api/cli/auth/device", () => { + let POST: (req: Request) => Promise + + beforeAll(async () => { + const routeModule = await import("@/app/api/cli/auth/device/route") + POST = routeModule.POST + }) + + it("returns device flow details for authentication", async () => { + const request = new Request("http://localhost/api/cli/auth/device", { + method: "POST", + }) + + const response = await POST(request) + const data = await response.json() + + expect(response.status).toBe(200) + expect(data).toEqual({ + userCode: "ABCD-1234", + verificationUri: "https://github.com/login/device", + deviceCode: "device123", + sessionId: "session-uuid", + expiresIn: 899, + interval: 5, + }) + }) +}) diff --git a/__test__/api/cli/auth/logout.test.ts b/__test__/api/cli/auth/logout.test.ts new file mode 100644 index 00000000..c9cec645 --- /dev/null +++ b/__test__/api/cli/auth/logout.test.ts @@ -0,0 +1,65 @@ +import { jest, describe, it, expect, beforeAll, beforeEach } from "@jest/globals" + +// Set environment variables before any module loading +process.env.REDIS_URL = "redis://localhost:6379" + +const mockDelete = jest.fn() + +// Use unstable_mockModule for ESM +jest.unstable_mockModule("@/common/key-value-store/RedisKeyValueStore", () => ({ + default: jest.fn().mockImplementation(() => ({})), +})) + +jest.unstable_mockModule("@/features/cli/data", () => ({ + RedisCLISessionStore: jest.fn().mockImplementation(() => ({ + delete: mockDelete, + })), +})) + +describe("POST /api/cli/auth/logout", () => { + let POST: (req: Request) => Promise + + beforeAll(async () => { + const routeModule = await import("@/app/api/cli/auth/logout/route") + POST = routeModule.POST + }) + + beforeEach(() => { + jest.clearAllMocks() + }) + + it("deletes session and returns success", async () => { + mockDelete.mockResolvedValue(undefined) + + const request = new Request("http://localhost/api/cli/auth/logout", { + method: "POST", + headers: { Authorization: "Bearer session-uuid" }, + }) + + const response = await POST(request) + const data = await response.json() + + expect(response.status).toBe(200) + expect(data).toEqual({ success: true }) + expect(mockDelete).toHaveBeenCalledWith("session-uuid") + }) + + it("returns 401 when no authorization header", async () => { + const request = new Request("http://localhost/api/cli/auth/logout", { + method: "POST", + }) + + const response = await POST(request) + expect(response.status).toBe(401) + }) + + it("returns 401 when authorization header is not Bearer token", async () => { + const request = new Request("http://localhost/api/cli/auth/logout", { + method: "POST", + headers: { Authorization: "Basic some-credentials" }, + }) + + const response = await POST(request) + expect(response.status).toBe(401) + }) +}) diff --git a/__test__/api/cli/auth/status.test.ts b/__test__/api/cli/auth/status.test.ts new file mode 100644 index 00000000..1365b477 --- /dev/null +++ b/__test__/api/cli/auth/status.test.ts @@ -0,0 +1,153 @@ +import { jest, describe, it, expect, beforeAll, beforeEach } from "@jest/globals" + +// Set environment variables before any module loading +process.env.REDIS_URL = "redis://localhost:6379" +process.env.GITHUB_CLIENT_ID = "test-client-id" +process.env.GITHUB_CLIENT_SECRET = "test-client-secret" + +const mockPollForToken = jest.fn() + +// Use unstable_mockModule for ESM +jest.unstable_mockModule("@/common/key-value-store/RedisKeyValueStore", () => ({ + default: jest.fn().mockImplementation(() => ({})), +})) + +jest.unstable_mockModule("@/features/cli/data", () => ({ + RedisCLISessionStore: jest.fn().mockImplementation(() => ({})), +})) + +jest.unstable_mockModule("@/features/cli/domain", () => ({ + CLIDeviceFlowService: jest.fn().mockImplementation(() => ({ + pollForToken: mockPollForToken, + })), +})) + +function createPostRequest(body: unknown, ip?: string): Request { + const headers: Record = { "Content-Type": "application/json" } + if (ip) { + headers["x-forwarded-for"] = ip + } + return new Request("http://localhost/api/cli/auth/status", { + method: "POST", + headers, + body: JSON.stringify(body), + }) +} + +describe("POST /api/cli/auth/status", () => { + let POST: (req: Request) => Promise + let rateLimitMap: Map + + beforeAll(async () => { + const routeModule = await import("@/app/api/cli/auth/status/route") + POST = routeModule.POST + rateLimitMap = routeModule.rateLimitMap + }) + + beforeEach(() => { + jest.clearAllMocks() + rateLimitMap.clear() + }) + + it("returns pending when authorization not complete", async () => { + mockPollForToken.mockResolvedValue(null) + + const request = createPostRequest({ device_code: "abc123" }, "192.168.1.1") + const response = await POST(request) + const data = await response.json() + + expect(response.status).toBe(200) + expect(data).toEqual({ status: "pending" }) + }) + + it("returns complete with sessionId on success", async () => { + mockPollForToken.mockResolvedValue({ sessionId: "session-uuid" }) + + const request = createPostRequest({ device_code: "abc123" }, "192.168.1.2") + const response = await POST(request) + const data = await response.json() + + expect(response.status).toBe(200) + expect(data).toEqual({ status: "complete", sessionId: "session-uuid" }) + }) + + it("returns 400 when device_code missing", async () => { + const request = createPostRequest({}, "192.168.1.3") + const response = await POST(request) + + expect(response.status).toBe(400) + }) + + it("returns 400 when body is invalid JSON", async () => { + const request = new Request("http://localhost/api/cli/auth/status", { + method: "POST", + headers: { "Content-Type": "application/json", "x-forwarded-for": "192.168.1.4" }, + body: "invalid json", + }) + const response = await POST(request) + const data = await response.json() + + expect(response.status).toBe(400) + expect(data).toEqual({ error: "Invalid JSON body" }) + }) + + it("returns error status when pollForToken fails", async () => { + mockPollForToken.mockRejectedValue(new Error("Token expired")) + + const request = createPostRequest({ device_code: "abc123" }, "192.168.1.5") + const response = await POST(request) + const data = await response.json() + + expect(response.status).toBe(500) + expect(data).toEqual({ status: "error", error: "Token expired" }) + }) + + describe("rate limiting", () => { + it("returns 429 when same IP makes requests too quickly", async () => { + mockPollForToken.mockResolvedValue(null) + const testIP = "10.0.0.1" + + // First request should succeed + const request1 = createPostRequest({ device_code: "abc123" }, testIP) + const response1 = await POST(request1) + expect(response1.status).toBe(200) + + // Second request from same IP should be rate limited + const request2 = createPostRequest({ device_code: "abc123" }, testIP) + const response2 = await POST(request2) + const data = await response2.json() + + expect(response2.status).toBe(429) + expect(data.error).toContain("Too many requests") + }) + + it("allows requests from different IPs", async () => { + mockPollForToken.mockResolvedValue(null) + + const request1 = createPostRequest({ device_code: "abc123" }, "10.0.0.2") + const response1 = await POST(request1) + expect(response1.status).toBe(200) + + const request2 = createPostRequest({ device_code: "abc123" }, "10.0.0.3") + const response2 = await POST(request2) + expect(response2.status).toBe(200) + }) + + it("allows request after rate limit window expires", async () => { + mockPollForToken.mockResolvedValue(null) + const testIP = "10.0.0.4" + + // First request + const request1 = createPostRequest({ device_code: "abc123" }, testIP) + await POST(request1) + + // Simulate time passing by manually updating the rate limit map + rateLimitMap.set(testIP, Date.now() - 6000) // 6 seconds ago + + // Request should now succeed + const request2 = createPostRequest({ device_code: "abc123" }, testIP) + const response2 = await POST(request2) + expect(response2.status).toBe(200) + }) + }) +}) diff --git a/__test__/api/cli/middleware.test.ts b/__test__/api/cli/middleware.test.ts new file mode 100644 index 00000000..b071d94f --- /dev/null +++ b/__test__/api/cli/middleware.test.ts @@ -0,0 +1,105 @@ +import { jest, describe, it, expect, beforeAll, beforeEach } from "@jest/globals" +import { NextRequest, NextResponse } from "next/server" + +// Set environment variables before any module loading +process.env.REDIS_URL = "redis://localhost:6379" + +const mockGet = jest.fn() + +// Use unstable_mockModule for ESM +jest.unstable_mockModule("@/common/key-value-store/RedisKeyValueStore", () => ({ + default: jest.fn().mockImplementation(() => ({})), +})) + +jest.unstable_mockModule("@/features/cli/data/RedisCLISessionStore", () => ({ + RedisCLISessionStore: jest.fn().mockImplementation(() => ({ + get: mockGet, + })), +})) + +describe("CLI middleware", () => { + let getSessionFromRequest: (request: NextRequest) => string | null + let withAuth: ( + handler: (request: NextRequest, auth: { session: { sessionId: string; accessToken: string }; sessionStore: unknown }) => Promise> + ) => (request: NextRequest) => Promise> + + beforeAll(async () => { + const middlewareModule = await import("@/app/api/cli/middleware") + getSessionFromRequest = middlewareModule.getSessionFromRequest + withAuth = middlewareModule.withAuth + }) + + beforeEach(() => { + jest.clearAllMocks() + }) + + describe("getSessionFromRequest", () => { + it("extracts session ID from Bearer token", () => { + const request = new Request("http://localhost/api/cli/test", { + headers: { Authorization: "Bearer abc123" }, + }) as NextRequest + expect(getSessionFromRequest(request as NextRequest)).toBe("abc123") + }) + + it("returns null when no auth header", () => { + const request = new Request("http://localhost/api/cli/test") as NextRequest + expect(getSessionFromRequest(request as NextRequest)).toBeNull() + }) + }) + + describe("withAuth", () => { + it("returns 401 when no session ID", async () => { + const handler = jest.fn() + const wrappedHandler = withAuth(handler) + + const request = new Request("http://localhost/api/cli/test") as NextRequest + const response = await wrappedHandler(request as NextRequest) + + expect(response.status).toBe(401) + expect(handler).not.toHaveBeenCalled() + }) + + it("returns 401 when session not found in Redis", async () => { + mockGet.mockResolvedValue(null) + + const handler = jest.fn() + const wrappedHandler = withAuth(handler) + + const request = new Request("http://localhost/api/cli/test", { + headers: { Authorization: "Bearer invalid-session" }, + }) as NextRequest + const response = await wrappedHandler(request as NextRequest) + + expect(response.status).toBe(401) + expect(handler).not.toHaveBeenCalled() + }) + + it("calls handler with auth context when session valid", async () => { + const mockSession = { + sessionId: "valid-session", + accessToken: "github-token", + createdAt: new Date().toISOString(), + } + mockGet.mockResolvedValue(mockSession) + + const handler = jest + .fn() + .mockResolvedValue(NextResponse.json({ ok: true })) + const wrappedHandler = withAuth(handler) + + const request = new Request("http://localhost/api/cli/test", { + headers: { Authorization: "Bearer valid-session" }, + }) as NextRequest + const response = await wrappedHandler(request as NextRequest) + + expect(response.status).toBe(200) + expect(handler).toHaveBeenCalledWith( + expect.any(Object), + expect.objectContaining({ + session: mockSession, + sessionStore: expect.any(Object), + }) + ) + }) + }) +}) diff --git a/__test__/cli/TokenRefreshingCLIGraphQLClient.test.ts b/__test__/cli/TokenRefreshingCLIGraphQLClient.test.ts new file mode 100644 index 00000000..a83b89b0 --- /dev/null +++ b/__test__/cli/TokenRefreshingCLIGraphQLClient.test.ts @@ -0,0 +1,126 @@ +import { jest, describe, it, expect, beforeEach } from "@jest/globals" +import { CLISession, ICLISessionStore } from "@/features/cli/domain" +import { IOAuthTokenRefresher } from "@/features/auth/domain" + +// Mock Octokit +const mockGraphql = jest.fn() +jest.unstable_mockModule("octokit", () => ({ + Octokit: jest.fn().mockImplementation(() => ({ + graphql: mockGraphql, + })), +})) + +describe("TokenRefreshingCLIGraphQLClient", () => { + let TokenRefreshingCLIGraphQLClient: typeof import("@/features/cli/domain").TokenRefreshingCLIGraphQLClient + let mockSessionStore: jest.Mocked + let mockTokenRefresher: jest.Mocked + let testSession: CLISession + + beforeEach(async () => { + jest.clearAllMocks() + + const cliModule = await import("@/features/cli/domain") + TokenRefreshingCLIGraphQLClient = cliModule.TokenRefreshingCLIGraphQLClient + + testSession = { + sessionId: "test-session-id", + accessToken: "old-access-token", + refreshToken: "old-refresh-token", + createdAt: new Date().toISOString(), + } + + mockSessionStore = { + get: jest.fn(), + set: jest.fn(), + delete: jest.fn(), + createPendingSession: jest.fn(), + getPendingSession: jest.fn(), + completePendingSession: jest.fn(), + } as jest.Mocked + + mockTokenRefresher = { + refreshOAuthToken: jest.fn(), + } as jest.Mocked + }) + + it("executes graphql request successfully", async () => { + mockGraphql.mockResolvedValue({ data: { viewer: { login: "test-user" } } }) + + const client = new TokenRefreshingCLIGraphQLClient({ + session: testSession, + sessionStore: mockSessionStore, + tokenRefresher: mockTokenRefresher, + }) + + const result = await client.graphql({ query: "{ viewer { login } }" }) + + expect(result).toEqual({ data: { viewer: { login: "test-user" } } }) + expect(mockTokenRefresher.refreshOAuthToken).not.toHaveBeenCalled() + }) + + it("refreshes token and retries on 401 error", async () => { + const error401 = { status: 401, message: "Bad credentials" } + mockGraphql + .mockRejectedValueOnce(error401) + .mockResolvedValueOnce({ data: { viewer: { login: "test-user" } } }) + + mockTokenRefresher.refreshOAuthToken.mockResolvedValue({ + accessToken: "new-access-token", + refreshToken: "new-refresh-token", + }) + + const client = new TokenRefreshingCLIGraphQLClient({ + session: testSession, + sessionStore: mockSessionStore, + tokenRefresher: mockTokenRefresher, + }) + + const result = await client.graphql({ query: "{ viewer { login } }" }) + + expect(result).toEqual({ data: { viewer: { login: "test-user" } } }) + expect(mockTokenRefresher.refreshOAuthToken).toHaveBeenCalledWith({ + accessToken: "old-access-token", + refreshToken: "old-refresh-token", + }) + expect(mockSessionStore.set).toHaveBeenCalledWith( + expect.objectContaining({ + sessionId: "test-session-id", + accessToken: "new-access-token", + refreshToken: "new-refresh-token", + }) + ) + }) + + it("throws error if no refresh token available", async () => { + const sessionWithoutRefreshToken: CLISession = { + ...testSession, + refreshToken: undefined, + } + + const error401 = { status: 401, message: "Bad credentials" } + mockGraphql.mockRejectedValue(error401) + + const client = new TokenRefreshingCLIGraphQLClient({ + session: sessionWithoutRefreshToken, + sessionStore: mockSessionStore, + tokenRefresher: mockTokenRefresher, + }) + + await expect(client.graphql({ query: "{ viewer { login } }" })).rejects.toEqual(error401) + expect(mockTokenRefresher.refreshOAuthToken).not.toHaveBeenCalled() + }) + + it("throws non-401 errors without attempting refresh", async () => { + const error500 = { status: 500, message: "Internal server error" } + mockGraphql.mockRejectedValue(error500) + + const client = new TokenRefreshingCLIGraphQLClient({ + session: testSession, + sessionStore: mockSessionStore, + tokenRefresher: mockTokenRefresher, + }) + + await expect(client.graphql({ query: "{ viewer { login } }" })).rejects.toEqual(error500) + expect(mockTokenRefresher.refreshOAuthToken).not.toHaveBeenCalled() + }) +}) diff --git a/__test__/cli/api.test.ts b/__test__/cli/api.test.ts new file mode 100644 index 00000000..9faa5538 --- /dev/null +++ b/__test__/cli/api.test.ts @@ -0,0 +1,200 @@ +import { jest, describe, it, expect, beforeEach } from "@jest/globals" + +// Mock global fetch +const mockFetch = jest.fn() as jest.Mock +global.fetch = mockFetch + +describe("APIClient", () => { + let APIClient: new (baseUrl: string, sessionId?: string) => { + get(path: string, params?: Record): Promise + post(path: string, body?: unknown): Promise + getRaw(path: string): Promise + } + let APIError: new (message: string, status: number) => Error & { status: number } + + beforeEach(async () => { + jest.clearAllMocks() + const api = await import("@framna-docs/cli/dist/api.js") + APIClient = api.APIClient + APIError = api.APIError + }) + + describe("get", () => { + it("makes GET request to correct URL", async () => { + mockFetch.mockResolvedValue({ + ok: true, + json: () => Promise.resolve({ data: "test" }), + }) + + const client = new APIClient("https://api.example.com") + await client.get("/api/test") + + expect(mockFetch).toHaveBeenCalledWith( + "https://api.example.com/api/test", + expect.objectContaining({ method: "GET" }) + ) + }) + + it("includes query parameters", async () => { + mockFetch.mockResolvedValue({ + ok: true, + json: () => Promise.resolve({ data: "test" }), + }) + + const client = new APIClient("https://api.example.com") + await client.get("/api/test", { foo: "bar", baz: "qux" }) + + expect(mockFetch).toHaveBeenCalledWith( + "https://api.example.com/api/test?foo=bar&baz=qux", + expect.any(Object) + ) + }) + + it("includes Authorization header when sessionId provided", async () => { + mockFetch.mockResolvedValue({ + ok: true, + json: () => Promise.resolve({ data: "test" }), + }) + + const client = new APIClient("https://api.example.com", "my-session-id") + await client.get("/api/test") + + expect(mockFetch).toHaveBeenCalledWith( + expect.any(String), + expect.objectContaining({ + headers: expect.objectContaining({ + Authorization: "Bearer my-session-id", + }), + }) + ) + }) + + it("throws APIError on non-ok response", async () => { + mockFetch.mockResolvedValue({ + ok: false, + status: 404, + json: () => Promise.resolve({ error: "Not found" }), + }) + + const client = new APIClient("https://api.example.com") + + await expect(client.get("/api/test")).rejects.toThrow("Not found") + }) + + it("returns data on success", async () => { + mockFetch.mockResolvedValue({ + ok: true, + json: () => Promise.resolve({ data: "test-value" }), + }) + + const client = new APIClient("https://api.example.com") + const result = await client.get<{ data: string }>("/api/test") + + expect(result.data).toBe("test-value") + }) + }) + + describe("post", () => { + it("makes POST request with JSON body", async () => { + mockFetch.mockResolvedValue({ + ok: true, + json: () => Promise.resolve({ success: true }), + }) + + const client = new APIClient("https://api.example.com") + await client.post("/api/test", { foo: "bar" }) + + expect(mockFetch).toHaveBeenCalledWith( + "https://api.example.com/api/test", + expect.objectContaining({ + method: "POST", + body: JSON.stringify({ foo: "bar" }), + }) + ) + }) + + it("includes Content-Type header", async () => { + mockFetch.mockResolvedValue({ + ok: true, + json: () => Promise.resolve({ success: true }), + }) + + const client = new APIClient("https://api.example.com") + await client.post("/api/test", { foo: "bar" }) + + expect(mockFetch).toHaveBeenCalledWith( + expect.any(String), + expect.objectContaining({ + headers: expect.objectContaining({ + "Content-Type": "application/json", + }), + }) + ) + }) + + it("allows POST without body", async () => { + mockFetch.mockResolvedValue({ + ok: true, + json: () => Promise.resolve({ success: true }), + }) + + const client = new APIClient("https://api.example.com") + await client.post("/api/test") + + expect(mockFetch).toHaveBeenCalledWith( + expect.any(String), + expect.objectContaining({ + method: "POST", + body: undefined, + }) + ) + }) + + it("throws APIError on non-ok response", async () => { + mockFetch.mockResolvedValue({ + ok: false, + status: 400, + json: () => Promise.resolve({ error: "Bad request" }), + }) + + const client = new APIClient("https://api.example.com") + + await expect(client.post("/api/test")).rejects.toThrow("Bad request") + }) + }) + + describe("getRaw", () => { + it("returns raw text response", async () => { + mockFetch.mockResolvedValue({ + ok: true, + text: () => Promise.resolve("raw response content"), + }) + + const client = new APIClient("https://api.example.com") + const result = await client.getRaw("/api/test") + + expect(result).toBe("raw response content") + }) + + it("throws APIError on non-ok response", async () => { + mockFetch.mockResolvedValue({ + ok: false, + status: 500, + }) + + const client = new APIClient("https://api.example.com") + + await expect(client.getRaw("/api/test")).rejects.toThrow("Request failed") + }) + }) + + describe("APIError", () => { + it("has correct name and status", () => { + const error = new APIError("Test error", 404) + + expect(error.name).toBe("APIError") + expect(error.message).toBe("Test error") + expect(error.status).toBe(404) + }) + }) +}) diff --git a/__test__/cli/config.test.ts b/__test__/cli/config.test.ts new file mode 100644 index 00000000..b7215e96 --- /dev/null +++ b/__test__/cli/config.test.ts @@ -0,0 +1,157 @@ +import { jest, describe, it, expect, beforeEach, afterEach } from "@jest/globals" +import * as fs from "fs/promises" +import * as path from "path" +import * as os from "os" + +// Mock fs module +jest.unstable_mockModule("fs/promises", () => ({ + readFile: jest.fn(), + writeFile: jest.fn(), + mkdir: jest.fn(), + unlink: jest.fn(), +})) + +describe("CLI config", () => { + let getSession: () => Promise<{ sessionId: string; createdAt: string } | null> + let saveSession: (sessionId: string) => Promise + let deleteSession: () => Promise + let getServerUrl: () => string + let mockFs: { + readFile: jest.Mock + writeFile: jest.Mock + mkdir: jest.Mock + unlink: jest.Mock + } + + const expectedConfigDir = path.join(os.homedir(), ".framna-docs") + const expectedSessionPath = path.join(expectedConfigDir, "session.json") + + beforeEach(async () => { + jest.clearAllMocks() + mockFs = (await import("fs/promises")) as typeof mockFs + const config = await import("@framna-docs/cli/dist/config.js") + getSession = config.getSession + saveSession = config.saveSession + deleteSession = config.deleteSession + getServerUrl = config.getServerUrl + }) + + describe("getSession", () => { + it("returns null when session file does not exist", async () => { + mockFs.readFile.mockRejectedValue(new Error("ENOENT")) + + const session = await getSession() + + expect(session).toBeNull() + }) + + it("returns null when session file contains invalid JSON", async () => { + mockFs.readFile.mockResolvedValue("not json") + + const session = await getSession() + + expect(session).toBeNull() + }) + + it("returns null when session file contains invalid schema", async () => { + mockFs.readFile.mockResolvedValue(JSON.stringify({ invalid: "data" })) + + const session = await getSession() + + expect(session).toBeNull() + }) + + it("returns session when valid", async () => { + const validSession = { + sessionId: "550e8400-e29b-41d4-a716-446655440000", + createdAt: "2026-01-16T10:00:00.000Z", + } + mockFs.readFile.mockResolvedValue(JSON.stringify(validSession)) + + const session = await getSession() + + expect(session).toEqual(validSession) + expect(mockFs.readFile).toHaveBeenCalledWith(expectedSessionPath, "utf-8") + }) + }) + + describe("saveSession", () => { + it("creates config directory with 0700 permissions", async () => { + mockFs.mkdir.mockResolvedValue(undefined) + mockFs.writeFile.mockResolvedValue(undefined) + + await saveSession("550e8400-e29b-41d4-a716-446655440000") + + expect(mockFs.mkdir).toHaveBeenCalledWith(expectedConfigDir, { + recursive: true, + mode: 0o700, + }) + }) + + it("writes session file with 0600 permissions", async () => { + mockFs.mkdir.mockResolvedValue(undefined) + mockFs.writeFile.mockResolvedValue(undefined) + + await saveSession("550e8400-e29b-41d4-a716-446655440000") + + expect(mockFs.writeFile).toHaveBeenCalledWith( + expectedSessionPath, + expect.stringContaining("550e8400-e29b-41d4-a716-446655440000"), + { mode: 0o600 } + ) + }) + + it("includes createdAt timestamp", async () => { + mockFs.mkdir.mockResolvedValue(undefined) + mockFs.writeFile.mockResolvedValue(undefined) + + await saveSession("550e8400-e29b-41d4-a716-446655440000") + + const writtenContent = mockFs.writeFile.mock.calls[0][1] as string + const parsed = JSON.parse(writtenContent) + expect(parsed.createdAt).toBeDefined() + expect(new Date(parsed.createdAt).getTime()).not.toBeNaN() + }) + }) + + describe("deleteSession", () => { + it("deletes session file", async () => { + mockFs.unlink.mockResolvedValue(undefined) + + await deleteSession() + + expect(mockFs.unlink).toHaveBeenCalledWith(expectedSessionPath) + }) + + it("does not throw when file does not exist", async () => { + mockFs.unlink.mockRejectedValue(new Error("ENOENT")) + + await expect(deleteSession()).resolves.not.toThrow() + }) + }) + + describe("getServerUrl", () => { + const originalEnv = process.env.FRAMNA_DOCS_URL + + afterEach(() => { + if (originalEnv === undefined) { + delete process.env.FRAMNA_DOCS_URL + } else { + process.env.FRAMNA_DOCS_URL = originalEnv + } + }) + + it("returns localhost when FRAMNA_DOCS_URL is not set", () => { + delete process.env.FRAMNA_DOCS_URL + + expect(getServerUrl()).toBe("http://localhost:3000") + }) + + it("returns FRAMNA_DOCS_URL when set", () => { + process.env.FRAMNA_DOCS_URL = "https://docs.example.com" + + // Need to re-import to pick up env change + expect(getServerUrl()).toBe("https://docs.example.com") + }) + }) +}) diff --git a/__test__/cli/shared.test.ts b/__test__/cli/shared.test.ts new file mode 100644 index 00000000..3a31f1f1 --- /dev/null +++ b/__test__/cli/shared.test.ts @@ -0,0 +1,110 @@ +import { jest, describe, it, expect, beforeEach } from "@jest/globals" + +// Mock config module to avoid file system access +jest.unstable_mockModule("@framna-docs/cli/dist/config.js", () => ({ + getSession: jest.fn(), + getServerUrl: jest.fn().mockReturnValue("http://localhost:3000"), +})) + +// Mock API client +jest.unstable_mockModule("@framna-docs/cli/dist/api.js", () => ({ + APIClient: jest.fn().mockImplementation(() => ({})), +})) + +// Mock OpenAPI service +jest.unstable_mockModule("@framna-docs/cli/dist/openapi/index.js", () => ({ + OpenAPIService: jest.fn().mockImplementation(() => ({})), +})) + +describe("CLI shared utilities", () => { + let resolveProject: (id: string) => { owner: string; name: string } + let formatTable: (headers: string[], rows: string[][]) => string + + beforeEach(async () => { + jest.clearAllMocks() + const shared = await import("@framna-docs/cli/dist/commands/shared.js") + resolveProject = shared.resolveProject + formatTable = shared.formatTable + }) + + describe("resolveProject", () => { + it("parses owner/name format correctly", () => { + const result = resolveProject("shapehq/plus") + + expect(result).toEqual({ + owner: "shapehq", + name: "plus", + }) + }) + + it("handles names with hyphens", () => { + const result = resolveProject("my-org/my-project-name") + + expect(result).toEqual({ + owner: "my-org", + name: "my-project-name", + }) + }) + + it("handles names with underscores", () => { + const result = resolveProject("my_org/my_project") + + expect(result).toEqual({ + owner: "my_org", + name: "my_project", + }) + }) + + it("throws error for invalid format without slash", () => { + expect(() => resolveProject("invalid")).toThrow( + "Invalid project format: invalid. Use owner/name format." + ) + }) + + it("throws error for empty string", () => { + expect(() => resolveProject("")).toThrow( + "Invalid project format: . Use owner/name format." + ) + }) + }) + + describe("formatTable", () => { + it("creates table with headers and rows", () => { + const result = formatTable( + ["NAME", "VALUE"], + [ + ["foo", "bar"], + ["baz", "qux"], + ] + ) + + expect(result).toContain("NAME") + expect(result).toContain("VALUE") + expect(result).toContain("foo") + expect(result).toContain("bar") + expect(result).toContain("baz") + expect(result).toContain("qux") + }) + + it("handles empty rows", () => { + const result = formatTable(["HEADER"], []) + + expect(result).toContain("HEADER") + }) + + it("handles single column", () => { + const result = formatTable(["ITEMS"], [["item1"], ["item2"]]) + + expect(result).toContain("ITEMS") + expect(result).toContain("item1") + expect(result).toContain("item2") + }) + + it("uses box-drawing characters", () => { + const result = formatTable(["A", "B"], [["1", "2"]]) + + // Should contain box-drawing characters + expect(result).toMatch(/[┌┐└┘│─┬┴├┤┼]/) + }) + }) +}) diff --git a/eslint.config.mjs b/eslint.config.mjs index c0753708..9bebc1cd 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,11 +3,13 @@ import nextCoreWebVitals from "eslint-config-next/core-web-vitals" import tseslint from "typescript-eslint" const config = [ + { + ignores: ["next-env.d.ts", ".next/**", "packages/*/dist/**", "packages/*/node_modules/**"], + }, ...nextCoreWebVitals, js.configs.recommended, ...tseslint.configs.recommended, { - ignores: ["next-env.d.ts", ".next"], rules: { "array-callback-return": ["error"], "no-await-in-loop": ["error"], diff --git a/package-lock.json b/package-lock.json index 5db706a0..355dd888 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,11 @@ "": { "name": "framna-docs", "version": "1.0.0", + "workspaces": [ + "packages/*" + ], "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.14.1", "@fontsource/poppins": "^5.2.7", @@ -16,9 +20,11 @@ "@fortawesome/free-regular-svg-icons": "^7.1.0", "@fortawesome/free-solid-svg-icons": "^7.1.0", "@fortawesome/react-fontawesome": "^3.1.1", + "@modelcontextprotocol/sdk": "^1.25.2", "@mui/icons-material": "^7.3.6", "@mui/material": "^7.0.1", "@octokit/auth-app": "^8.1.2", + "@octokit/auth-oauth-device": "^7.1.1", "@octokit/core": "^7.0.6", "@octokit/webhooks": "~14.2.0", "core-js": "^3.47.0", @@ -81,6 +87,108 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@apidevtools/json-schema-ref-parser": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz", + "integrity": "sha512-M3YgsLjI0lZxvrpeGVk9Ap032W6TPQkH6pRAZz81Ac3WUNF79VQooAFnp8umjvVzUmD93NkogxEwbSce7qMsUg==", + "license": "MIT", + "dependencies": { + "@jsdevtools/ono": "^7.1.3", + "call-me-maybe": "^1.0.1", + "js-yaml": "^3.13.1" + } + }, + "node_modules/@apidevtools/json-schema-ref-parser/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@apidevtools/openapi-schemas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", + "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/@apidevtools/swagger-methods": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==", + "license": "MIT" + }, + "node_modules/@apidevtools/swagger-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.1.0.tgz", + "integrity": "sha512-9Kt7EuS/7WbMAUv2gSziqjvxwDbFSg3Xeyfuj5laUODX8o/k/CpsAKiQ8W7/R88eXFTMbJYg6+7uAmOWNKmwnw==", + "license": "MIT", + "dependencies": { + "@apidevtools/json-schema-ref-parser": "9.0.6", + "@apidevtools/openapi-schemas": "^2.1.0", + "@apidevtools/swagger-methods": "^3.0.2", + "@jsdevtools/ono": "^7.1.3", + "ajv": "^8.6.3", + "ajv-draft-04": "^1.0.0", + "call-me-maybe": "^1.0.1" + }, + "peerDependencies": { + "openapi-types": ">=7" + } + }, + "node_modules/@apidevtools/swagger-parser/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/@apidevtools/swagger-parser/node_modules/ajv-draft-04": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "license": "MIT", + "peerDependencies": { + "ajv": "^8.5.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/@apidevtools/swagger-parser/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/@auth/core": { "version": "0.41.1", "resolved": "https://registry.npmjs.org/@auth/core/-/core-0.41.1.tgz", @@ -154,7 +262,6 @@ "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -286,6 +393,7 @@ "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -353,6 +461,7 @@ "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -366,6 +475,7 @@ "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -379,6 +489,7 @@ "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" }, @@ -392,6 +503,7 @@ "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -408,6 +520,7 @@ "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -424,6 +537,7 @@ "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -437,6 +551,7 @@ "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -450,6 +565,7 @@ "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -466,6 +582,7 @@ "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -479,6 +596,7 @@ "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -492,6 +610,7 @@ "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -505,6 +624,7 @@ "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -518,6 +638,7 @@ "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -531,6 +652,7 @@ "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -544,6 +666,7 @@ "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -560,6 +683,7 @@ "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -576,6 +700,7 @@ "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -645,7 +770,18 @@ "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } }, "node_modules/@emnapi/core": { "version": "1.7.1", @@ -738,7 +874,6 @@ "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.14.0.tgz", "integrity": "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", @@ -782,7 +917,6 @@ "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.1.tgz", "integrity": "sha512-qEEJt42DuToa3gurlH4Qqc1kVpNq8wO8cJtDzU46TjlzWjDlsVyevtYCRijVq3SrHsROS+gVQ8Fnea108GnKzw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", @@ -1046,7 +1180,6 @@ "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-7.1.0.tgz", "integrity": "sha512-fNxRUk1KhjSbnbuBxlWSnBLKLBNun52ZBTcs22H/xEEzM6Ap81ZFTQ4bZBxVQGQgVY0xugKGoRcCbaKjLQ3XZA==", "license": "MIT", - "peer": true, "dependencies": { "@fortawesome/fontawesome-common-types": "7.1.0" }, @@ -1103,6 +1236,22 @@ "react": "^18.0.0 || ^19.0.0" } }, + "node_modules/@framna-docs/cli": { + "resolved": "packages/cli", + "link": true + }, + "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/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -1632,6 +1781,7 @@ "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -1650,6 +1800,7 @@ "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", @@ -1667,6 +1818,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -1677,6 +1829,7 @@ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -1691,6 +1844,7 @@ "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -1705,6 +1859,7 @@ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -1718,6 +1873,7 @@ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-try": "^2.0.0" }, @@ -1734,6 +1890,7 @@ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -1747,6 +1904,7 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -1757,6 +1915,7 @@ "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -1767,6 +1926,7 @@ "integrity": "sha512-+O1ifRjkvYIkBqASKWgLxrpEhQAAE7hY77ALLUufSk5717KfOShg6IbqLmdsLMPdUiFvA2kTs0R7YZy+l0IzZQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/types": "30.2.0", "@types/node": "*", @@ -1785,6 +1945,7 @@ "integrity": "sha512-03W6IhuhjqTlpzh/ojut/pDB2LPRygyWX8ExpgHtQA8H/3K7+1vKmcINx5UzeOX1se6YEsBsOHQ1CRzf3fOwTQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/console": "30.2.0", "@jest/pattern": "30.0.1", @@ -1843,6 +2004,7 @@ "integrity": "sha512-/QPTL7OBJQ5ac09UDRa3EQes4gt1FTEG/8jZ/4v5IVzx+Cv7dLxlVIvfvSVRiiX2drWyXeBjkMSR8hvOWSog5g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/fake-timers": "30.2.0", "@jest/types": "30.2.0", @@ -1859,6 +2021,7 @@ "integrity": "sha512-V9yxQK5erfzx99Sf+7LbhBwNWEZ9eZay8qQ9+JSC0TrMR1pMDHLMY+BnVPacWU6Jamrh252/IKo4F1Xn/zfiqA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "expect": "30.2.0", "jest-snapshot": "30.2.0" @@ -1886,6 +2049,7 @@ "integrity": "sha512-HI3tRLjRxAbBy0VO8dqqm7Hb2mIa8d5bg/NJkyQcOk7V118ObQML8RC5luTF/Zsg4474a+gDvhce7eTnP4GhYw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/types": "30.2.0", "@sinonjs/fake-timers": "^13.0.0", @@ -1914,6 +2078,7 @@ "integrity": "sha512-b63wmnKPaK+6ZZfpYhz9K61oybvbI1aMcIs80++JI1O1rR1vaxHUCNqo3ITu6NU0d4V34yZFoHMn/uoKr/Rwfw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/environment": "30.2.0", "@jest/expect": "30.2.0", @@ -1944,6 +2109,7 @@ "integrity": "sha512-DRyW6baWPqKMa9CzeiBjHwjd8XeAyco2Vt8XbcLFjiwCOEKOvy82GJ8QQnJE9ofsxCMPjH4MfH8fCWIHHDKpAQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "30.2.0", @@ -2000,6 +2166,7 @@ "integrity": "sha512-0aVxM3RH6DaiLcjj/b0KrIBZhSX1373Xci4l3cW5xiUWPctZ59zQ7jj4rqcJQ/Z8JuN/4wX3FpJSa3RssVvCug==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/types": "30.2.0", "chalk": "^4.1.2", @@ -2016,6 +2183,7 @@ "integrity": "sha512-MIRWMUUR3sdbP36oyNyhbThLHyJ2eEDClPCiHVbrYAe5g3CHRArIVpBw7cdSB5fr+ofSfIb2Tnsw8iEHL0PYQg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "callsites": "^3.1.0", @@ -2031,6 +2199,7 @@ "integrity": "sha512-RF+Z+0CCHkARz5HT9mcQCBulb1wgCP3FBvl9VFokMX27acKphwyQsNuWH3c+ojd1LeWBLoTYoxF0zm6S/66mjg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/console": "30.2.0", "@jest/types": "30.2.0", @@ -2047,6 +2216,7 @@ "integrity": "sha512-wXKgU/lk8fKXMu/l5Hog1R61bL4q5GCdT6OJvdAFz1P+QrpoFuLU68eoKuVc4RbrTtNnTL5FByhWdLgOPSph+Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/test-result": "30.2.0", "graceful-fs": "^4.2.11", @@ -2063,6 +2233,7 @@ "integrity": "sha512-XsauDV82o5qXbhalKxD7p4TZYYdwcaEXC77PPD2HixEFF+6YGppjrAAQurTl2ECWcEomHBMMNS9AH3kcCFx8jA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.27.4", "@jest/types": "30.2.0", @@ -2089,7 +2260,8 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@jest/types": { "version": "30.2.0", @@ -2156,6 +2328,73 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", + "license": "MIT" + }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.25.2", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.25.2.tgz", + "integrity": "sha512-LZFeo4F9M5qOhC/Uc1aQSrBHxMrvxett+9KLHt7OhcExtoiRN9DKgbZffMP/nxjutWDQpfMDfP3nkHI4X9ijww==", + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.7", + "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.0.1", + "express-rate-limit": "^7.5.0", + "jose": "^6.1.1", + "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.0" + }, + "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/@modelcontextprotocol/sdk/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/@modelcontextprotocol/sdk/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/@mui/core-downloads-tracker": { "version": "7.3.6", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-7.3.6.tgz", @@ -2197,7 +2436,6 @@ "resolved": "https://registry.npmjs.org/@mui/material/-/material-7.3.6.tgz", "integrity": "sha512-R4DaYF3dgCQCUAkr4wW1w26GHXcf5rCmBRHVBuuvJvaGLmZdD8EjatP80Nz5JCw0KxORAzwftnHzXVnjR8HnFw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.28.4", "@mui/core-downloads-tracker": "^7.3.6", @@ -2648,7 +2886,7 @@ "node": ">= 20" } }, - "node_modules/@octokit/auth-oauth-device": { + "node_modules/@octokit/auth-oauth-app/node_modules/@octokit/auth-oauth-device": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/@octokit/auth-oauth-device/-/auth-oauth-device-8.0.3.tgz", "integrity": "sha512-zh2W0mKKMh/VWZhSqlaCzY7qFyrgd9oTWmTmHaXnHNeQRCZr/CXy2jCgHo4e4dJVTiuxP5dLa0YM5p5QVhJHbw==", @@ -2663,107 +2901,292 @@ "node": ">= 20" } }, - "node_modules/@octokit/auth-oauth-user": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@octokit/auth-oauth-user/-/auth-oauth-user-6.0.2.tgz", - "integrity": "sha512-qLoPPc6E6GJoz3XeDG/pnDhJpTkODTGG4kY0/Py154i/I003O9NazkrwJwRuzgCalhzyIeWQ+6MDvkUmKXjg/A==", + "node_modules/@octokit/auth-oauth-device": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-oauth-device/-/auth-oauth-device-7.1.1.tgz", + "integrity": "sha512-HWl8lYueHonuyjrKKIup/1tiy0xcmQCdq5ikvMO1YwkNNkxb6DXfrPjrMYItNLyCP/o2H87WuijuE+SlBTT8eg==", "license": "MIT", "dependencies": { - "@octokit/auth-oauth-device": "^8.0.3", - "@octokit/oauth-methods": "^6.0.2", - "@octokit/request": "^10.0.6", - "@octokit/types": "^16.0.0", + "@octokit/oauth-methods": "^5.0.0", + "@octokit/request": "^9.0.0", + "@octokit/types": "^13.0.0", "universal-user-agent": "^7.0.0" }, "engines": { - "node": ">= 20" + "node": ">= 18" } }, - "node_modules/@octokit/auth-token": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-6.0.0.tgz", - "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==", + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/endpoint": { + "version": "10.1.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.4.tgz", + "integrity": "sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==", "license": "MIT", + "dependencies": { + "@octokit/types": "^14.0.0", + "universal-user-agent": "^7.0.2" + }, "engines": { - "node": ">= 20" + "node": ">= 18" } }, - "node_modules/@octokit/auth-unauthenticated": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@octokit/auth-unauthenticated/-/auth-unauthenticated-7.0.3.tgz", - "integrity": "sha512-8Jb1mtUdmBHL7lGmop9mU9ArMRUTRhg8vp0T1VtZ4yd9vEm3zcLwmjQkhNEduKawOOORie61xhtYIhTDN+ZQ3g==", + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": { + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", + "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", + "license": "MIT" + }, + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/endpoint/node_modules/@octokit/types": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", + "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", "license": "MIT", "dependencies": { - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0" - }, + "@octokit/openapi-types": "^25.1.0" + } + }, + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/oauth-authorization-url": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@octokit/oauth-authorization-url/-/oauth-authorization-url-7.1.1.tgz", + "integrity": "sha512-ooXV8GBSabSWyhLUowlMIVd9l1s2nsOGQdlP2SQ4LnkEsGXzeCvbSbCPdZThXhEFzleGPwbapT0Sb+YhXRyjCA==", + "license": "MIT", "engines": { - "node": ">= 20" + "node": ">= 18" } }, - "node_modules/@octokit/core": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", - "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/oauth-methods": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@octokit/oauth-methods/-/oauth-methods-5.1.5.tgz", + "integrity": "sha512-Ev7K8bkYrYLhoOSZGVAGsLEscZQyq7XQONCBBAl2JdMg7IT3PQn/y8P0KjloPoYpI5UylqYrLeUcScaYWXwDvw==", "license": "MIT", - "peer": true, "dependencies": { - "@octokit/auth-token": "^6.0.0", - "@octokit/graphql": "^9.0.3", - "@octokit/request": "^10.0.6", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "before-after-hook": "^4.0.0", - "universal-user-agent": "^7.0.0" + "@octokit/oauth-authorization-url": "^7.0.0", + "@octokit/request": "^9.2.3", + "@octokit/request-error": "^6.1.8", + "@octokit/types": "^14.0.0" }, "engines": { - "node": ">= 20" + "node": ">= 18" } }, - "node_modules/@octokit/endpoint": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.2.tgz", - "integrity": "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ==", + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/oauth-methods/node_modules/@octokit/openapi-types": { + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", + "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", + "license": "MIT" + }, + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/oauth-methods/node_modules/@octokit/types": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", + "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", "license": "MIT", "dependencies": { - "@octokit/types": "^16.0.0", + "@octokit/openapi-types": "^25.1.0" + } + }, + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "license": "MIT" + }, + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/request": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.2.4.tgz", + "integrity": "sha512-q8ybdytBmxa6KogWlNa818r0k1wlqzNC+yNkcQDECHvQo8Vmstrg18JwqJHdJdUiHD2sjlwBgSm9kHkOKe2iyA==", + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^10.1.4", + "@octokit/request-error": "^6.1.8", + "@octokit/types": "^14.0.0", + "fast-content-type-parse": "^2.0.0", "universal-user-agent": "^7.0.2" }, "engines": { - "node": ">= 20" + "node": ">= 18" } }, - "node_modules/@octokit/graphql": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", - "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/request-error": { + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.8.tgz", + "integrity": "sha512-WEi/R0Jmq+IJKydWlKDmryPcmdYSVjL3ekaiEL1L9eo1sUnqMJ+grqmC9cjk7CA7+b2/T397tO5d8YLOH3qYpQ==", "license": "MIT", "dependencies": { - "@octokit/request": "^10.0.6", - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.0" + "@octokit/types": "^14.0.0" }, "engines": { - "node": ">= 20" + "node": ">= 18" } }, - "node_modules/@octokit/oauth-app": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@octokit/oauth-app/-/oauth-app-8.0.3.tgz", - "integrity": "sha512-jnAjvTsPepyUaMu9e69hYBuozEPgYqP4Z3UnpmvoIzHDpf8EXDGvTY1l1jK0RsZ194oRd+k6Hm13oRU8EoDFwg==", + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": { + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", + "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", + "license": "MIT" + }, + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/request-error/node_modules/@octokit/types": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", + "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", "license": "MIT", "dependencies": { - "@octokit/auth-oauth-app": "^9.0.2", - "@octokit/auth-oauth-user": "^6.0.1", - "@octokit/auth-unauthenticated": "^7.0.2", - "@octokit/core": "^7.0.5", - "@octokit/oauth-authorization-url": "^8.0.0", - "@octokit/oauth-methods": "^6.0.1", - "@types/aws-lambda": "^8.10.83", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" + "@octokit/openapi-types": "^25.1.0" + } + }, + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/request/node_modules/@octokit/openapi-types": { + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", + "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", + "license": "MIT" + }, + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/request/node_modules/@octokit/types": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", + "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^25.1.0" + } + }, + "node_modules/@octokit/auth-oauth-device/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/auth-oauth-device/node_modules/fast-content-type-parse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.1.tgz", + "integrity": "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@octokit/auth-oauth-user": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@octokit/auth-oauth-user/-/auth-oauth-user-6.0.2.tgz", + "integrity": "sha512-qLoPPc6E6GJoz3XeDG/pnDhJpTkODTGG4kY0/Py154i/I003O9NazkrwJwRuzgCalhzyIeWQ+6MDvkUmKXjg/A==", + "license": "MIT", + "dependencies": { + "@octokit/auth-oauth-device": "^8.0.3", + "@octokit/oauth-methods": "^6.0.2", + "@octokit/request": "^10.0.6", + "@octokit/types": "^16.0.0", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/auth-oauth-user/node_modules/@octokit/auth-oauth-device": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@octokit/auth-oauth-device/-/auth-oauth-device-8.0.3.tgz", + "integrity": "sha512-zh2W0mKKMh/VWZhSqlaCzY7qFyrgd9oTWmTmHaXnHNeQRCZr/CXy2jCgHo4e4dJVTiuxP5dLa0YM5p5QVhJHbw==", + "license": "MIT", + "dependencies": { + "@octokit/oauth-methods": "^6.0.2", + "@octokit/request": "^10.0.6", + "@octokit/types": "^16.0.0", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/auth-token": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-6.0.0.tgz", + "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==", + "license": "MIT", + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/auth-unauthenticated": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@octokit/auth-unauthenticated/-/auth-unauthenticated-7.0.3.tgz", + "integrity": "sha512-8Jb1mtUdmBHL7lGmop9mU9ArMRUTRhg8vp0T1VtZ4yd9vEm3zcLwmjQkhNEduKawOOORie61xhtYIhTDN+ZQ3g==", + "license": "MIT", + "dependencies": { + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/core": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", + "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^6.0.0", + "@octokit/graphql": "^9.0.3", + "@octokit/request": "^10.0.6", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "before-after-hook": "^4.0.0", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/endpoint": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.2.tgz", + "integrity": "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^16.0.0", + "universal-user-agent": "^7.0.2" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/graphql": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", + "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", + "license": "MIT", + "dependencies": { + "@octokit/request": "^10.0.6", + "@octokit/types": "^16.0.0", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/oauth-app": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@octokit/oauth-app/-/oauth-app-8.0.3.tgz", + "integrity": "sha512-jnAjvTsPepyUaMu9e69hYBuozEPgYqP4Z3UnpmvoIzHDpf8EXDGvTY1l1jK0RsZ194oRd+k6Hm13oRU8EoDFwg==", + "license": "MIT", + "dependencies": { + "@octokit/auth-oauth-app": "^9.0.2", + "@octokit/auth-oauth-user": "^6.0.1", + "@octokit/auth-unauthenticated": "^7.0.2", + "@octokit/core": "^7.0.5", + "@octokit/oauth-authorization-url": "^8.0.0", + "@octokit/oauth-methods": "^6.0.1", + "@types/aws-lambda": "^8.10.83", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 20" } }, "node_modules/@octokit/oauth-authorization-url": { @@ -2953,6 +3376,7 @@ "dev": true, "license": "MIT", "optional": true, + "peer": true, "engines": { "node": ">=14" } @@ -2963,6 +3387,7 @@ "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -3061,6 +3486,7 @@ "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "type-detect": "4.0.8" } @@ -3071,6 +3497,7 @@ "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "@sinonjs/commons": "^3.0.1" } @@ -3438,6 +3865,7 @@ "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -3452,6 +3880,7 @@ "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/types": "^7.0.0" } @@ -3462,6 +3891,7 @@ "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" @@ -3473,6 +3903,7 @@ "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/types": "^7.28.2" } @@ -3581,7 +4012,6 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.7.tgz", "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -3677,7 +4107,6 @@ "integrity": "sha512-3xP4XzzDNQOIqBMWogftkwxhg5oMKApqY0BAflmLZiFYHqyhSOxv/cd/zPQLTcCXr4AkaKb25joocY0BD1WC6A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.51.0", "@typescript-eslint/types": "8.51.0", @@ -3881,7 +4310,8 @@ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/@unrs/resolver-binding-android-arm-eabi": { "version": "1.11.1", @@ -4152,13 +4582,25 @@ "win32" ] }, + "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/acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -4202,12 +4644,52 @@ "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/ajv-formats/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/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/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "type-fest": "^0.21.3" }, @@ -4222,7 +4704,6 @@ "version": "6.2.2", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -4252,6 +4733,7 @@ "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -4495,6 +4977,7 @@ "integrity": "sha512-0YiBEOxWqKkSQWL9nNGGEgndoeL0ZpWrbLMNL5u/Kaxrli3Eaxlt3ZtIDktEvXt4L/R9r3ODr2zKwGM/2BjxVw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/transform": "30.2.0", "@types/babel__core": "^7.20.5", @@ -4517,6 +5000,7 @@ "integrity": "sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "workspaces": [ "test/babel-8" ], @@ -4537,6 +5021,7 @@ "integrity": "sha512-ftzhzSGMUnOzcCXd6WHdBGMyuwy15Wnn0iyyWGKgBDLxf9/s5ABuraCSpBX2uG0jUg4rqJnxsLc5+oYBqoxVaA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/babel__core": "^7.20.5" }, @@ -4565,6 +5050,7 @@ "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", @@ -4592,6 +5078,7 @@ "integrity": "sha512-US4Z3NOieAQumwFnYdUWKvUKh8+YSnS/gB3t6YBiz0bskpu7Pine8pPCheNxlPEW4wnUkma2a94YuW2q3guvCQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "babel-plugin-jest-hoist": "30.2.0", "babel-preset-current-node-syntax": "^1.2.0" @@ -4624,6 +5111,46 @@ "integrity": "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==", "license": "Apache-2.0" }, + "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/body-parser/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/bottleneck": { "version": "2.19.5", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", @@ -4672,7 +5199,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -4706,6 +5232,7 @@ "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "node-int64": "^0.4.0" } @@ -4715,7 +5242,32 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true + }, + "node_modules/bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "license": "MIT", + "dependencies": { + "run-applescript": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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": { "version": "1.0.8", @@ -4740,7 +5292,6 @@ "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==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -4754,7 +5305,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -4788,6 +5338,7 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -4838,45 +5389,130 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "dev": true, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.1.1.tgz", + "integrity": "sha512-+CmxIZ/L2vNcEfvNtLdU0ZQ6mbq3FZnwAP2PPTiKP+1QOoKwlKlPgb8UKV0Dds7QVaMnHm+FwSft2VB0s/SLjQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "license": "MIT" + }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/cli-table3/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-table3/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/cli-table3/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/ci-info": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", - "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], + "node_modules/cli-table3/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, "engines": { "node": ">=8" } }, - "node_modules/cjs-module-lexer": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.1.1.tgz", - "integrity": "sha512-+CmxIZ/L2vNcEfvNtLdU0ZQ6mbq3FZnwAP2PPTiKP+1QOoKwlKlPgb8UKV0Dds7QVaMnHm+FwSft2VB0s/SLjQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/classnames": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", - "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", - "license": "MIT" - }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -4979,6 +5615,7 @@ "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -4989,7 +5626,8 @@ "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/color-convert": { "version": "2.0.1", @@ -5015,6 +5653,15 @@ "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", "license": "MIT" }, + "node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -5022,24 +5669,76 @@ "dev": true, "license": "MIT" }, + "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/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "license": "MIT" }, + "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/core-js": { "version": "3.47.0", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.47.0.tgz", "integrity": "sha512-c3Q2VVkGAUyupsjRnaNX6u8Dq2vAdzm9iuPj5FW0fRxzlxgq9Q39MDq10IvmQSpLgHQNyQzQmOo6bgGHmH3NNg==", "hasInstallScript": true, "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" } }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -5069,7 +5768,6 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -5195,6 +5893,7 @@ "integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==", "dev": true, "license": "MIT", + "peer": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -5217,10 +5916,39 @@ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } }, + "node_modules/default-browser": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.4.0.tgz", + "integrity": "sha512-XDuvSq38Hr1MdN47EDvYtx3U0MTqpCEn+F6ft8z2vYDzMrvQhVp0ui9oQdqW3MvK3vqUETglt1tVGgjLuJ5izg==", + "license": "MIT", + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz", + "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -5239,6 +5967,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/define-properties": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", @@ -5266,6 +6006,15 @@ "node": ">=0.10" } }, + "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/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -5290,6 +6039,7 @@ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -5330,7 +6080,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -5346,6 +6095,13 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true, + "license": "MIT", + "peer": true + }, + "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/electron-to-chromium": { @@ -5361,6 +6117,7 @@ "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -5375,12 +6132,20 @@ "dev": true, "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/encoding": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", "license": "MIT", - "peer": true, "dependencies": { "iconv-lite": "^0.6.2" } @@ -5481,7 +6246,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -5491,7 +6255,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -5529,7 +6292,6 @@ "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==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -5600,6 +6362,12 @@ "node": ">=6" } }, + "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/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -5618,7 +6386,6 @@ "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -5804,7 +6571,6 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -6148,7 +6914,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", @@ -6204,18 +6969,49 @@ "node": ">=0.10.0" } }, + "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/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", "license": "MIT" }, + "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/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -6239,7 +7035,8 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/exit-x": { "version": "0.2.2", @@ -6247,6 +7044,7 @@ "integrity": "sha512-+I6B/IkJc1o/2tiURyz/ivu/O0nKNEArIUB5O7zBrlDVJr22SCLH3xTeEry428LvFhRzIA1g8izguxJ/gbNcVQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8.0" } @@ -6269,6 +7067,64 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.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": "7.5.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.1.tgz", + "integrity": "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, "node_modules/fast-content-type-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz", @@ -6391,6 +7247,7 @@ "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "bser": "2.1.1" } @@ -6427,6 +7284,27 @@ "node": ">=8" } }, + "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/find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", @@ -6499,6 +7377,7 @@ "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" @@ -6510,12 +7389,31 @@ "url": "https://github.com/sponsors/isaacs" } }, + "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/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/fsevents": { "version": "2.3.3", @@ -6528,6 +7426,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -6601,11 +7500,22 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "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==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -6632,6 +7542,7 @@ "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8.0.0" } @@ -6640,7 +7551,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", @@ -6656,6 +7566,7 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -6700,6 +7611,7 @@ "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -6762,7 +7674,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -6866,7 +7777,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -6935,12 +7845,43 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "node_modules/hono": { + "version": "4.11.4", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.4.tgz", + "integrity": "sha512-U7tt8JsyrxSRKspfhtLET79pU8K+tInj5QZXs1jSugO1Vq5dFj3kmZsRldo29mTBfcjDRVRXrEZ6LS63Cog9ZA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=16.9.0" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true + }, + "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/http2-client": { "version": "1.3.5", @@ -6967,6 +7908,7 @@ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=10.17.0" } @@ -7015,6 +7957,7 @@ "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" @@ -7046,6 +7989,7 @@ "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -7055,7 +7999,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, "license": "ISC" }, "node_modules/install": { @@ -7087,7 +8030,6 @@ "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.8.2.tgz", "integrity": "sha512-C6uC+kleiIMmjViJINWk80sOQw5lEzse1ZmvD+S/s8p8CWapftSaC+kocGTx6xrbrJ4WmYQGC08ffHLr6ToR6Q==", "license": "MIT", - "peer": true, "dependencies": { "@ioredis/commands": "1.4.0", "cluster-key-slot": "^1.1.0", @@ -7107,6 +8049,15 @@ "url": "https://opencollective.com/ioredis" } }, + "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-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -7257,6 +8208,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -7298,6 +8264,7 @@ "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -7335,6 +8302,36 @@ "node": ">=0.10.0" } }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-map": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", @@ -7388,6 +8385,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "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/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -7442,6 +8445,7 @@ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" }, @@ -7500,6 +8504,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-unicode-supported": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-weakmap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", @@ -7546,6 +8562,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -7557,7 +8588,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, "license": "ISC" }, "node_modules/istanbul-lib-coverage": { @@ -7566,6 +8596,7 @@ "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "engines": { "node": ">=8" } @@ -7576,6 +8607,7 @@ "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "@babel/core": "^7.23.9", "@babel/parser": "^7.23.9", @@ -7593,6 +8625,7 @@ "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -7608,6 +8641,7 @@ "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.23", "debug": "^4.1.1", @@ -7623,6 +8657,7 @@ "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -7655,6 +8690,7 @@ "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, "license": "BlueOak-1.0.0", + "peer": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -7699,6 +8735,7 @@ "integrity": "sha512-L8lR1ChrRnSdfeOvTrwZMlnWV8G/LLjQ0nG9MBclwWZidA2N5FviRki0Bvh20WRMOX31/JYvzdqTJrk5oBdydQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "execa": "^5.1.1", "jest-util": "30.2.0", @@ -7714,6 +8751,7 @@ "integrity": "sha512-Fh0096NC3ZkFx05EP2OXCxJAREVxj1BcW/i6EWqqymcgYKWjyyDpral3fMxVcHXg6oZM7iULer9wGRFvfpl+Tg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/environment": "30.2.0", "@jest/expect": "30.2.0", @@ -7746,6 +8784,7 @@ "integrity": "sha512-Os9ukIvADX/A9sLt6Zse3+nmHtHaE6hqOsjQtNiugFTbKRHYIYtZXNGNK9NChseXy7djFPjndX1tL0sCTlfpAA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/core": "30.2.0", "@jest/test-result": "30.2.0", @@ -7779,6 +8818,7 @@ "integrity": "sha512-g4WkyzFQVWHtu6uqGmQR4CQxz/CH3yDSlhzXMWzNjDx843gYjReZnMRanjRCq5XZFuQrGDxgUaiYWE8BRfVckA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.27.4", "@jest/get-type": "30.1.0", @@ -7847,6 +8887,7 @@ "integrity": "sha512-tR/FFgZKS1CXluOQzZvNH3+0z9jXr3ldGSD8bhyuxvlVUwbeLOGynkunvlTMxchC5urrKndYiwCFC0DLVjpOCA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "detect-newline": "^3.1.0" }, @@ -7860,6 +8901,7 @@ "integrity": "sha512-lpWlJlM7bCUf1mfmuqTA8+j2lNURW9eNafOy99knBM01i5CQeY5UH1vZjgT9071nDJac1M4XsbyI44oNOdhlDQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/get-type": "30.1.0", "@jest/types": "30.2.0", @@ -7877,6 +8919,7 @@ "integrity": "sha512-ElU8v92QJ9UrYsKrxDIKCxu6PfNj4Hdcktcn0JX12zqNdqWHB0N+hwOnnBBXvjLd2vApZtuLUGs1QSY+MsXoNA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/environment": "30.2.0", "@jest/fake-timers": "30.2.0", @@ -7896,6 +8939,7 @@ "integrity": "sha512-sQA/jCb9kNt+neM0anSj6eZhLZUIhQgwDt7cPGjumgLM4rXsfb9kpnlacmvZz3Q5tb80nS+oG/if+NBKrHC+Xw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/types": "30.2.0", "@types/node": "*", @@ -7921,6 +8965,7 @@ "integrity": "sha512-M6jKAjyzjHG0SrQgwhgZGy9hFazcudwCNovY/9HPIicmNSBuockPSedAP9vlPK6ONFJ1zfyH/M2/YYJxOz5cdQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/get-type": "30.1.0", "pretty-format": "30.2.0" @@ -7987,6 +9032,7 @@ "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" }, @@ -8015,6 +9061,7 @@ "integrity": "sha512-TCrHSxPlx3tBY3hWNtRQKbtgLhsXa1WmbJEqBlTBrGafd5fiQFByy2GNCEoGR+Tns8d15GaL9cxEzKOO3GEb2A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "chalk": "^4.1.2", "graceful-fs": "^4.2.11", @@ -8035,6 +9082,7 @@ "integrity": "sha512-xTOIGug/0RmIe3mmCqCT95yO0vj6JURrn1TKWlNbhiAefJRWINNPgwVkrVgt/YaerPzY3iItufd80v3lOrFJ2w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "jest-regex-util": "30.0.1", "jest-snapshot": "30.2.0" @@ -8049,6 +9097,7 @@ "integrity": "sha512-PqvZ2B2XEyPEbclp+gV6KO/F1FIFSbIwewRgmROCMBo/aZ6J1w8Qypoj2pEOcg3G2HzLlaP6VUtvwCI8dM3oqQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/console": "30.2.0", "@jest/environment": "30.2.0", @@ -8083,6 +9132,7 @@ "integrity": "sha512-p1+GVX/PJqTucvsmERPMgCPvQJpFt4hFbM+VN3n8TMo47decMUcJbt+rgzwrEme0MQUA/R+1de2axftTHkKckg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/environment": "30.2.0", "@jest/fake-timers": "30.2.0", @@ -8117,6 +9167,7 @@ "integrity": "sha512-5WEtTy2jXPFypadKNpbNkZ72puZCa6UjSr/7djeecHWOu7iYhSXSnHScT8wBz3Rn8Ena5d5RYRcsyKIeqG1IyA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.27.4", "@babel/generator": "^7.27.5", @@ -8181,6 +9232,7 @@ "integrity": "sha512-FBGWi7dP2hpdi8nBoWxSsLvBFewKAg0+uSQwBaof4Y4DPgBabXgpSYC5/lR7VmnIlSpASmCi/ntRWPbv7089Pw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/get-type": "30.1.0", "@jest/types": "30.2.0", @@ -8199,6 +9251,7 @@ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -8212,6 +9265,7 @@ "integrity": "sha512-PYxa28dxJ9g777pGm/7PrbnMeA0Jr7osHP9bS7eJy9DuAjMgdGtxgf0uKMyoIsTWAkIbUW5hSDdJ3urmgXBqxg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/test-result": "30.2.0", "@jest/types": "30.2.0", @@ -8232,6 +9286,7 @@ "integrity": "sha512-0Q4Uk8WF7BUwqXHuAjc23vmopWJw5WH7w2tqBoUOZpOjW/ZnR44GXXd1r82RvnmI2GZge3ivrYXk/BE2+VtW2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/node": "*", "@ungap/structured-clone": "^1.3.0", @@ -8249,6 +9304,7 @@ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -8346,6 +9402,12 @@ "dev": true, "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/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -8418,6 +9480,7 @@ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -8751,6 +9814,46 @@ "dev": true, "license": "MIT" }, + "node_modules/log-symbols": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz", + "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==", + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "is-unicode-supported": "^1.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -8795,6 +9898,7 @@ "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "semver": "^7.5.3" }, @@ -8818,6 +9922,7 @@ "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "tmpl": "1.0.5" } @@ -8844,18 +9949,39 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, "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/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/merge2": { "version": "1.4.1", @@ -8881,16 +10007,54 @@ "node": ">=8.6" } }, + "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/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -8923,6 +10087,7 @@ "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": ">=16 || 14 >=14.17" } @@ -8932,7 +10097,6 @@ "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.15.0.tgz", "integrity": "sha512-UczzB+0nnwGotYSgllfARAqWCJ5e/skuV2K/l+Zyck/H6pJIhLXuBnz+6vn2i211o7DtbE78HQtsYEKICHGI+g==", "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/mobx" @@ -9035,6 +10199,15 @@ "dev": true, "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/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -9216,7 +10389,8 @@ "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/node-readfiles": { "version": "0.2.0", @@ -9240,6 +10414,7 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -9406,6 +10581,7 @@ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "path-key": "^3.0.0" }, @@ -11109,7 +12285,6 @@ "version": "4.0.3", "inBundle": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -11355,7 +12530,6 @@ "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -11486,11 +12660,22 @@ "node": ">= 20" } }, + "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==", - "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -11502,6 +12687,7 @@ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -11512,6 +12698,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/open": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.2.0.tgz", + "integrity": "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==", + "license": "MIT", + "dependencies": { + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "wsl-utils": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/openapi-sampler": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/openapi-sampler/-/openapi-sampler-1.6.2.tgz", @@ -11523,6 +12727,12 @@ "json-pointer": "0.6.2" } }, + "node_modules/openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==", + "license": "MIT" + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -11541,6 +12751,64 @@ "node": ">= 0.8.0" } }, + "node_modules/ora": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz", + "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==", + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "cli-cursor": "^5.0.0", + "cli-spinners": "^2.9.2", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^2.0.0", + "log-symbols": "^6.0.0", + "stdin-discarder": "^0.2.2", + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT" + }, + "node_modules/ora/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/own-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", @@ -11597,6 +12865,7 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -11606,7 +12875,8 @@ "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "dev": true, - "license": "BlueOak-1.0.0" + "license": "BlueOak-1.0.0", + "peer": true }, "node_modules/parent-module": { "version": "1.0.1", @@ -11638,6 +12908,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", @@ -11660,6 +12939,7 @@ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -11668,7 +12948,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -11686,6 +12965,7 @@ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, "license": "BlueOak-1.0.0", + "peer": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -11702,7 +12982,18 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true + }, + "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/path-type": { "version": "4.0.0", @@ -11725,7 +13016,6 @@ "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "pg-connection-string": "^2.9.1", "pg-pool": "^3.10.1", @@ -11842,16 +13132,27 @@ "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 6" } }, + "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/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "find-up": "^4.0.0" }, @@ -11865,6 +13166,7 @@ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -11879,6 +13181,7 @@ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -11892,6 +13195,7 @@ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-try": "^2.0.0" }, @@ -11908,6 +13212,7 @@ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -12029,7 +13334,6 @@ "resolved": "https://registry.npmjs.org/preact/-/preact-10.24.3.tgz", "integrity": "sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA==", "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" @@ -12115,6 +13419,19 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "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/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -12140,7 +13457,23 @@ "url": "https://opencollective.com/fast-check" } ], - "license": "MIT" + "license": "MIT", + "peer": true + }, + "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/queue-microtask": { "version": "1.2.3", @@ -12163,12 +13496,51 @@ ], "license": "MIT" }, + "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/raw-body/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/react": { "version": "19.2.3", "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -12178,7 +13550,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz", "integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -12399,6 +13770,7 @@ "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "resolve-from": "^5.0.0" }, @@ -12412,6 +13784,7 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -12435,6 +13808,37 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", @@ -12446,6 +13850,34 @@ "node": ">=0.10.0" } }, + "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/run-applescript": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz", + "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -12549,6 +13981,51 @@ "node": ">=10" } }, + "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/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -12598,6 +14075,12 @@ "node": ">= 0.4" } }, + "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/shallowequal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", @@ -12652,7 +14135,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -12665,7 +14147,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -12729,7 +14210,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -12749,7 +14229,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -12766,7 +14245,6 @@ "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==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -12785,7 +14263,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -12805,7 +14282,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, "license": "ISC", "engines": { "node": ">=14" @@ -12857,6 +14333,7 @@ "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -12868,6 +14345,7 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -12886,7 +14364,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/stable-hash": { @@ -12925,6 +14402,27 @@ "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", "license": "MIT" }, + "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/stdin-discarder": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz", + "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/stickyfill": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stickyfill/-/stickyfill-1.1.1.tgz", @@ -12950,6 +14448,7 @@ "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -12964,6 +14463,7 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -12974,6 +14474,7 @@ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -12987,6 +14488,7 @@ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -13006,6 +14508,7 @@ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -13021,6 +14524,7 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -13030,7 +14534,8 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/string-width-cjs/node_modules/strip-ansi": { "version": "6.0.1", @@ -13038,6 +14543,7 @@ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -13162,7 +14668,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" @@ -13181,6 +14686,7 @@ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -13194,6 +14700,7 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -13204,6 +14711,7 @@ "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -13214,6 +14722,7 @@ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -13248,7 +14757,6 @@ "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.19.tgz", "integrity": "sha512-1v/e3Dl1BknC37cXMhwGomhO8AkYmN41CqyX9xhUDxry1ns3BFQy2lLDRQXJRdVVWB9OHemv/53xaStimvWyuA==", "license": "MIT", - "peer": true, "dependencies": { "@emotion/is-prop-valid": "1.2.2", "@emotion/unitless": "0.8.1", @@ -13448,6 +14956,7 @@ "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@pkgr/core": "^0.2.9" }, @@ -13485,6 +14994,7 @@ "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", @@ -13500,6 +15010,7 @@ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -13512,6 +15023,7 @@ "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -13533,6 +15045,7 @@ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -13581,7 +15094,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -13594,7 +15106,8 @@ "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true, - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "peer": true }, "node_modules/to-regex-range": { "version": "5.0.1", @@ -13618,6 +15131,15 @@ "node": ">=12" } }, + "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/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -13764,6 +15286,7 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=4" } @@ -13774,6 +15297,7 @@ "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "license": "(MIT OR CC0-1.0)", + "peer": true, "engines": { "node": ">=10" }, @@ -13781,6 +15305,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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/typed-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", @@ -13865,7 +15403,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -13950,6 +15487,15 @@ "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==", "license": "ISC" }, + "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/unrs-resolver": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz", @@ -14062,6 +15608,7 @@ "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -14076,7 +15623,17 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true + }, + "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/walker": { "version": "1.0.8", @@ -14084,6 +15641,7 @@ "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "makeerror": "1.0.12" } @@ -14108,7 +15666,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -14232,6 +15789,7 @@ "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -14251,6 +15809,7 @@ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -14269,6 +15828,7 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -14278,7 +15838,8 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", @@ -14286,6 +15847,7 @@ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -14301,6 +15863,7 @@ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -14314,6 +15877,7 @@ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -14325,7 +15889,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, "license": "ISC" }, "node_modules/write-file-atomic": { @@ -14334,6 +15897,7 @@ "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^4.0.1" @@ -14342,6 +15906,21 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/wsl-utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.1.0.tgz", + "integrity": "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==", + "license": "MIT", + "dependencies": { + "is-wsl": "^3.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -14475,11 +16054,19 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.4.tgz", "integrity": "sha512-Zw/uYiiyF6pUT1qmKbZziChgNPRu+ZRneAsMUDU6IwmXdWt5JwcUfy2bvLOCUtz5UniaN/Zx5aFttZYbYc7O/A==", "license": "MIT", - "peer": true, "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" + } + }, "node_modules/zod-validation-error": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", @@ -14492,6 +16079,70 @@ "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" } + }, + "packages/cli": { + "name": "@framna-docs/cli", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "chalk": "^5.3.0", + "cli-table3": "^0.6.5", + "commander": "^12.0.0", + "open": "^10.0.0", + "openapi-types": "^12.1.3", + "ora": "^8.0.0", + "yaml": "^2.3.0", + "zod": "^3.23.0" + }, + "bin": { + "framna-docs": "dist/index.js" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "typescript": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "packages/cli/node_modules/@types/node": { + "version": "20.19.29", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.29.tgz", + "integrity": "sha512-YrT9ArrGaHForBaCNwFjoqJWmn8G1Pr7+BH/vwyLHciA9qT/wSiuOhxGCT50JA5xLvFBd6PIiGkE3afxcPE1nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "packages/cli/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "packages/cli/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" + }, + "packages/cli/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/package.json b/package.json index 3a04e48a..7490e2d6 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "framna-docs", "version": "1.0.0", "private": true, + "workspaces": [ + "packages/*" + ], "engines": { "node": ">=24.0.0 <25.0.0", "npm": ">=11.1.0 <12.0.0" @@ -12,9 +15,13 @@ "start": "next start", "lint": "eslint --max-warnings=0 .", "test": "node --experimental-vm-modules ./node_modules/.bin/jest", - "testwatch": "node --experimental-vm-modules ./node_modules/.bin/jest --watch" + "testwatch": "node --experimental-vm-modules ./node_modules/.bin/jest --watch", + "cli:build": "npm run build --workspace=@framna-docs/cli", + "cli:dev": "npm run dev --workspace=@framna-docs/cli", + "cli:lint": "npm run lint --workspace=@framna-docs/cli" }, "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.14.1", "@fontsource/poppins": "^5.2.7", @@ -23,9 +30,11 @@ "@fortawesome/free-regular-svg-icons": "^7.1.0", "@fortawesome/free-solid-svg-icons": "^7.1.0", "@fortawesome/react-fontawesome": "^3.1.1", + "@modelcontextprotocol/sdk": "^1.25.2", "@mui/icons-material": "^7.3.6", "@mui/material": "^7.0.1", "@octokit/auth-app": "^8.1.2", + "@octokit/auth-oauth-device": "^7.1.1", "@octokit/core": "^7.0.6", "@octokit/webhooks": "~14.2.0", "core-js": "^3.47.0", @@ -61,13 +70,13 @@ "@types/react-dom": "^19.2.3", "@typescript-eslint/eslint-plugin": "^8.51.0", "@typescript-eslint/parser": "^8.51.0", - "typescript-eslint": "^8.51.0", "eslint": "^9.39.2", "eslint-config-next": "^16.1.1", "pg": "^8.16.3", "postcss": "^8.5.6", "tailwindcss": "^4.1.4", "ts-jest": "^29.4.6", - "typescript": "^5.9.3" + "typescript": "^5.9.3", + "typescript-eslint": "^8.51.0" } } diff --git a/packages/cli/.gitignore b/packages/cli/.gitignore new file mode 100644 index 00000000..f06235c4 --- /dev/null +++ b/packages/cli/.gitignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/cli/README.md b/packages/cli/README.md new file mode 100644 index 00000000..bbad9f55 --- /dev/null +++ b/packages/cli/README.md @@ -0,0 +1,90 @@ +# Framna Docs CLI + +CLI tool for interacting with Framna Docs - your OpenAPI documentation portal. + +## Installation + +```bash +npx @framna-docs/cli +``` + +Or install globally: + +```bash +npm install -g @framna-docs/cli +``` + +## Authentication + +```bash +# Login via GitHub device flow +framna-docs auth login + +# Check auth status +framna-docs auth status + +# Logout +framna-docs auth logout +``` + +## Usage + +### Projects + +```bash +# List all projects +framna-docs projects + +# Get project details +framna-docs project +``` + +### Endpoints + +```bash +# List endpoints +framna-docs endpoints [--version X] [--spec Y] + +# Search endpoints +framna-docs endpoints search + +# Get endpoint details +framna-docs endpoint +``` + +### Schemas + +```bash +# List schemas +framna-docs schemas + +# Get schema definition +framna-docs schema +``` + +## MCP Integration + +Add to Claude Code: + +```bash +claude mcp add framna-docs -- npx @framna-docs/cli mcp serve +``` + +The MCP server exposes these tools: +- `list_projects` - List all projects +- `get_project` - Get project details +- `list_endpoints` - List API endpoints +- `search_endpoints` - Search endpoints +- `get_endpoint_details` - Get endpoint details +- `list_schemas` - List schemas +- `get_schema` - Get schema definition + +## Configuration + +Set `FRAMNA_DOCS_URL` environment variable to use a custom server: + +```bash +export FRAMNA_DOCS_URL=https://your-server.com +``` + +Session is stored in `~/.framna-docs/session.json`. diff --git a/packages/cli/package-lock.json b/packages/cli/package-lock.json new file mode 100644 index 00000000..d88a999f --- /dev/null +++ b/packages/cli/package-lock.json @@ -0,0 +1,1569 @@ +{ + "name": "framna-docs", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "framna-docs", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@modelcontextprotocol/sdk": "^1.0.0", + "chalk": "^5.3.0", + "commander": "^12.0.0", + "open": "^10.0.0", + "ora": "^8.0.0", + "zod": "^3.23.0" + }, + "bin": { + "framna-docs": "dist/index.js" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "typescript": "^5.0.0" + }, + "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.25.2", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.25.2.tgz", + "integrity": "sha512-LZFeo4F9M5qOhC/Uc1aQSrBHxMrvxett+9KLHt7OhcExtoiRN9DKgbZffMP/nxjutWDQpfMDfP3nkHI4X9ijww==", + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.7", + "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.0.1", + "express-rate-limit": "^7.5.0", + "jose": "^6.1.1", + "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.0" + }, + "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.29", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.29.tgz", + "integrity": "sha512-YrT9ArrGaHForBaCNwFjoqJWmn8G1Pr7+BH/vwyLHciA9qT/wSiuOhxGCT50JA5xLvFBd6PIiGkE3afxcPE1nw==", + "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/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "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/bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "license": "MIT", + "dependencies": { + "run-applescript": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "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.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "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/default-browser": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.4.0.tgz", + "integrity": "sha512-XDuvSq38Hr1MdN47EDvYtx3U0MTqpCEn+F6ft8z2vYDzMrvQhVp0ui9oQdqW3MvK3vqUETglt1tVGgjLuJ5izg==", + "license": "MIT", + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz", + "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/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/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "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/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": "7.5.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.1.tgz", + "integrity": "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw==", + "license": "MIT", + "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-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/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.4", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.4.tgz", + "integrity": "sha512-U7tt8JsyrxSRKspfhtLET79pU8K+tInj5QZXs1jSugO1Vq5dFj3kmZsRldo29mTBfcjDRVRXrEZ6LS63Cog9ZA==", + "license": "MIT", + "peer": true, + "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/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-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/is-unicode-supported": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/log-symbols": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz", + "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==", + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "is-unicode-supported": "^1.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.2.0.tgz", + "integrity": "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==", + "license": "MIT", + "dependencies": { + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "wsl-utils": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz", + "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==", + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "cli-cursor": "^5.0.0", + "cli-spinners": "^2.9.2", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^2.0.0", + "log-symbols": "^6.0.0", + "stdin-discarder": "^0.2.2", + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/run-applescript": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz", + "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "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/stdin-discarder": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz", + "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "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/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/wsl-utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.1.0.tgz", + "integrity": "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==", + "license": "MIT", + "dependencies": { + "is-wsl": "^3.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "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/packages/cli/package.json b/packages/cli/package.json new file mode 100644 index 00000000..76e23913 --- /dev/null +++ b/packages/cli/package.json @@ -0,0 +1,41 @@ +{ + "name": "@framna-docs/cli", + "version": "0.1.0", + "description": "CLI for Framna Docs - OpenAPI documentation portal", + "type": "module", + "bin": { + "framna-docs": "./dist/index.js" + }, + "files": [ + "dist" + ], + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "lint": "eslint src" + }, + "dependencies": { + "@apidevtools/swagger-parser": "^10.1.0", + "chalk": "^5.3.0", + "cli-table3": "^0.6.5", + "commander": "^12.0.0", + "open": "^10.0.0", + "openapi-types": "^12.1.3", + "ora": "^8.0.0", + "yaml": "^2.3.0", + "zod": "^3.23.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "typescript": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "keywords": [ + "openapi", + "documentation", + "cli" + ], + "license": "MIT" +} diff --git a/packages/cli/src/api.ts b/packages/cli/src/api.ts new file mode 100644 index 00000000..9d671ba0 --- /dev/null +++ b/packages/cli/src/api.ts @@ -0,0 +1,92 @@ +export class APIError extends Error { + constructor( + message: string, + public status: number + ) { + super(message) + this.name = "APIError" + } +} + +type Headers = Record + +interface ErrorResponse { + error?: string +} + +export class APIClient { + constructor( + private baseUrl: string, + private sessionId?: string + ) {} + + private getHeaders(): Headers { + const headers: Headers = { + "Content-Type": "application/json", + } + + if (this.sessionId) { + headers["Authorization"] = `Bearer ${this.sessionId}` + } + + return headers + } + + async get(path: string, params?: Record): Promise { + const url = new URL(path, this.baseUrl) + + if (params) { + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined) { + url.searchParams.set(key, value) + } + }) + } + + const response = await fetch(url.toString(), { + method: "GET", + headers: this.getHeaders(), + }) + + const data = (await response.json()) as T & ErrorResponse + + if (!response.ok) { + throw new APIError(data.error || "Request failed", response.status) + } + + return data + } + + async post(path: string, body?: unknown): Promise { + const url = new URL(path, this.baseUrl) + + const response = await fetch(url.toString(), { + method: "POST", + headers: this.getHeaders(), + body: body ? JSON.stringify(body) : undefined, + }) + + const data = (await response.json()) as T & ErrorResponse + + if (!response.ok) { + throw new APIError(data.error || "Request failed", response.status) + } + + return data + } + + async getRaw(path: string): Promise { + const url = new URL(path, this.baseUrl) + + const response = await fetch(url.toString(), { + method: "GET", + headers: this.getHeaders(), + }) + + if (!response.ok) { + throw new APIError("Request failed", response.status) + } + + return response.text() + } +} diff --git a/packages/cli/src/cache/Cache.ts b/packages/cli/src/cache/Cache.ts new file mode 100644 index 00000000..0943e493 --- /dev/null +++ b/packages/cli/src/cache/Cache.ts @@ -0,0 +1,169 @@ +import * as fs from "fs/promises" +import * as path from "path" +import * as os from "os" +import * as crypto from "crypto" +import { OpenAPIV3 } from "openapi-types" +import { Project, ProjectSummary } from "../types.js" + +const CACHE_DIR = ".framna-docs/cache" +const SPECS_DIR = "specs" +const PROJECT_DETAILS_DIR = "projects" +const PROJECTS_FILE = "projects.json" +const PROJECT_LIST_TTL_MS = 60 * 1000 +const PROJECT_DETAILS_TTL_MS = 30 * 1000 + +function getCacheDir(): string { + return path.join(os.homedir(), CACHE_DIR) +} + +function getSpecsDir(): string { + return path.join(getCacheDir(), SPECS_DIR) +} + +function getProjectDetailsDir(): string { + return path.join(getCacheDir(), PROJECT_DETAILS_DIR) +} + +function hashToken(token: string): string { + return crypto.createHash("sha256").update(token).digest("hex").slice(0, 16) +} + +export class SpecCache { + private getSpecPath(commitSha: string): string { + return path.join(getSpecsDir(), `${commitSha}.json`) + } + + async getSpec(commitSha: string): Promise { + try { + const content = await fs.readFile(this.getSpecPath(commitSha), "utf-8") + return JSON.parse(content) as OpenAPIV3.Document + } catch { + return null + } + } + + async setSpec(commitSha: string, spec: OpenAPIV3.Document): Promise { + await fs.mkdir(getSpecsDir(), { recursive: true }) + await fs.writeFile(this.getSpecPath(commitSha), JSON.stringify(spec)) + } +} + +interface ProjectDetailsCacheData { + project: Project + timestamp: number +} + +export class ProjectDetailsCache { + private getProjectPath(owner: string, name: string): string { + return path.join(getProjectDetailsDir(), `${owner}_${name}.json`) + } + + async getProject(owner: string, name: string): Promise { + try { + const content = await fs.readFile(this.getProjectPath(owner, name), "utf-8") + const cache = JSON.parse(content) as ProjectDetailsCacheData + if (Date.now() - cache.timestamp > PROJECT_DETAILS_TTL_MS) return null + return cache.project + } catch { + return null + } + } + + async setProject(owner: string, name: string, project: Project): Promise { + await fs.mkdir(getProjectDetailsDir(), { recursive: true }) + const cache: ProjectDetailsCacheData = { + project, + timestamp: Date.now(), + } + await fs.writeFile(this.getProjectPath(owner, name), JSON.stringify(cache)) + } +} + +interface ProjectsCacheData { + projects: ProjectSummary[] + tokenHash: string + timestamp: number +} + +export class ProjectsCache { + private tokenHash: string + + constructor(sessionToken: string) { + this.tokenHash = hashToken(sessionToken) + } + + async getProjects(): Promise { + try { + const content = await fs.readFile(path.join(getCacheDir(), PROJECTS_FILE), "utf-8") + const cache = JSON.parse(content) as ProjectsCacheData + if (cache.tokenHash !== this.tokenHash) return null + if (Date.now() - cache.timestamp > PROJECT_LIST_TTL_MS) return null + return cache.projects + } catch { + return null + } + } + + async setProjects(projects: ProjectSummary[]): Promise { + await fs.mkdir(getCacheDir(), { recursive: true }) + const cache: ProjectsCacheData = { + projects, + tokenHash: this.tokenHash, + timestamp: Date.now(), + } + await fs.writeFile(path.join(getCacheDir(), PROJECTS_FILE), JSON.stringify(cache, null, 2)) + } +} + +export async function clearCache(): Promise<{ cleared: string[] }> { + const cleared: string[] = [] + try { + await fs.unlink(path.join(getCacheDir(), PROJECTS_FILE)) + cleared.push("projects.json") + } catch { /* ignore */ } + try { + const files = await fs.readdir(getSpecsDir()) + await Promise.all(files.map(async (file) => { + await fs.unlink(path.join(getSpecsDir(), file)) + cleared.push(`specs/${file}`) + })) + } catch { /* ignore */ } + try { + const files = await fs.readdir(getProjectDetailsDir()) + await Promise.all(files.map(async (file) => { + await fs.unlink(path.join(getProjectDetailsDir(), file)) + cleared.push(`projects/${file}`) + })) + } catch { /* ignore */ } + return { cleared } +} + +export async function getCacheStats(): Promise<{ + projectsCached: boolean + projectsAge?: number + specsCount: number + totalSizeBytes: number +}> { + let projectsCached = false + let projectsAge: number | undefined + let specsCount = 0 + let totalSizeBytes = 0 + + try { + const stat = await fs.stat(path.join(getCacheDir(), PROJECTS_FILE)) + projectsCached = true + projectsAge = Date.now() - stat.mtimeMs + totalSizeBytes += stat.size + } catch { /* ignore */ } + + try { + const files = await fs.readdir(getSpecsDir()) + specsCount = files.length + const stats = await Promise.all(files.map(file => fs.stat(path.join(getSpecsDir(), file)))) + for (const stat of stats) { + totalSizeBytes += stat.size + } + } catch { /* ignore */ } + + return { projectsCached, projectsAge, specsCount, totalSizeBytes } +} diff --git a/packages/cli/src/cache/index.ts b/packages/cli/src/cache/index.ts new file mode 100644 index 00000000..c14dc53b --- /dev/null +++ b/packages/cli/src/cache/index.ts @@ -0,0 +1 @@ +export { SpecCache, ProjectsCache, ProjectDetailsCache, clearCache, getCacheStats } from "./Cache.js" diff --git a/packages/cli/src/commands/auth/index.ts b/packages/cli/src/commands/auth/index.ts new file mode 100644 index 00000000..8c9d2eff --- /dev/null +++ b/packages/cli/src/commands/auth/index.ts @@ -0,0 +1,14 @@ +import { Command } from "commander" +import { createLoginCommand } from "./login.js" +import { createLogoutCommand } from "./logout.js" +import { createStatusCommand } from "./status.js" + +export function createAuthCommand(): Command { + const auth = new Command("auth").description("Authentication commands") + + auth.addCommand(createLoginCommand()) + auth.addCommand(createLogoutCommand()) + auth.addCommand(createStatusCommand()) + + return auth +} diff --git a/packages/cli/src/commands/auth/login.ts b/packages/cli/src/commands/auth/login.ts new file mode 100644 index 00000000..74f6e749 --- /dev/null +++ b/packages/cli/src/commands/auth/login.ts @@ -0,0 +1,89 @@ +import { Command } from "commander" +import chalk from "chalk" +import ora from "ora" +import open from "open" +import { APIClient } from "../../api.js" +import { saveSession, getServerUrl } from "../../config.js" + +interface DeviceFlowResponse { + userCode: string + verificationUri: string + deviceCode: string + sessionId: string + expiresIn: number + interval: number +} + +interface StatusResponse { + status: "pending" | "complete" | "error" + sessionId?: string + error?: string +} + +export function createLoginCommand(): Command { + return new Command("login") + .description("Authenticate with Framna Docs via GitHub") + .action(async () => { + const serverUrl = getServerUrl() + const client = new APIClient(serverUrl) + const spinner = ora() + + try { + spinner.start("Initiating authentication...") + const deviceFlow = await client.post("/api/cli/auth/device") + spinner.stop() + + console.log() + console.log(chalk.bold("To authenticate, visit:")) + console.log(chalk.cyan(deviceFlow.verificationUri)) + console.log() + console.log(chalk.bold("And enter this code:")) + console.log(chalk.yellow.bold(deviceFlow.userCode)) + console.log() + + try { + await open(deviceFlow.verificationUri) + console.log(chalk.dim("Browser opened automatically")) + } catch { + console.log(chalk.dim("Please open the URL manually")) + } + + spinner.start("Waiting for authorization...") + + const pollInterval = (deviceFlow.interval || 5) * 1000 + const maxAttempts = Math.floor((deviceFlow.expiresIn * 1000) / pollInterval) + + // Polling loop - sequential awaits are intentional for device flow auth + for (let attempt = 0; attempt < maxAttempts; attempt++) { + // eslint-disable-next-line no-await-in-loop + await new Promise((resolve) => setTimeout(resolve, pollInterval)) + + // eslint-disable-next-line no-await-in-loop + const status = await client.post("/api/cli/auth/status", { + device_code: deviceFlow.deviceCode, + }) + + if (status.status === "complete" && status.sessionId) { + spinner.succeed("Authentication successful!") + // eslint-disable-next-line no-await-in-loop + await saveSession(status.sessionId) + console.log(chalk.green("\nYou are now logged in.")) + return + } + + if (status.status === "error") { + spinner.fail("Authentication failed") + console.error(chalk.red(status.error || "Unknown error")) + process.exit(1) + } + } + + spinner.fail("Authentication timed out") + process.exit(1) + } catch (error) { + spinner.fail("Authentication failed") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} diff --git a/packages/cli/src/commands/auth/logout.ts b/packages/cli/src/commands/auth/logout.ts new file mode 100644 index 00000000..67d610c7 --- /dev/null +++ b/packages/cli/src/commands/auth/logout.ts @@ -0,0 +1,40 @@ +import { Command } from "commander" +import chalk from "chalk" +import ora from "ora" +import { APIClient } from "../../api.js" +import { getSession, deleteSession, getServerUrl } from "../../config.js" + +export function createLogoutCommand(): Command { + return new Command("logout") + .description("Log out from Framna Docs") + .action(async () => { + const spinner = ora() + + try { + const session = await getSession() + + if (!session) { + console.log(chalk.yellow("You are not logged in.")) + return + } + + spinner.start("Logging out...") + + const serverUrl = getServerUrl() + const client = new APIClient(serverUrl, session.sessionId) + + try { + await client.post("/api/cli/auth/logout") + } catch { + // Ignore server errors - still delete local session + } + + await deleteSession() + spinner.succeed("Logged out successfully") + } catch (error) { + spinner.fail("Logout failed") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} diff --git a/packages/cli/src/commands/auth/status.ts b/packages/cli/src/commands/auth/status.ts new file mode 100644 index 00000000..72afee8a --- /dev/null +++ b/packages/cli/src/commands/auth/status.ts @@ -0,0 +1,20 @@ +import { Command } from "commander" +import chalk from "chalk" +import { getSession } from "../../config.js" + +export function createStatusCommand(): Command { + return new Command("status") + .description("Check authentication status") + .action(async () => { + const session = await getSession() + + if (!session) { + console.log(chalk.yellow("Not authenticated")) + console.log(chalk.dim("Run 'framna-docs auth login' to authenticate")) + return + } + + console.log(chalk.green("Authenticated")) + console.log(chalk.dim(`Session created: ${session.createdAt}`)) + }) +} diff --git a/packages/cli/src/commands/cache.ts b/packages/cli/src/commands/cache.ts new file mode 100644 index 00000000..c4d9009e --- /dev/null +++ b/packages/cli/src/commands/cache.ts @@ -0,0 +1,47 @@ +import { Command } from "commander" +import chalk from "chalk" +import ora from "ora" +import { clearCache, getCacheStats } from "../cache/index.js" + +export function createCacheCommand(): Command { + const cache = new Command("cache").description("Manage local cache") + + cache.command("clear").description("Clear all cached data").action(async () => { + const spinner = ora("Clearing cache...").start() + try { + const { cleared } = await clearCache() + spinner.stop() + if (cleared.length === 0) { + console.log(chalk.yellow("Cache was already empty")) + } else { + console.log(chalk.green(`Cleared ${cleared.length} cached items`)) + } + } catch (error) { + spinner.fail("Failed to clear cache") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) + + cache.command("status").description("Show cache status").action(async () => { + try { + const stats = await getCacheStats() + console.log(chalk.bold("Cache Status:")) + console.log(` Projects cached: ${stats.projectsCached ? "yes" : "no"}`) + if (stats.projectsCached && stats.projectsAge !== undefined) { + const ageSeconds = Math.floor(stats.projectsAge / 1000) + const ttlRemaining = Math.max(0, 60 - ageSeconds) + console.log(chalk.dim(` Age: ${ageSeconds}s (expires in ${ttlRemaining}s)`)) + } + console.log(` Specs cached: ${stats.specsCount}`) + console.log(` Total size: ${(stats.totalSizeBytes / 1024).toFixed(1)} KB`) + console.log() + console.log(chalk.dim("Cache location: ~/.framna-docs/cache/")) + } catch (error) { + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) + + return cache +} diff --git a/packages/cli/src/commands/endpoints.ts b/packages/cli/src/commands/endpoints.ts new file mode 100644 index 00000000..f4e78c64 --- /dev/null +++ b/packages/cli/src/commands/endpoints.ts @@ -0,0 +1,223 @@ +import { Command } from "commander" +import chalk from "chalk" +import ora from "ora" +import yaml from "yaml" +import { OpenAPIV3 } from "openapi-types" +import { getOpenAPIService, resolveProject, formatTable } from "./shared.js" + +interface SpecOptions { + project: string + at: string + spec: string + json?: boolean + yaml?: boolean +} + +export function createEndpointsCommand(): Command { + return new Command("endpoints") + .description("Endpoint commands") +} + +export function createEndpointsListCommand(): Command { + return new Command("list") + .description("List API endpoints") + .requiredOption("-p, --project ", "Project (owner/name)") + .requiredOption("-a, --at ", "API version name") + .requiredOption("-s, --spec ", "Spec name") + .option("--json", "Output as JSON") + .option("--yaml", "Output as YAML") + .action(async (options: SpecOptions) => { + const spinner = ora("Fetching endpoints...").start() + + try { + const service = await getOpenAPIService() + const { owner, name } = resolveProject(options.project) + const project = await service.getProject(owner, name) + const endpoints = await service.listEndpoints(project, options.at, options.spec) + + spinner.stop() + + if (endpoints.length === 0) { + console.log(chalk.yellow("No endpoints found")) + return + } + + if (options.json) { + console.log(JSON.stringify(endpoints, null, 2)) + return + } + if (options.yaml) { + console.log(yaml.stringify(endpoints, { aliasDuplicateObjects: false })) + return + } + + const rows = endpoints.map((e) => [ + chalk.bold(e.method.toUpperCase()), + e.path, + e.summary || "", + e.operationId || "", + ]) + + console.log(formatTable(["METHOD", "PATH", "SUMMARY", "OPERATION ID"], rows)) + } catch (error) { + spinner.fail("Failed to fetch endpoints") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} + +export function createEndpointsSearchCommand(): Command { + return new Command("search") + .description("Search endpoints") + .argument("", "Search query") + .requiredOption("-p, --project ", "Project (owner/name)") + .requiredOption("-a, --at ", "API version name") + .requiredOption("-s, --spec ", "Spec name") + .option("--json", "Output as JSON") + .option("--yaml", "Output as YAML") + .action(async (query: string, options: SpecOptions) => { + const spinner = ora("Searching endpoints...").start() + + try { + const service = await getOpenAPIService() + const { owner, name } = resolveProject(options.project) + const project = await service.getProject(owner, name) + const endpoints = await service.searchEndpoints(project, query, options.at, options.spec) + + spinner.stop() + + if (endpoints.length === 0) { + console.log(chalk.yellow("No endpoints found matching query")) + return + } + + if (options.json) { + console.log(JSON.stringify(endpoints, null, 2)) + return + } + if (options.yaml) { + console.log(yaml.stringify(endpoints, { aliasDuplicateObjects: false })) + return + } + + const rows = endpoints.map((e) => [ + chalk.bold(e.method.toUpperCase()), + e.path, + e.summary || "", + ]) + + console.log(formatTable(["METHOD", "PATH", "SUMMARY"], rows)) + } catch (error) { + spinner.fail("Search failed") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} + +export function createEndpointGetCommand(): Command { + return new Command("get") + .description("Get endpoint details with schemas") + .argument("", "Endpoint path (e.g., /users/{id})") + .argument("", "HTTP method") + .requiredOption("-p, --project ", "Project (owner/name)") + .requiredOption("-a, --at ", "API version name") + .requiredOption("-s, --spec ", "Spec name") + .option("--json", "Output as JSON") + .option("--yaml", "Output as YAML") + .action(async (endpointPath: string, method: string, options: SpecOptions & { json?: boolean; yaml?: boolean }) => { + const spinner = ora("Fetching endpoint...").start() + + try { + const service = await getOpenAPIService() + const { owner, name } = resolveProject(options.project) + const project = await service.getProject(owner, name) + const endpoint = await service.getEndpointSlice(project, endpointPath, method, options.at, options.spec) + + spinner.stop() + + if (!endpoint) { + // Check if path exists with different methods + const availableMethods = await service.getMethodsForPath(project, endpointPath, options.at, options.spec) + if (availableMethods.length > 0) { + const otherMethods = availableMethods.filter(m => m.toLowerCase() !== method.toLowerCase()) + if (otherMethods.length > 0) { + console.log(chalk.yellow("Endpoint not found")) + console.log(chalk.dim(`Did you mean: ${otherMethods.map(m => m.toUpperCase()).join(", ")}?`)) + return + } + } + console.log(chalk.yellow("Endpoint not found")) + return + } + + // JSON or YAML output + if (options.json) { + console.log(JSON.stringify(endpoint, null, 2)) + return + } + if (options.yaml) { + console.log(yaml.stringify(endpoint, { aliasDuplicateObjects: false })) + return + } + + // Human-readable output - extract from OpenAPI document + const pathItem = endpoint.paths?.[endpointPath] as OpenAPIV3.PathItemObject + const operation = pathItem?.[method.toLowerCase() as keyof OpenAPIV3.PathItemObject] as OpenAPIV3.OperationObject + + console.log(chalk.bold(`${method.toUpperCase()} ${endpointPath}`)) + if (operation?.summary) console.log(chalk.dim(operation.summary)) + if (operation?.description) { + console.log() + console.log(operation.description) + } + console.log() + + if (operation?.tags && operation.tags.length > 0) { + console.log(chalk.bold("Tags:"), operation.tags.join(", ")) + } + + if (operation?.operationId) { + console.log(chalk.bold("Operation ID:"), operation.operationId) + } + + const parameters = operation?.parameters as OpenAPIV3.ParameterObject[] | undefined + if (parameters && parameters.length > 0) { + console.log() + console.log(chalk.bold("Parameters:")) + const paramRows = parameters.map((param) => [ + param.name, + param.in, + param.required ? chalk.red("required") : "optional", + param.description || "", + ]) + console.log(formatTable(["NAME", "IN", "REQUIRED", "DESCRIPTION"], paramRows)) + } + + if (operation?.responses) { + console.log() + console.log(chalk.bold("Responses:")) + const responseRows = Object.entries(operation.responses).map(([code, response]) => { + const resp = response as OpenAPIV3.ResponseObject + const color = code.startsWith("2") ? chalk.green : code.startsWith("4") ? chalk.yellow : chalk.red + return [color(code), resp.description || ""] + }) + console.log(formatTable(["CODE", "DESCRIPTION"], responseRows)) + } + + const schemas = endpoint.components?.schemas + if (schemas && Object.keys(schemas).length > 0) { + console.log() + console.log(chalk.bold("Referenced Schemas:")) + const schemaRows = Object.keys(schemas).map((name) => [name]) + console.log(formatTable(["SCHEMA"], schemaRows)) + console.log(chalk.dim("Use --json or --yaml to see full schema definitions")) + } + } catch (error) { + spinner.fail("Failed to fetch endpoint") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} diff --git a/packages/cli/src/commands/projects.ts b/packages/cli/src/commands/projects.ts new file mode 100644 index 00000000..4958f26a --- /dev/null +++ b/packages/cli/src/commands/projects.ts @@ -0,0 +1,105 @@ +import { Command } from "commander" +import chalk from "chalk" +import ora from "ora" +import yaml from "yaml" +import { getAuthenticatedClient, formatTable } from "./shared.js" +import { Project, ProjectSummary } from "../types.js" + +interface OutputOptions { + json?: boolean + yaml?: boolean +} + +export function createProjectsCommand(): Command { + return new Command("projects") + .description("Project commands") +} + +export function createProjectsListCommand(): Command { + return new Command("list") + .description("List all projects") + .option("--json", "Output as JSON") + .option("--yaml", "Output as YAML") + .action(async (options: OutputOptions) => { + const spinner = ora("Fetching projects...").start() + + try { + const client = await getAuthenticatedClient() + const { projects } = await client.get<{ projects: ProjectSummary[] }>("/api/cli/projects") + + spinner.stop() + + if (projects.length === 0) { + console.log(chalk.yellow("No projects found")) + return + } + + if (options.json) { + console.log(JSON.stringify(projects, null, 2)) + return + } + if (options.yaml) { + console.log(yaml.stringify(projects, { aliasDuplicateObjects: false })) + return + } + + const rows = projects.map((p) => [ + `${p.owner}/${p.name}`, + p.displayName, + ]) + + console.log(formatTable(["PROJECT", "DISPLAY NAME"], rows)) + console.log(chalk.dim(`\nUse 'projects get ' to see versions and specs`)) + } catch (error) { + spinner.fail("Failed to fetch projects") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} + +export function createProjectsGetCommand(): Command { + return new Command("get") + .description("Get project details") + .argument("", "Project identifier (owner/name)") + .option("--json", "Output as JSON") + .option("--yaml", "Output as YAML") + .action(async (projectId: string, options: OutputOptions) => { + const spinner = ora("Fetching project...").start() + + try { + const client = await getAuthenticatedClient() + const { project } = await client.get<{ project: Project }>(`/api/cli/projects/${projectId}`) + + spinner.stop() + + if (options.json) { + console.log(JSON.stringify(project, null, 2)) + return + } + if (options.yaml) { + console.log(yaml.stringify(project, { aliasDuplicateObjects: false })) + return + } + + console.log(chalk.bold(project.displayName)) + console.log(chalk.dim(`Owner: ${project.owner}`)) + console.log() + + console.log(chalk.bold("Versions:")) + for (const version of project.versions) { + const defaultMark = version.isDefault ? chalk.green(" (default)") : "" + console.log(` ${version.name}${defaultMark}`) + + for (const spec of version.specifications) { + const specDefault = spec.isDefault ? chalk.green(" *") : "" + console.log(chalk.dim(` - ${spec.name}${specDefault}`)) + } + } + } catch (error) { + spinner.fail("Failed to fetch project") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} diff --git a/packages/cli/src/commands/schemas.ts b/packages/cli/src/commands/schemas.ts new file mode 100644 index 00000000..e7c17e41 --- /dev/null +++ b/packages/cli/src/commands/schemas.ts @@ -0,0 +1,108 @@ +import { Command } from "commander" +import chalk from "chalk" +import ora from "ora" +import yaml from "yaml" +import { getOpenAPIService, resolveProject } from "./shared.js" + +interface SpecOptions { + project: string + at: string + spec: string + json?: boolean + yaml?: boolean +} + +export function createSchemasCommand(): Command { + return new Command("schemas") + .description("Schema commands") +} + +export function createSchemasListCommand(): Command { + return new Command("list") + .description("List API schemas") + .requiredOption("-p, --project ", "Project (owner/name)") + .requiredOption("-a, --at ", "API version name") + .requiredOption("-s, --spec ", "Spec name") + .option("--json", "Output as JSON") + .option("--yaml", "Output as YAML") + .action(async (options: SpecOptions) => { + const spinner = ora("Fetching schemas...").start() + + try { + const service = await getOpenAPIService() + const { owner, name } = resolveProject(options.project) + const project = await service.getProject(owner, name) + const schemas = await service.listSchemas(project, options.at, options.spec) + + spinner.stop() + + if (schemas.length === 0) { + console.log(chalk.yellow("No schemas found")) + return + } + + if (options.json) { + console.log(JSON.stringify(schemas, null, 2)) + return + } + if (options.yaml) { + console.log(yaml.stringify(schemas, { aliasDuplicateObjects: false })) + return + } + + console.log(chalk.bold("Schemas:")) + for (const schema of schemas) { + console.log(` ${schema}`) + } + } catch (error) { + spinner.fail("Failed to fetch schemas") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} + +export function createSchemasGetCommand(): Command { + return new Command("get") + .description("Get schema definition") + .argument("", "Schema name") + .requiredOption("-p, --project ", "Project (owner/name)") + .requiredOption("-a, --at ", "API version name") + .requiredOption("-s, --spec ", "Spec name") + .option("--json", "Output as JSON") + .option("--yaml", "Output as YAML") + .action(async (schemaName: string, options: SpecOptions) => { + const spinner = ora("Fetching schema...").start() + + try { + const service = await getOpenAPIService() + const { owner, name } = resolveProject(options.project) + const project = await service.getProject(owner, name) + const schema = await service.getSchema(project, schemaName, options.at, options.spec) + + spinner.stop() + + if (!schema) { + console.log(chalk.yellow("Schema not found")) + return + } + + if (options.json) { + console.log(JSON.stringify(schema, null, 2)) + return + } + if (options.yaml) { + console.log(yaml.stringify(schema, { aliasDuplicateObjects: false })) + return + } + + console.log(chalk.bold(schemaName)) + console.log() + console.log(JSON.stringify(schema, null, 2)) + } catch (error) { + spinner.fail("Failed to fetch schema") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} diff --git a/packages/cli/src/commands/shared.ts b/packages/cli/src/commands/shared.ts new file mode 100644 index 00000000..524e6e9a --- /dev/null +++ b/packages/cli/src/commands/shared.ts @@ -0,0 +1,58 @@ +import chalk from "chalk" +import Table from "cli-table3" +import { getSession, getServerUrl } from "../config.js" +import { APIClient } from "../api.js" +import { OpenAPIService } from "../openapi/index.js" + +export async function getAuthenticatedClient(): Promise { + const session = await getSession() + + if (!session) { + console.error(chalk.red("Not authenticated")) + console.error(chalk.dim("Run 'framna-docs auth login' to authenticate")) + process.exit(1) + } + + return new APIClient(getServerUrl(), session.sessionId) +} + +export async function getOpenAPIService(): Promise { + const session = await getSession() + if (!session) { + console.error(chalk.red("Not authenticated")) + console.error(chalk.dim("Run 'framna-docs auth login' to authenticate")) + process.exit(1) + } + const client = new APIClient(getServerUrl(), session.sessionId) + return new OpenAPIService(client, session.sessionId) +} + +export function resolveProject(id: string): { owner: string; name: string } { + if (!id.includes("/")) { + throw new Error(`Invalid project format: ${id}. Use owner/name format.`) + } + const [owner, name] = id.split("/") + return { owner, name } +} + +export function formatTable(headers: string[], rows: string[][]): string { + const table = new Table({ + head: headers.map(h => chalk.bold(h)), + style: { + head: [], + border: [], + }, + chars: { + 'top': '─', 'top-mid': '┬', 'top-left': '┌', 'top-right': '┐', + 'bottom': '─', 'bottom-mid': '┴', 'bottom-left': '└', 'bottom-right': '┘', + 'left': '│', 'left-mid': '├', 'mid': '─', 'mid-mid': '┼', + 'right': '│', 'right-mid': '┤', 'middle': '│' + } + }) + + for (const row of rows) { + table.push(row) + } + + return table.toString() +} diff --git a/packages/cli/src/commands/spec.ts b/packages/cli/src/commands/spec.ts new file mode 100644 index 00000000..c6512dd3 --- /dev/null +++ b/packages/cli/src/commands/spec.ts @@ -0,0 +1,45 @@ +import { Command } from "commander" +import chalk from "chalk" +import ora from "ora" +import yaml from "yaml" +import { getOpenAPIService, resolveProject } from "./shared.js" + +interface SpecOptions { + project: string + at: string + spec: string + json?: boolean + yaml?: boolean +} + +export function createSpecCommand(): Command { + return new Command("spec") + .description("Get full OpenAPI specification") + .requiredOption("-p, --project ", "Project (owner/name)") + .requiredOption("-a, --at ", "API version name") + .requiredOption("-s, --spec ", "Spec name") + .option("--json", "Output as JSON (default)") + .option("--yaml", "Output as YAML") + .action(async (options: SpecOptions) => { + const spinner = ora("Fetching spec...").start() + + try { + const service = await getOpenAPIService() + const { owner, name } = resolveProject(options.project) + const project = await service.getProject(owner, name) + const spec = await service.getSpec(project, options.at, options.spec) + + spinner.stop() + + if (options.yaml) { + console.log(yaml.stringify(spec, { aliasDuplicateObjects: false })) + } else { + console.log(JSON.stringify(spec, null, 2)) + } + } catch (error) { + spinner.fail("Failed to fetch spec") + console.error(chalk.red(error instanceof Error ? error.message : "Unknown error")) + process.exit(1) + } + }) +} diff --git a/packages/cli/src/config.ts b/packages/cli/src/config.ts new file mode 100644 index 00000000..90ec81ce --- /dev/null +++ b/packages/cli/src/config.ts @@ -0,0 +1,62 @@ +import * as fs from "fs/promises" +import * as path from "path" +import * as os from "os" +import { z } from "zod" + +const SessionSchema = z.object({ + sessionId: z.string().uuid(), + createdAt: z.string().datetime(), +}) + +export type Session = z.infer + +const CONFIG_DIR = ".framna-docs" +const SESSION_FILE = "session.json" + +function getConfigDir(): string { + return path.join(os.homedir(), CONFIG_DIR) +} + +function getSessionPath(): string { + return path.join(getConfigDir(), SESSION_FILE) +} + +export async function getSession(): Promise { + try { + const content = await fs.readFile(getSessionPath(), "utf-8") + const data = JSON.parse(content) + return SessionSchema.parse(data) + } catch { + return null + } +} + +export async function saveSession(sessionId: string): Promise { + const configDir = getConfigDir() + await fs.mkdir(configDir, { recursive: true, mode: 0o700 }) + + const session: Session = { + sessionId, + createdAt: new Date().toISOString(), + } + + await fs.writeFile(getSessionPath(), JSON.stringify(session, null, 2), { mode: 0o600 }) +} + +export async function deleteSession(): Promise { + try { + await fs.unlink(getSessionPath()) + } catch { + // Ignore if file doesn't exist + } +} + +export function getServerUrl(): string { + const url = process.env.FRAMNA_DOCS_URL + if (!url) { + // Default to localhost in development, require explicit URL in production + return "http://localhost:3000" + } + return url +} + diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts new file mode 100644 index 00000000..d47523b3 --- /dev/null +++ b/packages/cli/src/index.ts @@ -0,0 +1,59 @@ +#!/usr/bin/env node + +import { Command } from "commander" +import { createAuthCommand } from "./commands/auth/index.js" +import { + createProjectsCommand, + createProjectsListCommand, + createProjectsGetCommand, +} from "./commands/projects.js" +import { + createEndpointsCommand, + createEndpointsListCommand, + createEndpointsSearchCommand, + createEndpointGetCommand, +} from "./commands/endpoints.js" +import { + createSchemasCommand, + createSchemasListCommand, + createSchemasGetCommand, +} from "./commands/schemas.js" +import { createSpecCommand } from "./commands/spec.js" +import { createCacheCommand } from "./commands/cache.js" + +const program = new Command() + +program + .name("framna-docs") + .description("CLI for Framna Docs - OpenAPI documentation portal") + .version("0.1.0") + +// Auth commands +program.addCommand(createAuthCommand()) + +// Project commands +const projects = createProjectsCommand() +projects.addCommand(createProjectsListCommand()) +projects.addCommand(createProjectsGetCommand()) +program.addCommand(projects) + +// Endpoint commands +const endpoints = createEndpointsCommand() +endpoints.addCommand(createEndpointsListCommand()) +endpoints.addCommand(createEndpointsSearchCommand()) +endpoints.addCommand(createEndpointGetCommand()) +program.addCommand(endpoints) + +// Schema commands +const schemas = createSchemasCommand() +schemas.addCommand(createSchemasListCommand()) +schemas.addCommand(createSchemasGetCommand()) +program.addCommand(schemas) + +// Spec command +program.addCommand(createSpecCommand()) + +// Cache commands +program.addCommand(createCacheCommand()) + +program.parse() diff --git a/packages/cli/src/openapi/OpenAPIService.ts b/packages/cli/src/openapi/OpenAPIService.ts new file mode 100644 index 00000000..40b42c65 --- /dev/null +++ b/packages/cli/src/openapi/OpenAPIService.ts @@ -0,0 +1,228 @@ +import SwaggerParser from "@apidevtools/swagger-parser" +import { OpenAPIV3 } from "openapi-types" +import yaml from "yaml" +import { APIClient } from "../api.js" +import { SpecCache, ProjectsCache, ProjectDetailsCache } from "../cache/index.js" +import { Project, ProjectSummary, Version, OpenApiSpecification, EndpointSummary, EndpointSlice } from "../types.js" + +export class OpenAPIService { + private client: APIClient + private specCache: SpecCache + private projectsCache: ProjectsCache + private projectDetailsCache: ProjectDetailsCache + + constructor(client: APIClient, sessionToken: string) { + this.client = client + this.specCache = new SpecCache() + this.projectsCache = new ProjectsCache(sessionToken) + this.projectDetailsCache = new ProjectDetailsCache() + } + + async listProjects(): Promise { + const cached = await this.projectsCache.getProjects() + if (cached) return cached + const { projects } = await this.client.get<{ projects: ProjectSummary[] }>("/api/cli/projects") + await this.projectsCache.setProjects(projects) + return projects + } + + async getProject(owner: string, name: string): Promise { + const cached = await this.projectDetailsCache.getProject(owner, name) + if (cached) return cached + const { project } = await this.client.get<{ project: Project }>(`/api/cli/projects/${owner}/${name}`) + await this.projectDetailsCache.setProject(owner, name, project) + return project + } + + async getSpec(project: Project, versionName?: string, specName?: string): Promise { + const version = this.findVersion(project, versionName) + if (!version) throw new Error(`Version not found: ${versionName || "default"}`) + const spec = this.findSpec(version, specName) + if (!spec) throw new Error(`Spec not found: ${specName || "default"}`) + + const cacheKey = this.extractCacheKey(spec.url) + + // Only use cache for specs with a stable cache key + if (cacheKey) { + const cached = await this.specCache.getSpec(cacheKey) + if (cached) return cached + } + + const raw = await this.client.getRaw(spec.url) + const parsed = yaml.parse(raw) as OpenAPIV3.Document + + // Try to bundle (resolves external refs), fall back to parsed if refs are broken + let result: OpenAPIV3.Document + try { + result = await SwaggerParser.bundle(parsed) as OpenAPIV3.Document + } catch { + // External refs may be broken (e.g., remote specs with local file refs) + result = parsed + } + + if (cacheKey) { + await this.specCache.setSpec(cacheKey, result) + } + + return result + } + + async listEndpoints(project: Project, versionName?: string, specName?: string): Promise { + const spec = await this.getSpec(project, versionName, specName) + const endpoints: EndpointSummary[] = [] + const methods = ["get", "post", "put", "delete", "patch", "options", "head"] as const + for (const [path, pathItem] of Object.entries(spec.paths || {})) { + if (!pathItem) continue + for (const method of methods) { + const op = (pathItem as Record)[method] + if (op) { + endpoints.push({ path, method: method.toUpperCase(), summary: op.summary, operationId: op.operationId, tags: op.tags }) + } + } + } + return endpoints + } + + async getEndpointDetails(project: Project, path: string, method: string, versionName?: string, specName?: string): Promise { + const spec = await this.getSpec(project, versionName, specName) + const pathItem = spec.paths?.[path] + if (!pathItem) return null + return (pathItem as Record)[method.toLowerCase()] || null + } + + async searchEndpoints(project: Project, query: string, versionName?: string, specName?: string): Promise { + const endpoints = await this.listEndpoints(project, versionName, specName) + const q = query.toLowerCase() + return endpoints.filter(e => + e.path.toLowerCase().includes(q) || + e.summary?.toLowerCase().includes(q) || + e.operationId?.toLowerCase().includes(q) || + e.tags?.some(t => t.toLowerCase().includes(q)) + ) + } + + async listSchemas(project: Project, versionName?: string, specName?: string): Promise { + const spec = await this.getSpec(project, versionName, specName) + return Object.keys(spec.components?.schemas || {}) + } + + async getSchema(project: Project, schemaName: string, versionName?: string, specName?: string): Promise { + const spec = await this.getSpec(project, versionName, specName) + return spec.components?.schemas?.[schemaName] as OpenAPIV3.SchemaObject || null + } + + async getMethodsForPath( + project: Project, + path: string, + versionName?: string, + specName?: string + ): Promise { + const spec = await this.getSpec(project, versionName, specName) + const pathItem = spec.paths?.[path] + if (!pathItem) return [] + + const methods = ["get", "post", "put", "delete", "patch", "options", "head"] as const + return methods.filter(m => (pathItem as Record)[m] !== undefined) + } + + async getEndpointSlice( + project: Project, + path: string, + method: string, + versionName?: string, + specName?: string + ): Promise { + const spec = await this.getSpec(project, versionName, specName) + const pathItem = spec.paths?.[path] + if (!pathItem) return null + + const methodLower = method.toLowerCase() as "get" | "post" | "put" | "delete" | "patch" | "options" | "head" + const operation = (pathItem as Record)[methodLower] + if (!operation) return null + + // Collect $ref schema names from the operation + const schemaNames = new Set() + const collectRefs = (obj: unknown) => { + if (!obj || typeof obj !== "object") return + const record = obj as Record + if (record.$ref && typeof record.$ref === "string") { + const match = record.$ref.match(/#\/components\/schemas\/(.+)/) + if (match) schemaNames.add(match[1]) + } + for (const value of Object.values(record)) { + if (Array.isArray(value)) { + for (const item of value) collectRefs(item) + } else { + collectRefs(value) + } + } + } + collectRefs(operation) + + // Recursively collect nested schema refs + const collectNestedRefs = (name: string, visited: Set) => { + if (visited.has(name)) return + visited.add(name) + const schema = spec.components?.schemas?.[name] + if (schema) { + collectRefs(schema) + for (const newName of Array.from(schemaNames)) { + if (!visited.has(newName)) { + collectNestedRefs(newName, visited) + } + } + } + } + const visited = new Set() + for (const name of Array.from(schemaNames)) { + collectNestedRefs(name, visited) + } + + // Build schemas object + const schemas: Record = {} + for (const name of Array.from(schemaNames)) { + const schema = spec.components?.schemas?.[name] + if (schema) schemas[name] = schema + } + + // Construct valid OpenAPI 3.0 document + const slice: OpenAPIV3.Document = { + openapi: "3.0.0", + info: { + title: `${method.toUpperCase()} ${path}`, + version: spec.info?.version || "1.0.0", + }, + paths: { + [path]: { + [methodLower]: operation, + } as OpenAPIV3.PathItemObject, + }, + } + + // Add components.schemas if any + if (Object.keys(schemas).length > 0) { + slice.components = { schemas } + } + + return slice + } + + private findVersion(project: Project, name?: string): Version | undefined { + if (!name) return project.versions.find(v => v.isDefault) || project.versions[0] + return project.versions.find(v => v.name === name) + } + + private findSpec(version: Version, name?: string): OpenApiSpecification | undefined { + if (!name) return version.specifications.find(s => s.isDefault) || version.specifications[0] + return version.specifications.find(s => s.name === name) + } + + private extractCacheKey(url: string): string | null { + // Local specs: /api/blob/...?ref= - cache by commit SHA + const refMatch = url.match(/\?ref=(.+)$/) + if (refMatch) return refMatch[1] + + // Remote specs: /api/remotes/... - don't cache (content changes) + return null + } +} diff --git a/packages/cli/src/openapi/index.ts b/packages/cli/src/openapi/index.ts new file mode 100644 index 00000000..cdb9bdf4 --- /dev/null +++ b/packages/cli/src/openapi/index.ts @@ -0,0 +1 @@ +export { OpenAPIService } from "./OpenAPIService.js" diff --git a/packages/cli/src/types.ts b/packages/cli/src/types.ts new file mode 100644 index 00000000..b08e061f --- /dev/null +++ b/packages/cli/src/types.ts @@ -0,0 +1,44 @@ +import { OpenAPIV3 } from "openapi-types" + +export interface EndpointSummary { + path: string + method: string + summary?: string + operationId?: string + tags?: string[] +} + +// EndpointSlice is a valid OpenAPI 3.0 document containing a single endpoint +export type EndpointSlice = OpenAPIV3.Document + +export interface ProjectSummary { + id: string + name: string + displayName: string + owner: string + imageURL?: string + url?: string + ownerUrl: string +} + +export interface OpenApiSpecification { + id: string + name: string + url: string + isDefault: boolean +} + +export interface Version { + id: string + name: string + specifications: OpenApiSpecification[] + isDefault: boolean +} + +export interface Project { + id: string + name: string + displayName: string + versions: Version[] + owner: string +} diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json new file mode 100644 index 00000000..710db5d2 --- /dev/null +++ b/packages/cli/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022"], + "outDir": "./dist", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/src/app/api/blob/[owner]/[repository]/[...path]/route.ts b/src/app/api/blob/[owner]/[repository]/[...path]/route.ts index 1dc58c90..5c3ce3c6 100644 --- a/src/app/api/blob/[owner]/[repository]/[...path]/route.ts +++ b/src/app/api/blob/[owner]/[repository]/[...path]/route.ts @@ -1,15 +1,34 @@ import { NextRequest, NextResponse } from "next/server" import { session, userGitHubClient } from "@/composition" import { makeUnauthenticatedAPIErrorResponse } from "@/common" +import { getSessionFromRequest, createSessionStore } from "@/app/api/cli/middleware" +import { createFullGitHubClientForCLI } from "@/app/api/cli/helpers" + +async function getCLIGitHubClient(req: NextRequest) { + const sessionId = getSessionFromRequest(req) + if (!sessionId) return null + const sessionStore = createSessionStore() + const cliSession = await sessionStore.get(sessionId) + if (!cliSession) return null + return createFullGitHubClientForCLI({ + session: cliSession, + sessionStore, + }) +} export async function GET(req: NextRequest, { params }: { params: Promise<{ owner: string; repository: string; path: string[] }> }) { - const isAuthenticated = await session.getIsAuthenticated() - if (!isAuthenticated) { + // Try web session first, then CLI session + const isWebAuthenticated = await session.getIsAuthenticated() + const cliGitHubClient = !isWebAuthenticated ? await getCLIGitHubClient(req) : null + + if (!isWebAuthenticated && !cliGitHubClient) { return makeUnauthenticatedAPIErrorResponse() } + + const gitHubClient = cliGitHubClient || userGitHubClient const { path: paramsPath, owner, repository } = await params const path = paramsPath.join("/") - const item = await userGitHubClient.getRepositoryContent({ + const item = await gitHubClient.getRepositoryContent({ repositoryOwner: owner, repositoryName: repository, path: path, diff --git a/src/app/api/cli/auth/device/route.ts b/src/app/api/cli/auth/device/route.ts new file mode 100644 index 00000000..665b85dc --- /dev/null +++ b/src/app/api/cli/auth/device/route.ts @@ -0,0 +1,36 @@ +import { NextResponse } from "next/server" +import { CLIDeviceFlowService } from "@/features/cli/domain" +import { RedisCLISessionStore } from "@/features/cli/data" +import RedisKeyValueStore from "@/common/key-value-store/RedisKeyValueStore" +import { env } from "@/common" + +const sessionStore = new RedisCLISessionStore({ + store: new RedisKeyValueStore(env.getOrThrow("REDIS_URL")) +}) + +const deviceFlowService = new CLIDeviceFlowService({ + sessionStore, + clientId: env.getOrThrow("GITHUB_CLIENT_ID"), + clientSecret: env.getOrThrow("GITHUB_CLIENT_SECRET"), +}) + +export async function POST(): Promise { + try { + const result = await deviceFlowService.initiateDeviceFlow() + + return NextResponse.json({ + userCode: result.userCode, + verificationUri: result.verificationUri, + deviceCode: result.deviceCode, + sessionId: result.sessionId, + expiresIn: result.expiresIn, + interval: result.interval, + }) + } catch (error) { + console.error("Device flow initiation failed:", error) + return NextResponse.json( + { error: "Failed to initiate device flow" }, + { status: 500 } + ) + } +} diff --git a/src/app/api/cli/auth/logout/route.ts b/src/app/api/cli/auth/logout/route.ts new file mode 100644 index 00000000..6b020264 --- /dev/null +++ b/src/app/api/cli/auth/logout/route.ts @@ -0,0 +1,31 @@ +import { NextRequest, NextResponse } from "next/server" +import { RedisCLISessionStore } from "@/features/cli/data" +import RedisKeyValueStore from "@/common/key-value-store/RedisKeyValueStore" +import { env } from "@/common" + +function getSessionId(request: NextRequest): string | null { + const authHeader = request.headers.get("Authorization") + if (authHeader?.startsWith("Bearer ")) { + return authHeader.slice(7) + } + return null +} + +const sessionStore = new RedisCLISessionStore({ + store: new RedisKeyValueStore(env.getOrThrow("REDIS_URL")) +}) + +export async function POST(request: NextRequest): Promise { + const sessionId = getSessionId(request) + + if (!sessionId) { + return NextResponse.json( + { error: "Authorization header required" }, + { status: 401 } + ) + } + + await sessionStore.delete(sessionId) + + return NextResponse.json({ success: true }) +} diff --git a/src/app/api/cli/auth/status/route.ts b/src/app/api/cli/auth/status/route.ts new file mode 100644 index 00000000..8458f8fb --- /dev/null +++ b/src/app/api/cli/auth/status/route.ts @@ -0,0 +1,110 @@ +import { NextRequest, NextResponse } from "next/server" +import { CLIDeviceFlowService } from "@/features/cli/domain" +import { RedisCLISessionStore } from "@/features/cli/data" +import RedisKeyValueStore from "@/common/key-value-store/RedisKeyValueStore" +import { env } from "@/common" + +const sessionStore = new RedisCLISessionStore({ + store: new RedisKeyValueStore(env.getOrThrow("REDIS_URL")) +}) + +const deviceFlowService = new CLIDeviceFlowService({ + sessionStore, + clientId: env.getOrThrow("GITHUB_CLIENT_ID"), + clientSecret: env.getOrThrow("GITHUB_CLIENT_SECRET"), +}) + +// Rate limiting: max 1 request per 5 seconds per IP +const RATE_LIMIT_WINDOW_MS = 5000 +const rateLimitMap = new Map() + +// Cleanup stale entries periodically (every 60 seconds) +setInterval(() => { + const now = Date.now() + const entries = Array.from(rateLimitMap.entries()) + for (let i = 0; i < entries.length; i++) { + const [ip, timestamp] = entries[i] + if (now - timestamp > RATE_LIMIT_WINDOW_MS) { + rateLimitMap.delete(ip) + } + } +}, 60000) + +function getClientIP(request: NextRequest): string { + // Check common proxy headers + const forwarded = request.headers.get("x-forwarded-for") + if (forwarded) { + return forwarded.split(",")[0].trim() + } + const realIP = request.headers.get("x-real-ip") + if (realIP) { + return realIP + } + // Fallback to a default value for local development + return "127.0.0.1" +} + +function checkRateLimit(ip: string): boolean { + const now = Date.now() + const lastRequest = rateLimitMap.get(ip) + + if (lastRequest && now - lastRequest < RATE_LIMIT_WINDOW_MS) { + return false // Rate limited + } + + rateLimitMap.set(ip, now) + return true // Allowed +} + +interface StatusRequestBody { + device_code?: string +} + +export async function POST(request: NextRequest): Promise { + // Apply rate limiting + const clientIP = getClientIP(request) + if (!checkRateLimit(clientIP)) { + return NextResponse.json( + { error: "Too many requests. Please wait 5 seconds between requests." }, + { status: 429 } + ) + } + + let body: StatusRequestBody + try { + body = await request.json() as StatusRequestBody + } catch { + return NextResponse.json( + { error: "Invalid JSON body" }, + { status: 400 } + ) + } + + const deviceCode = body.device_code + + if (!deviceCode) { + return NextResponse.json( + { error: "device_code required in request body" }, + { status: 400 } + ) + } + + try { + const session = await deviceFlowService.pollForToken(deviceCode) + + if (!session) { + return NextResponse.json({ status: "pending" }) + } + + return NextResponse.json({ + status: "complete", + sessionId: session.sessionId, + }) + } catch (error) { + const message = error instanceof Error ? error.message : "Unknown error" + return NextResponse.json({ status: "error", error: message }, { status: 500 }) + } +} + +// Export for testing +export { checkRateLimit, rateLimitMap, getClientIP } diff --git a/src/app/api/cli/helpers.ts b/src/app/api/cli/helpers.ts new file mode 100644 index 00000000..76ea132d --- /dev/null +++ b/src/app/api/cli/helpers.ts @@ -0,0 +1,98 @@ +import { env, listFromCommaSeparatedString } from "@/common" +import IGitHubGraphQLClient from "@/features/projects/domain/IGitHubGraphQLClient" +import IGitHubClient from "@/common/github/IGitHubClient" +import IProjectListDataSource from "@/features/projects/domain/IProjectListDataSource" +import IProjectDetailsDataSource from "@/features/projects/domain/IProjectDetailsDataSource" +import { + GitHubProjectListDataSource, + GitHubProjectDetailsDataSource, + GitHubLoginDataSource, +} from "@/features/projects/data" +import RsaEncryptionService from "@/features/encrypt/EncryptionService" +import RemoteConfigEncoder from "@/features/projects/domain/RemoteConfigEncoder" +import GitHubOAuthTokenRefresher from "@/features/auth/data/GitHubOAuthTokenRefresher" +import { + CLISession, + ICLISessionStore, + TokenRefreshingCLIGitHubClient, + TokenRefreshingCLIGraphQLClient, +} from "@/features/cli/domain" + +const tokenRefresher = new GitHubOAuthTokenRefresher({ + clientId: env.getOrThrow("GITHUB_CLIENT_ID"), + clientSecret: env.getOrThrow("GITHUB_CLIENT_SECRET"), +}) + +export interface CLIGitHubClientConfig { + session: CLISession + sessionStore: ICLISessionStore +} + +export function createGitHubClientForCLI( + config: CLIGitHubClientConfig +): IGitHubGraphQLClient { + return new TokenRefreshingCLIGraphQLClient({ + session: config.session, + sessionStore: config.sessionStore, + tokenRefresher, + }) +} + +export function createFullGitHubClientForCLI( + config: CLIGitHubClientConfig +): IGitHubClient { + return new TokenRefreshingCLIGitHubClient({ + session: config.session, + sessionStore: config.sessionStore, + tokenRefresher, + }) +} + +export function createProjectListDataSourceForCLI( + gitHubClient: IGitHubGraphQLClient +): IProjectListDataSource { + const repositoryNameSuffix = env.getOrThrow("REPOSITORY_NAME_SUFFIX") + const projectConfigurationFilename = env.getOrThrow( + "FRAMNA_DOCS_PROJECT_CONFIGURATION_FILENAME" + ) + const hiddenRepositories = listFromCommaSeparatedString(env.get("HIDDEN_REPOSITORIES")) + + return new GitHubProjectListDataSource({ + loginsDataSource: new GitHubLoginDataSource({ + graphQlClient: gitHubClient, + }), + graphQlClient: gitHubClient, + repositoryNameSuffix, + projectConfigurationFilename, + hiddenRepositories, + }) +} + +export function createProjectDetailsDataSourceForCLI( + gitHubClient: IGitHubGraphQLClient +): IProjectDetailsDataSource { + const repositoryNameSuffix = env.getOrThrow("REPOSITORY_NAME_SUFFIX") + const projectConfigurationFilename = env.getOrThrow( + "FRAMNA_DOCS_PROJECT_CONFIGURATION_FILENAME" + ) + + const encryptionService = new RsaEncryptionService({ + publicKey: Buffer.from( + env.getOrThrow("ENCRYPTION_PUBLIC_KEY_BASE_64"), + "base64" + ).toString("utf-8"), + privateKey: Buffer.from( + env.getOrThrow("ENCRYPTION_PRIVATE_KEY_BASE_64"), + "base64" + ).toString("utf-8"), + }) + const remoteConfigEncoder = new RemoteConfigEncoder(encryptionService) + + return new GitHubProjectDetailsDataSource({ + graphQlClient: gitHubClient, + repositoryNameSuffix, + projectConfigurationFilename, + encryptionService, + remoteConfigEncoder, + }) +} diff --git a/src/app/api/cli/middleware.ts b/src/app/api/cli/middleware.ts new file mode 100644 index 00000000..354e1ec7 --- /dev/null +++ b/src/app/api/cli/middleware.ts @@ -0,0 +1,51 @@ +import { NextRequest, NextResponse } from "next/server" +import { RedisCLISessionStore } from "@/features/cli/data/RedisCLISessionStore" +import RedisKeyValueStore from "@/common/key-value-store/RedisKeyValueStore" +import { env } from "@/common" +import { CLISession, ICLISessionStore } from "@/features/cli/domain" + +export interface CLIAuthContext { + session: CLISession + sessionStore: ICLISessionStore +} + +export function getSessionFromRequest(request: NextRequest): string | null { + const authHeader = request.headers.get("Authorization") + if (authHeader?.startsWith("Bearer ")) { + return authHeader.slice(7) + } + return null +} + +export function createSessionStore(): ICLISessionStore { + return new RedisCLISessionStore({ + store: new RedisKeyValueStore(env.getOrThrow("REDIS_URL")) + }) +} + +export function withAuth( + handler: (request: NextRequest, auth: CLIAuthContext) => Promise> +): (request: NextRequest) => Promise> { + return async (request: NextRequest) => { + const sessionId = getSessionFromRequest(request) + + if (!sessionId) { + return NextResponse.json( + { error: "Authorization header required" }, + { status: 401 } + ) + } + + const sessionStore = createSessionStore() + const session = await sessionStore.get(sessionId) + + if (!session) { + return NextResponse.json( + { error: "Invalid or expired session" }, + { status: 401 } + ) + } + + return handler(request, { session, sessionStore }) + } +} diff --git a/src/app/api/cli/projects/[owner]/[name]/route.ts b/src/app/api/cli/projects/[owner]/[name]/route.ts new file mode 100644 index 00000000..b23e3c97 --- /dev/null +++ b/src/app/api/cli/projects/[owner]/[name]/route.ts @@ -0,0 +1,46 @@ +import { NextRequest, NextResponse } from "next/server" +import { withAuth, CLIAuthContext } from "../../../middleware" +import { + createGitHubClientForCLI, + createProjectDetailsDataSourceForCLI, +} from "../../../helpers" + +type RouteParams = { params: Promise<{ owner: string; name: string }> } + +async function handler( + _request: NextRequest, + auth: CLIAuthContext, + routeParams: RouteParams +): Promise { + try { + const { owner, name } = await routeParams.params + const gitHubClient = createGitHubClientForCLI({ + session: auth.session, + sessionStore: auth.sessionStore, + }) + + // Get full details + const detailsDataSource = createProjectDetailsDataSourceForCLI(gitHubClient) + const project = await detailsDataSource.getProjectDetails(owner, name) + + if (!project) { + return NextResponse.json({ error: "Project not found" }, { status: 404 }) + } + + return NextResponse.json({ project }) + } catch (error) { + console.error("Failed to fetch project:", error) + return NextResponse.json( + { error: "Failed to fetch project" }, + { status: 500 } + ) + } +} + +export async function GET( + request: NextRequest, + routeParams: RouteParams +): Promise { + const wrappedHandler = withAuth((req, auth) => handler(req, auth, routeParams)) + return wrappedHandler(request) +} diff --git a/src/app/api/cli/projects/route.ts b/src/app/api/cli/projects/route.ts new file mode 100644 index 00000000..79b68fdd --- /dev/null +++ b/src/app/api/cli/projects/route.ts @@ -0,0 +1,29 @@ +import { NextRequest, NextResponse } from "next/server" +import { withAuth, CLIAuthContext } from "../middleware" +import { + createGitHubClientForCLI, + createProjectListDataSourceForCLI, +} from "../helpers" + +async function handler( + _request: NextRequest, + auth: CLIAuthContext +): Promise { + try { + const gitHubClient = createGitHubClientForCLI({ + session: auth.session, + sessionStore: auth.sessionStore, + }) + const dataSource = createProjectListDataSourceForCLI(gitHubClient) + const projects = await dataSource.getProjectList() + return NextResponse.json({ projects }) + } catch (error) { + console.error("Failed to fetch projects:", error) + return NextResponse.json( + { error: "Failed to fetch projects" }, + { status: 500 } + ) + } +} + +export const GET = withAuth(handler) diff --git a/src/app/api/remotes/[encodedRemoteConfig]/route.ts b/src/app/api/remotes/[encodedRemoteConfig]/route.ts index b79ffcd7..32fa07ee 100644 --- a/src/app/api/remotes/[encodedRemoteConfig]/route.ts +++ b/src/app/api/remotes/[encodedRemoteConfig]/route.ts @@ -1,15 +1,26 @@ import { NextRequest, NextResponse } from "next/server" import { remoteConfigEncoder, session } from "@/composition" import { env, makeAPIErrorResponse, makeUnauthenticatedAPIErrorResponse } from "@/common" -import { downloadFile, checkIfJsonOrYaml, ErrorName } from "@/common/utils/fileUtils"; +import { downloadFile, checkIfJsonOrYaml, ErrorName } from "@/common/utils/fileUtils" +import { getSessionFromRequest, createSessionStore } from "@/app/api/cli/middleware" + +async function isCLIAuthenticated(req: NextRequest): Promise { + const sessionId = getSessionFromRequest(req) + if (!sessionId) return false + const sessionStore = createSessionStore() + const cliSession = await sessionStore.get(sessionId) + return cliSession !== null +} interface RemoteSpecificationParams { encodedRemoteConfig: string } -export async function GET(_req: NextRequest, { params }: { params: Promise }) { - const isAuthenticated = await session.getIsAuthenticated() - if (!isAuthenticated) { +export async function GET(req: NextRequest, { params }: { params: Promise }) { + const isWebAuthenticated = await session.getIsAuthenticated() + const isCLIAuth = !isWebAuthenticated ? await isCLIAuthenticated(req) : false + + if (!isWebAuthenticated && !isCLIAuth) { return makeUnauthenticatedAPIErrorResponse() } diff --git a/src/features/cli/data/RedisCLISessionStore.ts b/src/features/cli/data/RedisCLISessionStore.ts new file mode 100644 index 00000000..99b52879 --- /dev/null +++ b/src/features/cli/data/RedisCLISessionStore.ts @@ -0,0 +1,55 @@ +import IKeyValueStore from "@/common/key-value-store/IKeyValueStore" +import { ICLISessionStore, CLISession, CLISessionSchema } from "../domain" +import { randomUUID } from "crypto" + +const SESSION_TTL_SECONDS = 30 * 24 * 60 * 60 // 30 days +const PENDING_TTL_SECONDS = 15 * 60 // 15 minutes (GitHub device code expiry) + +interface RedisCLISessionStoreConfig { + store: IKeyValueStore +} + +export class RedisCLISessionStore implements ICLISessionStore { + private store: IKeyValueStore + + constructor(config: RedisCLISessionStoreConfig) { + this.store = config.store + } + + async get(sessionId: string): Promise { + const data = await this.store.get(`cli:session:${sessionId}`) + if (!data) return null + return CLISessionSchema.parse(JSON.parse(data)) + } + + async set(session: CLISession): Promise { + await this.store.setExpiring( + `cli:session:${session.sessionId}`, + JSON.stringify(session), + SESSION_TTL_SECONDS + ) + } + + async delete(sessionId: string): Promise { + await this.store.delete(`cli:session:${sessionId}`) + } + + async createPendingSession(deviceCode: string): Promise { + const sessionId = randomUUID() + await this.store.setExpiring( + `cli:pending:${deviceCode}`, + sessionId, + PENDING_TTL_SECONDS + ) + return sessionId + } + + async getPendingSession(deviceCode: string): Promise { + return await this.store.get(`cli:pending:${deviceCode}`) + } + + async completePendingSession(deviceCode: string, session: CLISession): Promise { + await this.set(session) + await this.store.delete(`cli:pending:${deviceCode}`) + } +} diff --git a/src/features/cli/data/index.ts b/src/features/cli/data/index.ts new file mode 100644 index 00000000..faef22d1 --- /dev/null +++ b/src/features/cli/data/index.ts @@ -0,0 +1 @@ +export { RedisCLISessionStore } from "./RedisCLISessionStore" diff --git a/src/features/cli/domain/CLIDeviceFlowService.ts b/src/features/cli/domain/CLIDeviceFlowService.ts new file mode 100644 index 00000000..df12e5fe --- /dev/null +++ b/src/features/cli/domain/CLIDeviceFlowService.ts @@ -0,0 +1,87 @@ +import { createDeviceCode, exchangeDeviceCode } from "@octokit/oauth-methods" +import { ICLISessionStore } from "./ICLISessionStore" +import { CLISession } from "./CLISession" + +export interface DeviceFlowInitiation { + deviceCode: string + userCode: string + verificationUri: string + expiresIn: number + interval: number + sessionId: string +} + +interface CLIDeviceFlowServiceConfig { + sessionStore: ICLISessionStore + clientId: string + clientSecret: string +} + +export class CLIDeviceFlowService { + private sessionStore: ICLISessionStore + private clientId: string + private clientSecret: string + + constructor(config: CLIDeviceFlowServiceConfig) { + this.sessionStore = config.sessionStore + this.clientId = config.clientId + this.clientSecret = config.clientSecret + } + + async getSessionToken(sessionId: string | undefined): Promise { + if (!sessionId) return null + return await this.sessionStore.get(sessionId) + } + + async initiateDeviceFlow(): Promise { + const response = await createDeviceCode({ + clientType: "github-app", + clientId: this.clientId, + }) + + const sessionId = await this.sessionStore.createPendingSession(response.data.device_code) + + return { + deviceCode: response.data.device_code, + userCode: response.data.user_code, + verificationUri: response.data.verification_uri, + expiresIn: response.data.expires_in, + interval: response.data.interval, + sessionId, + } + } + + async pollForToken(deviceCode: string): Promise { + const sessionId = await this.sessionStore.getPendingSession(deviceCode) + if (!sessionId) return null + + try { + const response = await exchangeDeviceCode({ + clientType: "github-app", + clientId: this.clientId, + clientSecret: this.clientSecret, + code: deviceCode, + }) + + const auth = response.authentication + const session: CLISession = { + sessionId, + accessToken: auth.token, + refreshToken: "refreshToken" in auth ? auth.refreshToken : undefined, + expiresAt: "expiresAt" in auth ? auth.expiresAt : undefined, + createdAt: new Date().toISOString(), + } + + await this.sessionStore.completePendingSession(deviceCode, session) + return session + } catch (error) { + // Check for authorization_pending or slow_down errors + const errorMessage = String(error) + if (errorMessage.includes("authorization_pending") || + errorMessage.includes("slow_down")) { + return null + } + throw error + } + } +} diff --git a/src/features/cli/domain/CLISession.ts b/src/features/cli/domain/CLISession.ts new file mode 100644 index 00000000..dbc8c1eb --- /dev/null +++ b/src/features/cli/domain/CLISession.ts @@ -0,0 +1,11 @@ +import { z } from "zod" + +export const CLISessionSchema = z.object({ + sessionId: z.string().uuid(), + accessToken: z.string(), + refreshToken: z.string().optional(), + expiresAt: z.string().datetime().optional(), + createdAt: z.string().datetime(), +}) + +export type CLISession = z.infer diff --git a/src/features/cli/domain/ICLISessionStore.ts b/src/features/cli/domain/ICLISessionStore.ts new file mode 100644 index 00000000..c7ee829c --- /dev/null +++ b/src/features/cli/domain/ICLISessionStore.ts @@ -0,0 +1,10 @@ +import { CLISession } from "./CLISession" + +export interface ICLISessionStore { + get(sessionId: string): Promise + set(session: CLISession): Promise + delete(sessionId: string): Promise + createPendingSession(deviceCode: string): Promise + getPendingSession(deviceCode: string): Promise + completePendingSession(deviceCode: string, session: CLISession): Promise +} diff --git a/src/features/cli/domain/TokenRefreshingCLIGitHubClient.ts b/src/features/cli/domain/TokenRefreshingCLIGitHubClient.ts new file mode 100644 index 00000000..890dc3fb --- /dev/null +++ b/src/features/cli/domain/TokenRefreshingCLIGitHubClient.ts @@ -0,0 +1,137 @@ +import { Octokit } from "octokit" +import IGitHubClient, { + GraphQLQueryRequest, + GraphQlQueryResponse, + GetRepositoryContentRequest, + RepositoryContent, + GetPullRequestFilesRequest, + PullRequestFile, + GetPullRequestCommentsRequest, + PullRequestComment, + AddCommentToPullRequestRequest, + UpdatePullRequestCommentRequest, + CompareCommitsRequest, + CompareCommitsResponse, +} from "@/common/github/IGitHubClient" +import { IOAuthTokenRefresher } from "@/features/auth/domain" +import { ICLISessionStore } from "./ICLISessionStore" +import { CLISession } from "./CLISession" + +type GitHubContentItem = { download_url: string } + +interface TokenRefreshingCLIGitHubClientConfig { + session: CLISession + sessionStore: ICLISessionStore + tokenRefresher: IOAuthTokenRefresher +} + +/** + * GitHub client for CLI that automatically refreshes expired tokens. + * When a 401 error is received, it refreshes the token, updates the session, + * and retries the request. + */ +export class TokenRefreshingCLIGitHubClient implements IGitHubClient { + private octokit: Octokit + private session: CLISession + private readonly sessionStore: ICLISessionStore + private readonly tokenRefresher: IOAuthTokenRefresher + + constructor(config: TokenRefreshingCLIGitHubClientConfig) { + this.session = config.session + this.sessionStore = config.sessionStore + this.tokenRefresher = config.tokenRefresher + this.octokit = new Octokit({ auth: config.session.accessToken }) + } + + private async withTokenRefresh(fn: () => Promise): Promise { + try { + return await fn() + } catch (error) { + if (this.isUnauthorizedError(error) && this.session.refreshToken) { + await this.refreshAndUpdateSession() + return await fn() + } + throw error + } + } + + private isUnauthorizedError(error: unknown): boolean { + if (error && typeof error === "object" && "status" in error) { + return (error as { status: number }).status === 401 + } + return false + } + + private async refreshAndUpdateSession(): Promise { + if (!this.session.refreshToken) { + throw new Error("Cannot refresh token: no refresh token available") + } + + const newTokens = await this.tokenRefresher.refreshOAuthToken({ + accessToken: this.session.accessToken, + refreshToken: this.session.refreshToken, + }) + + // Update session with new tokens + const updatedSession: CLISession = { + ...this.session, + accessToken: newTokens.accessToken, + refreshToken: newTokens.refreshToken, + } + + await this.sessionStore.set(updatedSession) + this.session = updatedSession + this.octokit = new Octokit({ auth: newTokens.accessToken }) + } + + async graphql(request: GraphQLQueryRequest): Promise { + return this.withTokenRefresh(() => + this.octokit.graphql(request.query, request.variables) + ) + } + + async getRepositoryContent( + request: GetRepositoryContentRequest + ): Promise { + return this.withTokenRefresh(async () => { + const response = await this.octokit.rest.repos.getContent({ + owner: request.repositoryOwner, + repo: request.repositoryName, + path: request.path, + ref: request.ref, + }) + const item = response.data as GitHubContentItem + return { downloadURL: item.download_url } + }) + } + + async getPullRequestFiles( + _request: GetPullRequestFilesRequest + ): Promise { + throw new Error("Not implemented for CLI client") + } + + async getPullRequestComments( + _request: GetPullRequestCommentsRequest + ): Promise { + throw new Error("Not implemented for CLI client") + } + + async addCommentToPullRequest( + _request: AddCommentToPullRequestRequest + ): Promise { + throw new Error("Not implemented for CLI client") + } + + async updatePullRequestComment( + _request: UpdatePullRequestCommentRequest + ): Promise { + throw new Error("Not implemented for CLI client") + } + + async compareCommitsWithBasehead( + _request: CompareCommitsRequest + ): Promise { + throw new Error("Not implemented for CLI client") + } +} diff --git a/src/features/cli/domain/TokenRefreshingCLIGraphQLClient.ts b/src/features/cli/domain/TokenRefreshingCLIGraphQLClient.ts new file mode 100644 index 00000000..fa7d1416 --- /dev/null +++ b/src/features/cli/domain/TokenRefreshingCLIGraphQLClient.ts @@ -0,0 +1,82 @@ +import { Octokit } from "octokit" +import IGitHubGraphQLClient, { + GitHubGraphQLClientRequest, + GitHubGraphQLClientResponse, +} from "@/features/projects/domain/IGitHubGraphQLClient" +import { IOAuthTokenRefresher } from "@/features/auth/domain" +import { ICLISessionStore } from "./ICLISessionStore" +import { CLISession } from "./CLISession" + +interface TokenRefreshingCLIGraphQLClientConfig { + session: CLISession + sessionStore: ICLISessionStore + tokenRefresher: IOAuthTokenRefresher +} + +/** + * GraphQL client for CLI that automatically refreshes expired tokens. + * When a 401 error is received, it refreshes the token, updates the session, + * and retries the request. + */ +export class TokenRefreshingCLIGraphQLClient implements IGitHubGraphQLClient { + private octokit: Octokit + private session: CLISession + private readonly sessionStore: ICLISessionStore + private readonly tokenRefresher: IOAuthTokenRefresher + + constructor(config: TokenRefreshingCLIGraphQLClientConfig) { + this.session = config.session + this.sessionStore = config.sessionStore + this.tokenRefresher = config.tokenRefresher + this.octokit = new Octokit({ auth: config.session.accessToken }) + } + + private async withTokenRefresh(fn: () => Promise): Promise { + try { + return await fn() + } catch (error) { + if (this.isUnauthorizedError(error) && this.session.refreshToken) { + await this.refreshAndUpdateSession() + return await fn() + } + throw error + } + } + + private isUnauthorizedError(error: unknown): boolean { + if (error && typeof error === "object" && "status" in error) { + return (error as { status: number }).status === 401 + } + return false + } + + private async refreshAndUpdateSession(): Promise { + if (!this.session.refreshToken) { + throw new Error("Cannot refresh token: no refresh token available") + } + + const newTokens = await this.tokenRefresher.refreshOAuthToken({ + accessToken: this.session.accessToken, + refreshToken: this.session.refreshToken, + }) + + // Update session with new tokens + const updatedSession: CLISession = { + ...this.session, + accessToken: newTokens.accessToken, + refreshToken: newTokens.refreshToken, + } + + await this.sessionStore.set(updatedSession) + this.session = updatedSession + this.octokit = new Octokit({ auth: newTokens.accessToken }) + } + + async graphql( + request: GitHubGraphQLClientRequest + ): Promise { + return this.withTokenRefresh(() => + this.octokit.graphql(request.query, request.variables) + ) + } +} diff --git a/src/features/cli/domain/index.ts b/src/features/cli/domain/index.ts new file mode 100644 index 00000000..bcd48eac --- /dev/null +++ b/src/features/cli/domain/index.ts @@ -0,0 +1,5 @@ +export { CLISessionSchema, type CLISession } from "./CLISession" +export type { ICLISessionStore } from "./ICLISessionStore" +export { CLIDeviceFlowService, type DeviceFlowInitiation } from "./CLIDeviceFlowService" +export { TokenRefreshingCLIGitHubClient } from "./TokenRefreshingCLIGitHubClient" +export { TokenRefreshingCLIGraphQLClient } from "./TokenRefreshingCLIGraphQLClient"