@syncular/cli 0.0.6-56 → 0.0.6-67
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncular/cli",
|
|
3
|
-
"version": "0.0.6-
|
|
3
|
+
"version": "0.0.6-67",
|
|
4
4
|
"description": "CLI for scaffolding and migration workflows in Syncular",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"release": "bunx syncular-publish"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@syncular/console": "0.0.6-
|
|
45
|
+
"@syncular/console": "0.0.6-67",
|
|
46
46
|
"eta": "^4.5.1",
|
|
47
47
|
"ink": "^6.8.0",
|
|
48
48
|
"react": "^19.2.4"
|
|
@@ -32,10 +32,12 @@ async function ensureDemoSchema() {
|
|
|
32
32
|
const { syncRoutes } = createSyncServer({
|
|
33
33
|
db,
|
|
34
34
|
dialect,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
sync: {
|
|
36
|
+
handlers: [tasksHandler],
|
|
37
|
+
authenticate: async (request) => {
|
|
38
|
+
const actorId = request.headers.get('x-user-id') ?? 'demo-user';
|
|
39
|
+
return { actorId };
|
|
40
|
+
},
|
|
39
41
|
},
|
|
40
42
|
});
|
|
41
43
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { createProxyRoutes } from '@syncular/server-hono';
|
|
6
|
-
import {
|
|
6
|
+
import { createProxyHandlerCollection } from '@syncular/server';
|
|
7
7
|
|
|
8
8
|
type ProxyRouteOptions = Parameters<typeof createProxyRoutes>[0];
|
|
9
9
|
|
|
@@ -13,10 +13,12 @@ export function createSyncularProxyRoutes(args: {
|
|
|
13
13
|
upgradeWebSocket: ProxyRouteOptions['upgradeWebSocket'];
|
|
14
14
|
validateToken: (token: string | undefined) => string | null;
|
|
15
15
|
}) {
|
|
16
|
-
const handlers =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const handlers = createProxyHandlerCollection([
|
|
17
|
+
{
|
|
18
|
+
table: 'tasks',
|
|
19
|
+
computeScopes: (row) => ({ user_id: String(row.user_id ?? '') }),
|
|
20
|
+
},
|
|
21
|
+
]);
|
|
20
22
|
|
|
21
23
|
return createProxyRoutes({
|
|
22
24
|
db: args.db,
|
|
@@ -29,10 +29,12 @@ export async function createSyncularServer() {
|
|
|
29
29
|
const server = createSyncServer({
|
|
30
30
|
db,
|
|
31
31
|
dialect,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
sync: {
|
|
33
|
+
handlers: [tasksHandler],
|
|
34
|
+
authenticate: async (request) => {
|
|
35
|
+
const actorId = request.headers.get('x-user-id');
|
|
36
|
+
return actorId ? { actorId } : null;
|
|
37
|
+
},
|
|
36
38
|
},
|
|
37
39
|
});
|
|
38
40
|
|
|
@@ -23,10 +23,12 @@ export async function createSyncularServer() {
|
|
|
23
23
|
const server = createSyncServer({
|
|
24
24
|
db,
|
|
25
25
|
dialect,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
sync: {
|
|
27
|
+
handlers: [tasksHandler],
|
|
28
|
+
authenticate: async (request) => {
|
|
29
|
+
const actorId = request.headers.get('x-user-id');
|
|
30
|
+
return actorId ? { actorId } : null;
|
|
31
|
+
},
|
|
30
32
|
},
|
|
31
33
|
});
|
|
32
34
|
|