@pol-studios/db 1.0.1 → 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.
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ReactNode } from 'react';
4
4
  import { User, SignUpWithPasswordCredentials, AuthTokenResponsePassword } from '@supabase/supabase-js';
5
- import { D as Database } from './useSupabase-DO9kQv2O.js';
5
+ import { D as Database } from './useSupabase-pPhUZHcl.js';
6
6
 
7
7
  type ProfileStatus = "active" | "archived" | "suspended";
8
8
  interface SetupAuthContext {
@@ -1,10 +1,10 @@
1
- export { c as Profile, P as ProfileStatus, a as SetupAuthContext, S as SetupAuthContextProvider, b as SetupAuthContextProviderProps, U as UserMetadataContextType, h as UserMetadataInsert, i as UserMetadataProvider, j as UserMetadataRow, k as UserMetadataUpdate, s as setupAuthContext, u as useSetUserMetadata, d as useUserMetadata, e as useUserMetadataState, f as useUserMetadataValue, g as userMetadataContext } from '../UserMetadataContext-CeUdM6kV.js';
1
+ export { c as Profile, P as ProfileStatus, a as SetupAuthContext, S as SetupAuthContextProvider, b as SetupAuthContextProviderProps, U as UserMetadataContextType, h as UserMetadataInsert, i as UserMetadataProvider, j as UserMetadataRow, k as UserMetadataUpdate, s as setupAuthContext, u as useSetUserMetadata, d as useUserMetadata, e as useUserMetadataState, f as useUserMetadataValue, g as userMetadataContext } from '../UserMetadataContext-BYYqA6LI.js';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
5
  import { d as EntityType, b as EntityPermissionCheck, a as EntityAction } from '../EntityPermissions-DwFt4tUd.js';
6
6
  import '@supabase/supabase-js';
7
- import '../useSupabase-DO9kQv2O.js';
7
+ import '../useSupabase-pPhUZHcl.js';
8
8
  import '@supabase/supabase-js/dist/module/lib/types.js';
9
9
 
10
10
  interface AuthProviderProps {
@@ -1,10 +1,10 @@
1
1
  import { User } from '@supabase/supabase-js';
2
- import { a as SetupAuthContext } from '../UserMetadataContext-CeUdM6kV.js';
3
- export { u as useSetUserMetadata, d as useUserMetadata, e as useUserMetadataState, f as useUserMetadataValue } from '../UserMetadataContext-CeUdM6kV.js';
2
+ import { a as SetupAuthContext } from '../UserMetadataContext-BYYqA6LI.js';
3
+ export { u as useSetUserMetadata, d as useUserMetadata, e as useUserMetadataState, f as useUserMetadataValue } from '../UserMetadataContext-BYYqA6LI.js';
4
4
  import { d as EntityType, a as EntityAction, b as EntityPermissionCheck } from '../EntityPermissions-DwFt4tUd.js';
5
5
  import 'react/jsx-runtime';
6
6
  import 'react';
7
- import '../useSupabase-DO9kQv2O.js';
7
+ import '../useSupabase-pPhUZHcl.js';
8
8
  import '@supabase/supabase-js/dist/module/lib/types.js';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  export { EntityWithPermission, useAuth, useCanCreate, useCanDelete, useCanEdit, useCanShare, useCanView, useInvalidatePermission, usePermission, usePermissionCheck, usePermissionLoading, usePermissionsBatch, useSetupAuth } from './hooks.js';
2
- export { c as Profile, P as ProfileStatus, a as SetupAuthContext, S as SetupAuthContextProvider, b as SetupAuthContextProviderProps, U as UserMetadataContextType, h as UserMetadataInsert, i as UserMetadataProvider, j as UserMetadataRow, k as UserMetadataUpdate, s as setupAuthContext, u as useSetUserMetadata, d as useUserMetadata, e as useUserMetadataState, f as useUserMetadataValue, g as userMetadataContext } from '../UserMetadataContext-CeUdM6kV.js';
2
+ export { c as Profile, P as ProfileStatus, a as SetupAuthContext, S as SetupAuthContextProvider, b as SetupAuthContextProviderProps, U as UserMetadataContextType, h as UserMetadataInsert, i as UserMetadataProvider, j as UserMetadataRow, k as UserMetadataUpdate, s as setupAuthContext, u as useSetUserMetadata, d as useUserMetadata, e as useUserMetadataState, f as useUserMetadataValue, g as userMetadataContext } from '../UserMetadataContext-BYYqA6LI.js';
3
3
  export { AuthProvider, AuthProviderProps, EntityPermissionContextValue, PermissionContextValue, PermissionProvider, entityPermissionContext, permissionContext, usePermissions } from './context.js';
4
4
  export { hasAccess, hasAllAccess, hasAllEntityAccess, hasAnyAccess, hasAnyEntityAccess, hasEntityAccess, isEntityAccessDenied, isPermissionLoaded } from './guards.js';
5
5
  export { E as EntityAccessRecord, a as EntityAction, b as EntityPermissionCheck, c as EntityPermissionLevel, d as EntityType, P as PermissionEffect } from '../EntityPermissions-DwFt4tUd.js';
6
6
  import '@supabase/supabase-js';
7
7
  import 'react/jsx-runtime';
8
8
  import 'react';
9
- import '../useSupabase-DO9kQv2O.js';
9
+ import '../useSupabase-pPhUZHcl.js';
10
10
  import '@supabase/supabase-js/dist/module/lib/types.js';
@@ -1,4 +1,4 @@
1
- export { D as Database, a as SupabaseDatabaseTypes, S as SupabaseProvider, T as TypedSupabaseClient, U as UserSessionId, c as createNewSupabaseClient, o as onSupabaseInitialized, s as setDefaultOptions, t as typedSupabase, u as useSupabase } from '../useSupabase-DO9kQv2O.js';
1
+ export { D as Database, S as SupabaseDatabaseTypes, a as SupabaseProvider, T as TypedSupabaseClient, U as UserSessionId, c as createNewSupabaseClient, o as onSupabaseInitialized, s as setDefaultOptions, t as typedSupabase, u as useSupabase } from '../useSupabase-pPhUZHcl.js';
2
2
  import 'react/jsx-runtime';
3
3
  import '@supabase/supabase-js/dist/module/lib/types.js';
4
4
  import 'react';
@@ -1,6 +1,83 @@
1
- export { a2 as ClarificationQuestion, n as DatabaseTypes, Y as Filter, Z as FilterGroup, _ as FilterOperator, ab as OnlineStatus, $ as Pagination, P as PublicTableNames, a1 as QueryState, R as ResolveRowType, S as SchemaNames, o as SchemaTableNames, a0 as Sort, p as TableIdentifier, w as UseAdvanceQueryOptions, x as UseAdvanceQueryResult, r as UseDbCountOptions, s as UseDbCountResult, a9 as UseDbDeleteOptions, aa as UseDbDeleteResult, U as UseDbInfiniteQueryOptions, q as UseDbInfiniteQueryResult, a3 as UseDbInsertOptions, a4 as UseDbInsertResult, W as UseDbQueryByIdOptions, X as UseDbQueryByIdResult, v as UseDbQueryOptions, t as UseDbQueryResult, a5 as UseDbUpdateOptions, a6 as UseDbUpdateResult, a7 as UseDbUpsertOptions, a8 as UseDbUpsertResult, m as useAdvanceQuery, u as useDataLayer, V as useDataLayerOptional, l as useDbCount, b as useDbDelete, k as useDbInfiniteQuery, c as useDbInsert, d as useDbQuery, e as useDbQueryById, f as useDbUpdate, g as useDbUpsert, h as useOnlineStatus, i as useSyncControl, j as useSyncStatus } from '../index-CMhJjgef.js';
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';
2
3
  import 'react';
3
4
  import '@supabase/supabase-js';
4
5
  import '@tanstack/react-query';
5
- import '../core/index.js';
6
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 };
@@ -8777,4 +8777,4 @@ declare function useDbAdvanceFilterQuery<Result>(query: PromiseLike<PostgrestSin
8777
8777
  Dispatch<SetStateAction<QueryState>>
8778
8778
  ];
8779
8779
 
8780
- export { type BooleanOperator as B, type CompositeTypes as C, type DbChangeLog as D, type Enums as E, type FilterOperator as F, type Json as J, type OrderColumn as O, type Pagination as P, type QueryState as Q, type Sort as S, type Tables as T, type ValueOrArrayForPropertyType as V, type Database as a, type TablesInsert as b, type TablesUpdate as c, Constants as d, type FilterConditionType as e, type Filter as f, type FilterGroup as g, type FilterInput as h, type FilterState as i, type ComputedSortConfig as j, type ClarificationSuggestion as k, type ClarificationQuestion as l, type FilterContextType as m, normalizeFilter as n, useDbAdvanceFilterQuery as u };
8780
+ export { type BooleanOperator as B, type CompositeTypes as C, type Database as D, type Enums as E, type FilterConditionType as F, type Json as J, type OrderColumn as O, type Pagination as P, type QueryState as Q, type Sort as S, type Tables as T, type ValueOrArrayForPropertyType as V, type TablesInsert as a, type TablesUpdate as b, Constants as c, type DbChangeLog as d, type FilterInput as e, type FilterState as f, type ComputedSortConfig as g, type ClarificationSuggestion as h, type FilterContextType as i, type FilterOperator as j, type Filter as k, type FilterGroup as l, type ClarificationQuestion as m, normalizeFilter as n, useDbAdvanceFilterQuery as u };