@atom-forge/rpc 0.3.5 → 0.3.7
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.
- package/CHANGELOG.md +27 -27
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
### Fixed
|
|
6
6
|
|
|
7
|
-
- **Node.js / Bun
|
|
7
|
+
- **Node.js / Bun compatibility for file uploads** — some runtimes (e.g. Node.js/undici) do not preserve the MIME type of a blob when using multipart form data. If `argsBlob.type` is empty, the server now falls back to `application/msgpack` instead of throwing a `ParseError`.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
### Added
|
|
14
14
|
|
|
15
|
-
- **Patron License** —
|
|
15
|
+
- **Patron License** — added own license document (`LICENSE`).
|
|
16
16
|
|
|
17
17
|
### Changed
|
|
18
18
|
|
|
19
|
-
- **`package.json`
|
|
20
|
-
- **README** —
|
|
19
|
+
- **`package.json` metadata** — keywords, repository URL, author and license fields updated.
|
|
20
|
+
- **README** — license and contribution sections expanded.
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
|
|
26
26
|
### Added
|
|
27
27
|
|
|
28
|
-
- **Client logger** (`src/client/logger.ts`) —
|
|
29
|
-
- **Cookie
|
|
30
|
-
- **`ServerContext` cookie API** — `ctx.cookies`
|
|
28
|
+
- **Client logger** (`src/client/logger.ts`) — standalone module for client-side debug logging.
|
|
29
|
+
- **Cookie utility** (`src/util/cookies.ts`) — cookie handler utility for server context.
|
|
30
|
+
- **`ServerContext` cookie API** — `ctx.cookies` is now available in handlers.
|
|
31
31
|
|
|
32
32
|
### Changed
|
|
33
33
|
|
|
34
|
-
- **
|
|
35
|
-
- **`createClient` logger
|
|
34
|
+
- **Documentation restructuring** — `README.md` split into `README.en.md`, `README.hu.md`, `README.llm.md` files.
|
|
35
|
+
- **`createClient` logger integration** — debug logging is now handled via the dedicated logger module.
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
@@ -40,28 +40,28 @@
|
|
|
40
40
|
|
|
41
41
|
### Breaking Changes
|
|
42
42
|
|
|
43
|
-
- **URL
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
- **SvelteKit routing:**
|
|
43
|
+
- **URL format changed.** Client-side calls now generate dot-separated, fully `kebab-case` URLs.
|
|
44
|
+
- Old: `/api/users/getProfile`
|
|
45
|
+
- New: `/api/users.get-profile`
|
|
46
|
+
- **SvelteKit routing:** it is recommended to change `src/routes/api/[...path]/+server.ts` to `[path]` to prevent partial processing of old format requests.
|
|
47
47
|
|
|
48
48
|
### Added
|
|
49
49
|
|
|
50
|
-
- **`flattenApiDefinition`** —
|
|
51
|
-
- **`camelToKebabCase`** utility (`src/util/string.ts`) —
|
|
52
|
-
- **415 Unsupported Media Type**
|
|
50
|
+
- **`flattenApiDefinition`** — at server startup, a flat `Map<string, { rpcType, handler }>` is built from the API definition. Each `handler` is a pre-assembled pipeline closure (middlewares + Zod validation + implementation), so only a `Map.get()` and a function call are needed per request.
|
|
51
|
+
- **`camelToKebabCase`** utility (`src/util/string.ts`) — shared helper function between client and server, with a regex that correctly handles acronyms (`getUserID` → `get-user-id`).
|
|
52
|
+
- **415 Unsupported Media Type** response for unknown `Content-Type` in `command` requests (previously it silently tried with msgpackr).
|
|
53
53
|
|
|
54
54
|
### Changed
|
|
55
55
|
|
|
56
|
-
- **`tango.ts`
|
|
57
|
-
- **`endpointMap`** —
|
|
58
|
-
- **
|
|
59
|
-
- **
|
|
56
|
+
- **`tango.ts` refactor** — duplication of `query`/`command`/`get` triad and Zod handling removed. Two internal helpers (`makeDescriptor`, `makeZodMethodSet`) replace the previous ~195 line triplicated logic (reduced to ~76 lines).
|
|
57
|
+
- **`endpointMap`** — renamed from the misleading `flatMap` name.
|
|
58
|
+
- **Client debug logging** — `isDebug` constant (previously a twice-evaluated condition); in case of error, the error appears inside the console group, and the group always closes (previously it remained open in case of pipeline error).
|
|
59
|
+
- **Client `middlewareMap` keys** — updated to a format consistent with the new URL convention (dot separator, kebab-case).
|
|
60
60
|
|
|
61
61
|
### Fixed
|
|
62
62
|
|
|
63
|
-
- **
|
|
64
|
-
- **`abortSignal` / `onProgress`** —
|
|
63
|
+
- **Heterogeneous File array upload** — the upload logic now checks if all array elements are `File` (`every()`), not just the first one.
|
|
64
|
+
- **`abortSignal` / `onProgress`** — unnecessary ternary operator removed in `ClientContext` constructor.
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
|
|
70
70
|
### Changed
|
|
71
71
|
|
|
72
|
-
-
|
|
73
|
-
- Zod re-export `tz`
|
|
74
|
-
-
|
|
75
|
-
- Pipeline middleware
|
|
72
|
+
- Dependency updates.
|
|
73
|
+
- Zod re-export with `tz` name (`import { tz } from "@atom-forge/rpc"`).
|
|
74
|
+
- Code style unification (concise imports, tab indent) across all source files.
|
|
75
|
+
- Pipeline middleware behavior refined: returns `undefined` if no middleware matches.
|
|
76
76
|
|
|
77
77
|
---
|
|
78
78
|
|
|
79
79
|
## [0.1.0] - 2025-xx-xx
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Initial implementation: type-safe RPC framework with middleware support, Zod validation, file uploads and progress tracking.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atom-forge/rpc",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Type-safe RPC framework for TypeScript with Zod validation and middleware support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rpc",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "tsc",
|
|
34
34
|
"prepublishOnly": "bun run scripts/prepublish.ts && bun run build",
|
|
35
|
-
"
|
|
35
|
+
"release": "npm publish --access public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"msgpackr": "^1.11.8"
|