@pol-studios/db 1.0.19 → 1.0.21
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/DataLayerContext-ZmLPYR_s.d.ts +825 -0
- package/dist/EntityPermissions-DwFt4tUd.d.ts +35 -0
- package/dist/FilterConfig-Bt2Ek74z.d.ts +99 -0
- package/dist/UserMetadataContext-B8gVWGMl.d.ts +35 -0
- package/dist/UserMetadataContext-DntmpK41.d.ts +33 -0
- package/dist/auth/context.d.ts +48 -0
- package/dist/auth/guards.d.ts +180 -0
- package/dist/auth/hooks.d.ts +312 -0
- package/dist/auth/index.d.ts +11 -0
- package/dist/client/index.d.ts +16 -0
- package/dist/core/index.d.ts +539 -0
- package/dist/database.types-ChFCG-4M.d.ts +8604 -0
- package/dist/executor-CB4KHyYG.d.ts +507 -0
- package/dist/gen/index.d.ts +1099 -0
- package/dist/hooks/index.d.ts +100 -0
- package/dist/index-BNKhgDdC.d.ts +433 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.native.d.ts +793 -0
- package/dist/index.web.d.ts +321 -0
- package/dist/mutation/index.d.ts +58 -0
- package/dist/parser/index.d.ts +366 -0
- package/dist/powersync-bridge/index.d.ts +284 -0
- package/dist/query/index.d.ts +723 -0
- package/dist/realtime/index.d.ts +44 -0
- package/dist/select-query-parser-BwyHum1L.d.ts +352 -0
- package/dist/setupAuthContext-Kv-THH-h.d.ts +61 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types-CYr9JiUE.d.ts +62 -0
- package/dist/useBatchUpsert-9OYjibLh.d.ts +24 -0
- package/dist/useDbCount-Id14x_1P.d.ts +1082 -0
- package/dist/useDbQuery-C-TL8jY1.d.ts +19 -0
- package/dist/useReceiptAI-6HkRpRml.d.ts +58 -0
- package/dist/useResolveFeedback-Ca2rh_Bs.d.ts +997 -0
- package/dist/useSupabase-DvWVuHHE.d.ts +28 -0
- package/dist/with-auth/index.d.ts +704 -0
- package/package.json +61 -13
|
@@ -0,0 +1,321 @@
|
|
|
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
|
+
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 { r as BackendSelectionResult, B as BooleanOperator, k as ClarificationSuggestion, C as CombinedProviderStatus, j as ComputedSortConfig, n as DataLayerWithPowerSyncProps, D as DbChangeLog, a as EnhancedSyncControl, E as EnhancedSyncStatus, d as FilterConditionType, m as FilterContextType, g as FilterInput, h as FilterState, H as HasPowerSyncConfig, O as OrderColumn, P as PowerSyncEnabledConfig, b as PowerSyncEnabledContextValue, q as PowerSyncTables, 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-BNKhgDdC.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-Ca2rh_Bs.js';
|
|
5
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
|
+
import { UseInfiniteQueryOptions, InfiniteData, QueryClient } from '@tanstack/react-query';
|
|
7
|
+
import { PostgrestSingleResponse, SupabaseClient } from '@supabase/supabase-js';
|
|
8
|
+
import { G as GenericTable, h as GenericView } from './types-CYr9JiUE.js';
|
|
9
|
+
export { F as Fetch, i as GenericFunction, g as GenericNonUpdatableView, j as GenericSchema, f as GenericUpdatableView, 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';
|
|
10
|
+
export { U as UseDbQuerySingleReturn, u as useDbQuery } from './useDbQuery-C-TL8jY1.js';
|
|
11
|
+
export { C as ClarificationQuestion, D as DatabaseTypes, F as Filter, x as FilterGroup, y as FilterOperator, z as Pagination, P as PublicTableNames, Q as QueryState, R as ResolveRowType, S as SchemaNames, l as SchemaTableNames, A as Sort, T as TableIdentifier, r as UseAdvanceQueryOptions, s as UseAdvanceQueryResult, n as UseDbCountOptions, o as UseDbCountResult, K as UseDbDeleteOptions, L as UseDbDeleteResult, U as UseDbInfiniteQueryOptions, m as UseDbInfiniteQueryResult, B as UseDbInsertOptions, E as UseDbInsertResult, v as UseDbQueryByIdOptions, w as UseDbQueryByIdResult, q as UseDbQueryOptions, p as UseDbQueryResult, G as UseDbUpdateOptions, H as UseDbUpdateResult, I as UseDbUpsertOptions, J as UseDbUpsertResult, k as useAdvanceQuery, a as useDataLayer, t as useDataLayerOptional, j as useDbCount, j as useDbCountV3, d as useDbDeleteV3, i as useDbInfiniteQueryV3, e as useDbInsertV3, g as useDbQueryById, f as useDbQueryV3, h as useDbUpdateV3, u as useDbUpsert, u as useDbUpsertV3, u as useUpsert } from './useDbCount-Id14x_1P.js';
|
|
12
|
+
import { DataLayerConfig } from './core/index.js';
|
|
13
|
+
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';
|
|
14
|
+
export { u as useBatchDelete, a as useBatchUpsert } from './useBatchUpsert-9OYjibLh.js';
|
|
15
|
+
export { UsePartialAdvancedQueryResult, UsePartialQueryResult, UseQuerySingleReturn, extractColumnNames, extractRelationNames, getRelationSelect, hasRelation, parseSelect, stringifySelect, tokenizeTopLevel, useAdvancedFilterQuery, useAdvancedQuery, useInfiniteQuery, usePartialAdvancedQuery, usePartialQuery, useQuery } from './query/index.js';
|
|
16
|
+
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';
|
|
17
|
+
import { p as DataLayerContextValue } from './DataLayerContext-ZmLPYR_s.js';
|
|
18
|
+
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, D as DataLayerContext, s as DataLayerStatus, T as TableDataAdapter, j as createAdapterAutoDetector, h as createAdapterRegistry } from './DataLayerContext-ZmLPYR_s.js';
|
|
19
|
+
import { ReactNode, JSX } from 'react';
|
|
20
|
+
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';
|
|
21
|
+
export { B as BatchAnalysisProgress, E as ExtractedReceipt, P as PendingExpense, a as useReceiptAI, u as useSupabaseFunction } from './useReceiptAI-6HkRpRml.js';
|
|
22
|
+
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';
|
|
23
|
+
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';
|
|
24
|
+
export { G as GetResult, S as SelectQueryError } from './select-query-parser-BwyHum1L.js';
|
|
25
|
+
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';
|
|
26
|
+
import 'moment';
|
|
27
|
+
import '@supabase-cache-helpers/postgrest-react-query';
|
|
28
|
+
import '@pol-studios/utils';
|
|
29
|
+
import '@supabase/functions-js';
|
|
30
|
+
import '@supabase/postgrest-js';
|
|
31
|
+
import '@supabase/storage-js';
|
|
32
|
+
import 'react/jsx-runtime';
|
|
33
|
+
import '@supabase/supabase-js/dist/module/lib/types.js';
|
|
34
|
+
|
|
35
|
+
type DataType = Record<string, any>;
|
|
36
|
+
declare function useDbInfiniteQuery<Relation extends GenericTable | GenericView, Result extends DataType, Query extends string = "*", RelationName = unknown, Relationships = Relation extends {
|
|
37
|
+
Relationships: infer R;
|
|
38
|
+
} ? 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"> & {
|
|
39
|
+
crossOrganization?: boolean;
|
|
40
|
+
onQuery?: ({ pageParam, query }: {
|
|
41
|
+
pageParam: number;
|
|
42
|
+
query: Builder;
|
|
43
|
+
}) => any;
|
|
44
|
+
enableOnQuery?: boolean;
|
|
45
|
+
}): {
|
|
46
|
+
count: number;
|
|
47
|
+
data: Result;
|
|
48
|
+
error: Error;
|
|
49
|
+
isError: true;
|
|
50
|
+
isPending: false;
|
|
51
|
+
isLoading: false;
|
|
52
|
+
isLoadingError: false;
|
|
53
|
+
isRefetchError: true;
|
|
54
|
+
isSuccess: false;
|
|
55
|
+
isPlaceholderData: false;
|
|
56
|
+
status: "error";
|
|
57
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
58
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
59
|
+
hasNextPage: boolean;
|
|
60
|
+
hasPreviousPage: boolean;
|
|
61
|
+
isFetchNextPageError: boolean;
|
|
62
|
+
isFetchingNextPage: boolean;
|
|
63
|
+
isFetchPreviousPageError: boolean;
|
|
64
|
+
isFetchingPreviousPage: boolean;
|
|
65
|
+
dataUpdatedAt: number;
|
|
66
|
+
errorUpdatedAt: number;
|
|
67
|
+
failureCount: number;
|
|
68
|
+
failureReason: Error;
|
|
69
|
+
errorUpdateCount: number;
|
|
70
|
+
isFetched: boolean;
|
|
71
|
+
isFetchedAfterMount: boolean;
|
|
72
|
+
isFetching: boolean;
|
|
73
|
+
isInitialLoading: boolean;
|
|
74
|
+
isPaused: boolean;
|
|
75
|
+
isRefetching: boolean;
|
|
76
|
+
isStale: boolean;
|
|
77
|
+
isEnabled: boolean;
|
|
78
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
79
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
80
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
81
|
+
} | {
|
|
82
|
+
count: number;
|
|
83
|
+
data: Result;
|
|
84
|
+
error: null;
|
|
85
|
+
isError: false;
|
|
86
|
+
isPending: false;
|
|
87
|
+
isLoading: false;
|
|
88
|
+
isLoadingError: false;
|
|
89
|
+
isRefetchError: false;
|
|
90
|
+
isFetchNextPageError: false;
|
|
91
|
+
isFetchPreviousPageError: false;
|
|
92
|
+
isSuccess: true;
|
|
93
|
+
isPlaceholderData: false;
|
|
94
|
+
status: "success";
|
|
95
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
96
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
97
|
+
hasNextPage: boolean;
|
|
98
|
+
hasPreviousPage: boolean;
|
|
99
|
+
isFetchingNextPage: boolean;
|
|
100
|
+
isFetchingPreviousPage: boolean;
|
|
101
|
+
dataUpdatedAt: number;
|
|
102
|
+
errorUpdatedAt: number;
|
|
103
|
+
failureCount: number;
|
|
104
|
+
failureReason: Error;
|
|
105
|
+
errorUpdateCount: number;
|
|
106
|
+
isFetched: boolean;
|
|
107
|
+
isFetchedAfterMount: boolean;
|
|
108
|
+
isFetching: boolean;
|
|
109
|
+
isInitialLoading: boolean;
|
|
110
|
+
isPaused: boolean;
|
|
111
|
+
isRefetching: boolean;
|
|
112
|
+
isStale: boolean;
|
|
113
|
+
isEnabled: boolean;
|
|
114
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
115
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
116
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
117
|
+
} | {
|
|
118
|
+
count: number;
|
|
119
|
+
data: Result;
|
|
120
|
+
error: Error;
|
|
121
|
+
isError: true;
|
|
122
|
+
isPending: false;
|
|
123
|
+
isLoading: false;
|
|
124
|
+
isLoadingError: true;
|
|
125
|
+
isRefetchError: false;
|
|
126
|
+
isFetchNextPageError: false;
|
|
127
|
+
isFetchPreviousPageError: false;
|
|
128
|
+
isSuccess: false;
|
|
129
|
+
isPlaceholderData: false;
|
|
130
|
+
status: "error";
|
|
131
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
132
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
133
|
+
hasNextPage: boolean;
|
|
134
|
+
hasPreviousPage: boolean;
|
|
135
|
+
isFetchingNextPage: boolean;
|
|
136
|
+
isFetchingPreviousPage: boolean;
|
|
137
|
+
dataUpdatedAt: number;
|
|
138
|
+
errorUpdatedAt: number;
|
|
139
|
+
failureCount: number;
|
|
140
|
+
failureReason: Error;
|
|
141
|
+
errorUpdateCount: number;
|
|
142
|
+
isFetched: boolean;
|
|
143
|
+
isFetchedAfterMount: boolean;
|
|
144
|
+
isFetching: boolean;
|
|
145
|
+
isInitialLoading: boolean;
|
|
146
|
+
isPaused: boolean;
|
|
147
|
+
isRefetching: boolean;
|
|
148
|
+
isStale: boolean;
|
|
149
|
+
isEnabled: boolean;
|
|
150
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
151
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
152
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
153
|
+
} | {
|
|
154
|
+
count: number;
|
|
155
|
+
data: Result;
|
|
156
|
+
error: null;
|
|
157
|
+
isError: false;
|
|
158
|
+
isPending: true;
|
|
159
|
+
isLoading: true;
|
|
160
|
+
isLoadingError: false;
|
|
161
|
+
isRefetchError: false;
|
|
162
|
+
isFetchNextPageError: false;
|
|
163
|
+
isFetchPreviousPageError: false;
|
|
164
|
+
isSuccess: false;
|
|
165
|
+
isPlaceholderData: false;
|
|
166
|
+
status: "pending";
|
|
167
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
168
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
169
|
+
hasNextPage: boolean;
|
|
170
|
+
hasPreviousPage: boolean;
|
|
171
|
+
isFetchingNextPage: boolean;
|
|
172
|
+
isFetchingPreviousPage: boolean;
|
|
173
|
+
dataUpdatedAt: number;
|
|
174
|
+
errorUpdatedAt: number;
|
|
175
|
+
failureCount: number;
|
|
176
|
+
failureReason: Error;
|
|
177
|
+
errorUpdateCount: number;
|
|
178
|
+
isFetched: boolean;
|
|
179
|
+
isFetchedAfterMount: boolean;
|
|
180
|
+
isFetching: boolean;
|
|
181
|
+
isInitialLoading: boolean;
|
|
182
|
+
isPaused: boolean;
|
|
183
|
+
isRefetching: boolean;
|
|
184
|
+
isStale: boolean;
|
|
185
|
+
isEnabled: boolean;
|
|
186
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
187
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
188
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
189
|
+
} | {
|
|
190
|
+
count: number;
|
|
191
|
+
data: Result;
|
|
192
|
+
error: null;
|
|
193
|
+
isError: false;
|
|
194
|
+
isPending: true;
|
|
195
|
+
isLoadingError: false;
|
|
196
|
+
isRefetchError: false;
|
|
197
|
+
isFetchNextPageError: false;
|
|
198
|
+
isFetchPreviousPageError: false;
|
|
199
|
+
isSuccess: false;
|
|
200
|
+
isPlaceholderData: false;
|
|
201
|
+
status: "pending";
|
|
202
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
203
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
204
|
+
hasNextPage: boolean;
|
|
205
|
+
hasPreviousPage: boolean;
|
|
206
|
+
isFetchingNextPage: boolean;
|
|
207
|
+
isFetchingPreviousPage: boolean;
|
|
208
|
+
dataUpdatedAt: number;
|
|
209
|
+
errorUpdatedAt: number;
|
|
210
|
+
failureCount: number;
|
|
211
|
+
failureReason: Error;
|
|
212
|
+
errorUpdateCount: number;
|
|
213
|
+
isFetched: boolean;
|
|
214
|
+
isFetchedAfterMount: boolean;
|
|
215
|
+
isFetching: boolean;
|
|
216
|
+
isLoading: boolean;
|
|
217
|
+
isInitialLoading: boolean;
|
|
218
|
+
isPaused: boolean;
|
|
219
|
+
isRefetching: boolean;
|
|
220
|
+
isStale: boolean;
|
|
221
|
+
isEnabled: boolean;
|
|
222
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
223
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
224
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
225
|
+
} | {
|
|
226
|
+
count: number;
|
|
227
|
+
data: Result;
|
|
228
|
+
isError: false;
|
|
229
|
+
error: null;
|
|
230
|
+
isPending: false;
|
|
231
|
+
isLoading: false;
|
|
232
|
+
isLoadingError: false;
|
|
233
|
+
isRefetchError: false;
|
|
234
|
+
isSuccess: true;
|
|
235
|
+
isPlaceholderData: true;
|
|
236
|
+
isFetchNextPageError: false;
|
|
237
|
+
isFetchPreviousPageError: false;
|
|
238
|
+
status: "success";
|
|
239
|
+
fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
240
|
+
fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
241
|
+
hasNextPage: boolean;
|
|
242
|
+
hasPreviousPage: boolean;
|
|
243
|
+
isFetchingNextPage: boolean;
|
|
244
|
+
isFetchingPreviousPage: boolean;
|
|
245
|
+
dataUpdatedAt: number;
|
|
246
|
+
errorUpdatedAt: number;
|
|
247
|
+
failureCount: number;
|
|
248
|
+
failureReason: Error;
|
|
249
|
+
errorUpdateCount: number;
|
|
250
|
+
isFetched: boolean;
|
|
251
|
+
isFetchedAfterMount: boolean;
|
|
252
|
+
isFetching: boolean;
|
|
253
|
+
isInitialLoading: boolean;
|
|
254
|
+
isPaused: boolean;
|
|
255
|
+
isRefetching: boolean;
|
|
256
|
+
isStale: boolean;
|
|
257
|
+
isEnabled: boolean;
|
|
258
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<PostgrestSingleResponse<Result>, unknown>, Error>>;
|
|
259
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
260
|
+
promise: Promise<InfiniteData<PostgrestSingleResponse<Result>, unknown>>;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* V3 Data Layer Provider - Web/Browser Version
|
|
265
|
+
*
|
|
266
|
+
* React context provider that initializes adapters and provides context for all V3 hooks.
|
|
267
|
+
* This is a browser-safe version that excludes PowerSync dependencies.
|
|
268
|
+
*
|
|
269
|
+
* For React Native apps that need PowerSync, use the default DataLayerProvider instead.
|
|
270
|
+
*/
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Props for DataLayerProvider (Web version)
|
|
274
|
+
*/
|
|
275
|
+
interface DataLayerProviderProps {
|
|
276
|
+
/** Data layer configuration */
|
|
277
|
+
config: DataLayerConfig;
|
|
278
|
+
/** Children to render */
|
|
279
|
+
children: ReactNode;
|
|
280
|
+
/** Supabase client (required) */
|
|
281
|
+
supabaseClient: SupabaseClient;
|
|
282
|
+
/** React Query client (required) */
|
|
283
|
+
queryClient: QueryClient;
|
|
284
|
+
/** Callback when initialization completes */
|
|
285
|
+
onInitialized?: (context: DataLayerContextValue) => void;
|
|
286
|
+
/** Callback when error occurs */
|
|
287
|
+
onError?: (error: Error) => void;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Provider component for the V3 data layer (Web/Browser version).
|
|
291
|
+
*
|
|
292
|
+
* This provider:
|
|
293
|
+
* - Creates and manages the AdapterRegistry
|
|
294
|
+
* - Initializes the AdapterAutoDetector for backend selection
|
|
295
|
+
* - Sets up Supabase adapter (PowerSync not supported in web builds)
|
|
296
|
+
* - Tracks online/offline status
|
|
297
|
+
* - Provides context for all V3 hooks
|
|
298
|
+
*
|
|
299
|
+
* Note: This is the browser-safe version that does NOT support PowerSync.
|
|
300
|
+
* For React Native apps that need PowerSync, use the default DataLayerProvider.
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* ```tsx
|
|
304
|
+
* import { DataLayerProvider } from "@pol-studios/db/web";
|
|
305
|
+
*
|
|
306
|
+
* function App() {
|
|
307
|
+
* return (
|
|
308
|
+
* <DataLayerProvider
|
|
309
|
+
* config={dataLayerConfig}
|
|
310
|
+
* supabaseClient={supabase}
|
|
311
|
+
* queryClient={queryClient}
|
|
312
|
+
* >
|
|
313
|
+
* <YourApp />
|
|
314
|
+
* </DataLayerProvider>
|
|
315
|
+
* );
|
|
316
|
+
* }
|
|
317
|
+
* ```
|
|
318
|
+
*/
|
|
319
|
+
declare function DataLayerProvider({ config, children, supabaseClient, queryClient, onInitialized, onError, }: DataLayerProviderProps): JSX.Element;
|
|
320
|
+
|
|
321
|
+
export { DataLayerConfig, DataLayerContextValue, DataLayerProvider, type DataLayerProviderProps, GenericTable, GenericView, useDbInfiniteQuery };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
+
import { D as Database } from '../useSupabase-DvWVuHHE.js';
|
|
3
|
+
import { useInsertMutation, useUpdateMutation } from '@supabase-cache-helpers/postgrest-react-query';
|
|
4
|
+
import { G as GetResult } from '../select-query-parser-BwyHum1L.js';
|
|
5
|
+
import { j as GenericSchema } from '../types-CYr9JiUE.js';
|
|
6
|
+
export { u as useBatchDelete, a as useBatchUpsert } from '../useBatchUpsert-9OYjibLh.js';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '@supabase/supabase-js/dist/module/lib/types.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import '@supabase/supabase-js';
|
|
11
|
+
|
|
12
|
+
type ItemType$3<T> = T extends Array<infer U> ? U : T;
|
|
13
|
+
type MutationOption$2 = Parameters<typeof useInsertMutation>[3];
|
|
14
|
+
declare function useInsert<TableName extends string & keyof PublicSchema["Tables"], Table extends PublicSchema["Tables"][TableName], Schema extends keyof Database = "public", ReturnQuery extends string | undefined = undefined, PublicSchema extends GenericSchema = Database[Extract<keyof Database, Schema>], RelationName = unknown, Relationships = Table extends {
|
|
15
|
+
Relationships: infer R;
|
|
16
|
+
} ? R : unknown, RowResult = ReturnQuery extends undefined ? null : GetResult<PublicSchema, Table["Row"], RelationName, Relationships, Extract<ReturnQuery, string>>, ResultInsert extends object = GetResult<PublicSchema, Table["Insert"], RelationName, Relationships, "*">>(relation: TableName | {
|
|
17
|
+
table: TableName;
|
|
18
|
+
schema: Schema;
|
|
19
|
+
}, primaryKeys?: (keyof (ItemType$3<RowResult> | any) & string)[], query?: ReturnQuery, mutationOption?: MutationOption$2 & {
|
|
20
|
+
crossOrganization?: boolean;
|
|
21
|
+
}): _tanstack_react_query.UseMutationResult<RowResult, Error, ResultInsert, unknown>;
|
|
22
|
+
|
|
23
|
+
type ItemType$2<T> = T extends Array<infer U> ? U : T;
|
|
24
|
+
type MutationOption$1 = Parameters<typeof useUpdateMutation>[3];
|
|
25
|
+
declare function useUpdate<TableName extends string & keyof PublicSchema["Tables"], Table extends PublicSchema["Tables"][TableName], Schema extends keyof Database = "public", ReturnQuery extends string | undefined = undefined, PublicSchema extends GenericSchema = Database[Extract<keyof Database, Schema>], RelationName = unknown, Relationships = Table extends {
|
|
26
|
+
Relationships: infer R;
|
|
27
|
+
} ? R : unknown, RowResult = ReturnQuery extends undefined ? null : GetResult<PublicSchema, Table["Row"], RelationName, Relationships, Extract<ReturnQuery, string>>, ResultUpdate extends object = (Omit<GetResult<PublicSchema, Table["Update"], RelationName, Relationships, "*">, "id"> & {
|
|
28
|
+
id: number;
|
|
29
|
+
}) | Omit<GetResult<PublicSchema, Table["Update"], RelationName, Relationships, "*">, "id">>(relation: TableName | {
|
|
30
|
+
table: TableName;
|
|
31
|
+
schema: Schema;
|
|
32
|
+
}, primaryKeys?: (keyof (ItemType$2<RowResult> | any) & string)[], query?: ReturnQuery, mutationOption?: MutationOption$1 & {
|
|
33
|
+
crossOrganization?: boolean;
|
|
34
|
+
}): _tanstack_react_query.UseMutationResult<RowResult, Error, ResultUpdate, unknown>;
|
|
35
|
+
|
|
36
|
+
type ItemType$1<T> = T extends Array<infer U> ? U : T;
|
|
37
|
+
type MutationOption = Parameters<typeof useUpdateMutation>[3];
|
|
38
|
+
type useUpsertResponse = ReturnType<typeof useUpsert>;
|
|
39
|
+
declare function useUpsert<TableName extends string & keyof PublicSchema["Tables"], Table extends PublicSchema["Tables"][TableName], Schema extends keyof Database = "public", ReturnQuery extends string | undefined = undefined, PublicSchema extends GenericSchema = Database[Extract<keyof Database, Schema>], RelationName = unknown, Relationships = Table extends {
|
|
40
|
+
Relationships: infer R;
|
|
41
|
+
} ? R : unknown, RowResult = ReturnQuery extends undefined ? null : GetResult<PublicSchema, Table["Row"], RelationName, Relationships, Extract<ReturnQuery, string>>, ResultInsert extends object = Omit<GetResult<PublicSchema, Table["Insert"], RelationName, Relationships, "*">, "id">, ResultUpdate extends object = Omit<GetResult<PublicSchema, Table["Update"], RelationName, Relationships, "*">, "id"> & {
|
|
42
|
+
id?: any;
|
|
43
|
+
}>(relation: TableName | {
|
|
44
|
+
table: TableName;
|
|
45
|
+
schema: Schema;
|
|
46
|
+
}, primaryKeys?: (keyof (ItemType$1<RowResult> | any) & string)[], query?: ReturnQuery, mutationOption?: MutationOption & {
|
|
47
|
+
crossOrganization?: boolean;
|
|
48
|
+
}): _tanstack_react_query.UseMutationResult<RowResult, Error, ResultInsert | ResultUpdate, unknown>;
|
|
49
|
+
|
|
50
|
+
type ItemType<T> = T extends Array<infer U> ? U : T;
|
|
51
|
+
declare function useDelete<TableName extends string & keyof PublicSchema["Tables"], Table extends PublicSchema["Tables"][TableName], Schema extends keyof Database = "public", PublicSchema extends GenericSchema = Database[Extract<keyof Database, Schema>], Query extends string = "*", RelationName = unknown, Relationships = Table extends {
|
|
52
|
+
Relationships: infer R;
|
|
53
|
+
} ? R : unknown, RowResult extends object = GetResult<PublicSchema, Table["Row"], RelationName, Relationships, Query>>(relation: TableName | {
|
|
54
|
+
table: TableName;
|
|
55
|
+
schema: Schema;
|
|
56
|
+
}, primaryKeys?: (keyof ItemType<RowResult> & string)[]): _tanstack_react_query.UseMutationResult<RowResult, Error, Partial<RowResult>, unknown>;
|
|
57
|
+
|
|
58
|
+
export { type MutationOption, useDelete as useDbDelete, useUpsert as useDbUpsert, useDelete, useInsert, useUpdate, useUpsert, type useUpsertResponse };
|