@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.
- package/dist/{UserMetadataContext-CeUdM6kV.d.ts → UserMetadataContext-BYYqA6LI.d.ts} +1 -1
- package/dist/auth/context.d.ts +2 -2
- package/dist/auth/hooks.d.ts +3 -3
- package/dist/auth/index.d.ts +2 -2
- package/dist/client/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +79 -2
- package/dist/{index-DNv49L9u.d.ts → index-DNrSptau.d.ts} +1 -1
- package/dist/index.d.ts +22 -1170
- 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 +4 -4
- package/dist/parser/index.d.ts +2 -2
- package/dist/query/index.d.ts +1 -1
- package/dist/{select-query-parser-CGI40aOg.d.ts → select-query-parser-CLkOKHzc.d.ts} +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-DjuX1XHy.d.ts → types-CKsWM8T3.d.ts} +1 -1
- package/dist/{useBatchUpsert-BHaIk9ID.d.ts → useBatchUpsert-ooLlpJMg.d.ts} +3 -3
- package/dist/{index-CMhJjgef.d.ts → useDbCount-B5-Va9sg.d.ts} +1 -76
- package/dist/useResolveFeedback-DuGP4Tgb.d.ts +1165 -0
- package/dist/{useSupabase-DO9kQv2O.d.ts → useSupabase-pPhUZHcl.d.ts} +1 -1
- package/package.json +23 -12
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
export { B as BooleanOperator, h as ClarificationSuggestion, C as CompositeTypes, g as ComputedSortConfig, c as Constants, D as Database, d as DbChangeLog, E as Enums, F as FilterConditionType, i as FilterContextType, e as FilterInput, f as FilterState, J as Json, O as OrderColumn, T as Tables, a as TablesInsert, b as TablesUpdate, V as ValueOrArrayForPropertyType, n as normalizeFilter, u as useDbAdvanceFilterQuery, u as useDbAdvanceQuery } from './index-DNrSptau.js';
|
|
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 { G as AIOptions, H as AIResponse, a3 as AlertProps, Z as BUCKETS, K as BatchAnalysisProgress, _ as BucketName, T as CustomPageQueryResult, a1 as DEFAULT_QUERY_TIMEOUT, J as ExtractedReceipt, am as FeedbackListItem, an as FeedbackListParams, a4 as LiveChangeContext, a5 as LiveChangeContextProvider, M as MutationOption, P as PendingExpense, L as ServerAvailabilityState, Y as StorageObjectMetadata, ap as SubmitFeedbackParams, S as SupabaseAdapter, a0 as TIMEOUT_ERROR_MESSAGE, Q as UpdateOptions, U as UseDbPartialAdvanceQueryResult, w as UseDbPartialQueryResult, y as UseDbRealtimeQueryResult, C as UseMutationSuccessOptions, W as UseSupabaseUploadOptions, X as UseSupabaseUploadReturn, z as convertFilterToRealtimeQuery, $ as createInCondition, g as createSupabaseAdapter, R as executeAdvanceQuery, F as getErrorBody, q as getSupabaseUrl, a2 as isTimeoutError, n as newTimeActivity, A as sanitizeStorageKey, s as setSupabaseUrl, I as useAI, aq as useApplyFeedback, l as useAutosaveState, ah as useChangelogById, ai as useChangelogBySlug, aj as useChangelogEntries, ak as useChangelogMedia, af as useChangelogs, d as useDbDelete, b as useDbInsert, r as useDbMultiDelete, t as useDbMultiUpsert, v as useDbPartialAdvanceQuery, x as useDbPartialQuery, u as useDbRealtime, f as useDbRealtimeQuery, c as useDbUpdate, a as useDbUpload, e as useDbUpsert, B as useDbUpsertResponse, d as useDelete, a7 as useDeleteChangelog, aa as useDeleteChangelogEntry, ad as useDeleteChangelogMedia, al as useFeedbackList, b as useInsert, k as useLatestOperationLog, j as useLiveChangeTracking, ab as useMultiDeleteChangelogEntries, a9 as useMultiUpsertChangelogEntries, D as useMutationSuccess, E as useMutationSuccessRN, ag as usePublishedChangelogs, u as useRealtime, f as useRealtimeQuery, i as useReceiptAI, ar as useResolveFeedback, O as useSearchQuery, N as useServerAvailability, p as useStoragePath, o as useStorageUrl, ao as useSubmitFeedback, h as useSupabaseFunction, V as useSupabaseUpload, m as useToastError, c as useUpdate, ae as useUploadChangelogMedia, e as useUpsert, a6 as useUpsertChangelog, a8 as useUpsertChangelogEntry, ac as useUpsertChangelogMedia } from './useResolveFeedback-DuGP4Tgb.js';
|
|
4
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
+
import { UseInfiniteQueryOptions, InfiniteData, QueryClient } from '@tanstack/react-query';
|
|
6
|
+
import { PostgrestSingleResponse, SupabaseClient } from '@supabase/supabase-js';
|
|
7
|
+
import { a as GenericTable, b as GenericView } from './types-CKsWM8T3.js';
|
|
8
|
+
export { F as Fetch, k as GenericFunction, j as GenericNonUpdatableView, G as GenericSchema, i as GenericUpdatableView, c as PostgrestError, g as PostgrestMaybeSingleResponse, h as PostgrestResponse, e as PostgrestResponseFailure, d as PostgrestResponseSuccess, f as PostgrestSingleResponse, P as Prettify } from './types-CKsWM8T3.js';
|
|
9
|
+
export { U as UseDbQuerySingleReturn, u as useDbQuery } from './useDbQuery-C-TL8jY1.js';
|
|
10
|
+
export { u as useBatchDelete, a as useBatchUpsert } from './useBatchUpsert-ooLlpJMg.js';
|
|
11
|
+
import { DataLayerConfig } from './core/index.js';
|
|
12
|
+
export { AdapterRegistry as AdapterRegistryInterface, AutoStrategy, BuiltQuery, CachedStrategy, ColumnInfo, ColumnType, ConnectionConfig, DataAdapter, DataLayerHooks, DatabaseSchema, DeleteMutationResult, ExtractInsert, ExtractRow, ExtractUpdate, HybridStrategy, MutationHookResult, MutationResult, OrderBy, ParsedSelect, PowerSyncStrategy, QueryOptions, 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';
|
|
13
|
+
export { UsePartialAdvancedQueryResult, UsePartialQueryResult, UseQuerySingleReturn, extractColumnNames, extractRelationNames, getRelationSelect, hasRelation, parseSelect, stringifySelect, tokenizeTopLevel, useAdvancedFilterQuery, useAdvancedQuery, useInfiniteQuery, usePartialAdvancedQuery, usePartialQuery, useQuery } from './query/index.js';
|
|
14
|
+
export { P as PowerSyncDatabase, Q as QueryExecutor, 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 { D as DataLayerContextValue } from './useDbCount-B5-Va9sg.js';
|
|
16
|
+
export { f as ADAPTER_STRATEGIES, i as AdapterAutoDetector, c as AdapterCapabilities, a as AdapterConfig, d as AdapterDependencies, b as AdapterFactory, A as AdapterQueryResult, g as AdapterRegistry, e as AdapterStrategyType, k as AutoDetectionResult, l as AutoDetectorOptions, m as BackendChangeListener, B as BackendStatus, C as CapableDataAdapter, H as ClarificationQuestion, a6 as DataLayerContext, a7 as DataLayerStatus, 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, T as TableDataAdapter, 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, j as createAdapterAutoDetector, h as createAdapterRegistry, x as useAdvanceQuery, u as useDataLayer, n as useDataLayerOptional, a3 as useDbCount, a3 as useDbCountV3, Z as useDbDeleteV3, a0 as useDbInfiniteQueryV3, K as useDbInsertV3, t as useDbQueryById, o as useDbQueryV3, N as useDbUpdateV3, W as useDbUpsertV3 } from './useDbCount-B5-Va9sg.js';
|
|
17
|
+
import { ReactNode, JSX } from 'react';
|
|
18
|
+
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';
|
|
19
|
+
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';
|
|
20
|
+
export { G as GetResult, S as SelectQueryError } from './select-query-parser-CLkOKHzc.js';
|
|
21
|
+
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';
|
|
22
|
+
import 'moment';
|
|
23
|
+
import '@supabase-cache-helpers/postgrest-react-query';
|
|
24
|
+
import '@pol-studios/utils';
|
|
25
|
+
import '@supabase/storage-js';
|
|
26
|
+
import '@supabase/functions-js';
|
|
27
|
+
import '@supabase/postgrest-js';
|
|
28
|
+
import 'react-dropzone';
|
|
29
|
+
import 'react/jsx-runtime';
|
|
30
|
+
import '@supabase/supabase-js/dist/module/lib/types.js';
|
|
31
|
+
|
|
32
|
+
type DataType = Record<string, any>;
|
|
33
|
+
declare function useDbInfiniteQuery<Relation extends GenericTable | GenericView, Result extends DataType, Query extends string = "*", RelationName = unknown, Relationships = Relation extends {
|
|
34
|
+
Relationships: infer R;
|
|
35
|
+
} ? R : unknown, Builder = PromiseLike<PostgrestSingleResponse<Result>>>(query: PromiseLike<PostgrestSingleResponse<Result>>, countPerLoad: number, config?: Omit<UseInfiniteQueryOptions<PostgrestSingleResponse<Result>, Error, InfiniteData<PostgrestSingleResponse<Result>, number>>, "queryKey" | "queryFn" | "getNextPageParam" | "initialPageParam"> & {
|
|
36
|
+
crossOrganization?: boolean;
|
|
37
|
+
onQuery?: ({ pageParam, query }: {
|
|
38
|
+
pageParam: number;
|
|
39
|
+
query: Builder;
|
|
40
|
+
}) => any;
|
|
41
|
+
enableOnQuery?: boolean;
|
|
42
|
+
}): {
|
|
43
|
+
count: number;
|
|
44
|
+
data: Result;
|
|
45
|
+
error: Error;
|
|
46
|
+
isError: true;
|
|
47
|
+
isPending: false;
|
|
48
|
+
isLoading: false;
|
|
49
|
+
isLoadingError: false;
|
|
50
|
+
isRefetchError: true;
|
|
51
|
+
isSuccess: false;
|
|
52
|
+
isPlaceholderData: false;
|
|
53
|
+
status: "error";
|
|
54
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
55
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
56
|
+
hasNextPage: boolean;
|
|
57
|
+
hasPreviousPage: boolean;
|
|
58
|
+
isFetchNextPageError: boolean;
|
|
59
|
+
isFetchingNextPage: boolean;
|
|
60
|
+
isFetchPreviousPageError: boolean;
|
|
61
|
+
isFetchingPreviousPage: boolean;
|
|
62
|
+
dataUpdatedAt: number;
|
|
63
|
+
errorUpdatedAt: number;
|
|
64
|
+
failureCount: number;
|
|
65
|
+
failureReason: Error;
|
|
66
|
+
errorUpdateCount: number;
|
|
67
|
+
isFetched: boolean;
|
|
68
|
+
isFetchedAfterMount: boolean;
|
|
69
|
+
isFetching: boolean;
|
|
70
|
+
isInitialLoading: boolean;
|
|
71
|
+
isPaused: boolean;
|
|
72
|
+
isRefetching: boolean;
|
|
73
|
+
isStale: boolean;
|
|
74
|
+
isEnabled: boolean;
|
|
75
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
76
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
77
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
78
|
+
} | {
|
|
79
|
+
count: number;
|
|
80
|
+
data: Result;
|
|
81
|
+
error: null;
|
|
82
|
+
isError: false;
|
|
83
|
+
isPending: false;
|
|
84
|
+
isLoading: false;
|
|
85
|
+
isLoadingError: false;
|
|
86
|
+
isRefetchError: false;
|
|
87
|
+
isFetchNextPageError: false;
|
|
88
|
+
isFetchPreviousPageError: false;
|
|
89
|
+
isSuccess: true;
|
|
90
|
+
isPlaceholderData: false;
|
|
91
|
+
status: "success";
|
|
92
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
93
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
94
|
+
hasNextPage: boolean;
|
|
95
|
+
hasPreviousPage: boolean;
|
|
96
|
+
isFetchingNextPage: boolean;
|
|
97
|
+
isFetchingPreviousPage: boolean;
|
|
98
|
+
dataUpdatedAt: number;
|
|
99
|
+
errorUpdatedAt: number;
|
|
100
|
+
failureCount: number;
|
|
101
|
+
failureReason: Error;
|
|
102
|
+
errorUpdateCount: number;
|
|
103
|
+
isFetched: boolean;
|
|
104
|
+
isFetchedAfterMount: boolean;
|
|
105
|
+
isFetching: boolean;
|
|
106
|
+
isInitialLoading: boolean;
|
|
107
|
+
isPaused: boolean;
|
|
108
|
+
isRefetching: boolean;
|
|
109
|
+
isStale: boolean;
|
|
110
|
+
isEnabled: boolean;
|
|
111
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
112
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
113
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
114
|
+
} | {
|
|
115
|
+
count: number;
|
|
116
|
+
data: Result;
|
|
117
|
+
error: Error;
|
|
118
|
+
isError: true;
|
|
119
|
+
isPending: false;
|
|
120
|
+
isLoading: false;
|
|
121
|
+
isLoadingError: true;
|
|
122
|
+
isRefetchError: false;
|
|
123
|
+
isFetchNextPageError: false;
|
|
124
|
+
isFetchPreviousPageError: false;
|
|
125
|
+
isSuccess: false;
|
|
126
|
+
isPlaceholderData: false;
|
|
127
|
+
status: "error";
|
|
128
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
129
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
130
|
+
hasNextPage: boolean;
|
|
131
|
+
hasPreviousPage: boolean;
|
|
132
|
+
isFetchingNextPage: boolean;
|
|
133
|
+
isFetchingPreviousPage: boolean;
|
|
134
|
+
dataUpdatedAt: number;
|
|
135
|
+
errorUpdatedAt: number;
|
|
136
|
+
failureCount: number;
|
|
137
|
+
failureReason: Error;
|
|
138
|
+
errorUpdateCount: number;
|
|
139
|
+
isFetched: boolean;
|
|
140
|
+
isFetchedAfterMount: boolean;
|
|
141
|
+
isFetching: boolean;
|
|
142
|
+
isInitialLoading: boolean;
|
|
143
|
+
isPaused: boolean;
|
|
144
|
+
isRefetching: boolean;
|
|
145
|
+
isStale: boolean;
|
|
146
|
+
isEnabled: boolean;
|
|
147
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
148
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
149
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
150
|
+
} | {
|
|
151
|
+
count: number;
|
|
152
|
+
data: Result;
|
|
153
|
+
error: null;
|
|
154
|
+
isError: false;
|
|
155
|
+
isPending: true;
|
|
156
|
+
isLoading: true;
|
|
157
|
+
isLoadingError: false;
|
|
158
|
+
isRefetchError: false;
|
|
159
|
+
isFetchNextPageError: false;
|
|
160
|
+
isFetchPreviousPageError: false;
|
|
161
|
+
isSuccess: false;
|
|
162
|
+
isPlaceholderData: false;
|
|
163
|
+
status: "pending";
|
|
164
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
165
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
166
|
+
hasNextPage: boolean;
|
|
167
|
+
hasPreviousPage: boolean;
|
|
168
|
+
isFetchingNextPage: boolean;
|
|
169
|
+
isFetchingPreviousPage: boolean;
|
|
170
|
+
dataUpdatedAt: number;
|
|
171
|
+
errorUpdatedAt: number;
|
|
172
|
+
failureCount: number;
|
|
173
|
+
failureReason: Error;
|
|
174
|
+
errorUpdateCount: number;
|
|
175
|
+
isFetched: boolean;
|
|
176
|
+
isFetchedAfterMount: boolean;
|
|
177
|
+
isFetching: boolean;
|
|
178
|
+
isInitialLoading: boolean;
|
|
179
|
+
isPaused: boolean;
|
|
180
|
+
isRefetching: boolean;
|
|
181
|
+
isStale: boolean;
|
|
182
|
+
isEnabled: boolean;
|
|
183
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
184
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
185
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
186
|
+
} | {
|
|
187
|
+
count: number;
|
|
188
|
+
data: Result;
|
|
189
|
+
error: null;
|
|
190
|
+
isError: false;
|
|
191
|
+
isPending: true;
|
|
192
|
+
isLoadingError: false;
|
|
193
|
+
isRefetchError: false;
|
|
194
|
+
isFetchNextPageError: false;
|
|
195
|
+
isFetchPreviousPageError: false;
|
|
196
|
+
isSuccess: false;
|
|
197
|
+
isPlaceholderData: false;
|
|
198
|
+
status: "pending";
|
|
199
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
200
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
201
|
+
hasNextPage: boolean;
|
|
202
|
+
hasPreviousPage: boolean;
|
|
203
|
+
isFetchingNextPage: boolean;
|
|
204
|
+
isFetchingPreviousPage: boolean;
|
|
205
|
+
dataUpdatedAt: number;
|
|
206
|
+
errorUpdatedAt: number;
|
|
207
|
+
failureCount: number;
|
|
208
|
+
failureReason: Error;
|
|
209
|
+
errorUpdateCount: number;
|
|
210
|
+
isFetched: boolean;
|
|
211
|
+
isFetchedAfterMount: boolean;
|
|
212
|
+
isFetching: boolean;
|
|
213
|
+
isLoading: boolean;
|
|
214
|
+
isInitialLoading: boolean;
|
|
215
|
+
isPaused: boolean;
|
|
216
|
+
isRefetching: boolean;
|
|
217
|
+
isStale: boolean;
|
|
218
|
+
isEnabled: boolean;
|
|
219
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
220
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
221
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
222
|
+
} | {
|
|
223
|
+
count: number;
|
|
224
|
+
data: Result;
|
|
225
|
+
isError: false;
|
|
226
|
+
error: null;
|
|
227
|
+
isPending: false;
|
|
228
|
+
isLoading: false;
|
|
229
|
+
isLoadingError: false;
|
|
230
|
+
isRefetchError: false;
|
|
231
|
+
isSuccess: true;
|
|
232
|
+
isPlaceholderData: true;
|
|
233
|
+
isFetchNextPageError: false;
|
|
234
|
+
isFetchPreviousPageError: false;
|
|
235
|
+
status: "success";
|
|
236
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
237
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
238
|
+
hasNextPage: boolean;
|
|
239
|
+
hasPreviousPage: boolean;
|
|
240
|
+
isFetchingNextPage: boolean;
|
|
241
|
+
isFetchingPreviousPage: boolean;
|
|
242
|
+
dataUpdatedAt: number;
|
|
243
|
+
errorUpdatedAt: number;
|
|
244
|
+
failureCount: number;
|
|
245
|
+
failureReason: Error;
|
|
246
|
+
errorUpdateCount: number;
|
|
247
|
+
isFetched: boolean;
|
|
248
|
+
isFetchedAfterMount: boolean;
|
|
249
|
+
isFetching: boolean;
|
|
250
|
+
isInitialLoading: boolean;
|
|
251
|
+
isPaused: boolean;
|
|
252
|
+
isRefetching: boolean;
|
|
253
|
+
isStale: boolean;
|
|
254
|
+
isEnabled: boolean;
|
|
255
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
256
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
257
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* V3 Data Layer Provider - Web/Browser Version
|
|
262
|
+
*
|
|
263
|
+
* React context provider that initializes adapters and provides context for all V3 hooks.
|
|
264
|
+
* This is a browser-safe version that excludes PowerSync dependencies.
|
|
265
|
+
*
|
|
266
|
+
* For React Native apps that need PowerSync, use the default DataLayerProvider instead.
|
|
267
|
+
*/
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Props for DataLayerProvider (Web version)
|
|
271
|
+
*/
|
|
272
|
+
interface DataLayerProviderProps {
|
|
273
|
+
/** Data layer configuration */
|
|
274
|
+
config: DataLayerConfig;
|
|
275
|
+
/** Children to render */
|
|
276
|
+
children: ReactNode;
|
|
277
|
+
/** Supabase client (required) */
|
|
278
|
+
supabaseClient: SupabaseClient;
|
|
279
|
+
/** React Query client (required) */
|
|
280
|
+
queryClient: QueryClient;
|
|
281
|
+
/** Callback when initialization completes */
|
|
282
|
+
onInitialized?: (context: DataLayerContextValue) => void;
|
|
283
|
+
/** Callback when error occurs */
|
|
284
|
+
onError?: (error: Error) => void;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Provider component for the V3 data layer (Web/Browser version).
|
|
288
|
+
*
|
|
289
|
+
* This provider:
|
|
290
|
+
* - Creates and manages the AdapterRegistry
|
|
291
|
+
* - Initializes the AdapterAutoDetector for backend selection
|
|
292
|
+
* - Sets up Supabase adapter (PowerSync not supported in web builds)
|
|
293
|
+
* - Tracks online/offline status
|
|
294
|
+
* - Provides context for all V3 hooks
|
|
295
|
+
*
|
|
296
|
+
* Note: This is the browser-safe version that does NOT support PowerSync.
|
|
297
|
+
* For React Native apps that need PowerSync, use the default DataLayerProvider.
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```tsx
|
|
301
|
+
* import { DataLayerProvider } from "@pol-studios/db/web";
|
|
302
|
+
*
|
|
303
|
+
* function App() {
|
|
304
|
+
* return (
|
|
305
|
+
* <DataLayerProvider
|
|
306
|
+
* config={dataLayerConfig}
|
|
307
|
+
* supabaseClient={supabase}
|
|
308
|
+
* queryClient={queryClient}
|
|
309
|
+
* >
|
|
310
|
+
* <YourApp />
|
|
311
|
+
* </DataLayerProvider>
|
|
312
|
+
* );
|
|
313
|
+
* }
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
declare function DataLayerProvider({ config, children, supabaseClient, queryClient, onInitialized, onError, }: DataLayerProviderProps): JSX.Element;
|
|
317
|
+
|
|
318
|
+
export { DataLayerConfig, DataLayerContextValue, DataLayerProvider, type DataLayerProviderProps, GenericTable, GenericView, useDbInfiniteQuery };
|