@pol-studios/db 1.0.10 → 1.0.12

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 (120) hide show
  1. package/dist/DataLayerContext-CL6alnkb.d.ts +755 -0
  2. package/dist/UserMetadataContext-B8gVWGMl.d.ts +35 -0
  3. package/dist/UserMetadataContext-DntmpK41.d.ts +33 -0
  4. package/dist/auth/context.d.ts +3 -2
  5. package/dist/auth/context.js +5 -4
  6. package/dist/auth/guards.js +2 -2
  7. package/dist/auth/hooks.d.ts +3 -3
  8. package/dist/auth/hooks.js +6 -5
  9. package/dist/auth/index.d.ts +3 -2
  10. package/dist/auth/index.js +8 -6
  11. package/dist/{canvas-UVNDA54X.node → canvas-C4TBBDUL.node} +0 -0
  12. package/dist/{canvas-75Y7XMF3.js → canvas-ZQNCL7JL.js} +2 -2
  13. package/dist/chunk-5EFDS7SR.js +205 -0
  14. package/dist/chunk-5EFDS7SR.js.map +1 -0
  15. package/dist/{chunk-BRTW7CO5.js → chunk-7SCJNYTE.js} +1 -9
  16. package/dist/chunk-7SCJNYTE.js.map +1 -0
  17. package/dist/chunk-DJ6VLEAL.js +247 -0
  18. package/dist/chunk-DJ6VLEAL.js.map +1 -0
  19. package/dist/{chunk-Y3INY2CS.js → chunk-GC3TBUWE.js} +1 -1
  20. package/dist/chunk-GC3TBUWE.js.map +1 -0
  21. package/dist/{chunk-7HG6G25H.js → chunk-H3LNH2NT.js} +169 -268
  22. package/dist/chunk-H3LNH2NT.js.map +1 -0
  23. package/dist/{chunk-USJYMRUO.js → chunk-HAWJTZCK.js} +2 -2
  24. package/dist/chunk-HAWJTZCK.js.map +1 -0
  25. package/dist/chunk-JAATANS3.js +429 -0
  26. package/dist/chunk-JAATANS3.js.map +1 -0
  27. package/dist/chunk-LNJ3WF7V.js +470 -0
  28. package/dist/chunk-LNJ3WF7V.js.map +1 -0
  29. package/dist/chunk-N26IEHZT.js +79 -0
  30. package/dist/chunk-N26IEHZT.js.map +1 -0
  31. package/dist/chunk-NSIAAYW3.js +1 -0
  32. package/dist/chunk-NSIAAYW3.js.map +1 -0
  33. package/dist/chunk-NZON56CB.js +3864 -0
  34. package/dist/chunk-NZON56CB.js.map +1 -0
  35. package/dist/{chunk-O3K7R32P.js → chunk-OQ7U6EQ3.js} +118 -123
  36. package/dist/chunk-OQ7U6EQ3.js.map +1 -0
  37. package/dist/chunk-SM73S2DY.js +11 -0
  38. package/dist/chunk-SM73S2DY.js.map +1 -0
  39. package/dist/{chunk-JUVE3DWY.js → chunk-TKWR5AAY.js} +47 -65
  40. package/dist/chunk-TKWR5AAY.js.map +1 -0
  41. package/dist/{chunk-2IFGILT3.js → chunk-U5UNPBKB.js} +76 -107
  42. package/dist/chunk-U5UNPBKB.js.map +1 -0
  43. package/dist/chunk-WGDJ4IXR.js +921 -0
  44. package/dist/chunk-WGDJ4IXR.js.map +1 -0
  45. package/dist/chunk-WVF7RUW5.js +186 -0
  46. package/dist/chunk-WVF7RUW5.js.map +1 -0
  47. package/dist/{chunk-ZTSBF536.js → chunk-X3HZLNBV.js} +637 -435
  48. package/dist/chunk-X3HZLNBV.js.map +1 -0
  49. package/dist/{chunk-EL45Z26M.js → chunk-XU3SBFAG.js} +1219 -208
  50. package/dist/chunk-XU3SBFAG.js.map +1 -0
  51. package/dist/chunk-ZVBHWU7O.js +1412 -0
  52. package/dist/chunk-ZVBHWU7O.js.map +1 -0
  53. package/dist/client/index.d.ts +1 -1
  54. package/dist/client/index.js +42 -23
  55. package/dist/client/index.js.map +1 -1
  56. package/dist/core/index.d.ts +19 -0
  57. package/dist/{index-BFu5_dS8.d.ts → database.types-ChFCG-4M.d.ts} +1 -177
  58. package/dist/gen/index.js +4 -2
  59. package/dist/hooks/index.d.ts +10 -3
  60. package/dist/hooks/index.js +8 -10
  61. package/dist/index-CQLyNG6A.d.ts +433 -0
  62. package/dist/index.d.ts +12 -8
  63. package/dist/index.js +92 -48
  64. package/dist/index.native.d.ts +373 -33
  65. package/dist/index.native.js +79 -47
  66. package/dist/index.web.d.ts +10 -7
  67. package/dist/index.web.js +83 -78
  68. package/dist/index.web.js.map +1 -1
  69. package/dist/mutation/index.d.ts +2 -2
  70. package/dist/mutation/index.js +307 -122
  71. package/dist/mutation/index.js.map +1 -1
  72. package/dist/parser/index.js +2 -2
  73. package/dist/{pdf-3TIGQRLA.js → pdf-PHXP7RHD.js} +2 -2
  74. package/dist/powersync-bridge/index.d.ts +284 -0
  75. package/dist/powersync-bridge/index.js +22 -0
  76. package/dist/powersync-bridge/index.js.map +1 -0
  77. package/dist/query/index.js +5 -5
  78. package/dist/realtime/index.js +252 -128
  79. package/dist/realtime/index.js.map +1 -1
  80. package/dist/{UserMetadataContext-BYYqA6LI.d.ts → setupAuthContext-Kv-THH-h.d.ts} +1 -29
  81. package/dist/types/index.d.ts +5 -1
  82. package/dist/types/index.js +10 -5
  83. package/dist/{useBatchUpsert-CSQVX7w8.d.ts → useBatchUpsert-9OYjibLh.d.ts} +1 -1
  84. package/dist/{useDbCount-RGCuHmHp.d.ts → useDbCount-BG356T9i.d.ts} +3 -719
  85. package/dist/{useReceiptAI-Bn0czE7C.d.ts → useReceiptAI-6HkRpRml.d.ts} +1 -1
  86. package/dist/{useResolveFeedback-CpZPP8Pw.d.ts → useResolveFeedback-BWmatBlE.d.ts} +26 -45
  87. package/dist/{useSupabase-pPhUZHcl.d.ts → useSupabase-DvWVuHHE.d.ts} +2 -1
  88. package/dist/with-auth/index.d.ts +704 -0
  89. package/dist/with-auth/index.js +1221 -0
  90. package/dist/with-auth/index.js.map +1 -0
  91. package/package.json +25 -10
  92. package/dist/chunk-2IFGILT3.js.map +0 -1
  93. package/dist/chunk-3M2U6TXH.js +0 -928
  94. package/dist/chunk-3M2U6TXH.js.map +0 -1
  95. package/dist/chunk-5ZYAEGCJ.js +0 -416
  96. package/dist/chunk-5ZYAEGCJ.js.map +0 -1
  97. package/dist/chunk-7HG6G25H.js.map +0 -1
  98. package/dist/chunk-7XT7K4QT.js +0 -2687
  99. package/dist/chunk-7XT7K4QT.js.map +0 -1
  100. package/dist/chunk-AWFMICFV.js +0 -158
  101. package/dist/chunk-AWFMICFV.js.map +0 -1
  102. package/dist/chunk-BRTW7CO5.js.map +0 -1
  103. package/dist/chunk-EL45Z26M.js.map +0 -1
  104. package/dist/chunk-ERGF2FCE.js +0 -903
  105. package/dist/chunk-ERGF2FCE.js.map +0 -1
  106. package/dist/chunk-GK7B66LY.js +0 -135
  107. package/dist/chunk-GK7B66LY.js.map +0 -1
  108. package/dist/chunk-GQI6WJGI.js +0 -172
  109. package/dist/chunk-GQI6WJGI.js.map +0 -1
  110. package/dist/chunk-JUVE3DWY.js.map +0 -1
  111. package/dist/chunk-O3K7R32P.js.map +0 -1
  112. package/dist/chunk-SEY5UO2T.js +0 -89
  113. package/dist/chunk-SEY5UO2T.js.map +0 -1
  114. package/dist/chunk-USJYMRUO.js.map +0 -1
  115. package/dist/chunk-XX3IWSPM.js +0 -189
  116. package/dist/chunk-XX3IWSPM.js.map +0 -1
  117. package/dist/chunk-Y3INY2CS.js.map +0 -1
  118. package/dist/chunk-ZTSBF536.js.map +0 -1
  119. /package/dist/{canvas-75Y7XMF3.js.map → canvas-ZQNCL7JL.js.map} +0 -0
  120. /package/dist/{pdf-3TIGQRLA.js.map → pdf-PHXP7RHD.js.map} +0 -0
@@ -1,35 +1,38 @@
1
- export { B as BooleanOperator, l as ClarificationQuestion, k as ClarificationSuggestion, C as CompositeTypes, j as ComputedSortConfig, c as Constants, D as Database, d as DbChangeLog, E as Enums, f as Filter, e as FilterConditionType, m as FilterContextType, g as FilterGroup, h as FilterInput, F as FilterOperator, i as FilterState, J as Json, O as OrderColumn, P as Pagination, Q as QueryState, S as Sort, T as Tables, a as TablesInsert, b as TablesUpdate, V as ValueOrArrayForPropertyType, n as normalizeFilter, u as useDbAdvanceFilterQuery, u as useDbAdvanceQuery } from './index-BFu5_dS8.js';
1
+ export { C as CompositeTypes, c as Constants, D as Database, E as Enums, J as Json, T as Tables, a as TablesInsert, b as TablesUpdate } from './database.types-ChFCG-4M.js';
2
2
  export { a as FilterConfig, F as FilterConfigOption, G as Group, P as PropertyType, S as SortConfig, T as TableInfo, V as ValueForPropertyType, W as WhereFilter } from './FilterConfig-Bt2Ek74z.js';
3
- export { C as AIOptions, D as AIResponse, V as AlertProps, N as BUCKETS, O as BucketName, K as CustomPageQueryResult, Q as DEFAULT_QUERY_TIMEOUT, ac as FeedbackListItem, ad as FeedbackListParams, W as LiveChangeContext, X as LiveChangeContextProvider, M as MutationOption, F as ServerAvailabilityState, L as StorageObjectMetadata, af as SubmitFeedbackParams, S as SupabaseAdapter, T as TIMEOUT_ERROR_MESSAGE, I as UpdateOptions, U as UseDbPartialAdvanceQueryResult, q as UseDbPartialQueryResult, t as UseDbRealtimeQueryResult, x as UseMutationSuccessOptions, v as convertFilterToRealtimeQuery, P as createInCondition, A as createSupabaseAdapter, J as executeAdvanceQuery, B as getErrorBody, l as getSupabaseUrl, R as isTimeoutError, n as newTimeActivity, s as setSupabaseUrl, E as useAI, ag as useApplyFeedback, h as useAutosaveState, a7 as useChangelogById, a8 as useChangelogBySlug, a9 as useChangelogEntries, aa as useChangelogMedia, a5 as useChangelogs, c as useDbDelete, a as useDbInsert, m as useDbMultiDelete, o as useDbMultiUpsert, p as useDbPartialAdvanceQuery, r as useDbPartialQuery, u as useDbRealtime, e as useDbRealtimeQuery, b as useDbUpdate, d as useDbUpsert, w as useDbUpsertResponse, c as useDelete, Z as useDeleteChangelog, a0 as useDeleteChangelogEntry, a3 as useDeleteChangelogMedia, ab as useFeedbackList, a as useInsert, g as useLatestOperationLog, f as useLiveChangeTracking, a1 as useMultiDeleteChangelogEntries, $ as useMultiUpsertChangelogEntries, y as useMutationSuccess, z as useMutationSuccessRN, a6 as usePublishedChangelogs, u as useRealtime, e as useRealtimeQuery, ah as useResolveFeedback, H as useSearchQuery, G as useServerAvailability, k as useStoragePath, j as useStorageUrl, ae as useSubmitFeedback, i as useToastError, b as useUpdate, a4 as useUploadChangelogMedia, d as useUpsert, Y as useUpsertChangelog, _ as useUpsertChangelogEntry, a2 as useUpsertChangelogMedia } from './useResolveFeedback-CpZPP8Pw.js';
3
+ export { r as BackendSelectionResult, B as BooleanOperator, l as ClarificationQuestion, k as ClarificationSuggestion, C as CombinedProviderStatus, j as ComputedSortConfig, n as DataLayerWithPowerSyncProps, D as DbChangeLog, a as EnhancedSyncControl, E as EnhancedSyncStatus, e as Filter, d as FilterConditionType, m as FilterContextType, f as FilterGroup, g as FilterInput, F as FilterOperator, h as FilterState, H as HasPowerSyncConfig, O as OrderColumn, i as Pagination, P as PowerSyncEnabledConfig, b as PowerSyncEnabledContextValue, q as PowerSyncTables, Q as QueryState, S as Sort, U as UseDataLayerWithPowerSync, p as UseSyncControlWithPowerSync, o as UseSyncStatusWithPowerSync, V as ValueOrArrayForPropertyType, c as createCombinedStatus, s as normalizeFilter, u as useDbAdvanceFilterQuery, u as useDbAdvanceQuery } from './index-CQLyNG6A.js';
4
+ export { A as AIOptions, B as AIResponse, P as AlertProps, K as BUCKETS, L as BucketName, I as CustomPageQueryResult, N as DEFAULT_QUERY_TIMEOUT, a9 as FeedbackListItem, aa as FeedbackListParams, Q as LiveChangeContext, R as LiveChangeContextProvider, D as ServerAvailabilityState, J as StorageObjectMetadata, ac as SubmitFeedbackParams, S as SupabaseAdapter, T as TIMEOUT_ERROR_MESSAGE, G as UpdateOptions, U as UseDbPartialAdvanceQueryResult, p as UseDbPartialQueryResult, r as UseDbRealtimeQueryResult, v as UseMutationSuccessOptions, t as convertFilterToRealtimeQuery, M as createInCondition, y as createSupabaseAdapter, H as executeAdvanceQuery, z as getErrorBody, k as getSupabaseUrl, O as isTimeoutError, n as newTimeActivity, s as setSupabaseUrl, C as useAI, ad as useApplyFeedback, g as useAutosaveState, a4 as useChangelogById, a5 as useChangelogBySlug, a6 as useChangelogEntries, a7 as useChangelogMedia, a2 as useChangelogs, c as useDbDelete, a as useDbInsert, l as useDbMultiDelete, m as useDbMultiUpsert, o as useDbPartialAdvanceQuery, q as useDbPartialQuery, u as useDbRealtime, d as useDbRealtimeQuery, b as useDbUpdate, c as useDelete, W as useDeleteChangelog, Z as useDeleteChangelogEntry, a0 as useDeleteChangelogMedia, a8 as useFeedbackList, a as useInsert, f as useLatestOperationLog, e as useLiveChangeTracking, _ as useMultiDeleteChangelogEntries, Y as useMultiUpsertChangelogEntries, w as useMutationSuccess, x as useMutationSuccessRN, a3 as usePublishedChangelogs, u as useRealtime, d as useRealtimeQuery, ae as useResolveFeedback, F as useSearchQuery, E as useServerAvailability, j as useStoragePath, i as useStorageUrl, ab as useSubmitFeedback, h as useToastError, b as useUpdate, a1 as useUploadChangelogMedia, V as useUpsertChangelog, X as useUpsertChangelogEntry, $ as useUpsertChangelogMedia } from './useResolveFeedback-BWmatBlE.js';
4
5
  export { F as Fetch, i as GenericFunction, g as GenericNonUpdatableView, j as GenericSchema, G as GenericTable, f as GenericUpdatableView, h as GenericView, P as PostgrestError, d as PostgrestMaybeSingleResponse, e as PostgrestResponse, b as PostgrestResponseFailure, a as PostgrestResponseSuccess, c as PostgrestSingleResponse, k as Prettify } from './types-CYr9JiUE.js';
5
6
  export { U as UseDbQuerySingleReturn, u as useDbQuery } from './useDbQuery-C-TL8jY1.js';
6
7
  import * as _tanstack_react_query from '@tanstack/react-query';
7
8
  import { QueryClient } from '@tanstack/react-query';
8
9
  import { FileOptions } from '@supabase/storage-js';
9
- export { u as useBatchDelete, a as useBatchUpsert } from './useBatchUpsert-CSQVX7w8.js';
10
+ export { D as DatabaseTypes, P as PublicTableNames, R as ResolveRowType, S as SchemaNames, j as SchemaTableNames, T as TableIdentifier, p as UseAdvanceQueryOptions, q as UseAdvanceQueryResult, l as UseDbCountOptions, m as UseDbCountResult, U as UseDbInfiniteQueryOptions, k as UseDbInfiniteQueryResult, o as UseDbQueryOptions, n as UseDbQueryResult, i as useAdvanceQuery, a as useDataLayer, h as useDbCount, h as useDbCountV3, b as useDbDeleteV3, g as useDbInfiniteQuery, g as useDbInfiniteQueryV3, c as useDbInsertV3, e as useDbQueryById, d as useDbQueryV3, f as useDbUpdateV3, u as useDbUpsert, u as useDbUpsertV3, u as useUpsert } from './useDbCount-BG356T9i.js';
11
+ export { useOnlineStatus, useSyncControl, useSyncStatus } from './hooks/index.js';
12
+ export { u as useBatchDelete, a as useBatchUpsert } from './useBatchUpsert-9OYjibLh.js';
10
13
  import { DatabaseSchema, QueryOptions, DataLayerConfig } from './core/index.js';
11
14
  export { AdapterRegistry as AdapterRegistryInterface, AutoStrategy, BuiltQuery, CachedStrategy, ColumnInfo, ColumnType, ConnectionConfig, DataAdapter, DataLayerHooks, DeleteMutationResult, ExtractInsert, ExtractRow, ExtractUpdate, HybridStrategy, MutationHookResult, MutationResult, OrderBy, ParsedSelect, PowerSyncStrategy, QueryResult, QuerySingleResult, RelationshipInfo, RelationshipType, ResolvedRelationship, ScopeDefinition, SelectColumn, SelectRelation, SupabaseStrategy, SyncControl, SyncMode, SyncScope, SyncStatus, TableNames, TableSchema, TableStrategy, UseDbMutationHook, UseDbQueryByIdHook, UseDbQueryHook, WhereClause, WhereOperators } from './core/index.js';
12
15
  export { UsePartialAdvancedQueryResult, UsePartialQueryResult, UseQuerySingleReturn, extractColumnNames, extractRelationNames, getRelationSelect, hasRelation, parseSelect, stringifySelect, tokenizeTopLevel, useAdvancedFilterQuery, useAdvancedQuery, useInfiniteQuery, usePartialAdvancedQuery, usePartialQuery, useQuery } from './query/index.js';
13
16
  import { Q as QueryExecutor, P as PowerSyncDatabase$1 } from './executor-CB4KHyYG.js';
14
17
  export { e as RelationJoinData, R as RelationshipResolver, b as ResultJoiner, S as SQLBuilder, f as createQueryExecutor, c as createRelationshipResolver, d as createResultJoiner, a as createSQLBuilder } from './executor-CB4KHyYG.js';
15
- import { r as TableDataAdapter, C as CapableDataAdapter, v as AdapterCapabilities, A as AdapterQueryResult, L as DataLayerContextValue } from './useDbCount-RGCuHmHp.js';
16
- export { y as ADAPTER_STRATEGIES, E as AdapterAutoDetector, s as AdapterConfig, w as AdapterDependencies, t as AdapterFactory, z as AdapterRegistry, x as AdapterStrategyType, H as AutoDetectionResult, I as AutoDetectorOptions, J as BackendChangeListener, G as BackendStatus, K as DataLayerContext, M as DataLayerStatus, D as DatabaseTypes, P as PublicTableNames, R as ResolveRowType, S as SchemaNames, j as SchemaTableNames, T as TableIdentifier, p as UseAdvanceQueryOptions, q as UseAdvanceQueryResult, l as UseDbCountOptions, m as UseDbCountResult, U as UseDbInfiniteQueryOptions, k as UseDbInfiniteQueryResult, o as UseDbQueryOptions, n as UseDbQueryResult, F as createAdapterAutoDetector, B as createAdapterRegistry, i as useAdvanceQuery, u as useDataLayer, h as useDbCount, h as useDbCountV3, a as useDbDeleteV3, g as useDbInfiniteQuery, g as useDbInfiniteQueryV3, b as useDbInsertV3, d as useDbQueryById, c as useDbQueryV3, e as useDbUpdateV3, f as useDbUpsertV3 } from './useDbCount-RGCuHmHp.js';
18
+ import { T as TableDataAdapter, C as CapableDataAdapter, c as AdapterCapabilities, A as AdapterQueryResult, n as DataLayerContextValue, S as SyncStatusInfo } from './DataLayerContext-CL6alnkb.js';
19
+ export { f as ADAPTER_STRATEGIES, i as AdapterAutoDetector, a as AdapterConfig, d as AdapterDependencies, b as AdapterFactory, g as AdapterRegistry, e as AdapterStrategyType, k as AutoDetectionResult, l as AutoDetectorOptions, m as BackendChangeListener, B as BackendStatus, D as DataLayerContext, o as DataLayerStatus, j as createAdapterAutoDetector, h as createAdapterRegistry } from './DataLayerContext-CL6alnkb.js';
17
20
  import * as react from 'react';
18
- import { ReactNode, JSX } from 'react';
21
+ import react__default, { ReactNode, JSX } from 'react';
19
22
  import { SupabaseClient } from '@supabase/supabase-js';
20
- export { useOnlineStatus, useSyncControl, useSyncStatus } from './hooks/index.js';
21
- export { S as SupabaseDatabaseTypes, a as SupabaseProvider, T as TypedSupabaseClient, U as UserSessionId, c as createNewSupabaseClient, u as default, o as onSupabaseInitialized, s as setDefaultOptions, t as typedSupabase, u as useSupabase } from './useSupabase-pPhUZHcl.js';
23
+ export { C as ClientInstanceId, S as SupabaseDatabaseTypes, a as SupabaseProvider, T as TypedSupabaseClient, U as UserSessionId, c as createNewSupabaseClient, u as default, o as onSupabaseInitialized, s as setDefaultOptions, t as typedSupabase, u as useSupabase } from './useSupabase-DvWVuHHE.js';
24
+ export { e as UserMetadataContextProvider, c as UserMetadataContextType, a as UserMetadataInsert, U as UserMetadataRow, b as UserMetadataUpdate, u as useLiveChangesIndicator, h as useSetUserMetadata, f as useUserMetadata, i as useUserMetadataState, g as useUserMetadataValue, d as userMetadataContext } from './UserMetadataContext-B8gVWGMl.js';
22
25
  import * as react_dropzone from 'react-dropzone';
23
26
  import { FileRejection, FileError } from 'react-dropzone';
24
27
  export { AnyPostgrestResponse, FilterDefinition, FilterDefinitions, FilterFn, NestedPath, OPERATOR_MAP, OperatorFn, OrderDefinition, Path, PostgrestFilter, PostgrestFilterOperator, PostgrestHasMorePaginationCacheData, PostgrestHasMorePaginationResponse, PostgrestPaginationCacheData, PostgrestPaginationResponse, PostgrestParser, PostgrestQueryParser, PostgrestQueryParserOptions, SUPPORTED_OPERATORS, ValueType, binarySearch, buildSortedComparator, denormalize, encodeObject, extractPathsFromFilters, filterFilterDefinitionsByPaths, findFilters, findIndexOrdered, findLastIndex, get, getTable, groupPathsRecursive, ifDateGetTime, isAndFilter, isAnyPostgrestResponse, isFilterDefinition, isISODateString, isNestedPath, isNotNull, isObject, isOrFilter, isPostgrestBuilder, isPostgrestHasMorePaginationCacheData, isPostgrestHasMorePaginationResponse, isPostgrestPaginationCacheData, isPostgrestPaginationResponse, parseOrderByKey, parseSelectParam, parseValue, removeAliasFromDeclaration, removeFirstPathElement, setFilterValue, sortSearchParams } from './parser/index.js';
25
28
  export { G as GetResult, S as SelectQueryError } from './select-query-parser-BwyHum1L.js';
26
29
  export { Accessory, Address, AdvanceQuery, AdvanceQueryNotificationSetting, AdvancedQueryView, BillableService, BillingDetails, CachedEmbedding, Changelog, ChangelogEntry, ChangelogMedia, ChargeTable, Circuit, Client, Comment, CommentReaction, CommentRead, CommentSection, CommentTag, CommonNote, CommonNoteCategory, CommonNoteSubCategory, ControlComponent, ControlComponentDatasheet, Controller, CoreSavedQuery, CoreSavedQueryAccess, Currency, CurrencyUsdConversion, DataExchangeImport, Datasheet, Dimension, DimmerModule, DimmerRack, Embedding, EquipmentConfigurationGroup, EquipmentFixture, EquipmentFixtureConfiguration, EquipmentFixtureConfigurationAccessoryEntry, EquipmentFixtureConfigurationControlComponentEntry, EquipmentFixtureCost, EquipmentFixtureDatasheet, EquipmentFixtureDimension, EquipmentFixtureDocument, EquipmentFixtureLampConfiguration, EquipmentFixtureListing, EquipmentFixtureMode, EquipmentFixtureModeChannel, EquipmentFixturePreset, EquipmentFixtureUnit, EquipmentFixtureUnitControl, EquipmentFixtureUnitLocation, EquipmentFixtureUnitLocationTag, EquipmentFixtureUnitLocationTagValue, EquipmentFixtureUnitPatternEntry, EquipmentFixtureWeight, EquipmentType, EquipmentUnitMediaContent, Expense, ExpenseLineItem, ExpenseReport, Fixture, FixtureCatalog, FixtureCatalogItem, FixtureCategory, FixtureTag, GlobalExpenseReport, HighlightServer, HighlightServerInstance, HighlightServerInstanceLog, HighlightServerInstanceOptions, HighlightServerInstanceStatus, HighlightServerRequest, Invoice, InvoiceSummaryTable, InvoiceTerm, InvoiceTermCondition, Lamp, LampCategory, LampCurrentListing, LampType, LicenseAssignment, Logo, Manufacturer, ManufacturerTag, ManufacturerToTag, OperationLog, OrderHinted, Organization, OrganizationUser, OrganizationUserAccess, ParameterMappingProfile, ParameterMappingProfileAssignment, Pattern, PaymentCustomer, PaymentInvoice, PaymentPaymentIntents, PaymentPlan, PaymentProduct, PaymentProductFeature, PaymentSubscription, PaymentSubscriptionPlan, PhaseActivityBucket, ProfileConfig as Profile, ProfileConfig, ProfileTimeBank, Project, ProjectDatabase, ProjectDatabaseEquipmentConfigurationGroup, ProjectDatabaseExcelParameterAssignment, ProjectDatabaseGroup, ProjectDatabaseParameterMappingProfile, ProjectDefaultRateByTitle, ProjectDocument, ProjectDocumentLineItem, PunchList, PunchListAccess, PunchListItem, PunchListItemAssignment, PunchListItemAttachedEntity, PunchListItemAttachment, PunchListItemCheckListItem, PunchListPage, PunchListPageAccess, PunchListUserOrderHint, QrCode, RetainageItem, RevitEquipmentUnitChange, RevitImport, RevitValueChangedEvent, Role, Service, ServiceCosts, ServiceStorageHourly, SmartCode, SmartCodeTag, Subtask, SystemBroadcastChannel, SystemBroadcastChannelThrottle, SystemConfiguration, SystemEmailNotification, SystemEvent, SystemEventListener, SystemEventWorker, SystemGlobalVariables, SystemHealthCheck, SystemInAppNotification, SystemLog, SystemMutedTopic, SystemNotification, SystemPushNotification, SystemSubscriber, SystemSupportAccess, SystemSupportTeam, SystemTask, SystemTaskAttempt, SystemTaskAttemptAccess, SystemTemp, SystemTicket, SystemTicketAttachment, SystemTicketComment, SystemTicketCommentAttachment, SystemUserPushTokens, Tag, Task, TaxCategory, Ticket, TicketAttachment, TicketComment, TicketCommentAttachment, TimeActivity, TimeBankTransaction, UserMetadata, UserTimesheet, WeeklyTimesheet, WorkEstimation, WorkEstimationLineItem, WorkingPhase, WorkingPhaseBillingItemDailySummary, WorkingPhaseBillingItemLatestSummary, WorkingPhaseCategory, WorkingPhaseDailySummary, WorkingPhaseRoleRate, WorkingPhaseSummary } from './gen/index.js';
30
+ import * as react_jsx_runtime from 'react/jsx-runtime';
27
31
  import 'moment';
28
32
  import '@supabase-cache-helpers/postgrest-react-query';
29
33
  import '@pol-studios/utils';
30
34
  import '@supabase/functions-js';
31
35
  import '@supabase/postgrest-js';
32
- import 'react/jsx-runtime';
33
36
  import '@supabase/supabase-js/dist/module/lib/types.js';
34
37
 
35
38
  type RequestOptions = {
@@ -273,7 +276,32 @@ interface DataLayerProviderProps {
273
276
  config: DataLayerConfig;
274
277
  /** Children to render */
275
278
  children: ReactNode;
276
- /** Optional PowerSync database instance */
279
+ /**
280
+ * Optional PowerSync database instance.
281
+ *
282
+ * This accepts any object that implements the PowerSyncDatabase interface,
283
+ * including the AbstractPowerSyncDatabase from @pol-studios/powersync.
284
+ *
285
+ * When using with @pol-studios/powersync, pass the `db` value from usePowerSync():
286
+ * @example
287
+ * ```tsx
288
+ * // With @pol-studios/powersync
289
+ * const { db, isReady } = usePowerSync();
290
+ *
291
+ * if (!isReady) return <Loading />;
292
+ *
293
+ * return (
294
+ * <DataLayerProvider
295
+ * config={config}
296
+ * powerSyncInstance={db}
297
+ * supabaseClient={supabase}
298
+ * queryClient={queryClient}
299
+ * >
300
+ * {children}
301
+ * </DataLayerProvider>
302
+ * );
303
+ * ```
304
+ */
277
305
  powerSyncInstance?: PowerSyncDatabase$1 | null;
278
306
  /** Supabase client (required) */
279
307
  supabaseClient: SupabaseClient;
@@ -283,6 +311,13 @@ interface DataLayerProviderProps {
283
311
  onInitialized?: (context: DataLayerContextValue) => void;
284
312
  /** Callback when error occurs */
285
313
  onError?: (error: Error) => void;
314
+ /**
315
+ * Current sync status from @pol-studios/powersync.
316
+ * Pass the status object from useSyncStatus() hook.
317
+ * When hasSynced is false and useOnlineUntilSynced is true (default),
318
+ * queries will use Supabase until initial sync completes.
319
+ */
320
+ powerSyncSyncStatus?: SyncStatusInfo;
286
321
  }
287
322
  /**
288
323
  * Provider component for the V3 data layer.
@@ -312,7 +347,7 @@ interface DataLayerProviderProps {
312
347
  * }
313
348
  * ```
314
349
  */
315
- declare function DataLayerProvider({ config, children, powerSyncInstance, supabaseClient, queryClient, onInitialized, onError, }: DataLayerProviderProps): JSX.Element;
350
+ declare function DataLayerProvider({ config, children, powerSyncInstance, supabaseClient, queryClient, onInitialized, onError, powerSyncSyncStatus, }: DataLayerProviderProps): JSX.Element;
316
351
 
317
352
  interface FileWithPreview extends File {
318
353
  preview?: string;
@@ -392,42 +427,347 @@ declare const useSupabaseUpload: (options: UseSupabaseUploadOptions) => {
392
427
  };
393
428
 
394
429
  /**
395
- * Platform-aware network status utility
430
+ * Conflict Types for @pol-studios/db
431
+ *
432
+ * Canonical type definitions for conflict detection and resolution.
433
+ * These types are shared between @pol-studios/db and @pol-studios/powersync.
434
+ */
435
+ /**
436
+ * Represents a field-level conflict where both local and server changed the same field.
437
+ */
438
+ interface FieldConflict {
439
+ /** The field name that has conflicting changes */
440
+ field: string;
441
+ /** The local (pending) value */
442
+ localValue: unknown;
443
+ /** The current server value */
444
+ serverValue: unknown;
445
+ /** User who made the server change (from AuditLog.changeBy) */
446
+ changedBy: string | null;
447
+ /** When the server change occurred (from AuditLog.changeAt) */
448
+ changedAt: Date;
449
+ }
450
+ /**
451
+ * Result of checking for conflicts between local changes and server state.
452
+ */
453
+ interface ConflictCheckResult {
454
+ /** Whether any field conflicts were detected */
455
+ hasConflict: boolean;
456
+ /** List of field-level conflicts */
457
+ conflicts: FieldConflict[];
458
+ /** Fields that can safely sync (no server changes) */
459
+ nonConflictingChanges: string[];
460
+ /** The table name */
461
+ table: string;
462
+ /** The record ID */
463
+ recordId: string;
464
+ }
465
+ /**
466
+ * User's resolution choice for a conflict.
467
+ */
468
+ type ConflictResolution = {
469
+ action: 'overwrite';
470
+ } | {
471
+ action: 'keep-server';
472
+ } | {
473
+ action: 'partial';
474
+ fields: string[];
475
+ };
476
+
477
+ /**
478
+ * Interface for ConflictBus from @pol-studios/powersync.
479
+ * Defined here to avoid circular dependency between packages.
480
+ */
481
+ interface ConflictBusInterface {
482
+ onConflict: (listener: (conflict: ConflictCheckResult) => void) => () => void;
483
+ onResolution: (listener: (table: string, recordId: string, resolution: ConflictResolution) => void) => () => void;
484
+ emitConflict: (conflict: ConflictCheckResult) => void;
485
+ emitResolution: (table: string, recordId: string, resolution: ConflictResolution) => void;
486
+ }
487
+ /**
488
+ * Context value provided to consumers.
489
+ */
490
+ interface ConflictContextValue {
491
+ /** Current conflict state */
492
+ pendingConflicts: ConflictCheckResult[];
493
+ /** Add a conflict (called by connector) */
494
+ addConflict: (conflict: ConflictCheckResult) => void;
495
+ /** Resolve a single conflict by table and record ID */
496
+ resolveConflict: (table: string, recordId: string, resolution: ConflictResolution) => void;
497
+ /** Resolve all pending conflicts with the same resolution */
498
+ resolveAll: (resolution: ConflictResolution) => void;
499
+ /** Remove a conflict by table and record ID (after sync completes) */
500
+ removeConflict: (table: string, recordId: string) => void;
501
+ /** Get resolution for a specific table and record */
502
+ getResolution: (table: string, recordId: string) => ConflictResolution | undefined;
503
+ /** Clear all resolved conflicts from the resolutions map */
504
+ clearResolved: () => void;
505
+ /** Clear all conflicts (resolved and pending) */
506
+ clearAll: () => void;
507
+ /** Whether there are any pending conflicts */
508
+ hasConflicts: boolean;
509
+ }
510
+ declare const ConflictContext: react__default.Context<ConflictContextValue>;
511
+ interface ConflictProviderProps {
512
+ children: react__default.ReactNode;
513
+ /**
514
+ * Optional: Event bus for receiving conflicts from the connector.
515
+ * When provided, the provider will:
516
+ * - Subscribe to conflict events and add them to state
517
+ * - Emit resolution events when conflicts are resolved
518
+ */
519
+ conflictBus?: ConflictBusInterface;
520
+ }
521
+ /**
522
+ * Provider component for conflict state management.
396
523
  *
397
- * Provides unified network connectivity detection for both web (browser)
398
- * and React Native environments.
524
+ * Wrap your app with this provider to enable conflict detection and resolution.
399
525
  *
400
- * - On React Native: Uses @react-native-community/netinfo
401
- * - On Web: Uses navigator.onLine and window online/offline events
526
+ * @example
527
+ * ```tsx
528
+ * <PowerSyncProvider connector={connector}>
529
+ * <ConflictProvider>
530
+ * <App />
531
+ * </ConflictProvider>
532
+ * </PowerSyncProvider>
533
+ * ```
402
534
  */
535
+ declare function ConflictProvider({ children, conflictBus }: ConflictProviderProps): react_jsx_runtime.JSX.Element;
536
+
403
537
  /**
404
- * Check if we're running in React Native environment
538
+ * Conflict State Hooks for @pol-studios/db
539
+ *
540
+ * Provides hooks for accessing and filtering conflict state.
405
541
  */
406
- declare function isReactNative(): boolean;
542
+
407
543
  /**
408
- * Get current online status
544
+ * Hook to access the full conflict state and actions.
545
+ *
546
+ * @throws Error if used outside of ConflictProvider
547
+ * @returns Full conflict context value
548
+ *
549
+ * @example
550
+ * ```tsx
551
+ * function ConflictManager() {
552
+ * const { pendingConflicts, resolveAll, clearResolved } = useConflictState();
409
553
  *
410
- * @returns Promise resolving to true if online, false if offline
554
+ * return (
555
+ * <View>
556
+ * <Text>{pendingConflicts.length} conflicts pending</Text>
557
+ * <Button onPress={() => resolveAll({ action: 'keep-server' })}>
558
+ * Accept All Server Changes
559
+ * </Button>
560
+ * </View>
561
+ * );
562
+ * }
563
+ * ```
411
564
  */
412
- declare function getOnlineStatus(): Promise<boolean>;
565
+ declare function useConflictState(): ConflictContextValue;
413
566
  /**
414
- * Get current online status synchronously (browser only, RN returns cached/default)
415
- * Use getOnlineStatus() for accurate cross-platform results
567
+ * Hook to get only pending conflicts (read-only).
568
+ *
569
+ * Use this when you only need to display conflicts without resolution actions.
570
+ *
571
+ * @returns Array of pending conflicts
416
572
  *
417
- * @returns true if online (or unknown), false if offline
573
+ * @example
574
+ * ```tsx
575
+ * function ConflictBadge() {
576
+ * const conflicts = usePendingConflicts();
577
+ * if (conflicts.length === 0) return null;
578
+ * return <Badge count={conflicts.length} />;
579
+ * }
580
+ * ```
418
581
  */
419
- declare function getOnlineStatusSync(): boolean;
582
+ declare function usePendingConflicts(): ConflictCheckResult[];
420
583
  /**
421
- * Subscribe to network status changes
584
+ * Hook to check if there are any pending conflicts.
422
585
  *
423
- * @param callback - Function called when online status changes
424
- * @returns Unsubscribe function
586
+ * Optimized for conditional rendering - only triggers re-render on boolean change.
587
+ *
588
+ * @returns True if there are pending conflicts
589
+ *
590
+ * @example
591
+ * ```tsx
592
+ * function App() {
593
+ * const hasConflicts = useHasConflicts();
594
+ * return (
595
+ * <>
596
+ * {hasConflicts && <ConflictBanner />}
597
+ * <MainContent />
598
+ * </>
599
+ * );
600
+ * }
601
+ * ```
425
602
  */
426
- declare function subscribeToNetworkChanges(callback: (isOnline: boolean) => void): () => void;
603
+ declare function useHasConflicts(): boolean;
427
604
  /**
428
- * Initialize network monitoring (call early in app lifecycle)
429
- * This pre-loads NetInfo on React Native for faster subsequent calls
605
+ * Hook to get a specific conflict by table and record ID.
606
+ *
607
+ * Returns null if no conflict exists for the record.
608
+ *
609
+ * @param table - The table name
610
+ * @param recordId - The record ID to look up
611
+ * @returns The conflict for this record, or null
612
+ *
613
+ * @example
614
+ * ```tsx
615
+ * function RecordEditor({ table, recordId }: { table: string; recordId: string }) {
616
+ * const conflict = useConflictForRecord(table, recordId);
617
+ *
618
+ * if (conflict) {
619
+ * return <ConflictWarning conflict={conflict} />;
620
+ * }
621
+ *
622
+ * return <EditForm recordId={recordId} />;
623
+ * }
624
+ * ```
625
+ */
626
+ declare function useConflictForRecord(table: string, recordId: string): ConflictCheckResult | null;
627
+ /**
628
+ * Hook to get conflicts filtered by table name.
629
+ *
630
+ * Useful for showing conflicts scoped to a specific entity type.
631
+ *
632
+ * @param table - The table name to filter by
633
+ * @returns Conflicts for the specified table
634
+ *
635
+ * @example
636
+ * ```tsx
637
+ * function EquipmentConflicts() {
638
+ * const conflicts = useConflictsForTable('EquipmentFixtureUnit');
639
+ * return (
640
+ * <FlatList
641
+ * data={conflicts}
642
+ * renderItem={({ item }) => <ConflictCard conflict={item} />}
643
+ * />
644
+ * );
645
+ * }
646
+ * ```
647
+ */
648
+ declare function useConflictsForTable(table: string): ConflictCheckResult[];
649
+ /**
650
+ * Hook to get conflict count by table.
651
+ *
652
+ * Returns a map of table names to conflict counts for summary display.
653
+ *
654
+ * @returns Map of table name to conflict count
655
+ *
656
+ * @example
657
+ * ```tsx
658
+ * function ConflictSummary() {
659
+ * const countByTable = useConflictCountByTable();
660
+ * return (
661
+ * <View>
662
+ * {Array.from(countByTable.entries()).map(([table, count]) => (
663
+ * <Text key={table}>{table}: {count} conflicts</Text>
664
+ * ))}
665
+ * </View>
666
+ * );
667
+ * }
668
+ * ```
669
+ */
670
+ declare function useConflictCountByTable(): Map<string, number>;
671
+
672
+ /**
673
+ * Conflict Resolution Hook for @pol-studios/db
674
+ *
675
+ * Provides methods for resolving individual conflicts.
676
+ */
677
+
678
+ /**
679
+ * Return type for useConflictResolution hook.
430
680
  */
431
- declare function initializeNetworkMonitoring(): Promise<void>;
681
+ interface UseConflictResolutionReturn {
682
+ /** The conflict being resolved */
683
+ conflict: ConflictCheckResult;
684
+ /** Resolve with a specific resolution */
685
+ resolve: (resolution: ConflictResolution) => void;
686
+ /** Accept server changes, discard local */
687
+ keepServer: () => void;
688
+ /** Overwrite server with local changes */
689
+ overwrite: () => void;
690
+ /** Only sync fields that don't conflict */
691
+ syncNonConflicting: () => void;
692
+ /** Sync specific fields only */
693
+ syncFields: (fields: string[]) => void;
694
+ /** Check if a specific field has a conflict */
695
+ hasFieldConflict: (field: string) => boolean;
696
+ /** Get conflict info for a specific field */
697
+ getFieldConflict: (field: string) => {
698
+ localValue: unknown;
699
+ serverValue: unknown;
700
+ changedBy: string | null;
701
+ changedAt: Date;
702
+ } | null;
703
+ }
704
+ /**
705
+ * Hook for resolving a specific conflict.
706
+ *
707
+ * Provides convenience methods for common resolution patterns.
708
+ *
709
+ * @param conflict - The conflict to resolve
710
+ * @returns Resolution methods and utilities
711
+ *
712
+ * @example
713
+ * ```tsx
714
+ * function ConflictCard({ conflict }: { conflict: ConflictCheckResult }) {
715
+ * const {
716
+ * keepServer,
717
+ * overwrite,
718
+ * syncNonConflicting,
719
+ * hasFieldConflict,
720
+ * getFieldConflict,
721
+ * } = useConflictResolution(conflict);
722
+ *
723
+ * return (
724
+ * <Card>
725
+ * <Text>Conflict on {conflict.table}</Text>
726
+ * {conflict.conflicts.map(fc => (
727
+ * <View key={fc.field}>
728
+ * <Text>{fc.field}</Text>
729
+ * <Text>Yours: {String(fc.localValue)}</Text>
730
+ * <Text>Theirs: {String(fc.serverValue)} by {fc.changedBy}</Text>
731
+ * </View>
732
+ * ))}
733
+ * <Button onPress={keepServer}>Keep Theirs</Button>
734
+ * <Button onPress={overwrite}>Use Mine</Button>
735
+ * <Button onPress={syncNonConflicting}>Sync Safe Fields Only</Button>
736
+ * </Card>
737
+ * );
738
+ * }
739
+ * ```
740
+ */
741
+ declare function useConflictResolution(conflict: ConflictCheckResult): UseConflictResolutionReturn;
742
+ /**
743
+ * Hook for bulk conflict resolution.
744
+ *
745
+ * Provides methods for resolving multiple conflicts at once.
746
+ *
747
+ * @returns Bulk resolution methods
748
+ *
749
+ * @example
750
+ * ```tsx
751
+ * function ConflictSummary() {
752
+ * const conflicts = usePendingConflicts();
753
+ * const { resolveAllKeepServer, resolveAllOverwrite } = useBulkConflictResolution();
754
+ *
755
+ * return (
756
+ * <View>
757
+ * <Text>{conflicts.length} conflicts</Text>
758
+ * <Button onPress={resolveAllKeepServer}>Accept All Server Changes</Button>
759
+ * <Button onPress={resolveAllOverwrite}>Overwrite All with Mine</Button>
760
+ * </View>
761
+ * );
762
+ * }
763
+ * ```
764
+ */
765
+ declare function useBulkConflictResolution(): {
766
+ resolveAllKeepServer: () => void;
767
+ resolveAllOverwrite: () => void;
768
+ resolveAllSyncNonConflicting: () => void;
769
+ clearResolved: () => void;
770
+ conflictCount: number;
771
+ };
432
772
 
433
- export { AdapterCapabilities, AdapterQueryResult, CapableDataAdapter, DataLayerConfig, DataLayerContextValue, DataLayerProvider, type DataLayerProviderProps, DatabaseSchema, PowerSyncAdapter, PowerSyncDatabase$1 as PowerSyncDatabase, QueryExecutor, QueryOptions, TableDataAdapter, type UseSupabaseUploadOptions, type UseSupabaseUploadReturn, createPowerSyncAdapter, getOnlineStatus, getOnlineStatusSync, initializeNetworkMonitoring, isReactNative, sanitizeStorageKey, subscribeToNetworkChanges, useDbAttachmentUpload as useDbUpload, useSupabaseUpload };
773
+ export { AdapterCapabilities, AdapterQueryResult, CapableDataAdapter, type ConflictCheckResult, ConflictContext, type ConflictContextValue, ConflictProvider, type ConflictProviderProps, type ConflictResolution, DataLayerConfig, DataLayerContextValue, DataLayerProvider, type DataLayerProviderProps, DatabaseSchema, type FieldConflict, PowerSyncAdapter, PowerSyncDatabase$1 as PowerSyncDatabase, QueryExecutor, QueryOptions, SyncStatusInfo, TableDataAdapter, type UseConflictResolutionReturn, type UseSupabaseUploadOptions, type UseSupabaseUploadReturn, createPowerSyncAdapter, sanitizeStorageKey, useBulkConflictResolution, useConflictCountByTable, useConflictForRecord, useConflictResolution, useConflictState, useConflictsForTable, useDbAttachmentUpload as useDbUpload, useHasConflicts, usePendingConflicts, useSupabaseUpload };