Skip to content

Commit d2e7397

Browse files
authored
Merge pull request #2 from upstash/DX-1537
Dx 1537: Add support for node15
2 parents 87d2664 + ebdf43a commit d2e7397

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

.github/workflows/release.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@ jobs:
3535

3636
- name: Publish
3737
if: "!github.event.release.prerelease"
38-
working-directory: ./dist
3938
run: |
40-
npm pkg delete scripts.prepare
4139
npm publish --access public
4240
4341
- name: Publish release candidate
4442
if: "github.event.release.prerelease"
45-
working-directory: ./dist
4643
run: |
47-
npm pkg delete scripts.prepare
4844
npm publish --access public --tag=canary

bun.lockb

2.21 KB
Binary file not shown.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@modelcontextprotocol/sdk": "^1.0.3",
4141
"chalk": "^5.3.0",
4242
"dotenv": "^16.4.7",
43+
"node-fetch": "^3.3.2",
4344
"zod": "^3.24.1",
4445
"zod-to-json-schema": "^3.24.1"
4546
}

src/http.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { config } from "./config";
22
import { log } from "./log";
33
import { applyMiddlewares } from "./middlewares";
4+
import fetch from "node-fetch";
45

56
export type UpstashRequest = {
67
method: string;
@@ -54,11 +55,13 @@ class HttpClient {
5455
}
5556

5657
const url = [this.baseUrl, ...req.path].join("/");
58+
const token = [config.email, config.apiKey].join(":");
59+
5760
const init: RequestInit = {
5861
method: req.method,
5962
headers: {
6063
"Content-Type": "application/json",
61-
Authorization: `Basic ${btoa([config.email, config.apiKey].join(":"))}`,
64+
Authorization: `Basic ${Buffer.from(token).toString("base64")}`,
6265
},
6366
};
6467

src/tools/redis/command.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { z } from "zod";
22
import { json, tool } from "..";
33
import { log } from "../../log";
4+
import fetch from "node-fetch";
45

56
type RedisCommandResult =
67
| {

0 commit comments

Comments
 (0)