diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6b19245..8e0cdc3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,14 +35,10 @@ jobs: - name: Publish if: "!github.event.release.prerelease" - working-directory: ./dist run: | - npm pkg delete scripts.prepare npm publish --access public - name: Publish release candidate if: "github.event.release.prerelease" - working-directory: ./dist run: | - npm pkg delete scripts.prepare npm publish --access public --tag=canary diff --git a/bun.lockb b/bun.lockb index 59fdac0..3646a9d 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 255c646..893d919 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "@modelcontextprotocol/sdk": "^1.0.3", "chalk": "^5.3.0", "dotenv": "^16.4.7", + "node-fetch": "^3.3.2", "zod": "^3.24.1", "zod-to-json-schema": "^3.24.1" } diff --git a/src/http.ts b/src/http.ts index 5a94503..9725d0d 100644 --- a/src/http.ts +++ b/src/http.ts @@ -1,6 +1,7 @@ import { config } from "./config"; import { log } from "./log"; import { applyMiddlewares } from "./middlewares"; +import fetch from "node-fetch"; export type UpstashRequest = { method: string; @@ -54,11 +55,13 @@ class HttpClient { } const url = [this.baseUrl, ...req.path].join("/"); + const token = [config.email, config.apiKey].join(":"); + const init: RequestInit = { method: req.method, headers: { "Content-Type": "application/json", - Authorization: `Basic ${btoa([config.email, config.apiKey].join(":"))}`, + Authorization: `Basic ${Buffer.from(token).toString("base64")}`, }, }; diff --git a/src/tools/redis/command.ts b/src/tools/redis/command.ts index ea43cc4..304caae 100644 --- a/src/tools/redis/command.ts +++ b/src/tools/redis/command.ts @@ -1,6 +1,7 @@ import { z } from "zod"; import { json, tool } from ".."; import { log } from "../../log"; +import fetch from "node-fetch"; type RedisCommandResult = | {