@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.
Files changed (49) hide show
  1. package/README.md +434 -0
  2. package/dist/EntityPermissions-DwFt4tUd.d.ts +35 -0
  3. package/dist/FilterConfig-Bt2Ek74z.d.ts +99 -0
  4. package/dist/UserMetadataContext-BYYqA6LI.d.ts +89 -0
  5. package/dist/auth/context.d.ts +47 -0
  6. package/dist/auth/context.js +12791 -0
  7. package/dist/auth/context.js.map +1 -0
  8. package/dist/auth/guards.d.ts +180 -0
  9. package/dist/auth/guards.js +7651 -0
  10. package/dist/auth/guards.js.map +1 -0
  11. package/dist/auth/hooks.d.ts +312 -0
  12. package/dist/auth/hooks.js +10600 -0
  13. package/dist/auth/hooks.js.map +1 -0
  14. package/dist/auth/index.d.ts +10 -0
  15. package/dist/auth/index.js +13035 -0
  16. package/dist/auth/index.js.map +1 -0
  17. package/dist/client/index.d.ts +16 -0
  18. package/dist/core/index.d.ts +508 -0
  19. package/dist/executor-CB4KHyYG.d.ts +507 -0
  20. package/dist/gen/index.d.ts +1099 -0
  21. package/dist/hooks/index.d.ts +83 -0
  22. package/dist/index-DNrSptau.d.ts +8780 -0
  23. package/dist/index.d.ts +338 -0
  24. package/dist/index.js +10320 -7124
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.web.d.ts +318 -0
  27. package/dist/index.web.js +56795 -0
  28. package/dist/index.web.js.map +1 -0
  29. package/dist/mutation/index.d.ts +58 -0
  30. package/dist/mutation/index.js +4581 -76
  31. package/dist/mutation/index.js.map +1 -1
  32. package/dist/parser/index.d.ts +366 -0
  33. package/dist/parser/index.js +26 -26
  34. package/dist/parser/index.js.map +1 -1
  35. package/dist/query/index.d.ts +723 -0
  36. package/dist/query/index.js +13124 -10324
  37. package/dist/query/index.js.map +1 -1
  38. package/dist/realtime/index.d.ts +44 -0
  39. package/dist/realtime/index.js +13217 -9297
  40. package/dist/realtime/index.js.map +1 -1
  41. package/dist/select-query-parser-CLkOKHzc.d.ts +352 -0
  42. package/dist/types/index.d.ts +6 -0
  43. package/dist/types-CKsWM8T3.d.ts +62 -0
  44. package/dist/useBatchUpsert-ooLlpJMg.d.ts +24 -0
  45. package/dist/useDbCount-B5-Va9sg.d.ts +1740 -0
  46. package/dist/useDbQuery-C-TL8jY1.d.ts +19 -0
  47. package/dist/useResolveFeedback-DuGP4Tgb.d.ts +1165 -0
  48. package/dist/useSupabase-pPhUZHcl.d.ts +27 -0
  49. 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 };