local-lite 1.0.2 → 1.0.4
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 +4 -3
- package/dist/actions/manager.js +6 -2
- package/dist/actions/store.js +33 -19
- package/dist/adapters/local/expo-sqlite.js +4 -2
- package/dist/adapters/local/libsql.js +3 -1
- package/dist/adapters/local/op-sqlite.js +2 -1
- package/dist/adapters/network/index.js +10 -5
- package/dist/adapters/remote/convex.js +37 -10
- package/dist/adapters/remote/firestore.js +11 -4
- package/dist/adapters/remote/self-hosted.js +8 -4
- package/dist/adapters/remote/supabase.js +95 -29
- package/dist/auth/apple.js +8 -4
- package/dist/auth/github.js +15 -7
- package/dist/auth/google.js +7 -4
- package/dist/auth/identity.js +5 -1
- package/dist/auth/local.js +74 -21
- package/dist/auth/microsoft.js +22 -8
- package/dist/auth/session.js +45 -34
- package/dist/auth/unified.js +3 -2
- package/dist/backups/cloud-storage.js +10 -7
- package/dist/backups/encryption.js +4 -2
- package/dist/backups/onedrive.js +3 -3
- package/dist/backups/operations.js +4 -2
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +3 -0
- package/dist/config/resolve-local.js +18 -6
- package/dist/config/resolve-remote.js +2 -1
- package/dist/core/client.d.ts +2 -2
- package/dist/core/client.js +64 -26
- package/dist/core/index.d.ts +1 -1
- package/dist/core/maintenance.js +5 -4
- package/dist/core/meta-store.js +3 -3
- package/dist/core/outbox-store.js +32 -25
- package/dist/core/query-builder.js +23 -10
- package/dist/core/query.js +19 -7
- package/dist/core/schema-manager.js +6 -2
- package/dist/core/sync-worker.js +38 -12
- package/dist/core/table-manager.js +8 -2
- package/dist/core/types.d.ts +1 -1
- package/dist/devtools/BenchmarkModal.d.ts +1 -1
- package/dist/devtools/BenchmarkModal.js +234 -54
- package/dist/devtools/SyncInspector.js +260 -37
- package/dist/email/index.d.ts +17 -18
- package/dist/email/index.js +46 -72
- package/dist/keys/generator.js +4 -1
- package/dist/keys/manager.js +22 -4
- package/dist/keys/signed-token.js +12 -4
- package/dist/keys/store.js +23 -16
- package/dist/kv/manager.js +5 -2
- package/dist/kv/store.js +13 -13
- package/dist/react/auth.js +12 -12
- package/dist/react/backups.js +1 -1
- package/dist/react/index.js +14 -9
- package/dist/react/runner.js +1 -1
- package/dist/react/status.js +6 -2
- package/dist/reactive/event-emitter.js +2 -2
- package/dist/scheduler/cron.js +3 -1
- package/dist/scheduler/store.js +37 -31
- package/dist/schema/generator.js +37 -34
- package/dist/search/manager.js +3 -1
- package/dist/search/store.js +17 -16
- package/dist/server/email.d.ts +8 -0
- package/dist/server/email.js +48 -3
- package/dist/server/index.js +4 -4
- package/dist/server/sync.js +11 -4
- package/dist/storage/driver.js +2 -1
- package/dist/storage/expo.js +5 -2
- package/dist/storage/manager.js +3 -1
- package/dist/storage/store.js +26 -25
- package/dist/utils/dynamic.js +4 -2
- package/dist/utils/logger.js +13 -6
- package/dist/utils/portability.js +21 -9
- package/package.json +1 -1
|
@@ -37,7 +37,10 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
37
37
|
(0, react_1.useEffect)(() => {
|
|
38
38
|
if (!client || !isOpen)
|
|
39
39
|
return;
|
|
40
|
-
client
|
|
40
|
+
client
|
|
41
|
+
.getMetrics()
|
|
42
|
+
.then(setMetrics)
|
|
43
|
+
.catch(() => { });
|
|
41
44
|
}, [client, isOpen, status.isSyncing, status.pendingCount]);
|
|
42
45
|
const runAction = (0, react_1.useCallback)(async (startMsg, doneMsg, action) => {
|
|
43
46
|
if (!client)
|
|
@@ -63,9 +66,14 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
63
66
|
const clearOutbox = () => runAction('Clearing stuck outbox...', (count) => `Cleared ${count || 0} stuck outbox mutations`, async () => {
|
|
64
67
|
client.syncWorker.pause();
|
|
65
68
|
try {
|
|
66
|
-
const count = await client.maintenance.pruneOutbox({
|
|
69
|
+
const count = await client.maintenance.pruneOutbox({
|
|
70
|
+
statuses: ['PENDING', 'PROCESSING', 'FAILED'],
|
|
71
|
+
});
|
|
67
72
|
if (count > 0) {
|
|
68
|
-
client.events.emit('sync_outbox', {
|
|
73
|
+
client.events.emit('sync_outbox', {
|
|
74
|
+
operation: 'DELETE',
|
|
75
|
+
rowId: 'clear-stuck',
|
|
76
|
+
});
|
|
69
77
|
}
|
|
70
78
|
await status.refresh();
|
|
71
79
|
return count;
|
|
@@ -78,11 +86,18 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
78
86
|
if (RN?.Alert?.alert) {
|
|
79
87
|
RN.Alert.alert('Clear stuck outbox?', message, [
|
|
80
88
|
{ text: 'Cancel', style: 'cancel' },
|
|
81
|
-
{
|
|
89
|
+
{
|
|
90
|
+
text: 'Clear outbox',
|
|
91
|
+
style: 'destructive',
|
|
92
|
+
onPress: () => {
|
|
93
|
+
void clearOutbox();
|
|
94
|
+
},
|
|
95
|
+
},
|
|
82
96
|
]);
|
|
83
97
|
return;
|
|
84
98
|
}
|
|
85
|
-
if (typeof globalThis.confirm === 'function' &&
|
|
99
|
+
if (typeof globalThis.confirm === 'function' &&
|
|
100
|
+
globalThis.confirm(message)) {
|
|
86
101
|
void clearOutbox();
|
|
87
102
|
}
|
|
88
103
|
};
|
|
@@ -95,8 +110,16 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
95
110
|
setIsBenchmarkModalOpen(true);
|
|
96
111
|
}
|
|
97
112
|
};
|
|
98
|
-
const statusColor = !status.isOnline
|
|
99
|
-
|
|
113
|
+
const statusColor = !status.isOnline
|
|
114
|
+
? '#EF4444'
|
|
115
|
+
: status.isSyncing
|
|
116
|
+
? '#F59E0B'
|
|
117
|
+
: '#10B981';
|
|
118
|
+
const statusLabel = !status.isOnline
|
|
119
|
+
? 'Offline'
|
|
120
|
+
: status.isSyncing
|
|
121
|
+
? 'Syncing'
|
|
122
|
+
: 'Online';
|
|
100
123
|
const isInline = position === 'inline';
|
|
101
124
|
const isTop = position.startsWith('top') || position === 'top';
|
|
102
125
|
const isLeft = position.includes('left');
|
|
@@ -120,11 +143,42 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
120
143
|
], [status.pendingCount, metrics?.outboxFailedCount, currentTheme.text]);
|
|
121
144
|
// Shared Action Buttons
|
|
122
145
|
const actionButtons = (0, react_1.useMemo)(() => [
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
146
|
+
{
|
|
147
|
+
id: 'push',
|
|
148
|
+
label: '🚀 Push Changes',
|
|
149
|
+
onPress: handlePush,
|
|
150
|
+
bg: '#3B82F6',
|
|
151
|
+
color: '#FFFFFF',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: 'pull',
|
|
155
|
+
label: '📥 Pull Changes',
|
|
156
|
+
onPress: handlePull,
|
|
157
|
+
bg: '#2563EB',
|
|
158
|
+
color: '#FFFFFF',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'retry',
|
|
162
|
+
label: '🔄 Retry Failed',
|
|
163
|
+
onPress: handleRetryFailed,
|
|
164
|
+
bg: currentTheme.actionBg,
|
|
165
|
+
color: currentTheme.actionText,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: 'reset',
|
|
169
|
+
label: '⏪ Reset Cursor',
|
|
170
|
+
onPress: handleResetCursor,
|
|
171
|
+
bg: currentTheme.actionBg,
|
|
172
|
+
color: currentTheme.actionText,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: 'clear-outbox',
|
|
176
|
+
label: 'Clear Stuck Outbox',
|
|
177
|
+
onPress: handleClearOutbox,
|
|
178
|
+
disabled: status.pendingCount === 0,
|
|
179
|
+
bg: '#EF4444',
|
|
180
|
+
color: '#FFFFFF',
|
|
181
|
+
},
|
|
128
182
|
{
|
|
129
183
|
id: 'flush-actions',
|
|
130
184
|
label: '📨 Flush Actions & Email',
|
|
@@ -132,7 +186,18 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
132
186
|
bg: '#8B5CF6',
|
|
133
187
|
color: '#FFFFFF',
|
|
134
188
|
},
|
|
135
|
-
], [
|
|
189
|
+
], [
|
|
190
|
+
handlePush,
|
|
191
|
+
handlePull,
|
|
192
|
+
handleRetryFailed,
|
|
193
|
+
handleResetCursor,
|
|
194
|
+
handleClearOutbox,
|
|
195
|
+
runAction,
|
|
196
|
+
client,
|
|
197
|
+
currentTheme.actionBg,
|
|
198
|
+
currentTheme.actionText,
|
|
199
|
+
status.pendingCount,
|
|
200
|
+
]);
|
|
136
201
|
const triggerLabel = variant === 'compact'
|
|
137
202
|
? status.pendingCount > 0
|
|
138
203
|
? `${status.pendingCount} queued`
|
|
@@ -142,7 +207,7 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
142
207
|
return null;
|
|
143
208
|
// React Native Renderer
|
|
144
209
|
if (RN && RN.View) {
|
|
145
|
-
const { View, Text, TouchableOpacity, ScrollView, Modal, Platform, StatusBar } = RN;
|
|
210
|
+
const { View, Text, TouchableOpacity, ScrollView, Modal, Platform, StatusBar, } = RN;
|
|
146
211
|
const SafeComp = RNSafeArea?.SafeAreaView || RN.SafeAreaView || View;
|
|
147
212
|
const isAndroid = Platform?.OS === 'android';
|
|
148
213
|
const statusBarHeight = isAndroid ? StatusBar?.currentHeight || 24 : 0;
|
|
@@ -153,7 +218,9 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
153
218
|
zIndex: 99999,
|
|
154
219
|
left: isCenter ? 16 : isLeft ? 16 : undefined,
|
|
155
220
|
right: isCenter ? 16 : !isLeft ? 16 : undefined,
|
|
156
|
-
...(isTop
|
|
221
|
+
...(isTop
|
|
222
|
+
? { top: isAndroid ? statusBarHeight + 12 : 48 }
|
|
223
|
+
: { bottom: 24 }),
|
|
157
224
|
};
|
|
158
225
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isOpen && ((0, jsx_runtime_1.jsx)(View, { style: [pillPosStyle, style], pointerEvents: "box-none", children: renderTrigger ? (renderTrigger({
|
|
159
226
|
isOpen,
|
|
@@ -162,33 +229,101 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
162
229
|
metrics,
|
|
163
230
|
statusColor,
|
|
164
231
|
statusLabel,
|
|
165
|
-
})) : !alwaysVisible &&
|
|
232
|
+
})) : !alwaysVisible &&
|
|
233
|
+
status.pendingCount === 0 &&
|
|
234
|
+
status.isOnline &&
|
|
235
|
+
!status.isSyncing ? null : ((0, jsx_runtime_1.jsxs)(TouchableOpacity, { onPress: () => setIsOpen(true), style: [
|
|
166
236
|
isInline ? rnStyles.inlinePill : rnStyles.pill,
|
|
167
237
|
{
|
|
168
238
|
borderColor: statusColor,
|
|
169
239
|
backgroundColor: currentTheme.surface,
|
|
170
|
-
alignSelf: isInline
|
|
240
|
+
alignSelf: isInline
|
|
241
|
+
? 'auto'
|
|
242
|
+
: isCenter
|
|
243
|
+
? 'center'
|
|
244
|
+
: isLeft
|
|
245
|
+
? 'flex-start'
|
|
246
|
+
: 'flex-end',
|
|
171
247
|
},
|
|
172
|
-
], activeOpacity: 0.8, children: [(0, jsx_runtime_1.jsx)(View, { style: [rnStyles.dot, { backgroundColor: statusColor }] }), variant !== 'icon' && variant !== 'minimal' && ((0, jsx_runtime_1.jsx)(Text, { style: [
|
|
248
|
+
], activeOpacity: 0.8, children: [(0, jsx_runtime_1.jsx)(View, { style: [rnStyles.dot, { backgroundColor: statusColor }] }), variant !== 'icon' && variant !== 'minimal' && ((0, jsx_runtime_1.jsx)(Text, { style: [
|
|
249
|
+
isInline ? rnStyles.inlinePillText : rnStyles.pillText,
|
|
250
|
+
{ color: currentTheme.text },
|
|
251
|
+
], children: triggerLabel })), status.pendingCount > 0 && variant !== 'compact' && ((0, jsx_runtime_1.jsx)(View, { style: rnStyles.badge, children: (0, jsx_runtime_1.jsx)(Text, { style: rnStyles.badgeText, children: status.pendingCount }) }))] })) })), (0, jsx_runtime_1.jsx)(Modal, { visible: isOpen, animationType: "slide", presentationStyle: "fullScreen", statusBarTranslucent: true, onRequestClose: () => setIsOpen(false), children: (0, jsx_runtime_1.jsxs)(SafeComp, { style: [
|
|
252
|
+
rnStyles.fullScreenSafe,
|
|
253
|
+
{ backgroundColor: currentTheme.bg },
|
|
254
|
+
], edges: ['top', 'bottom', 'left', 'right'], children: [(0, jsx_runtime_1.jsxs)(View, { style: [
|
|
173
255
|
rnStyles.topBar,
|
|
174
256
|
{
|
|
175
257
|
backgroundColor: currentTheme.surface,
|
|
176
258
|
borderBottomColor: currentTheme.border,
|
|
177
259
|
},
|
|
178
|
-
!RNSafeArea?.SafeAreaView &&
|
|
179
|
-
|
|
260
|
+
!RNSafeArea?.SafeAreaView &&
|
|
261
|
+
isAndroid && { paddingTop: statusBarHeight + 10 },
|
|
262
|
+
], children: [(0, jsx_runtime_1.jsxs)(View, { style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)(Text, { style: [rnStyles.topBarTitle, { color: currentTheme.text }], children: title }), (0, jsx_runtime_1.jsx)(Text, { style: [
|
|
263
|
+
rnStyles.topBarSub,
|
|
264
|
+
{ color: currentTheme.textMuted },
|
|
265
|
+
], children: "Engine Inspector & Sync Telemetry" })] }), (0, jsx_runtime_1.jsx)(View, { style: [
|
|
266
|
+
rnStyles.statusBadge,
|
|
267
|
+
{
|
|
268
|
+
borderColor: statusColor,
|
|
269
|
+
backgroundColor: `${statusColor}20`,
|
|
270
|
+
},
|
|
271
|
+
], children: (0, jsx_runtime_1.jsx)(Text, { style: [rnStyles.statusBadgeText, { color: statusColor }], children: statusLabel }) }), (0, jsx_runtime_1.jsx)(TouchableOpacity, { onPress: () => setIsOpen(false), style: [
|
|
272
|
+
rnStyles.closeCircle,
|
|
273
|
+
{ backgroundColor: currentTheme.actionBg },
|
|
274
|
+
], activeOpacity: 0.7, children: (0, jsx_runtime_1.jsx)(Text, { style: [
|
|
275
|
+
rnStyles.closeCircleText,
|
|
276
|
+
{ color: currentTheme.actionText },
|
|
277
|
+
], children: "\u2715" }) })] }), (0, jsx_runtime_1.jsxs)(ScrollView, { style: [
|
|
278
|
+
rnStyles.scrollBody,
|
|
279
|
+
{ backgroundColor: currentTheme.bg },
|
|
280
|
+
], contentContainerStyle: rnStyles.scrollContent, showsVerticalScrollIndicator: true, children: [actionMessage && ((0, jsx_runtime_1.jsx)(View, { style: rnStyles.actionMsgBox, children: (0, jsx_runtime_1.jsx)(Text, { style: rnStyles.actionMsgText, children: actionMessage }) })), (0, jsx_runtime_1.jsx)(View, { style: rnStyles.statGrid, children: statCards.map((card) => ((0, jsx_runtime_1.jsxs)(View, { style: [
|
|
180
281
|
rnStyles.statCard,
|
|
181
282
|
{
|
|
182
283
|
backgroundColor: currentTheme.card,
|
|
183
284
|
borderColor: currentTheme.border,
|
|
184
285
|
},
|
|
185
|
-
], children: [(0, jsx_runtime_1.jsx)(Text, { style: [rnStyles.statNum, { color: card.numColor }], children: String(card.num ?? 0) }), (0, jsx_runtime_1.jsx)(Text, { style: [
|
|
286
|
+
], children: [(0, jsx_runtime_1.jsx)(Text, { style: [rnStyles.statNum, { color: card.numColor }], children: String(card.num ?? 0) }), (0, jsx_runtime_1.jsx)(Text, { style: [
|
|
287
|
+
rnStyles.statLabel,
|
|
288
|
+
{ color: currentTheme.textSecondary },
|
|
289
|
+
], children: card.label }), (0, jsx_runtime_1.jsx)(Text, { style: [
|
|
290
|
+
rnStyles.statSub,
|
|
291
|
+
{ color: currentTheme.textMuted },
|
|
292
|
+
], children: card.sub })] }, card.id))) }), (0, jsx_runtime_1.jsxs)(View, { style: [
|
|
186
293
|
rnStyles.infoCard,
|
|
187
294
|
{
|
|
188
295
|
backgroundColor: currentTheme.card,
|
|
189
296
|
borderColor: currentTheme.border,
|
|
190
297
|
},
|
|
191
|
-
], children: [(0, jsx_runtime_1.jsx)(Text, { style: [
|
|
298
|
+
], children: [(0, jsx_runtime_1.jsx)(Text, { style: [
|
|
299
|
+
rnStyles.infoCardTitle,
|
|
300
|
+
{ color: currentTheme.textMuted },
|
|
301
|
+
], children: "ENGINE ACTIONS" }), (0, jsx_runtime_1.jsx)(View, { style: rnStyles.btnRow, children: actionButtons.slice(0, 2).map((btn) => ((0, jsx_runtime_1.jsx)(TouchableOpacity, { onPress: btn.onPress, style: [rnStyles.actionBtn, { backgroundColor: btn.bg }], activeOpacity: 0.8, children: (0, jsx_runtime_1.jsx)(Text, { style: [rnStyles.actionBtnText, { color: btn.color }], children: btn.label }) }, btn.id))) }), (0, jsx_runtime_1.jsx)(View, { style: [rnStyles.btnRow, { marginTop: 8 }], children: actionButtons.slice(2, 4).map((btn) => ((0, jsx_runtime_1.jsx)(TouchableOpacity, { onPress: btn.onPress, style: [
|
|
302
|
+
rnStyles.actionBtn,
|
|
303
|
+
{ backgroundColor: btn.bg },
|
|
304
|
+
btn.disabled && { opacity: 0.5 },
|
|
305
|
+
], disabled: btn.disabled, activeOpacity: 0.8, children: (0, jsx_runtime_1.jsx)(Text, { style: [rnStyles.actionBtnText, { color: btn.color }], children: btn.label }) }, btn.id))) }), (0, jsx_runtime_1.jsx)(View, { style: [rnStyles.btnRow, { marginTop: 8 }], children: actionButtons.slice(4, 6).map((btn) => ((0, jsx_runtime_1.jsx)(TouchableOpacity, { onPress: btn.onPress, style: [
|
|
306
|
+
rnStyles.actionBtn,
|
|
307
|
+
{ backgroundColor: btn.bg },
|
|
308
|
+
btn.disabled && { opacity: 0.5 },
|
|
309
|
+
], disabled: btn.disabled, activeOpacity: 0.8, children: (0, jsx_runtime_1.jsx)(Text, { style: [rnStyles.actionBtnText, { color: btn.color }], children: btn.label }) }, btn.id))) })] }), (metrics?.lastPushError || metrics?.lastPullError) && ((0, jsx_runtime_1.jsxs)(View, { style: [
|
|
310
|
+
rnStyles.infoCard,
|
|
311
|
+
{
|
|
312
|
+
borderColor: currentTheme.border,
|
|
313
|
+
backgroundColor: currentTheme.surfaceSubtle,
|
|
314
|
+
},
|
|
315
|
+
], children: [(0, jsx_runtime_1.jsx)(Text, { style: [
|
|
316
|
+
rnStyles.infoCardTitle,
|
|
317
|
+
{ color: currentTheme.text },
|
|
318
|
+
], children: "SYNC ENGINE ERRORS" }), metrics?.lastPushError && ((0, jsx_runtime_1.jsxs)(View, { style: { marginBottom: 6 }, children: [(0, jsx_runtime_1.jsx)(Text, { style: {
|
|
319
|
+
fontSize: 11,
|
|
320
|
+
color: currentTheme.textSecondary,
|
|
321
|
+
fontWeight: '700',
|
|
322
|
+
}, children: "Last Push Error:" }), (0, jsx_runtime_1.jsx)(Text, { style: { fontSize: 12, color: currentTheme.text }, children: String(metrics.lastPushError) })] })), metrics?.lastPullError && ((0, jsx_runtime_1.jsxs)(View, { children: [(0, jsx_runtime_1.jsx)(Text, { style: {
|
|
323
|
+
fontSize: 11,
|
|
324
|
+
color: currentTheme.textSecondary,
|
|
325
|
+
fontWeight: '700',
|
|
326
|
+
}, children: "Last Pull Error:" }), (0, jsx_runtime_1.jsx)(Text, { style: { fontSize: 12, color: currentTheme.text }, children: String(metrics.lastPullError) })] }))] })), status.pendingRecords && status.pendingRecords.length > 0 && ((0, jsx_runtime_1.jsxs)(View, { style: [
|
|
192
327
|
rnStyles.infoCard,
|
|
193
328
|
{
|
|
194
329
|
backgroundColor: currentTheme.card,
|
|
@@ -199,23 +334,65 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
199
334
|
justifyContent: 'space-between',
|
|
200
335
|
alignItems: 'center',
|
|
201
336
|
marginBottom: 10,
|
|
202
|
-
}, children: [(0, jsx_runtime_1.jsxs)(Text, { style: [
|
|
337
|
+
}, children: [(0, jsx_runtime_1.jsxs)(Text, { style: [
|
|
338
|
+
rnStyles.infoCardTitle,
|
|
339
|
+
{ color: currentTheme.textMuted },
|
|
340
|
+
], children: ["QUEUED OUTBOX MUTATIONS (", status.pendingRecords.length, ")"] }), (0, jsx_runtime_1.jsx)(Text, { style: { fontSize: 10, color: currentTheme.textMuted }, children: "Latest queued" })] }), status.pendingRecords
|
|
341
|
+
.slice(0, 8)
|
|
342
|
+
.map((rec, idx) => ((0, jsx_runtime_1.jsxs)(View, { style: [
|
|
203
343
|
rnStyles.infoRow,
|
|
204
344
|
{ borderBottomColor: currentTheme.border },
|
|
205
|
-
idx ===
|
|
206
|
-
|
|
345
|
+
idx ===
|
|
346
|
+
Math.min(status.pendingRecords.length, 8) - 1 && {
|
|
347
|
+
borderBottomWidth: 0,
|
|
348
|
+
},
|
|
349
|
+
], children: [(0, jsx_runtime_1.jsxs)(View, { style: { flex: 1 }, children: [(0, jsx_runtime_1.jsxs)(View, { style: {
|
|
350
|
+
flexDirection: 'row',
|
|
351
|
+
alignItems: 'center',
|
|
352
|
+
gap: 6,
|
|
353
|
+
}, children: [(0, jsx_runtime_1.jsx)(View, { style: [
|
|
207
354
|
rnStyles.dotSmall,
|
|
208
|
-
{
|
|
209
|
-
|
|
355
|
+
{
|
|
356
|
+
backgroundColor: rec.status === 'FAILED'
|
|
357
|
+
? '#EF4444'
|
|
358
|
+
: '#F59E0B',
|
|
359
|
+
},
|
|
360
|
+
] }), (0, jsx_runtime_1.jsx)(Text, { style: {
|
|
361
|
+
color: currentTheme.text,
|
|
362
|
+
fontSize: 13,
|
|
363
|
+
fontWeight: '600',
|
|
364
|
+
}, children: rec.tableName || 'record' }), (0, jsx_runtime_1.jsx)(View, { style: {
|
|
210
365
|
backgroundColor: currentTheme.actionBg,
|
|
211
366
|
paddingHorizontal: 5,
|
|
212
367
|
paddingVertical: 1,
|
|
213
368
|
borderRadius: 4,
|
|
214
|
-
}, children: (0, jsx_runtime_1.jsx)(Text, { style: {
|
|
369
|
+
}, children: (0, jsx_runtime_1.jsx)(Text, { style: {
|
|
370
|
+
color: currentTheme.actionText,
|
|
371
|
+
fontSize: 10,
|
|
372
|
+
fontWeight: '700',
|
|
373
|
+
}, children: rec.operation || 'MUTATE' }) })] }), rec.rowId && ((0, jsx_runtime_1.jsxs)(Text, { style: {
|
|
374
|
+
color: currentTheme.textMuted,
|
|
375
|
+
fontSize: 11,
|
|
376
|
+
marginTop: 2,
|
|
377
|
+
}, numberOfLines: 1, children: ["ID: ", rec.rowId] })), rec.errorMessage && ((0, jsx_runtime_1.jsx)(Text, { style: {
|
|
378
|
+
color: '#EF4444',
|
|
379
|
+
fontSize: 11,
|
|
380
|
+
marginTop: 2,
|
|
381
|
+
}, children: rec.errorMessage }))] }), (0, jsx_runtime_1.jsx)(Text, { style: {
|
|
382
|
+
color: currentTheme.textMuted,
|
|
383
|
+
fontSize: 11,
|
|
384
|
+
}, children: rec.status || 'PENDING' })] }, rec.id || idx))), status.pendingRecords.length > 8 && ((0, jsx_runtime_1.jsxs)(Text, { style: {
|
|
385
|
+
color: currentTheme.textMuted,
|
|
386
|
+
fontSize: 11,
|
|
387
|
+
textAlign: 'center',
|
|
388
|
+
marginTop: 8,
|
|
389
|
+
}, children: ["+ ", status.pendingRecords.length - 8, " more mutations in outbox"] }))] })), enableBenchmark && ((0, jsx_runtime_1.jsxs)(View, { style: [
|
|
215
390
|
rnStyles.infoCard,
|
|
216
391
|
{
|
|
217
392
|
borderColor: '#8B5CF640',
|
|
218
|
-
backgroundColor: currentTheme.isDark
|
|
393
|
+
backgroundColor: currentTheme.isDark
|
|
394
|
+
? '#1E1B4B25'
|
|
395
|
+
: '#F5F3FF',
|
|
219
396
|
},
|
|
220
397
|
], children: [(0, jsx_runtime_1.jsxs)(View, { style: {
|
|
221
398
|
flexDirection: 'row',
|
|
@@ -224,12 +401,23 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
224
401
|
marginBottom: 8,
|
|
225
402
|
}, children: [(0, jsx_runtime_1.jsx)(Text, { style: [
|
|
226
403
|
rnStyles.infoCardTitle,
|
|
227
|
-
{
|
|
404
|
+
{
|
|
405
|
+
color: currentTheme.isDark ? '#C4B5FD' : '#6D28D9',
|
|
406
|
+
marginBottom: 0,
|
|
407
|
+
},
|
|
228
408
|
], children: "PERFORMANCE BENCHMARK" }), (0, jsx_runtime_1.jsx)(Text, { style: {
|
|
229
409
|
fontSize: 10,
|
|
230
410
|
color: currentTheme.isDark ? '#A78BFA' : '#7C3AED',
|
|
231
411
|
fontWeight: '700',
|
|
232
|
-
}, children: "ACID & WAL" })] }), (0, jsx_runtime_1.jsx)(Text, { style: {
|
|
412
|
+
}, children: "ACID & WAL" })] }), (0, jsx_runtime_1.jsx)(Text, { style: {
|
|
413
|
+
fontSize: 12,
|
|
414
|
+
color: currentTheme.textMuted,
|
|
415
|
+
marginBottom: 12,
|
|
416
|
+
lineHeight: 18,
|
|
417
|
+
}, children: BENCHMARK_DESCRIPTION }), (0, jsx_runtime_1.jsx)(TouchableOpacity, { onPress: handleBenchmarkPress, style: [rnStyles.actionBtn, { backgroundColor: '#8B5CF6' }], activeOpacity: 0.8, children: (0, jsx_runtime_1.jsx)(Text, { style: [
|
|
418
|
+
rnStyles.actionBtnText,
|
|
419
|
+
{ color: '#FFFFFF', fontWeight: '700' },
|
|
420
|
+
], children: "\u26A1 Open SQLite Benchmark Suite" }) })] }))] })] }) }), enableBenchmark && !onOpenBenchmark && ((0, jsx_runtime_1.jsx)(BenchmarkModal_js_1.BenchmarkModal, { client: client, visible: isBenchmarkModalOpen, onDismiss: () => setIsBenchmarkModalOpen(false), theme: theme }))] }));
|
|
233
421
|
}
|
|
234
422
|
// Web / DOM Renderer Fallback
|
|
235
423
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isOpen ? ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
@@ -253,7 +441,15 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
253
441
|
height: 12,
|
|
254
442
|
borderRadius: 6,
|
|
255
443
|
backgroundColor: statusColor,
|
|
256
|
-
} }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
444
|
+
} }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
445
|
+
fontSize: 17,
|
|
446
|
+
fontWeight: 700,
|
|
447
|
+
color: currentTheme.text,
|
|
448
|
+
}, children: title }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
449
|
+
fontSize: 11,
|
|
450
|
+
color: currentTheme.textMuted,
|
|
451
|
+
marginTop: 2,
|
|
452
|
+
}, children: "Engine Inspector & Sync Telemetry" })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: 12 }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
257
453
|
border: `1px solid ${statusColor}`,
|
|
258
454
|
color: statusColor,
|
|
259
455
|
padding: '3px 10px',
|
|
@@ -302,7 +498,20 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
302
498
|
border: `1px solid ${currentTheme.border}`,
|
|
303
499
|
borderRadius: 12,
|
|
304
500
|
padding: 8,
|
|
305
|
-
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
501
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
502
|
+
fontSize: 24,
|
|
503
|
+
fontWeight: 800,
|
|
504
|
+
color: card.numColor,
|
|
505
|
+
}, children: card.num }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
506
|
+
fontSize: 12,
|
|
507
|
+
color: currentTheme.textSecondary,
|
|
508
|
+
marginTop: 4,
|
|
509
|
+
fontWeight: 600,
|
|
510
|
+
}, children: card.label }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
511
|
+
fontSize: 11,
|
|
512
|
+
color: currentTheme.textMuted,
|
|
513
|
+
marginTop: 2,
|
|
514
|
+
}, children: card.sub })] }, card.id))) }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
306
515
|
backgroundColor: currentTheme.card,
|
|
307
516
|
border: `1px solid ${currentTheme.border}`,
|
|
308
517
|
borderRadius: 12,
|
|
@@ -313,7 +522,11 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
313
522
|
color: currentTheme.textMuted,
|
|
314
523
|
letterSpacing: '0.8px',
|
|
315
524
|
marginBottom: 12,
|
|
316
|
-
}, children: "ENGINE ACTIONS" }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
525
|
+
}, children: "ENGINE ACTIONS" }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
526
|
+
display: 'grid',
|
|
527
|
+
gridTemplateColumns: '1fr 1fr',
|
|
528
|
+
gap: 10,
|
|
529
|
+
}, children: actionButtons.map((btn) => ((0, jsx_runtime_1.jsx)("button", { onClick: btn.onPress, disabled: btn.disabled, style: {
|
|
317
530
|
padding: '10px 14px',
|
|
318
531
|
backgroundColor: btn.bg,
|
|
319
532
|
color: btn.color,
|
|
@@ -323,7 +536,9 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
323
536
|
cursor: btn.disabled ? 'not-allowed' : 'pointer',
|
|
324
537
|
opacity: btn.disabled ? 0.5 : 1,
|
|
325
538
|
}, children: btn.label }, btn.id))) })] }), enableBenchmark && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
326
|
-
backgroundColor: currentTheme.isDark
|
|
539
|
+
backgroundColor: currentTheme.isDark
|
|
540
|
+
? '#1E1B4B25'
|
|
541
|
+
: '#F5F3FF',
|
|
327
542
|
border: '1px solid #8B5CF640',
|
|
328
543
|
borderRadius: 12,
|
|
329
544
|
padding: 16,
|
|
@@ -340,7 +555,12 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
340
555
|
fontSize: 10,
|
|
341
556
|
color: currentTheme.isDark ? '#A78BFA' : '#7C3AED',
|
|
342
557
|
fontWeight: 700,
|
|
343
|
-
}, children: "ACID & WAL" })] }), (0, jsx_runtime_1.jsx)("p", { style: {
|
|
558
|
+
}, children: "ACID & WAL" })] }), (0, jsx_runtime_1.jsx)("p", { style: {
|
|
559
|
+
fontSize: 12,
|
|
560
|
+
color: currentTheme.textMuted,
|
|
561
|
+
margin: '0 0 12px 0',
|
|
562
|
+
lineHeight: '18px',
|
|
563
|
+
}, children: BENCHMARK_DESCRIPTION }), (0, jsx_runtime_1.jsx)("button", { onClick: handleBenchmarkPress, style: {
|
|
344
564
|
width: '100%',
|
|
345
565
|
padding: '10px 16px',
|
|
346
566
|
backgroundColor: '#8B5CF6',
|
|
@@ -368,7 +588,10 @@ function SyncInspector({ client, position = 'bottom-right', variant = 'pill', in
|
|
|
368
588
|
metrics,
|
|
369
589
|
statusColor,
|
|
370
590
|
statusLabel,
|
|
371
|
-
})) : !alwaysVisible &&
|
|
591
|
+
})) : !alwaysVisible &&
|
|
592
|
+
status.pendingCount === 0 &&
|
|
593
|
+
status.isOnline &&
|
|
594
|
+
!status.isSyncing ? null : ((0, jsx_runtime_1.jsxs)("button", { onClick: () => setIsOpen(true), style: {
|
|
372
595
|
display: 'inline-flex',
|
|
373
596
|
alignItems: 'center',
|
|
374
597
|
gap: 8,
|
package/dist/email/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Transporter, SendMailOptions, TransportOptions } from 'nodemailer';
|
|
2
1
|
import type { ActionHandlerContext, ActionRecord, EmailAttachment, EmailPayload } from '../actions/types.js';
|
|
3
2
|
export type EmailProviderType = 'nodemailer' | 'resend' | 'sendgrid' | 'postmark' | 'http' | 'dev' | 'preview' | 'custom';
|
|
4
3
|
export interface EmailHandlerOptions {
|
|
@@ -10,7 +9,7 @@ export interface EmailHandlerOptions {
|
|
|
10
9
|
/**
|
|
11
10
|
* Additional default options merged into every outgoing email.
|
|
12
11
|
*/
|
|
13
|
-
defaults?: Partial<
|
|
12
|
+
defaults?: Partial<EmailMailOptions> & Record<string, any>;
|
|
14
13
|
/**
|
|
15
14
|
* Custom template renderer invoked when `template` or `templateData` is provided in EmailPayload.
|
|
16
15
|
*/
|
|
@@ -53,7 +52,19 @@ export interface EmailDeliveryConfig extends EmailHandlerOptions {
|
|
|
53
52
|
silentDev?: boolean;
|
|
54
53
|
}
|
|
55
54
|
export type NodemailerHandlerOptions = EmailHandlerOptions;
|
|
56
|
-
export
|
|
55
|
+
export interface EmailMailOptions {
|
|
56
|
+
to?: any;
|
|
57
|
+
from?: any;
|
|
58
|
+
subject?: string;
|
|
59
|
+
text?: string;
|
|
60
|
+
html?: string;
|
|
61
|
+
cc?: any;
|
|
62
|
+
bcc?: any;
|
|
63
|
+
replyTo?: any;
|
|
64
|
+
headers?: Record<string, any>;
|
|
65
|
+
attachments?: any[];
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}
|
|
57
68
|
export interface EmailSendResult {
|
|
58
69
|
messageId: string;
|
|
59
70
|
response?: any;
|
|
@@ -66,7 +77,7 @@ export type ConcreteEmailHandler = (payload: EmailPayload, record: ActionRecord<
|
|
|
66
77
|
export interface DevSentEmail {
|
|
67
78
|
id: string;
|
|
68
79
|
sentAt: number;
|
|
69
|
-
mailOptions:
|
|
80
|
+
mailOptions: EmailMailOptions;
|
|
70
81
|
payload: EmailPayload;
|
|
71
82
|
record: ActionRecord<EmailPayload>;
|
|
72
83
|
}
|
|
@@ -80,14 +91,6 @@ export declare class DevMailbox {
|
|
|
80
91
|
static clear(): void;
|
|
81
92
|
static record(email: DevSentEmail): void;
|
|
82
93
|
}
|
|
83
|
-
/**
|
|
84
|
-
* Dynamically loads the nodemailer module if not already available.
|
|
85
|
-
*/
|
|
86
|
-
export declare function loadNodemailer(): Promise<any>;
|
|
87
|
-
/**
|
|
88
|
-
* Resolves or instantiates a Nodemailer Transporter instance.
|
|
89
|
-
*/
|
|
90
|
-
export declare function resolveTransporter(input: NodemailerTransportInput, defaults?: Partial<SendMailOptions>): Promise<Transporter>;
|
|
91
94
|
/**
|
|
92
95
|
* Renders a React element or JSX component into clean HTML and plaintext fallback.
|
|
93
96
|
*/
|
|
@@ -102,12 +105,8 @@ export declare function hydrateAttachment(att: EmailAttachment): Promise<any>;
|
|
|
102
105
|
/**
|
|
103
106
|
* Maps an offline Local-Lite EmailPayload to standard email options.
|
|
104
107
|
*/
|
|
105
|
-
export declare function buildMailOptions(payload: EmailPayload, options?: EmailHandlerOptions):
|
|
106
|
-
|
|
107
|
-
* Creates an EmailHandler for local-lite ActionManager that sends emails
|
|
108
|
-
* directly via Nodemailer (SMTP, Sendmail, SES, etc.).
|
|
109
|
-
*/
|
|
110
|
-
export declare function createNodemailerHandler(transporterOrOptions: NodemailerTransportInput, handlerOptions?: NodemailerHandlerOptions): ConcreteEmailHandler;
|
|
108
|
+
export declare function buildMailOptions(payload: EmailPayload, options?: EmailHandlerOptions): EmailMailOptions;
|
|
109
|
+
export declare function prepareMailOptions(payload: EmailPayload, options: EmailHandlerOptions, record: ActionRecord<EmailPayload>): Promise<EmailMailOptions>;
|
|
111
110
|
/**
|
|
112
111
|
* Creates an EmailHandler for local-lite ActionManager that dispatches emails
|
|
113
112
|
* via HTTP APIs (e.g. Resend, SendGrid, Postmark, or custom webhooks/endpoints).
|