@atom-forge/rpc 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -171,7 +171,10 @@ async function parseCommandMultipartFormData(request) {
|
|
|
171
171
|
const argsBlob = formData.get("args");
|
|
172
172
|
if (argsBlob instanceof Blob) {
|
|
173
173
|
const buffer = new Uint8Array(await argsBlob.arrayBuffer());
|
|
174
|
-
|
|
174
|
+
// Some runtimes (e.g. Node.js) may not preserve the MIME type of blobs in
|
|
175
|
+
// multipart form data. Fall back to msgpack since that is what the client sends.
|
|
176
|
+
const argsType = argsBlob.type || "application/msgpack";
|
|
177
|
+
switch (argsType) {
|
|
175
178
|
case "application/json":
|
|
176
179
|
try {
|
|
177
180
|
args = JSON.parse(new TextDecoder().decode(buffer)) || {};
|
|
@@ -189,7 +192,7 @@ async function parseCommandMultipartFormData(request) {
|
|
|
189
192
|
}
|
|
190
193
|
break;
|
|
191
194
|
default:
|
|
192
|
-
throw new ParseError(`Unsupported args type: ${
|
|
195
|
+
throw new ParseError(`Unsupported args type: ${argsType}`);
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
198
|
const keys = new Set();
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atom-forge/rpc",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Type-safe RPC framework for TypeScript with Zod validation and middleware support",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"rpc",
|
|
7
|
+
"typescript",
|
|
8
|
+
"zod",
|
|
9
|
+
"type-safe",
|
|
10
|
+
"middleware",
|
|
11
|
+
"api"
|
|
12
|
+
],
|
|
6
13
|
"author": "Gergely Laborci",
|
|
7
14
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
15
|
"type": "module",
|
|
@@ -22,7 +29,9 @@
|
|
|
22
29
|
"LICENSE"
|
|
23
30
|
],
|
|
24
31
|
"scripts": {
|
|
25
|
-
"build": "tsc"
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"prepublishOnly": "bun run scripts/prepublish.ts && bun run build",
|
|
34
|
+
"publish": "npm publish --access public"
|
|
26
35
|
},
|
|
27
36
|
"dependencies": {
|
|
28
37
|
"msgpackr": "^1.11.8"
|