@inflector/aura 0.1.16 → 0.1.18
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/dist/auth.d.ts +1 -6
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +27 -48
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +16 -55
- package/dist/hooks/react.d.ts.map +1 -1
- package/dist/hooks/react.js +11 -23
- package/package.json +2 -1
package/dist/auth.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
interface SessionEventsType {
|
|
3
|
-
on(event: SessionEvent, callback: () => void): () => void;
|
|
4
|
-
emit(event: SessionEvent): void;
|
|
5
|
-
}
|
|
1
|
+
export declare const authTokenVersion: import("nanostores").PreinitializedWritableAtom<number> & object;
|
|
6
2
|
declare const getTokenKey: (workspace: string) => string;
|
|
7
3
|
declare const getToken: (workspace: string) => string;
|
|
8
4
|
declare const setToken: (workspace: string, token: string | null) => void;
|
|
9
5
|
export { getToken, setToken, getTokenKey };
|
|
10
|
-
export declare const SessionEvents: SessionEventsType;
|
|
11
6
|
export declare const AuraAuth: (url: string, workspace: string) => {
|
|
12
7
|
Logout: () => Promise<{
|
|
13
8
|
data: {
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,kEAAW,CAAC;AAKzC,QAAA,MAAM,WAAW,GAAI,WAAW,MAAM,WAAqC,CAAC;AAG5E,QAAA,MAAM,QAAQ,GAAI,WAAW,MAAM,KAAG,MAGrC,CAAC;AAEF,QAAA,MAAM,QAAQ,GAAI,WAAW,MAAM,EAAE,OAAO,MAAM,GAAG,IAAI,SAWxD,CAAC;AAG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA7EvC,CAAC;iBAAe,CAAC;;;;;;;;;;;;;;;;qBAZI,CAAC;;;;;;;;;;;;;;;;CAoKtC,CAAC"}
|
package/dist/auth.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createAuthClient } from "better-auth/client";
|
|
2
2
|
import { anonymousClient } from "better-auth/client/plugins";
|
|
3
|
-
import { computed } from "nanostores";
|
|
3
|
+
import { computed, atom } from "nanostores";
|
|
4
|
+
// Atom to track session/token version for reactivity
|
|
5
|
+
export const authTokenVersion = atom(-1);
|
|
4
6
|
// Token storage key - unique per workspace to avoid conflicts
|
|
5
7
|
const getTokenKey = (workspace) => `aura_bearer_token_${workspace}`;
|
|
6
8
|
// Helper to get/set token from localStorage (with SSR safety)
|
|
@@ -12,52 +14,26 @@ const getToken = (workspace) => {
|
|
|
12
14
|
const setToken = (workspace, token) => {
|
|
13
15
|
if (typeof window === 'undefined')
|
|
14
16
|
return;
|
|
17
|
+
const key = getTokenKey(workspace);
|
|
15
18
|
if (token) {
|
|
16
|
-
localStorage.setItem(
|
|
19
|
+
localStorage.setItem(key, token);
|
|
17
20
|
}
|
|
18
21
|
else {
|
|
19
|
-
localStorage.removeItem(
|
|
22
|
+
localStorage.removeItem(key);
|
|
20
23
|
}
|
|
24
|
+
// Update version to trigger reactivity in hooks
|
|
25
|
+
authTokenVersion.set(authTokenVersion.get() + 1);
|
|
21
26
|
};
|
|
22
27
|
// Export for use in other modules
|
|
23
28
|
export { getToken, setToken, getTokenKey };
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
if (window.__SessionEvents)
|
|
35
|
-
return window.__SessionEvents;
|
|
36
|
-
const listeners = {
|
|
37
|
-
login: [],
|
|
38
|
-
logout: [],
|
|
39
|
-
change: [],
|
|
40
|
-
};
|
|
41
|
-
const events = {
|
|
42
|
-
on(event, callback) {
|
|
43
|
-
listeners[event].push(callback);
|
|
44
|
-
return () => {
|
|
45
|
-
const i = listeners[event].indexOf(callback);
|
|
46
|
-
if (i >= 0)
|
|
47
|
-
listeners[event].splice(i, 1);
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
emit(event) {
|
|
51
|
-
listeners[event].forEach((cb) => cb());
|
|
52
|
-
listeners.change.forEach((cb) => cb());
|
|
53
|
-
window.dispatchEvent(new CustomEvent("__AuraSession", {
|
|
54
|
-
detail: { type: event },
|
|
55
|
-
}));
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
window.__SessionEvents = events;
|
|
59
|
-
return events;
|
|
60
|
-
})();
|
|
29
|
+
// Listen for storage events (cross-tab sync) to update token version
|
|
30
|
+
if (typeof window !== 'undefined') {
|
|
31
|
+
window.addEventListener('storage', (e) => {
|
|
32
|
+
if (e.key && e.key.startsWith('aura_bearer_token_')) {
|
|
33
|
+
authTokenVersion.set(authTokenVersion.get() + 1);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
61
37
|
export const AuraAuth = (url, workspace) => {
|
|
62
38
|
const _onUserLoadedCallbacks = [];
|
|
63
39
|
const _onUserNotFoundCallbacks = [];
|
|
@@ -81,14 +57,14 @@ export const AuraAuth = (url, workspace) => {
|
|
|
81
57
|
}
|
|
82
58
|
},
|
|
83
59
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
60
|
+
// Refresh session when token changes (e.g. from another tab)
|
|
61
|
+
if (typeof window !== 'undefined') {
|
|
62
|
+
const unsub = authTokenVersion.subscribe(() => {
|
|
63
|
+
authClient.getSession().catch(() => { });
|
|
64
|
+
});
|
|
65
|
+
// Note: we're not unsubscribing here as AuraAuth is likely initialized once.
|
|
66
|
+
// If AuraAuth can be destroyed, we'd need to handle cleanup.
|
|
67
|
+
}
|
|
92
68
|
const Session = computed(authClient.useSession, (session) => {
|
|
93
69
|
if (!session?.data?.user)
|
|
94
70
|
return session;
|
|
@@ -123,6 +99,9 @@ export const AuraAuth = (url, workspace) => {
|
|
|
123
99
|
await triggerCallbacks(_onUserNotFoundCallbacks);
|
|
124
100
|
}
|
|
125
101
|
finally {
|
|
102
|
+
if (authTokenVersion.get() < 0) {
|
|
103
|
+
authTokenVersion.set(0);
|
|
104
|
+
}
|
|
126
105
|
_initialized = true;
|
|
127
106
|
}
|
|
128
107
|
};
|
package/dist/database.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAMjE,cAAM,WAAW,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAQ;IACnB,OAAO,CAAC,IAAI,CA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5B,CAAA"}
|
package/dist/database.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createFluentBuilder } from "./fluent";
|
|
2
2
|
import axios from "axios";
|
|
3
3
|
import { getToken } from "./auth";
|
|
4
|
+
import { SSE } from "sse.js";
|
|
4
5
|
class RemoteTable {
|
|
5
6
|
URL;
|
|
6
7
|
Name;
|
|
@@ -108,66 +109,26 @@ class RemoteTable {
|
|
|
108
109
|
if (init)
|
|
109
110
|
params.push("init=true");
|
|
110
111
|
const query = params.length ? "?" + params.join("&") : "";
|
|
111
|
-
let abortController = new AbortController();
|
|
112
112
|
const tableName = this.Name;
|
|
113
|
-
const
|
|
113
|
+
const url = `${this.URL}/api/db/${this.WorkSpace}/${this.Name}${query}`;
|
|
114
|
+
const source = new SSE(url, {
|
|
115
|
+
headers: this.getAuthHeaders(),
|
|
116
|
+
});
|
|
117
|
+
source.addEventListener(tableName, (event) => {
|
|
114
118
|
try {
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
headers: {
|
|
118
|
-
...this.getAuthHeaders(),
|
|
119
|
-
'Accept': 'text/event-stream',
|
|
120
|
-
},
|
|
121
|
-
signal: abortController?.signal,
|
|
122
|
-
});
|
|
123
|
-
if (!response.ok || !response.body) {
|
|
124
|
-
throw new Error(`SSE connection failed: ${response.status}`);
|
|
125
|
-
}
|
|
126
|
-
const reader = response.body.getReader();
|
|
127
|
-
const decoder = new TextDecoder();
|
|
128
|
-
let buffer = '';
|
|
129
|
-
while (true) {
|
|
130
|
-
const { done, value } = await reader.read();
|
|
131
|
-
if (done)
|
|
132
|
-
break;
|
|
133
|
-
buffer += decoder.decode(value, { stream: true });
|
|
134
|
-
const lines = buffer.split('\n');
|
|
135
|
-
buffer = lines.pop() || '';
|
|
136
|
-
let currentEvent = '';
|
|
137
|
-
let currentData = '';
|
|
138
|
-
for (const line of lines) {
|
|
139
|
-
if (line.startsWith('event:')) {
|
|
140
|
-
currentEvent = line.slice(6).trim();
|
|
141
|
-
}
|
|
142
|
-
else if (line.startsWith('data:')) {
|
|
143
|
-
currentData = line.slice(5).trim();
|
|
144
|
-
}
|
|
145
|
-
else if (line === '' && currentEvent === tableName && currentData) {
|
|
146
|
-
try {
|
|
147
|
-
const { op, data } = JSON.parse(currentData);
|
|
148
|
-
callback({ action: op, data });
|
|
149
|
-
}
|
|
150
|
-
catch (e) {
|
|
151
|
-
// Ignore parse errors
|
|
152
|
-
}
|
|
153
|
-
currentEvent = '';
|
|
154
|
-
currentData = '';
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
119
|
+
const { op, data } = JSON.parse(event.data);
|
|
120
|
+
callback({ action: op, data });
|
|
158
121
|
}
|
|
159
|
-
catch (
|
|
160
|
-
|
|
161
|
-
console.error('SSE stream error:', error);
|
|
162
|
-
}
|
|
122
|
+
catch (e) {
|
|
123
|
+
// Ignore parse errors
|
|
163
124
|
}
|
|
164
|
-
};
|
|
165
|
-
|
|
125
|
+
});
|
|
126
|
+
source.addEventListener('error', (error) => {
|
|
127
|
+
console.error('SSE stream error:', error);
|
|
128
|
+
});
|
|
129
|
+
source.stream();
|
|
166
130
|
return () => {
|
|
167
|
-
|
|
168
|
-
abortController.abort();
|
|
169
|
-
abortController = null;
|
|
170
|
-
}
|
|
131
|
+
source.close();
|
|
171
132
|
};
|
|
172
133
|
};
|
|
173
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/hooks/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAS,MAAM,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/hooks/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAS,MAAM,IAAI,CAAA;AAK3C,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAkB5B,wBAAgB,QAAQ,CACtB,IAAI,SAAS,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAElF,KAAK,EAAE,IAAI,EACX,OAAO,CAAC,EAAE;IACR,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;CACnE,guBAwDF;AAED,wBAAgB,SAAS,CACvB,IAAI,SAAS,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAElF,KAAK,EAAE,IAAI,EACX,OAAO,EAAE;IACP,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;CACnE,0uBAqDF;AAED,eAAO,MAAM,OAAO,GAAI,UAAU,OAAO,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;;;;;;;;;aAGjF,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,UAAU,GAAG,QAGvC,CAAA"}
|
package/dist/hooks/react.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { authTokenVersion } from '../auth';
|
|
1
2
|
import { useStore } from '@nanostores/react';
|
|
2
3
|
import { useEffect, useState, useRef } from 'react';
|
|
3
4
|
function deepEqual(a, b) {
|
|
@@ -19,8 +20,8 @@ function deepEqual(a, b) {
|
|
|
19
20
|
}
|
|
20
21
|
export function useTable(table, Options) {
|
|
21
22
|
const [data, setData] = useState([]);
|
|
22
|
-
//
|
|
23
|
-
const
|
|
23
|
+
// Subscribe to token version changes for reactivity
|
|
24
|
+
const sessionVersion = useStore(authTokenVersion);
|
|
24
25
|
// Use ref to track where clause changes with deep comparison
|
|
25
26
|
const whereRef = useRef(Options?.where);
|
|
26
27
|
const whereString = JSON.stringify(Options?.where);
|
|
@@ -28,15 +29,9 @@ export function useTable(table, Options) {
|
|
|
28
29
|
whereRef.current = Options?.where;
|
|
29
30
|
}
|
|
30
31
|
useEffect(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
window.addEventListener('__AuraSession', handler);
|
|
35
|
-
return () => {
|
|
36
|
-
window.removeEventListener('__AuraSession', handler);
|
|
37
|
-
};
|
|
38
|
-
}, []);
|
|
39
|
-
useEffect(() => {
|
|
32
|
+
// Wait for auth to be initialized
|
|
33
|
+
if (sessionVersion < 0)
|
|
34
|
+
return;
|
|
40
35
|
// Subscribe to table
|
|
41
36
|
const unsubscribe = table.Subscribe((event) => {
|
|
42
37
|
setData((prev) => {
|
|
@@ -68,25 +63,18 @@ export function useTable(table, Options) {
|
|
|
68
63
|
}
|
|
69
64
|
export function useRecord(table, Options) {
|
|
70
65
|
const [data, setData] = useState(undefined);
|
|
71
|
-
//
|
|
72
|
-
const
|
|
66
|
+
// Subscribe to token version changes for reactivity
|
|
67
|
+
const sessionVersion = useStore(authTokenVersion);
|
|
73
68
|
// Use ref to track where clause changes with deep comparison
|
|
74
69
|
const whereRef = useRef(Options.where);
|
|
75
70
|
const whereString = JSON.stringify(Options.where);
|
|
76
71
|
if (JSON.stringify(whereRef.current) !== whereString) {
|
|
77
72
|
whereRef.current = Options.where;
|
|
78
73
|
}
|
|
79
|
-
// Subscribe to global session changes
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
const handler = () => {
|
|
82
|
-
setSessionVersion((v) => v + 1);
|
|
83
|
-
};
|
|
84
|
-
window.addEventListener('__AuraSession', handler);
|
|
85
|
-
return () => {
|
|
86
|
-
window.removeEventListener('__AuraSession', handler);
|
|
87
|
-
};
|
|
88
|
-
}, []);
|
|
89
74
|
useEffect(() => {
|
|
75
|
+
// Wait for auth to be initialized
|
|
76
|
+
if (sessionVersion < 0)
|
|
77
|
+
return;
|
|
90
78
|
const unsubscribe = table.Subscribe((event) => {
|
|
91
79
|
setData((prev) => {
|
|
92
80
|
if (!prev && event.action !== 'Get' && event.action !== 'Add')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inflector/aura",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"chalk": "^5.6.2",
|
|
43
43
|
"chokidar": "^5.0.0",
|
|
44
44
|
"eventsource": "^4.1.0",
|
|
45
|
+
"sse.js": "^2.7.2",
|
|
45
46
|
"tsx": "^4.20.4",
|
|
46
47
|
"zod": "^3.25.67"
|
|
47
48
|
}
|