@absolutejs/sync 2.5.0 → 2.7.0
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 +12 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +3 -3
- package/dist/platform.d.ts +30 -2
- package/dist/platform.js +56 -8
- package/dist/platform.js.map +4 -4
- package/dist/plugin.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,19 +14,29 @@ collections, permissions, writers, and authentication on the returned runtime:
|
|
|
14
14
|
```ts
|
|
15
15
|
import { Elysia } from 'elysia';
|
|
16
16
|
import { createPlatformSyncRuntime } from '@absolutejs/sync/platform';
|
|
17
|
+
import { createCommentsPack } from '@absolutejs/sync-pack-comments';
|
|
18
|
+
import { createPostgresClusterBus } from '@absolutejs/sync-bus-pg';
|
|
17
19
|
|
|
18
20
|
const managedSync = createPlatformSyncRuntime({
|
|
21
|
+
clusterBus: createPostgresClusterBus({ sql }),
|
|
22
|
+
packs: [createCommentsPack({ store: commentsStore })],
|
|
19
23
|
resolveContext: (request) => authenticate(request)
|
|
20
24
|
});
|
|
21
25
|
|
|
22
|
-
managedSync.
|
|
26
|
+
await managedSync.ready;
|
|
23
27
|
new Elysia().use(managedSync.app).listen(3000);
|
|
28
|
+
|
|
29
|
+
// During graceful shutdown:
|
|
30
|
+
await managedSync.dispose();
|
|
24
31
|
```
|
|
25
32
|
|
|
26
33
|
The platform contract controls paths, reconnect history, mutation pressure,
|
|
27
34
|
slow-client behavior, and stable instance identity. A fixed
|
|
28
35
|
`/.well-known/absolute/sync` endpoint lets the runtime host fail readiness when
|
|
29
|
-
an opted-in release forgot to mount the returned app
|
|
36
|
+
an opted-in release forgot to mount the returned app, or while its declared
|
|
37
|
+
cluster bus is disconnected. Its response reports the connected cluster posture
|
|
38
|
+
and registered packs, so operators can verify the application assembled the
|
|
39
|
+
capabilities it declared. The platform never owns
|
|
30
40
|
application schemas or authorization rules, so the project remains portable
|
|
31
41
|
and can construct `@absolutejs/sync` explicitly outside managed hosting.
|
|
32
42
|
|
package/dist/index.js
CHANGED
|
@@ -458,7 +458,12 @@ var sync = ({
|
|
|
458
458
|
heartbeatMs = 25000
|
|
459
459
|
}) => {
|
|
460
460
|
const app = new Elysia({ name: "@absolutejs/sync" }).get(path, async (context) => {
|
|
461
|
+
const cookies = Object.fromEntries(Object.entries(context.cookie).map(([name, cookie]) => [
|
|
462
|
+
name,
|
|
463
|
+
cookie.value
|
|
464
|
+
]));
|
|
461
465
|
const topics = await resolveTopics({
|
|
466
|
+
cookies,
|
|
462
467
|
query: context.query,
|
|
463
468
|
request: context.request
|
|
464
469
|
});
|
|
@@ -3777,5 +3782,5 @@ export {
|
|
|
3777
3782
|
ConnectionBrokerDrainedError
|
|
3778
3783
|
};
|
|
3779
3784
|
|
|
3780
|
-
//# debugId=
|
|
3785
|
+
//# debugId=422565C3498D831B64756E2164756E21
|
|
3781
3786
|
//# sourceMappingURL=index.js.map
|