@rakun-kit/core 1.7.1 → 1.7.2

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/README.md CHANGED
@@ -90,16 +90,16 @@ rakunBootstrap({
90
90
  })
91
91
  ```
92
92
 
93
- The default image processor is native `Bun.Image` when available and `sharp`
94
- otherwise. Node.js image optimization therefore requires the optional `sharp`
95
- peer. Bun also falls back to it when an OS-dependent codec cannot handle the
96
- requested format. Custom `ImageProcessor` implementations provide
97
- `metadata`, `transform`, and `placeholder`; the latter returns an inline
98
- `{ dataUrl, mime }` LQIP. Bun uses native `Bun.Image.placeholder()`, while
99
- Sharp produces the placeholder through its normal reduced transform and serves
100
- as the fallback when the Bun method is unavailable. The
101
- platform resolves crypto, filesystem, compression,
102
- workers, and realtime capabilities. Polling is the safe realtime default when
93
+ The default image processor is native `Bun.Image` when available and `sharp`
94
+ otherwise. Node.js image optimization therefore requires the optional `sharp`
95
+ peer. Bun also falls back to it when an OS-dependent codec cannot handle the
96
+ requested format. Custom `ImageProcessor` implementations provide
97
+ `metadata`, `transform`, and `placeholder`; the latter returns an inline
98
+ `{ dataUrl, mime }` LQIP. Bun uses native `Bun.Image.placeholder()`, while
99
+ Sharp produces the placeholder through its normal reduced transform and serves
100
+ as the fallback when the Bun method is unavailable. The
101
+ platform resolves crypto, filesystem, compression,
102
+ workers, and realtime capabilities. Polling is the safe realtime default when
103
103
  the host cannot keep persistent connections open. The Next and Express
104
104
  adapters automatically serve configured SSE streams.
105
105
  Calling `sseRealtime()` uses the API-relative `/realtime` endpoint; pass an
@@ -127,12 +127,12 @@ keyed by its content type and `_id`. Editor updates synchronize through the
127
127
  authenticated `manager.contentCollaboration.sync` operation without changing
128
128
  the MongoDB content snapshot or triggering revalidation. Save calls
129
129
  `manager.contentCollaboration.save`, which materializes and validates the
130
- server-side CRDT state before using the normal update and revalidation flow.
131
- Draft promotion remains separate and promotes only a saved draft snapshot.
132
- `manager.contentCollaboration.discard` restores the room from that persisted
133
- snapshot, publishes the reset to connected editors, and marks the restored Yjs
134
- state as saved without creating a new content revision. Shared templates expose
135
- the equivalent `manager.templateCollaboration.discard` operation.
130
+ server-side CRDT state before using the normal update and revalidation flow.
131
+ Draft promotion remains separate and promotes only a saved draft snapshot.
132
+ `manager.contentCollaboration.discard` restores the room from that persisted
133
+ snapshot, publishes the reset to connected editors, and marks the restored Yjs
134
+ state as saved without creating a new content revision. Shared templates expose
135
+ the equivalent `manager.templateCollaboration.discard` operation.
136
136
 
137
137
  The default adapter keeps working documents in process memory. Configure a
138
138
  shared, durable implementation for replicated or restart-durable deployments:
@@ -142,33 +142,33 @@ rakunBootstrap({
142
142
  // ...
143
143
  collaboration: {
144
144
  adapter: {
145
- load: async (roomId) => loadRoom(roomId),
146
- save: async (roomId, state) => saveRoom(roomId, state),
147
- loadPresence: async (roomId) => loadRoomPresence(roomId),
148
- savePresence: async (roomId, presence) => saveRoomPresence(roomId, presence),
149
- delete: async (roomId) => deleteRoom(roomId),
145
+ load: async (roomId) => loadRoom(roomId),
146
+ save: async (roomId, state) => saveRoom(roomId, state),
147
+ loadPresence: async (roomId) => loadRoomPresence(roomId),
148
+ savePresence: async (roomId, presence) => saveRoomPresence(roomId, presence),
149
+ delete: async (roomId) => deleteRoom(roomId),
150
150
  },
151
151
  },
152
152
  })
153
153
  ```
154
154
 
155
155
  `state.update` and `state.savedStateVector` are opaque `Uint8Array` values.
156
- Store them outside the public content record. The built-in manager applies this
156
+ Store them outside the public content record. The built-in manager applies this
157
157
  to saved content edit screens and to each content type's shared Template.
158
158
  Templates use their own `template:<contentType>` room rather than an individual
159
159
  document room. Settings, route-layout overrides, and other administrative forms
160
160
  remain local. Translation changes join the working document and are persisted
161
- only by Save.
162
-
163
- The sync response also includes ephemeral viewers keyed by browser-tab client
164
- id, including the focused field. Presence expires automatically and is not
165
- part of `state.update`, `state.savedStateVector`, or the persistent event log.
166
- With SSE, the authenticated subscription owns the tab presence: server
167
- heartbeats renew it and closing the last stream for that tab removes it, so the
168
- manager does not send a periodic collaboration sync request just to stay
169
- visible. Polling refreshes presence through its normal sync cycle.
170
- `loadPresence` and `savePresence` are optional; implement both in replicated
171
- deployments that need presence shared across processes.
161
+ only by Save.
162
+
163
+ The sync response also includes ephemeral viewers keyed by browser-tab client
164
+ id, including the focused field. Presence expires automatically and is not
165
+ part of `state.update`, `state.savedStateVector`, or the persistent event log.
166
+ With SSE, the authenticated subscription owns the tab presence: server
167
+ heartbeats renew it and closing the last stream for that tab removes it, so the
168
+ manager does not send a periodic collaboration sync request just to stay
169
+ visible. Polling refreshes presence through its normal sync cycle.
170
+ `loadPresence` and `savePresence` are optional; implement both in replicated
171
+ deployments that need presence shared across processes.
172
172
 
173
173
  `@rakun-kit/manager-react` additionally stores these Yjs rooms per user in
174
174
  IndexedDB, allowing cached content and Template fields to remain editable during
@@ -1153,15 +1153,15 @@ APIs:
1153
1153
  - `getMediaService()`: returns the singleton or creates it from config.
1154
1154
  - `handleMediaBinaryUpload`: processes manager binary uploads.
1155
1155
 
1156
- The service supports prepare/finalize upload, URL generation, folders, and media optimization depending on adapter/configuration. Manager uploads encode original file names for transport, so Unicode names (including accents, non-Latin scripts, and emoji) are preserved without placing invalid characters in HTTP headers.
1157
-
1158
- Adapters can implement `getPublicObject` to let every Rakun server adapter proxy
1159
- public media at its normal `/media/public/<key>` API route. This keeps browser
1160
- URLs stable even when the object store is private or only supports expiring
1161
- presigned URLs. The core handler validates the key under `public/`, forwards
1162
- byte ranges, preserves object metadata, and applies long-lived caching by
1163
- default. The storage adapter receives server-side credentials; never expose its
1164
- presigned storage URL as the public media URL.
1156
+ The service supports prepare/finalize upload, URL generation, folders, and media optimization depending on adapter/configuration. Manager uploads encode original file names for transport, so Unicode names (including accents, non-Latin scripts, and emoji) are preserved without placing invalid characters in HTTP headers.
1157
+
1158
+ Adapters can implement `getPublicObject` to let every Rakun server adapter proxy
1159
+ public media at its normal `/media/<key>` API route. This keeps browser
1160
+ URLs stable even when the object store is private or only supports expiring
1161
+ presigned URLs. The core handler validates the key under `public/`, forwards
1162
+ byte ranges, preserves object metadata, and applies long-lived caching by
1163
+ default. The storage adapter receives server-side credentials; never expose its
1164
+ presigned storage URL as the public media URL.
1165
1165
 
1166
1166
  Optimized video uploads use the `ffmpeg-static` peer dependency and produce an MP4 primary object plus MP4 and WebM entries in `sources`. Existing image-only optimize options remain compatible; use `video: { quality: 80 }` to configure video quality explicitly.
1167
1167
 
@@ -475,12 +475,12 @@ blocking. Account recovery requires both a mail service and
475
475
 
476
476
  Core defines service contracts; concrete integrations are separate:
477
477
 
478
- - Media: use `@rakun-kit/s3`, or local media from the selected framework
479
- adapter. Configure the result as `media` in bootstrap.
480
- - Storage adapters may expose `getPublicObject`; Next.js, Express and Bun then
481
- serve public media through their normal `/media/public/<key>` API route. This
482
- gives public Rakun media a stable application URL while the backing object
483
- store remains private or uses expiring storage URLs.
478
+ - Media: use `@rakun-kit/s3`, or local media from the selected framework
479
+ adapter. Configure the result as `media` in bootstrap.
480
+ - Storage adapters may expose `getPublicObject`; Next.js, Express and Bun then
481
+ serve public media through their normal `/media/<key>` API route. This
482
+ gives public Rakun media a stable application URL while the backing object
483
+ store remains private or uses expiring storage URLs.
484
484
  - Mail: use `@rakun-kit/smtp` or `@rakun-kit/resend`; optionally render typed
485
485
  templates with `@rakun-kit/jsx-email`. Configure delivery as `mail`.
486
486
  - Translation: use `@rakun-kit/openai` or implement the core translation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rakun-kit/core",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "Core Rakun content, routing, media, mail, auth, and manager APIs.",
5
5
  "license": "MIT",
6
6
  "author": {