@pol-studios/db 1.0.0 → 1.0.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 +434 -0
- package/dist/EntityPermissions-DwFt4tUd.d.ts +35 -0
- package/dist/FilterConfig-Bt2Ek74z.d.ts +99 -0
- package/dist/UserMetadataContext-BYYqA6LI.d.ts +89 -0
- package/dist/auth/context.d.ts +47 -0
- package/dist/auth/context.js +12791 -0
- package/dist/auth/context.js.map +1 -0
- package/dist/auth/guards.d.ts +180 -0
- package/dist/auth/guards.js +7651 -0
- package/dist/auth/guards.js.map +1 -0
- package/dist/auth/hooks.d.ts +312 -0
- package/dist/auth/hooks.js +10600 -0
- package/dist/auth/hooks.js.map +1 -0
- package/dist/auth/index.d.ts +10 -0
- package/dist/auth/index.js +13035 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/client/index.d.ts +16 -0
- package/dist/core/index.d.ts +508 -0
- package/dist/executor-CB4KHyYG.d.ts +507 -0
- package/dist/gen/index.d.ts +1099 -0
- package/dist/hooks/index.d.ts +83 -0
- package/dist/index-DNrSptau.d.ts +8780 -0
- package/dist/index.d.ts +338 -0
- package/dist/index.js +10320 -7124
- package/dist/index.js.map +1 -1
- package/dist/index.web.d.ts +318 -0
- package/dist/index.web.js +56795 -0
- package/dist/index.web.js.map +1 -0
- package/dist/mutation/index.d.ts +58 -0
- package/dist/mutation/index.js +4581 -76
- package/dist/mutation/index.js.map +1 -1
- package/dist/parser/index.d.ts +366 -0
- package/dist/parser/index.js +26 -26
- package/dist/parser/index.js.map +1 -1
- package/dist/query/index.d.ts +723 -0
- package/dist/query/index.js +13124 -10324
- package/dist/query/index.js.map +1 -1
- package/dist/realtime/index.d.ts +44 -0
- package/dist/realtime/index.js +13217 -9297
- package/dist/realtime/index.js.map +1 -1
- package/dist/select-query-parser-CLkOKHzc.d.ts +352 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types-CKsWM8T3.d.ts +62 -0
- package/dist/useBatchUpsert-ooLlpJMg.d.ts +24 -0
- package/dist/useDbCount-B5-Va9sg.d.ts +1740 -0
- package/dist/useDbQuery-C-TL8jY1.d.ts +19 -0
- package/dist/useResolveFeedback-DuGP4Tgb.d.ts +1165 -0
- package/dist/useSupabase-pPhUZHcl.d.ts +27 -0
- package/package.json +31 -7
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export { H as ClarificationQuestion, p as DatabaseTypes, F as Filter, y as FilterGroup, z as FilterOperator, E as Pagination, P as PublicTableNames, Q as QueryState, R as ResolveRowType, S as SchemaNames, q as SchemaTableNames, G as Sort, r as TableIdentifier, I as UseAdvanceQueryOptions, J as UseAdvanceQueryResult, a4 as UseDbCountOptions, a5 as UseDbCountResult, _ as UseDbDeleteOptions, $ as UseDbDeleteResult, a1 as UseDbInfiniteQueryOptions, a2 as UseDbInfiniteQueryResult, L as UseDbInsertOptions, M as UseDbInsertResult, v as UseDbQueryByIdOptions, w as UseDbQueryByIdResult, U as UseDbQueryOptions, s as UseDbQueryResult, O as UseDbUpdateOptions, V as UseDbUpdateResult, X as UseDbUpsertOptions, Y as UseDbUpsertResult, x as useAdvanceQuery, u as useDataLayer, n as useDataLayerOptional, a3 as useDbCount, Z as useDbDelete, a0 as useDbInfiniteQuery, K as useDbInsert, o as useDbQuery, t as useDbQueryById, N as useDbUpdate, W as useDbUpsert } from '../useDbCount-B5-Va9sg.js';
|
|
2
|
+
import { SyncStatus, SyncControl } from '../core/index.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@supabase/supabase-js';
|
|
5
|
+
import '@tanstack/react-query';
|
|
6
|
+
import '../executor-CB4KHyYG.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* V3 useSyncStatus Hook
|
|
10
|
+
*
|
|
11
|
+
* Provides sync status information from the data layer.
|
|
12
|
+
* Returns default "always synced" status when PowerSync is not available.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Hook to get the current sync status
|
|
17
|
+
*
|
|
18
|
+
* When PowerSync is not available, returns a default "always synced" status.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const { isSyncing, pendingUploads, isConnected } = useSyncStatus();
|
|
22
|
+
*
|
|
23
|
+
* if (pendingUploads > 0) {
|
|
24
|
+
* console.log(`${pendingUploads} changes waiting to sync`);
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
declare function useSyncStatus(): SyncStatus;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* V3 useSyncControl Hook
|
|
31
|
+
*
|
|
32
|
+
* Provides sync control functions from the data layer.
|
|
33
|
+
* Returns no-op functions when PowerSync is not available.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Hook to get sync controls for PowerSync
|
|
38
|
+
*
|
|
39
|
+
* When PowerSync is not available, all methods are no-ops that log a warning.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const { triggerSync, startLiveSync, stopLiveSync } = useSyncControl();
|
|
43
|
+
*
|
|
44
|
+
* // Manually trigger a sync
|
|
45
|
+
* await triggerSync();
|
|
46
|
+
*
|
|
47
|
+
* // Start/stop live sync
|
|
48
|
+
* await startLiveSync();
|
|
49
|
+
* stopLiveSync();
|
|
50
|
+
*/
|
|
51
|
+
declare function useSyncControl(): SyncControl;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* V3 useOnlineStatus Hook
|
|
55
|
+
*
|
|
56
|
+
* Provides online/connection status information.
|
|
57
|
+
* Combines data layer status with platform-specific online/offline events.
|
|
58
|
+
* Works on both web (browser events) and React Native (NetInfo).
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* Online status information
|
|
62
|
+
*/
|
|
63
|
+
interface OnlineStatus {
|
|
64
|
+
/** Whether the device has network connectivity */
|
|
65
|
+
isOnline: boolean;
|
|
66
|
+
/** Whether PowerSync is connected (false if using Supabase-only) */
|
|
67
|
+
isConnected: boolean;
|
|
68
|
+
/** Current backend being used */
|
|
69
|
+
backend: "powersync" | "supabase" | null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Hook to get online/connection status
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* const { isOnline, isConnected, backend } = useOnlineStatus();
|
|
76
|
+
*
|
|
77
|
+
* if (!isOnline) {
|
|
78
|
+
* return <OfflineBanner />;
|
|
79
|
+
* }
|
|
80
|
+
*/
|
|
81
|
+
declare function useOnlineStatus(): OnlineStatus;
|
|
82
|
+
|
|
83
|
+
export { type OnlineStatus, useOnlineStatus, useSyncControl, useSyncStatus };
|